LiquidGUI [1.1.0.0] Dev

- Initial Linux support.
This commit is contained in:
2024-07-07 16:41:50 +01:00
parent 5fab490885
commit 495de03e39
6 changed files with 53 additions and 47 deletions
+26 -23
View File
@@ -1,24 +1,22 @@
import sys
import win32mica
from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar
from PySide6.QtCore import Qt, QTimer, QThreadPool
from PySide6.QtGui import QFont, QIcon
from PyQt6.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout, QLabel, QProgressBar
from PyQt6.QtCore import Qt, QTimer, QThreadPool
from PyQt6.QtGui import QFont, QIcon
from LiquidCTL_Helper import LiquidCTL_Helper
from MessageHandler import MessageHandler
import resources, pkg_resources.extern
import resources
from styles.SubLabel import SubLabel
from styles.SubLabelValue import SubLabelValue
class MainWindow(QMainWindow):
""" Main application window. """
def __init__(self, lctl):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("LiquidGUI (v.1.0.3.2)")
self.setWindowTitle("LiquidGUI (v.1.1.0.0)")
self.setFixedSize(450, 385)
self.lctl = lctl
self.lctl = LiquidCTL_Helper()
# Widgets ##########################################
self.lbl_device_name = QLabel(font=QFont("Calibre",
@@ -62,7 +60,6 @@ class MainWindow(QMainWindow):
layout.addWidget(self.lbl_fwvers)
layout.setSpacing(10)
self.setLayout(layout)
self.setCentralWidget(widget)
self.setContentsMargins(20, 20, 20, 20)
@@ -77,15 +74,16 @@ class MainWindow(QMainWindow):
def update_widgets(self):
""" Update widgets using LiquidCTL library."""
self.lbl_device_name.setText("- " + self.lctl.device_name + " -")
self.prg_temp.setValue(self.lctl.device_temp)
self.lbl_value_prg_temp.setText(str(self.lctl.device_temp) + "°C")
self.prg_fanspeed.setValue(self.lctl.device_fanSpeed)
self.lbl_value_prg_fanspeed.setText(str(self.lctl.device_fanSpeed) + " rpm")
self.prg_pumpspeed.setValue(self.lctl.device_pumpSpeed)
self.lbl_value_prg_pumpspeed.setText(str(self.lctl.device_pumpSpeed) + " rpm")
if self.lctl.device_fwVers is not None:
self.lbl_fwvers.setText(f"Firmware: v{self.lctl.device_fwVers}")
if self.lctl.device_name != None:
self.lbl_device_name.setText("- " + self.lctl.device_name + " -")
self.prg_temp.setValue(int(self.lctl.device_temp))
self.lbl_value_prg_temp.setText(str(self.lctl.device_temp) + "°C")
self.prg_fanspeed.setValue(self.lctl.device_fanSpeed)
self.lbl_value_prg_fanspeed.setText(str(self.lctl.device_fanSpeed) + " rpm")
self.prg_pumpspeed.setValue(self.lctl.device_pumpSpeed)
self.lbl_value_prg_pumpspeed.setText(str(self.lctl.device_pumpSpeed) + " rpm")
if self.lctl.device_fwVers is not None:
self.lbl_fwvers.setText(f"Firmware: v{self.lctl.device_fwVers}")
def main():
@@ -94,18 +92,23 @@ def main():
icon = QIcon(":/icons/LiquidGUI.ico")
app.setWindowIcon(icon)
window = MainWindow(LiquidCTL_Helper())
window = MainWindow()
window.setWindowIcon(icon)
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
# Show error and quit app if no devices are found
if window.lctl.TestConnectionState():
MessageHandler().ShowNoDevicesFoundError()
sys.exit(1)
else:
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
try:
import win32mica
win32mica.ApplyMica(window.winId(), win32mica.MICAMODE.DARK)
window.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
except ImportError as e:
print(f"ERROR: Unable to import {e.name}")
window.show()
app.setStyle("Breeze")
app.exec()