-
Notifications
You must be signed in to change notification settings - Fork 0
message
version: v1.0.5
object MessageBoxType [src]
Singleton object of the type _MessageBoxType, containing the types defined in the source JSON file.
function get_messagebox_types() [src]
def get_messagebox_types(fetch_data: bool = False) -> list[str | _MessageBoxData]Returns the available messagebox types.
Parameters:
- fetch_data: A flag requesting the _MessageBoxData objects themselves. The default is False.
function merge_json() [src]
def merge_json(path: str) -> NoneTakes an external JSON messagebox type file and merges its contents to the package's own file. This way if you create messageboxes you can reuse them in another project.
Parameters:
- path: Path to the external JSON messagebox type file.
dataclass _MessageBoxData [src]
Settings defining the appearance of a QMessageBox.
Parameters:
- icon: The icon to set for the message box.
- title: The title to set for the message box window.
- text: The text content to set for the message box.
- buttons: A list of standard buttons to set for the message box.
- flags: A list of flags to set for the message box defining its behaviour.
[src]
def __post_init__(self) -> NoneAdds the correct default values where they are mutable.
[src]
def __eq__(self, other) -> boolCustom comparison rule, comparing each field.
[src]
def merged_bits(self, attr: str) -> QMessageBox.StandardButton | Qt.WindowTypeMerges the bits of either buttons or flags and returns.
Parameters:
-
attr: The requested attribute (
buttonsorflags) as a string.
Returns: An Enum subclass (concrete type based on attr) with the merged value.
[src]
@property
def as_dict(self) -> dictReturns the data content as a dictionary.
[src]
@classmethod
def from_dict(cls, src: dict) -> _MessageBoxDataReturns an instance built from a dictionary.
Parameters:
- src: A dictionary containing data to build an instance, extracted from the handled JSON file.
dataclass _MessageBoxCategories(metaclass=Singleton) [src]
A constant dataclass for holding parameters of the four basic categories of message boxes and an additional custom type. (It's not an Enum-subclass because the fields are mutable.)
[src]
def __post_init__(self) -> NoneCreates mutable values after initialization.
class _MessageBoxType(metaclass=Singleton) [src]
A collection of predefined types of messagebox.
[src]
def __init__(self) -> NoneInitializer for the class.
[src]
def __getattr__(self, name: str) -> AnyHandles an attribute access request.
Parameters:
- name: The name of the requested attribute.
Returns: A stored _MessageBoxData object or an attribute of the internal dictionary.
[src]
def __setattr__(self, key: str, value: _MessageBoxData | None) -> NoneHandles an attribute setting request.
Parameters:
- key: The name of the attribute whose value is to be set.
- value: The value to set for the attribute.
[src]
def __setitem__(self, key: str, value: _MessageBoxData) -> NoneSets a new set of message box data for the internal dictionary by accessing with '[]'.
Parameters:
- key: The type ID to set the data to.
- value: The message box data to set.
[src]
def __delitem__(self, key: str) -> NoneDeletes a set of message box data from the internal dictionary.
[src]
def import_types(self) -> NoneImports types from the handled JSON file.
[src]
def export_types(self) -> NoneExports types to the handled JSON file.
[src]
def is_empty(self) -> boolReturns True if there are no defined types, False if there are.
[src]
def converted_keys(self) -> list[str]Returns the keys converted to a list of space-separated and capitalized strings.
class _OrderedSelectionList(QWidget) [src]
A widget where an ordered selection can be made from a combobox.
[src]
def __init__(self, list_name: str, items: list, add: str, remove: str) -> NoneInitializer for the class.
Parameters:
- list_name: String identifier of the list set to a label.
- items: A list of items to set for the combobox.
- add: Text to set for the add button.
- remove: Text to set for the remove button.
[src]
def _setup_ui(self) -> NoneSets up the user interface: GUI objects and layouts.
[src]
def _setup_connections(self) -> NoneSets up the connections of the GUI objects.
[src]
def _slot_add_item(self) -> NoneAdds the current item of the combobox to the selection list.
[src]
def _slot_remove_item(self) -> NoneRemoves the currently selected item from the selection list.
[src]
def set_selection(self, new_selection: list[str]) -> NoneResets the selection list by the provided items.
Parameters:
- new_selection: The new items to set to the selection list.
[src]
@property
def selection_str(self) -> list[str]Returns the string content of the selection list.
[src]
@property
def selection_idx(self) -> list[int]Returns the selection list encoded by the order of the source item list.
[src]
def setEnabled(self, new_state: bool) -> NoneSets the enabled state of the child widgets.
Parameters:
- new_state: The new enabled state to set.
class _MessageBoxTypeCreator(QDialog) [src]
A dialog for defining custom messagebox types / editing existing ones.
[src]
def __init__(self) -> NoneInitializer for the class.
[src]
def _setup_ui(self) -> NoneSets up the user interface: GUI objects and layouts.
[src]
def _setup_connections(self) -> NoneSets up the connections of the GUI objects.
[src]
def _slot_set_control_states(self) -> NoneUpdates the controls' enabled state based on the state of the checkbox.
[src]
def _slot_update_by_combobox(self) -> NoneUpdates the dialog according to the controlling combobox.
[src]
def _get_as_messageboxdata(self) -> _MessageBoxDataReturns a MessageBoxData object built from the settings made in the dialog.
[src]
def _slot_test_settings(self) -> NoneCreates a message box dialog based on the settings.
[src]
def _slot_export_settings(self) -> NoneExports the currently set type and updates the dialog accordingly.
[src]
def _slot_delete_settings(self) -> NoneDeletes the currently selected type and updates the dialog accordingly.
function message() [src]
def message(parent: QWidget, mbd: _MessageBoxData, custom_text: str = None) -> QMessageBox.StandardButtonShows a modal QMessageBox with preset content (or custom text) and a custom theme.
Parameters:
- parent: The parent widget calling for the message dialog.
- mbd: MessageBox data to define the appearance of the created window.
- custom_text: Overrides the preset text. The default is None, having no effect.
Returns: The clicked standard button (or its equal if the dialog was just closed).
function write_stub() [src]
def write_stub() -> NoneWrites the stub file to the project directory if it doesn't exist already or if an external stub file directory is set it creates a new stub file there (and deletes the package's own) or overrides the existing one.