8.6.4.5. pymodaq_gui.managers.manager_base module
- class pymodaq_gui.managers.manager_base.ListView(parent=None)[source]
Bases:
QListView- staticMetaObject = PySide6.QtCore.QMetaObject("ListView" inherits "QListView": )
- class pymodaq_gui.managers.manager_base.ManagerActions(*values)[source]
Bases:
StrEnum- COPY = 'copy_entry'
- DELETE = 'delete_entry'
- EXECUTE = 'execute_entry'
- LABEL_EXTERNAL = 'label_external'
- LIST = 'list_entries'
- LIST_EXTERNAL = 'list_entries_external'
- NEW = 'create_new_entry'
- OPEN = 'open_manager'
- RELOAD = 'reload_entry'
- SAVE = 'save_entry'
- class pymodaq_gui.managers.manager_base.ManagerBase(**kwargs)[source]
Bases:
CustomApp- Attributes:
applied_entry_nameGet the name of the last entry that has been successfully applied/executed
ask_before_executing_unsavedWhether to ask what to do when executing settings that differ from the saved entry
entriesGet the name of all existing entries
entries_filepathGet the full path of all entries file
entryGet/Set the name of the current entry
entry_appliedGet the status of the execution of the last applied entry
entry_filepathGet the full path of the current entry file
- manager_name
Methods
Whether entries can be executed, to be reimplemented
To be reimplemented if needed
Execute the entry as currently set in the manager (also if not saved)
execute_entry([entry_path, reload])To be called to execute an entry
Called at the end of the initialization of the manager, to be reimplemented if needed
format_subentries(entries)Should be reimplemented for better display than the repr one
get_action_from_file(file)Get an action name given a file and the manager name
Convenience method to get right return type
get_entry_folder(**kwargs_to_entry_folder)Get the folder path where the managed entries are stored.
get_external_toolbar_menu([toolbar, menu])Create or update a toolbar and a menu containing actions to open/set/execute the manager
Whether the settings currently set in the manager differ from the saved entry
init_extra(**kwargs)Called right after the CustomApp initialization (and before the UI setup) with the keyword arguments not used by CustomApp, to be reimplemented to make use of them
list_managed_entries(**kwargs_to_entry_folder)Returns a list of names of managed entries with the default one as first
Should return a list of Path objects representing managed entries.
quit_fun()save_entries([entry_path])Particular implementation to save entries for this inherited Manager
Save a new history entry in the history file
Sets up the widgets for the manager.
setup_ui()update_entry([entry])Load and display the given entry
applied_entry
close_subentries_display
connect_things_base
copy_entry
create_entry
create_slot_from_file
delete_entry
deleted_entry
enable_actions
entry_path_from_name
force_show
get_sync_combo_entry
new_entry
save_check
set_entry_applied
setup_actions_base
show
show_subentries
sync_entries_with
update_action_list
update_actions_connection
update_execute_action_tooltip
update_menu
updated_entry
- static format_subentries(entries)[source]
Should be reimplemented for better display than the repr one
- can_execute_entry()[source]
Whether entries can be executed, to be reimplemented
The base manager does not know about the dashboard: the managers working on it reimplement this method, usually returning
DashboardMixin.is_dashboard_available- Return type:
- execute_current_entry()[source]
Execute the entry as currently set in the manager (also if not saved)
The entry file is left untouched, except if
ask_before_executing_unsavedis True and the user chooses to save the changes before executing (a popup is shown when the current settings differ from the saved entry).
- execute_entry(entry_path=None, reload=True, **kwargs)[source]
To be called to execute an entry
- Parameters:
entry_path (
str|Path) – The entry to execute. If None, the entry is executed as it is currently set in the manager, unsaved changes included, and its file is left untouched (seeexecute_current_entry()). Otherwise the entry (a name or a file path) is first loaded in the manager, replacing its current settings, then executed.reload (
bool) – Whether to load the entry in the manager before executing it, only relevant with anentry_path.
- finish_init()[source]
Called at the end of the initialization of the manager, to be reimplemented if needed
- get_action_from_file(file)[source]
Get an action name given a file and the manager name
- Return type:
- get_entry_folder(**kwargs_to_entry_folder)[source]
Get the folder path where the managed entries are stored.
- Return type:
Create or update a toolbar and a menu containing actions to open/set/execute the manager
- has_unsaved_changes()[source]
Whether the settings currently set in the manager differ from the saved entry
- Return type:
- init_extra(**kwargs)[source]
Called right after the CustomApp initialization (and before the UI setup) with the keyword arguments not used by CustomApp, to be reimplemented to make use of them
- list_managed_entries(**kwargs_to_entry_folder)[source]
Returns a list of names of managed entries with the default one as first
See default_entry_name class attribute
- list_managed_entries_path(**kwargs_to_entry_folder)[source]
Should return a list of Path objects representing managed entries.
- save_entries(entry_path=None)[source]
Particular implementation to save entries for this inherited Manager
- setup_docks_and_widgets()[source]
Sets up the widgets for the manager.
Eventually, this can be reimplemented in subclasses to add more/different widgets/docks…
- applied_entry
- property applied_entry_name: str | None
Get the name of the last entry that has been successfully applied/executed
- property ask_before_executing_unsaved: bool
Whether to ask what to do when executing settings that differ from the saved entry
Set by
ask_before_executing_unsavedin the[manager]section of the gui configuration
- default_entry_name = 'default'
- deleted_entry
- property entry_applied: bool
Get the status of the execution of the last applied entry
If True, the
applied_entry_nameproperty will reflect the last successfully applied/executed entry
- execute_action_checkable = False
- icon_name = 'build_circle'
- new_entry
- splash_subentries: SubEntriesSplash | None
- staticMetaObject = PySide6.QtCore.QMetaObject("ManagerBase" inherits "CustomApp": Methods: #5 type=Signal, signature=new_entry(QString), parameters=QString #6 type=Signal, signature=applied_entry(QString), parameters=QString #7 type=Signal, signature=deleted_entry(QString), parameters=QString #8 type=Signal, signature=updated_entry(QString), parameters=QString #9 type=Slot, signature=set_entry_applied(bool), parameters=bool )
- subentries_model: ManagerSubEntriesModel | None
- updated_entry
- class pymodaq_gui.managers.manager_base.ManagerSubEntriesModel(entries)[source]
Bases:
QAbstractListModelMethods
data
rowCount
set_status
- colors: list[GlobalColor]
- staticMetaObject = PySide6.QtCore.QMetaObject("ManagerSubEntriesModel" inherits "QAbstractListModel": )
- class pymodaq_gui.managers.manager_base.Menu(*values)[source]
Bases:
StrEnum- EXTERNAL = 'external'
- MAIN = 'main'