qmm.manager module¶
Handles the Qt main window.
- class qmm.manager.ArchiveAddedEventHandler(moved_cb, created_cb, deleted_cb, modified_cb)[source]¶
Bases:
QmmWdEventHandler,PatternMatchingEventHandler,QObject- on_created(event)[source]¶
Called when a file or directory is created.
- Parameters:
event (
DirCreatedEventorFileCreatedEvent) – Event representing file/directory creation.
- on_deleted(event)[source]¶
Called when a file or directory is deleted.
- Parameters:
event (
DirDeletedEventorFileDeletedEvent) – Event representing file/directory deletion.
- class qmm.manager.GameModEventHandler(moved_cb, created_cb, deleted_cb, modified_cb)[source]¶
Bases:
QmmWdEventHandler,PatternMatchingEventHandler,QObject- on_created(event)[source]¶
Called when a file or directory is created.
- Parameters:
event (
DirCreatedEventorFileCreatedEvent) – Event representing file/directory creation.
- on_deleted(event)[source]¶
Called when a file or directory is deleted.
- Parameters:
event (
DirDeletedEventorFileDeletedEvent) – Event representing file/directory deletion.
- class qmm.manager.MainWindow[source]¶
Bases:
QMainWindow,QEventFilter,Ui_MainWindow- closeEvent(self, a0: QCloseEvent | None)[source]¶
- fswatch_clear(QString, QString)¶
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- fswatch_ignore(QString, QString)¶
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- get_row_index_by_name(name)[source]¶
Return row if name is found in the list.
- Parameters:
name (str) – Filename of the archive to find, matches content of the
ListRowItemtext method.- Returns:
index of item found, None if name matches nothing.
- Return type:
int or None
- property is_mod_repo_dirty¶
- on_selection_change() None[source]¶
Change the tab color to match the selected element in linked list.
- class qmm.manager.QAppEventFilter[source]¶
Bases:
QObjectDetect if the application is active then triggers to appropriate events.
The purpose of this object is to enable or disable WatchDog related procedures. We want to disable file system watch on the modules directory when the window is inactive (user has alt-tabbed outside of it or minimized the application), as such delay any activity until the user comes back to the application itself. The intent is to minimize uneeded operations as the user could move and rename multiple files in the folder. We only need to scan the module’s repository once the user has finished, thus once the application becomes active.
The detection of activity needs to be done at the Session Manager, namely
PyQt5:QApplication(QGuiApplicationorQCoreApplication). That object handles every window and widgets of the application. Each of those window and widgets could become inactive regardless of the status of the whole application. Inactivity could be defined as whenever the application loose focus (keyboard input). This loss also happen whenever the window is being dragged around by the user, which means we need to make sure to not trigger any refresh of the database for those user cases. To achieve that we track the geometry and coordinates of the window and trigger the callback only if those parameters remains the same between an inactive and active event.Callbacks are
on_window_activateandon_window_deactivate.- set_top_window(window: MainWindow)[source]¶
Define the widget that is considered as top window.
- class qmm.manager.QmmWdEventHandler(moved_cb, created_cb, deleted_cb, modified_cb)[source]¶
Bases:
object- sgn_created(PyQt_PyObject)¶
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- sgn_deleted(PyQt_PyObject)¶
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- sgn_modified(PyQt_PyObject)¶
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name
- sgn_moved(PyQt_PyObject)¶
str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- Type:
pyqtSignal(*types, name