items.bookmark_items#

Bookmark items at their core are simple file paths made up of a server, job and root components. We usually store them in the following form:

1{
2    '//path/to/my/server/my_job/my_shots': {
3        'server': '//path_to_my/server',
4        'job': 'my_job',
5        'root': 'my_shots'
6    }
7}

BookmarkItemModel is responsible for loading saved bookmark items and BookmarkItemView for displaying them. See BookmarkItemModel.item_generator() for how the model finds saved bookmark items.

Properties like description, frame-range, frame-rate, or ShotGrid linkage are stored in sqlite3 databases located at each bookmark item’s root folder. See bookmarks.database more details.

Throughout the app, data interfaces usually require a bookmark item, commonly as separate server, job, root arguments. See active() to see how active path components can be queried.

Hint

The term “active” refers to items the user has activated, e.g. double-clicked. When an item is activated all path components that make up that item will become active.

1server = common.active('server')
2job = common.active('job')
3root = common.active('root')
4
5# Or...
6
7server, job, root = common.active('root', args=True)

Model items store their path segments using the ParentPathRole role. E.g.:

1# ...in case of a QtCore.QModelIndex item:
2server, job, root = index.data(common.ParentPathRole)[0:3]

Classes:

BookmarkItemModel([parent])

The model used store the data necessary to display bookmark item.

BookmarkItemView([parent])

The view used to display bookmark item.

BookmarkItemViewContextMenu(index[, parent])

Context menu associated with the BookmarkItemView.

class bookmarks.items.bookmark_items.BookmarkItemModel(parent=None)[source]#

Bases: ItemModel

The model used store the data necessary to display bookmark item.

Methods:

data_type()

The data type of the model.

default_row_size()

Returns the default item size.

filter_setting_dict_key()

The custom dictionary key used to save filter settings to the user settings file.

flags(index)

Overrides the flag behaviour to disable drag if the alt modifier is not pressed.

init_data(**kwargs)

Function wrapper.

item_generator()

Returns the items to be processed by init_data().

save_active()

Save the active bookmark item.

source_path()

The bookmark list's source paths.

data_type()[source]#

The data type of the model.

default_row_size()[source]#

Returns the default item size.

filter_setting_dict_key()[source]#

The custom dictionary key used to save filter settings to the user settings file.

flags(index)[source]#

Overrides the flag behaviour to disable drag if the alt modifier is not pressed.

init_data(**kwargs)#

Function wrapper.

item_generator()[source]#

Returns the items to be processed by init_data().

save_active()[source]#

Save the active bookmark item.

source_path()[source]#

The bookmark list’s source paths.

There’s no file source for bookmark items, so we’re returning some arbitrary names.

class bookmarks.items.bookmark_items.BookmarkItemView(parent=None)[source]#

Bases: ThreadedItemView

The view used to display bookmark item.

See BookmarkItemModel.

Classes:

Methods:

add_item_action(index)

Action to execute when the add item icon is clicked.

edit_item_action(index)

Action to execute when the edit item icon is clicked.

get_hint_string()

Returns an informative hint text.

get_source_model()

Returns the model class associated with this view.

inline_icons_count()

Inline buttons count.

ContextMenu#

alias of BookmarkItemViewContextMenu Methods:

setup()

Creates the context menu.

Delegate#

alias of BookmarkItemViewDelegate Methods:

paint(painter, option, index)

Paints a bookmarks.items.bookmark_items.BookmarkItemView item.

setEditorData(self, editor, index)

setModelData(self, editor, model, index)

sizeHint(option, index)

Returns the item's size hint.

Attributes:

fallback_thumb

The item's default thumbnail image

add_item_action(index)[source]#

Action to execute when the add item icon is clicked.

edit_item_action(index)[source]#

Action to execute when the edit item icon is clicked.

get_hint_string()[source]#

Returns an informative hint text.

get_source_model()[source]#

Returns the model class associated with this view.

inline_icons_count()[source]#

Inline buttons count.

class bookmarks.items.bookmark_items.BookmarkItemViewContextMenu(index, parent=None)[source]#

Bases: BaseContextMenu

Context menu associated with the BookmarkItemView.

refresh()#

Refreshes the collector and repopulates the widget.

Methods:

setup()

Creates the context menu.

setup()[source]#

Creates the context menu.