From 6005caf8b71deac1ba7c595f670f109bf63ebe15 Mon Sep 17 00:00:00 2001 From: atse Date: Fri, 29 Sep 2023 10:19:17 +0800 Subject: [PATCH] Add info boxes when loading/saving configs --- pytec/tec_qt.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pytec/tec_qt.py b/pytec/tec_qt.py index b3faa7b..acd93e3 100644 --- a/pytec/tec_qt.py +++ b/pytec/tec_qt.py @@ -443,6 +443,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): @asyncSlot(bool) async def load(_): await self.client.load_config() + loaded = QtWidgets.QMessageBox(self) + loaded.setWindowTitle("Config loaded") + loaded.setText(f"All channel configs have been loaded from flash.") + loaded.setIcon(QtWidgets.QMessageBox.Icon.Information) + loaded.show() self.actionLoad_all_configs.triggered.connect(load) self.thermostat_menu.addAction(self.actionLoad_all_configs) @@ -450,6 +455,11 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): @asyncSlot(bool) async def save(_): await self.client.save_config() + saved = QtWidgets.QMessageBox(self) + saved.setWindowTitle("Config saved") + saved.setText(f"All channel configs have been saved to flash.") + saved.setIcon(QtWidgets.QMessageBox.Icon.Information) + saved.show() self.actionSave_all_configs.triggered.connect(save) self.thermostat_menu.addAction(self.actionSave_all_configs) @@ -685,12 +695,22 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow): @asyncSlot() async def save(_, ch=i): await self.client.save_config(ch) + saved = QtWidgets.QMessageBox(self) + saved.setWindowTitle("Config saved") + saved.setText(f"Channel {ch} Config has been saved to flash.") + saved.setIcon(QtWidgets.QMessageBox.Icon.Information) + saved.show() self.params[i].child('Save to flash').sigActivated.connect(save) @asyncSlot() async def load(_, ch=i): await self.client.load_config(ch) + loaded = QtWidgets.QMessageBox(self) + loaded.setWindowTitle("Config loaded") + loaded.setText(f"Channel {ch} Config has been loaded from flash.") + loaded.setIcon(QtWidgets.QMessageBox.Icon.Information) + loaded.show() self.params[i].child('Load from flash').sigActivated.connect(load)