qmm.widgets module

Contains various Qt Widgets used internally by the application.

class qmm.widgets.ListRowItem(filename: str, archive_manager: qmm.filehandler.ArchivesCollection)[source]

Bases: QListWidgetItem

ListWidgetItem representing one single archive.

filename

Returns the name of the archive filename, suitable for path manipulations.

hashsum

Returns the sha256 hashsum of the archive.

modified

Return last modified time for an archive, usually time of creation.

name

Return the name of the archive, formatted for GUI usage.

Transfrom the ‘_’ character into space.

refresh_strings()[source]

Called when the game’s folder state changed.

Reinitialize the widget’s strings, recompute the conflicts then redo all triaging and formatting.

set_gradients()[source]
set_text_color()[source]
class qmm.widgets.QAbout(parent=None)[source]

Bases: QWidget, qmm.ui_about.Ui_About

About window displaying various informations about the software.

class qmm.widgets.QSettings[source]

Bases: QMainWindow

connect_to_savebutton(callback)[source]
disconnect_from_savebutton(callback)[source]
set_mode(first_run=False)[source]
setup_ui()[source]
show()[source]

Show the window and assign internal variables.

class qmm.widgets.QSettingsCentralWidget(parent=None)[source]

Bases: QWidget, qmm.ui_settings.Ui_Settings

Define the settings windows.

on_cancel_button_clicked()[source]

Simply hide the window.

The default values are being defined within the show method, thus there is nothing here for us to do.

Returns:void
qmm.widgets.autoresize_columns(tree_widget: PyQt5.QtWidgets.QTreeWidget)[source]

Resize all columns of a QTreeWidget to fit content.

qmm.widgets.build_conflict_tree_widget(container: PyQt5.QtWidgets.QTreeWidget, archive_instance: qmm.filehandler.ArchiveInstance)[source]
qmm.widgets.build_ignored_tree_widget(tree_widget: PyQt5.QtWidgets.QTreeWidget, ignored_iter: Iterable[qmm.bucket.FileMetadata])[source]
qmm.widgets.build_tree_from_path(item: qmm.bucket.FileMetadata, parent: PyQt5.QtWidgets.QTreeWidget, folders, color=None, extra_column=None)[source]

Generate a set of related PyQt5.QtWidgets.QTreeWidgetItem() based on a file path.

Parameters:
  • item – a qmm.bucket.FileMetadata object.
  • parent – The container widget to anchor the first node to.
  • folders – A dict containing the parents widgets.
  • color – Background color value for the widget.
  • extra_column – Extra values to pass down to _create_treewidget()
Returns:

A dictionnary containing the folders ancestry.

Return type:

dict

qmm.widgets.build_tree_widget(container: PyQt5.QtWidgets.QTreeWidget, archive_instance: qmm.filehandler.ArchiveInstance)[source]