From 67ac43565536b9e3429e8eb545f3c719aac5a6b5 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 10 Apr 2021 15:46:10 +0300 Subject: [PATCH] UI: Update tray menu on password unlock changed. --- src/ui/fortmanager.cpp | 3 ++- src/ui/fortsettings.cpp | 6 +++--- src/ui/fortsettings.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ui/fortmanager.cpp b/src/ui/fortmanager.cpp index e584b05f..90cf1498 100644 --- a/src/ui/fortmanager.cpp +++ b/src/ui/fortmanager.cpp @@ -304,7 +304,8 @@ void FortManager::setupTrayIcon() connect(m_trayIcon, &QSystemTrayIcon::messageClicked, this, &FortManager::onTrayMessageClicked); connect(this, &FortManager::optWindowChanged, this, &FortManager::updateTrayMenuFlags); - connect(settings(), &FortSettings::passwordUnlocked, this, &FortManager::updateTrayMenuFlags); + connect(settings(), &FortSettings::passwordUnlockChanged, this, + &FortManager::updateTrayMenuFlags); connect(confManager(), &ConfManager::confSaved, this, &FortManager::updateTrayMenu); connect(confManager(), &ConfManager::alertedAppAdded, this, [&] { updateTrayIcon(true); }); diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index 81953b22..97327a3c 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -236,10 +236,10 @@ void FortSettings::setPasswordChecked(bool checked, int unlockType) return; m_passwordChecked = checked; - m_passwordUnlockType = unlockType; - if (m_passwordUnlockType != 0) { - emit passwordUnlocked(); + if (m_passwordUnlockType != unlockType) { + m_passwordUnlockType = unlockType; + emit passwordUnlockChanged(); } emit iniChanged(); diff --git a/src/ui/fortsettings.h b/src/ui/fortsettings.h index 0cfb8cbd..130e6815 100644 --- a/src/ui/fortsettings.h +++ b/src/ui/fortsettings.h @@ -232,7 +232,7 @@ public: signals: void iniChanged(); void errorMessageChanged(); - void passwordUnlocked(); + void passwordUnlockChanged(); public slots: void setupGlobal();