Skip to content

Commit

Permalink
Add "Start minimized" functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
akej74 committed Dec 27, 2017
1 parent b595e8d commit 684355c
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions grid-control/gridcontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
ICON_RED_LED = ":/icons/led-red-on.png"
ICON_GREEN_LED = ":/icons/green-led-on.png"

# TODO: Verify "Fan config" values are valid in the UI
# TODO: Check for loop with range 1,7

class GridControl(QtWidgets.QMainWindow):
"""Create the UI, based on PyQt5.
The UI elements are defined in "mainwindow.py" and resource file "resources_rc.py", created in QT Designer.
Expand Down Expand Up @@ -100,9 +97,16 @@ def __init__(self):
self.manual_value_fan5 = self.ui.horizontalSliderFan5.value()
self.manual_value_fan6 = self.ui.horizontalSliderFan6.value()

# Minimize to tray if enabled
if self.ui.checkBoxStartMinimized.isChecked():
self.hide()
else:
self.show()

# Initialize communication
self.init_communication()


def setup_ui_logic(self):
"""Define QT signal and slot connections and initializes UI values."""

Expand Down Expand Up @@ -793,10 +797,10 @@ def on_systemTrayIcon_activated(self, reason):
win = GridControl()

# Set program version
win.setWindowTitle("Grid Control 1.0.5")
win.setWindowTitle("Grid Control 1.0.6")

# Show window
win.show()
#win.show()

# Disable window resizing
win.setFixedSize(win.size())
Expand Down

0 comments on commit 684355c

Please sign in to comment.