This commit is contained in:
+22
-14
@@ -16,7 +16,7 @@ from PyQt5 import QtCore, QtGui, QtWidgets
|
|||||||
|
|
||||||
|
|
||||||
APP_NAME = "Watchdog GUI"
|
APP_NAME = "Watchdog GUI"
|
||||||
APP_VERSION = "1.1.0"
|
APP_VERSION = "1.1.2"
|
||||||
|
|
||||||
BASE_DIR = Path(__file__).resolve().parent
|
BASE_DIR = Path(__file__).resolve().parent
|
||||||
CONFIG_PATH = BASE_DIR / "watchdog_config.json"
|
CONFIG_PATH = BASE_DIR / "watchdog_config.json"
|
||||||
@@ -255,6 +255,7 @@ class WatchdogWindow(QtWidgets.QMainWindow):
|
|||||||
self.setMinimumSize(520, 270)
|
self.setMinimumSize(520, 270)
|
||||||
|
|
||||||
self.cfg = load_config()
|
self.cfg = load_config()
|
||||||
|
self._is_loading_config = False
|
||||||
self.monitoring = False
|
self.monitoring = False
|
||||||
self.last_restart_time = 0.0
|
self.last_restart_time = 0.0
|
||||||
self._really_quit = False
|
self._really_quit = False
|
||||||
@@ -431,23 +432,30 @@ class WatchdogWindow(QtWidgets.QMainWindow):
|
|||||||
LOGGER.addHandler(self.ui_log_handler)
|
LOGGER.addHandler(self.ui_log_handler)
|
||||||
|
|
||||||
def _load_config_to_ui(self):
|
def _load_config_to_ui(self):
|
||||||
self.edit_exe_path.setText(self.cfg.get("target_exe_path", ""))
|
self._is_loading_config = True
|
||||||
self.spin_interval.setValue(int(self.cfg.get("check_interval_sec", 5)))
|
try:
|
||||||
self.spin_cooldown.setValue(int(self.cfg.get("restart_cooldown_sec", 10)))
|
self.edit_exe_path.setText(self.cfg.get("target_exe_path", ""))
|
||||||
self.chk_auto_start.setChecked(bool(self.cfg.get("auto_start_monitoring", False)))
|
self.spin_interval.setValue(int(self.cfg.get("check_interval_sec", 5)))
|
||||||
self.chk_start_minimized.setChecked(bool(self.cfg.get("start_minimized_to_tray", False)))
|
self.spin_cooldown.setValue(int(self.cfg.get("restart_cooldown_sec", 10)))
|
||||||
self.chk_hide_on_close.setChecked(bool(self.cfg.get("hide_on_close", True)))
|
self.chk_auto_start.setChecked(bool(self.cfg.get("auto_start_monitoring", False)))
|
||||||
|
self.chk_start_minimized.setChecked(bool(self.cfg.get("start_minimized_to_tray", False)))
|
||||||
|
self.chk_hide_on_close.setChecked(bool(self.cfg.get("hide_on_close", True)))
|
||||||
|
|
||||||
show_log = bool(self.cfg.get("show_log_panel", False))
|
show_log = bool(self.cfg.get("show_log_panel", False))
|
||||||
self.log_group.setVisible(show_log)
|
self.log_group.setVisible(show_log)
|
||||||
self.btn_toggle_log.setText("로그 숨기기" if show_log else "로그 보기")
|
self.btn_toggle_log.setText("로그 숨기기" if show_log else "로그 보기")
|
||||||
|
|
||||||
if show_log:
|
if show_log:
|
||||||
self.resize(600, 540)
|
self.resize(600, 540)
|
||||||
else:
|
else:
|
||||||
self.resize(560, 300)
|
self.resize(560, 300)
|
||||||
|
finally:
|
||||||
|
self._is_loading_config = False
|
||||||
|
|
||||||
def save_ui_to_config(self):
|
def save_ui_to_config(self):
|
||||||
|
if getattr(self, "_is_loading_config", False):
|
||||||
|
return
|
||||||
|
|
||||||
self.cfg["target_exe_path"] = self.edit_exe_path.text().strip()
|
self.cfg["target_exe_path"] = self.edit_exe_path.text().strip()
|
||||||
self.cfg["check_interval_sec"] = int(self.spin_interval.value())
|
self.cfg["check_interval_sec"] = int(self.spin_interval.value())
|
||||||
self.cfg["restart_cooldown_sec"] = int(self.spin_cooldown.value())
|
self.cfg["restart_cooldown_sec"] = int(self.spin_cooldown.value())
|
||||||
|
|||||||
Reference in New Issue
Block a user