Skip to content

dialog

Classes:

ScriptErrorDialog

ScriptErrorDialog(main_window: MainWindow)

Bases: ExtendedDialog

Methods:

Attributes:

Source code
25
26
27
28
29
30
31
32
33
34
def __init__(self, main_window: MainWindow) -> None:
    super().__init__(main_window, Qt.WindowType.Dialog)
    self.main = main_window

    self.setWindowTitle('There was an error')
    self.setModal(True)

    self.setup_ui()

    self.set_qobject_names()

main instance-attribute

main = main_window

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

closeEvent

closeEvent(event: QCloseEvent) -> None
Source code
61
62
def closeEvent(self, event: QCloseEvent) -> None:
    self.on_exit_clicked()

on_exit_clicked

on_exit_clicked(clicked: bool | None = None) -> None
Source code
54
55
56
57
58
59
def on_exit_clicked(self, clicked: bool | None = None) -> None:
    self.hide()
    self.script_exec_failed = True

    if not self.main.no_exit:
        sys.exit(1)

on_reload_clicked

on_reload_clicked(clicked: bool | None = None) -> None
Source code
50
51
52
def on_reload_clicked(self, clicked: bool | None = None) -> None:
    self.hide()
    self.main.reload_script()

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
36
37
38
39
40
41
42
43
44
45
46
47
48
def setup_ui(self) -> None:
    self.vlayout = VBoxLayout(self)

    self.label = QLabel()
    self.reload_button = PushButton(
        'Reload', self, clicked=self.on_reload_clicked, hidden=not self.main.reload_enabled
    )
    self.exit_button = PushButton('Exit', self, clicked=self.on_exit_clicked)

    self.vlayout.addWidget(self.label)
    self.vlayout.addLayout(HBoxLayout(
        [self.reload_button, self.exit_button] if self.main.reload_enabled else [self.exit_button]
    ))

SettingsDialog

SettingsDialog(main_window: MainWindow)

Bases: ExtendedDialog

Methods:

Attributes:

Source code
68
69
70
71
72
73
74
75
76
def __init__(self, main_window: MainWindow) -> None:
    super().__init__(main_window)

    self.main = main_window
    self.setWindowTitle('Settings')

    self.setup_ui()

    self.set_qobject_names()

main instance-attribute

main = main_window

storable_attrs class-attribute

storable_attrs: tuple[str, ...] = ()

addTab

addTab(widget: QWidget, label: str) -> int
Source code
82
83
def addTab(self, widget: QWidget, label: str) -> int:
    return self.tab_widget.addTab(widget, label)

set_qobject_names

set_qobject_names() -> None
Source code
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def set_qobject_names(self) -> None:
    if not hasattr(self, '__slots__'):
        return

    slots = list(self.__slots__)

    if isinstance(self, AbstractToolbar) and 'main' in slots:
        slots.remove('main')

    for attr_name in slots:
        attr = getattr(self, attr_name)
        if not isinstance(attr, QObject):
            continue
        attr.setObjectName(type(self).__name__ + '.' + attr_name)

setup_ui

setup_ui() -> None
Source code
78
79
80
def setup_ui(self) -> None:
    self.tab_widget = QTabWidget(self)
    self.vlayout = VBoxLayout(self, [self.tab_widget])