Skip to content

Commit

Permalink
added version and window title
Browse files Browse the repository at this point in the history
  • Loading branch information
achimmihca committed Aug 16, 2021
1 parent d85dbf5 commit 32d1590
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/common/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
version = "0.1.0"
7 changes: 7 additions & 0 deletions src/gui/MainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from PySide6.QtGui import QResizeEvent
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QMainWindow, QLabel
from common.version import version
from common.Config import Config
from common.LogHolder import LogHolder
from common.WebcamControl import WebcamControl
Expand All @@ -17,6 +18,7 @@ class MainWindow(QMainWindow, LogHolder):
def __init__(self, config: Config, webcam_control: WebcamControl) -> None:
QMainWindow.__init__(self)
LogHolder.__init__(self)
self.setWindowTitle(f"DedoMouse")
self.config = config
self.webcam_control = webcam_control

Expand Down Expand Up @@ -62,9 +64,14 @@ def setup_video_capture(self) -> None:
self.video_capture_thread.start()

def setup_status_bar(self) -> None:
global version
version_label = QLabel(f"Version: {version}")
self.statusBar().addWidget(version_label)

capture_size_label = QLabel()
self.config.capture_size.subscribe_and_run(lambda new_value: capture_size_label.setText(f"Video size: {new_value.x}x{new_value.y}"))
self.statusBar().addWidget(capture_size_label)

monitor_size_label = QLabel()
self.config.screen_size.subscribe_and_run(lambda new_value: monitor_size_label.setText(f"Monitor size: {new_value.x}x{new_value.y}"))
self.statusBar().addWidget(monitor_size_label)
Expand Down
3 changes: 2 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@
from common.WebcamControl import WebcamControl
from common.GestureRecognizer import GestureRecognizer
from common.GlobalShortcutControl import GlobalShortcutControl
from common.version import version

init_logging()
logging.getLogger('root').info("=============================================")
logging.getLogger('root').info("DedoMouse started")
logging.getLogger('root').info(f"DedoMouse {version} started")
logging.getLogger('root').info("=============================================")

ConfigJsonHandler.handles(Config)
Expand Down

0 comments on commit 32d1590

Please sign in to comment.