feat(main): implement def run_app
This commit is contained in:
parent
7be34dd161
commit
e5a1ec288f
1 changed files with 18 additions and 0 deletions
|
|
@ -443,3 +443,21 @@ class QtScanSlicer(QMainWindow, ScanSlicerUiBuilderMixin, ScanSlicerControllerMi
|
|||
if hasattr(self, "_close_status_log"):
|
||||
self._close_status_log()
|
||||
super().closeEvent(event)
|
||||
|
||||
# run_app: function definition for ScanSlicer behavior.
|
||||
def run_app(startup_dir=None):
|
||||
app = QApplication.instance()
|
||||
if app is None:
|
||||
app = QApplication(sys.argv)
|
||||
apply_dark_theme_if_requested(app)
|
||||
apply_global_text_size_offset(app, 2)
|
||||
app.setApplicationName("ScanSlicer")
|
||||
app.setApplicationDisplayName("ScanSlicer")
|
||||
app.setDesktopFileName("scanslicer")
|
||||
app_icon = resolve_app_icon()
|
||||
if not app_icon.isNull():
|
||||
app.setWindowIcon(app_icon)
|
||||
|
||||
scan_slicer_window = QtScanSlicer(startup_dir)
|
||||
scan_slicer_window.showMaximized()
|
||||
return app.exec()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue