LiquidGUI [1.0.1.2]
- Error handling and app termination for no compatible coolers. - Minor code refactoring.
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
import sys
|
||||
import qdarktheme
|
||||
import win32mica
|
||||
import liquidctl_worker
|
||||
import resources
|
||||
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar, QGroupBox
|
||||
from PySide6.QtCore import Qt, QTimer, QThreadPool
|
||||
from PySide6.QtGui import QFont, QIcon
|
||||
from liquidctl_worker import LiquidCTL_Init
|
||||
from messagehandler import MessageHandler
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super(MainWindow, self).__init__()
|
||||
self.setWindowTitle("LiquidGUI (v.1.0.0.1)")
|
||||
self.setWindowTitle("LiquidGUI (v.1.0.1.2)")
|
||||
self.setFixedSize(450, 300)
|
||||
self.setWindowFlags(Qt.WindowType.Dialog)
|
||||
widget = QWidget(self)
|
||||
@@ -56,7 +57,6 @@ class MainWindow(QMainWindow):
|
||||
self.timer.timeout.connect(self.update_widgets)
|
||||
self.timer.start()
|
||||
|
||||
|
||||
def update_widgets(self):
|
||||
self.lbl_device_name.setText(lctl_worker.device_name)
|
||||
self.prg_temp.setValue(lctl_worker.device_temp)
|
||||
@@ -66,11 +66,16 @@ class MainWindow(QMainWindow):
|
||||
self.lbl_fwVers.setText(f"Firmware: v{lctl_worker.device_fwVers}")
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
icon = QIcon(":/icons/LiquidGUI.ico")
|
||||
app.setWindowIcon(icon)
|
||||
|
||||
lctl_worker = liquidctl_worker.LiquidCTL_Init()
|
||||
messagehandler = MessageHandler()
|
||||
|
||||
lctl_worker = LiquidCTL_Init()
|
||||
# Show error and quit app if no devices are found
|
||||
if lctl_worker.TestConnectionState() == True:
|
||||
messagehandler.ShowNoDevicesFoundError()
|
||||
sys.exit(1)
|
||||
|
||||
window = MainWindow()
|
||||
window.setWindowIcon(icon)
|
||||
|
||||
Reference in New Issue
Block a user