actions#
User actions module.
These actions are usually triggered by the user via keyboard shortcuts or by interactions with the UI.
Functions:
|
Add the given bookmark item and save it in the user settings file. |
|
Add and save a favourite item. |
|
Triggers the current tab's add item action. |
|
Adds a server item to the list of user specified servers. |
|
Adds the selected source zip archive as a mode template file. |
|
Slot used to adjust the size of the top bar buttons size. |
|
Refresh the assets model if the identifier changes. |
|
Captures a thumbnail for the given index. |
|
Change the sorting role of the current item view model. |
|
Changes the current item tab. |
|
Clear the list of saved favourite items. |
|
Convert the selected image sequence to a movie file. |
|
Copy asset properties to clipboard. |
|
Copies the given path to the clipboard. |
|
Copies the path of the given item to the clipboard. |
|
Copies the path of the given item to the clipboard. |
Decreases the row size of the current tab view. |
|
|
Deletes the selected file items. |
|
Shows |
|
Shows |
|
Edit the given file. |
|
Action used to open an item editor. |
Opens a new app instance. |
|
|
Given the model index, executes the index's path using QDesktopServices. |
|
Utility function used to execute a file as a detached process. |
|
Saves all favourite items to a zip file. |
|
Exports the selected item's properties. |
|
Expands the selected source zip archive to destination as name. |
|
Slot used to keep item filter flag values updated across all datasets. |
|
Slot called when the thumbnail generating preference has changed. |
Hides a ShotGrid connection progress message. |
|
|
Import a previously exported favourites file. |
|
Imports properties and applies them to the selected item. |
Increases the row size of the current tab view. |
|
|
Decorator function sure functions only run when |
|
Shows the next available item tab. |
|
Paste asset properties from clipboard to the selected item. |
Slot called when a launcher item was clicked. |
|
|
Prompts the user to pick a new *.zip file containing a template directory structure. |
|
Picks a thumbnail for the given index. |
|
Picks a thumbnail for the given index. |
|
Shows a preview of the given image. |
|
Displays a preview of the currently selected item. |
Shows the previous item tab. |
|
Removes invalid bookmark items from the current set. |
|
|
Refresh the model of an item view. |
|
Remove the given bookmark from the user settings file. |
|
Remove a saved favourite item. |
Remove a server item from the list of user specified servers. |
|
|
Deletes a thumbnail file and the cached entries associated with it. |
|
Deletes a zip template file from the disk. |
Reset the current tab view row size to its default value. |
|
|
Reveals an item in the file explorer. |
Reveals |
|
|
Reveal the currently selected item in the file explorer. |
|
Opens the given item's primary ULR. |
|
Decorator function to ensure QModelIndexes passed to worker threads are in a valid state. |
|
Sets the given path as the active path segment for the given key. |
Sets the active task folder. |
|
|
Shows |
|
Shows |
|
Slot used to reveal an asset item in the asset tab. |
Shows |
|
|
Shows the |
Shows the |
|
|
Shows the |
Shows a ShotGrid connection progress message. |
|
Shows a ShotGrid error message. |
|
Opens the Slack widget used to send messages using SlackAPI. |
|
|
Suggests a prefix for the given job. |
|
Tests the given slack api token. |
Toggles the |
|
Toggle the active path mode. |
|
|
Toggles the |
Toggles the |
|
|
Toggles debugging staten on or off. |
|
Toggles the |
Toggles the |
|
Toggles the search filter editor view of the current item view. |
|
|
Toggle an item filter flag in the current item tab. |
Toggle |
|
Toggles the inline icon visibility of the current tab view. |
|
Toggle |
|
Toggle |
|
Toggles the visibility of the progress tracker columns. |
|
Toggles the data type of the file item model. |
|
Change the sorting order of the current item view model. |
|
Toggle |
|
Shows or hides the visibility of the :class:~bookmarks.items.task_items.TaskItemView`` widget. |
- bookmarks.actions.add_bookmark(server, job, root)[source]#
Add the given bookmark item and save it in the user settings file.
- Parameters:
server (str) – server path segment.
job (str) – job path segment.
root (str) – root path segment.
- bookmarks.actions.add_favourite(source_paths, source)[source]#
Add and save a favourite item.
- Parameters:
source_paths (list) – A list of parent paths.
source (str) – The item to save as a favourite item.
- bookmarks.actions.add_server(v)[source]#
Adds a server item to the list of user specified servers.
- Parameters:
v (str) – A path to a server, e.g. Q:/jobs.
- bookmarks.actions.add_zip_template(source, mode, prompt=False)[source]#
Adds the selected source zip archive as a mode template file.
- Parameters:
source (str) – Path to a zip template file.
mode (str) – A template mode (one of ‘job’ or ‘asset’).
prompt (bool) – Prompt user to confirm overriding existing files.
- Returns:
Path to the saved template file, or None.
- Return type:
str
- bookmarks.actions.adjust_tab_button_size(*args, **kwargs)[source]#
Slot used to adjust the size of the top bar buttons size.
- bookmarks.actions.asset_identifier_changed(table, source, key, value)[source]#
Refresh the assets model if the identifier changes.
- bookmarks.actions.capture_thumbnail(index)[source]#
Captures a thumbnail for the given index.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.change_sorting(role, order)[source]#
Change the sorting role of the current item view model.
- bookmarks.actions.clear_favourites(prompt=True)[source]#
Clear the list of saved favourite items.
- Parameters:
prompt (bool) – If True, will prompt the user for confirmation.
- bookmarks.actions.convert_image_sequence(index)[source]#
Convert the selected image sequence to a movie file.
- bookmarks.actions.copy_asset_properties(index)[source]#
Copy asset properties to clipboard.
- Parameters:
index (QModelIndex) – Index of the currently selected item.
- bookmarks.actions.copy_path(path, mode=common.WindowsPath, first=True, copy=True)[source]#
Copies the given path to the clipboard.
The path will be conformed to the given mode. E.g. forward slashes converted to back-slashes for WindowsPath.
- Parameters:
path (str) – A file path.
mode (int) – Any of
WindowsPath
,UnixPath
,SlackPath
orMacOSPath
. Defaults toWindowsPath
.first (bool) – When True, copies the first item of a sequence.
copy (bool) – When False, the converted path won’t be copied to the clipboard. Defaults to True.
- Returns:
The path copied to the clipboard.
- Return type:
str
- bookmarks.actions.copy_selected_alt_path(index)[source]#
Copies the path of the given item to the clipboard.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.copy_selected_path(index)[source]#
Copies the path of the given item to the clipboard.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.edit_asset(asset=None)[source]#
Shows
AssetPropertyEditor
to edit the properties of a bookmark item.- Parameters:
asset (str) – asset path segment.
- bookmarks.actions.edit_bookmark(server=None, job=None, root=None)[source]#
Shows
BookmarkPropertyEditor
to edit the properties of a bookmark item.- Parameters:
server (str) – server path segment. Optional.
job (str) – job path segment. Optional.
root (str) – root path segment. Optional.
- bookmarks.actions.execute(index, first=False)[source]#
Given the model index, executes the index’s path using QDesktopServices.
- Parameters:
index (QModelIndex or str) – A list item index or a path to a file.
first (bool) – Execute the first item of a collapsed sequence.
- bookmarks.actions.execute_detached(path)[source]#
Utility function used to execute a file as a detached process.
On Windows, we’ll call the give file through the explorer. This is so, that the new process does not inherit the current environment.
- bookmarks.actions.export_favourites(*args, destination=None)[source]#
Saves all favourite items to a zip file.
- Parameters:
args (tuple) – A server, job, root argument tuple.
destination (str) – The path to save the zip file to. Optional.
- bookmarks.actions.extract_zip_template(source, destination, name)[source]#
Expands the selected source zip archive to destination as name.
The contents will be expanded to a {destination}/{name} where name is an arbitrary name of a job or an asset item to be created.
- Parameters:
source (str) – Path to a zip archive.
destination (str) – Path to a folder
name (str) – Name of the root folder where the archive contents will be expanded to.
- Returns:
Path to the expanded archive contents.
- Return type:
str
- bookmarks.actions.filter_flag_changed(flag, parent_paths, source, state=None, limit=9999)[source]#
Slot used to keep item filter flag values updated across all datasets.
For instance, the favourite item model might set flag values that we want to keep updated in other models too.
- Parameters:
flag (int) – A filter flag.
parent_paths (list) – The parent paths that make up the source file.
source (str) – The source file path.
state (bool) – The favourite state flat value.
limit (int) – The maximum number of items to check.
- bookmarks.actions.generate_thumbnails_changed(state)[source]#
Slot called when the thumbnail generating preference has changed.
- Parameters:
state (QtCore.Qt.CheckState) – The preference state.
- bookmarks.actions.hide_sg_connecting_message()[source]#
Hides a ShotGrid connection progress message.
- bookmarks.actions.import_favourites(*args, source=None)[source]#
Import a previously exported favourites file.
- Parameters:
source (str) – Path to a file. Defaults to None.
- bookmarks.actions.import_properties(index)[source]#
Imports properties and applies them to the selected item.
- bookmarks.actions.must_be_initialized(func)[source]#
Decorator function sure functions only run when
common.main_widget
exists and initialized.
- bookmarks.actions.paste_asset_properties(index)[source]#
Paste asset properties from clipboard to the selected item.
- Parameters:
index (QModelIndex) – Index of the currently selected item.
- bookmarks.actions.pick_template(mode)[source]#
Prompts the user to pick a new *.zip file containing a template directory structure.
The template is copied to
%localappdata%/[product]/[mode]_templates/*.zip
folder.- Parameters:
mode (str) – A template mode, e.g. JobTemplateMode.
- bookmarks.actions.pick_thumbnail_from_file(index)[source]#
Picks a thumbnail for the given index.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.pick_thumbnail_from_library(index)[source]#
Picks a thumbnail for the given index.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.preview_image(index)[source]#
Shows a preview of the given image.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.preview_thumbnail(index)[source]#
Displays a preview of the currently selected item.
For image files we’ll try to load and display the image itself, and for any other case we will fall back to cached or default thumbnail images.
- bookmarks.actions.refresh(idx=None)[source]#
Refresh the model of an item view.
- Parameters:
idx (int) – The item tab number. Optional.
- bookmarks.actions.remove_bookmark(server, job, root)[source]#
Remove the given bookmark from the user settings file.
Removing a bookmark item will close and delete the item’s database controller instances.
- Parameters:
server (str) – server path segment.
job (str) – job path segment.
root (str) – A path segment.
- bookmarks.actions.remove_favourite(source_paths, source)[source]#
Remove a saved favourite item.
- Parameters:
source_paths (list) – A list of parent paths.
source (str) – The item to save as a favourite item.
- bookmarks.actions.remove_server(v)[source]#
Remove a server item from the list of user specified servers.
- Parameters:
v (str) – A path to a server, e.g. Q:/jobs.
- bookmarks.actions.remove_thumbnail(index)[source]#
Deletes a thumbnail file and the cached entries associated with it.
- bookmarks.actions.remove_zip_template(source, prompt=True)[source]#
Deletes a zip template file from the disk.
- Parameters:
source (str) – Path to a zip template file.
prompt (bool) – Prompt the user for confirmation.
- bookmarks.actions.reset_row_size()[source]#
Reset the current tab view row size to its default value.
- bookmarks.actions.reveal(item)[source]#
Reveals an item in the file explorer.
- Parameters:
item (str or QModelIndex) – The item to show in the file manager.
- bookmarks.actions.reveal_default_bookmarks_json()[source]#
Reveals
common.default_bookmarks_template
in the file explorer.
- bookmarks.actions.reveal_selected(index)[source]#
Reveal the currently selected item in the file explorer.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.reveal_url(index)[source]#
Opens the given item’s primary ULR.
- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.selection(func)[source]#
Decorator function to ensure QModelIndexes passed to worker threads are in a valid state.
- bookmarks.actions.set_active(k, v)[source]#
Sets the given path as the active path segment for the given key.
- Parameters:
k (str) – An active key, e.g. ‘server’.
v (str or None) – A path segment, e.g. ‘//myserver/jobs’.
- bookmarks.actions.set_task_folder(v)[source]#
Sets the active task folder.
- Parameters:
v (str) – A task path segment, e.g. ‘scenes’.
- bookmarks.actions.show_add_asset(server=None, job=None, root=None)[source]#
Shows
AssetPropertyEditor
to create a new asset item.- Parameters:
server (str) – server path segment. Optional.
job (str) – job path segment. Optional.
root (str) – root path segment. Optional.
- bookmarks.actions.show_add_file(asset=None, extension=None, file=None, create_file=True, increment=False)[source]#
Shows
FileSaverWidget
to add a new empty template path file.- Parameters:
asset (str) – Name of the asset.
extension (str) – An format, e.g. ‘psd’.
file (str) – Path to an existing file. Optional.
create_file (bool) – Creates an empty file if True.
increment (bool) – Increment the version number element of
file
.
- Returns:
The editor widget instance.
- bookmarks.actions.show_asset(path)[source]#
Slot used to reveal an asset item in the asset tab.
- Parameters:
path (str) – Path of the asset item.
- bookmarks.actions.show_bookmarker()[source]#
Shows
BookmarkerWidget
.
- bookmarks.actions.show_notes(index)[source]#
Shows the
NoteEditor
editor.- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.show_preferences()[source]#
Shows the
PreferenceEditor
editor widget.
- bookmarks.actions.show_sg_connecting_message()[source]#
Shows a ShotGrid connection progress message.
- bookmarks.actions.show_slack()[source]#
Opens the Slack widget used to send messages using SlackAPI.
- bookmarks.actions.suggest_prefix(job)[source]#
Suggests a prefix for the given job.
- Parameters:
job (Job) – The job to suggest prefix for.
- bookmarks.actions.test_slack_token(token)[source]#
Tests the given slack api token.
- Parameters:
token (str) – The slack api token.
- bookmarks.actions.toggle_active_item()[source]#
Toggles the
MarkedAsActive
item filter of the current tab model.
- bookmarks.actions.toggle_archived(index)[source]#
Toggles the
MarkedAsArchived
flag of the given item.- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.toggle_archived_items()[source]#
Toggles the
MarkedAsArchived
item filter of the current tab model.
- bookmarks.actions.toggle_debug(state)[source]#
Toggles debugging staten on or off.
When on, the app will print debugging information to the console.
- Parameters:
state (QtCore.Qt.CheckState) – Debugging state.
- bookmarks.actions.toggle_favourite(index)[source]#
Toggles the
MarkedAsFavourite
flag of the given item.- Parameters:
index (QtCore.QModelIndex) – The item index.
- bookmarks.actions.toggle_favourite_items()[source]#
Toggles the
MarkedAsFavourite
item filter of the current tab model.
- bookmarks.actions.toggle_filter_editor()[source]#
Toggles the search filter editor view of the current item view.
- bookmarks.actions.toggle_flag(flag, v)[source]#
Toggle an item filter flag in the current item tab.
- Parameters:
flag (int) – An item filter flag.
v (bool) – The filter flag value.
- bookmarks.actions.toggle_full_screen()[source]#
Toggle
BookmarksAppWindow
full-screen view.
- bookmarks.actions.toggle_inline_icons()[source]#
Toggles the inline icon visibility of the current tab view.
- bookmarks.actions.toggle_maximized()[source]#
Toggle
BookmarksAppWindow
maximized view.
- bookmarks.actions.toggle_minimized()[source]#
Toggle
BookmarksAppWindow
minimized view.
- bookmarks.actions.toggle_progress_columns()[source]#
Toggles the visibility of the progress tracker columns.
- bookmarks.actions.toggle_sort_order()[source]#
Change the sorting order of the current item view model.
- bookmarks.actions.toggle_stays_always_on_top()[source]#
Toggle
BookmarksAppWindow
stacking value.