aboutsummaryrefslogtreecommitdiff
path: root/src/main.py
diff options
context:
space:
mode:
authortassaron2022-04-26 13:10:29 -0400
committertassaron2022-04-26 13:10:29 -0400
commit17b4cba6d1a5f24b4de3b53f79b93dd409e28ccd (patch)
tree77bc1cfe57e4e756b0a56833bb2784b0c7ee630b /src/main.py
parentfe3251c528df7eff51be6ecbb18261990b524944 (diff)
tests for commandline argument parsing
Diffstat (limited to 'src/main.py')
-rw-r--r--src/main.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.py b/src/main.py
index 5fabda3..39fa997 100644
--- a/src/main.py
+++ b/src/main.py
@@ -30,25 +30,25 @@ def main():
from .command import Command
main = Command()
- main.parseArgs()
+ mode = main.parseArgs()
log.debug("Finished creating command object")
- elif mode == 'GUI':
+ # Both branches here may occur in one execution:
+ # Commandline parsing could change mode back to GUI
+ if mode == 'GUI':
from .gui.mainwindow import MainWindow
window = uic.loadUi(os.path.join(wd, "gui", "mainwindow.ui"))
- # window.adjustSize()
desc = QtWidgets.QDesktopWidget()
dpi = desc.physicalDpiX()
-
- topMargin = 0 if (dpi == 96) else int(10 * (dpi / 96))
+ log.info("Detected screen DPI: %s", dpi)
+
window.resize(
int(window.width() *
(dpi / 96)),
int(window.height() *
(dpi / 96))
)
- # window.verticalLayout_2.setContentsMargins(0, topMargin, 0, 0)
main = MainWindow(window, proj)
log.debug("Finished creating main window")