From 4549087d4f7044dbf51a75d1af605ac93f6fbd6b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 5 Oct 2023 20:44:01 +0300 Subject: =?UTF-8?q?fixes=20#3709=20(GmailNotifier:=20=D0=B8=D0=B7=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=83=D1=87=D1=91=D1=82?= =?UTF-8?q?=D0=BD=D1=8B=D1=85=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20?= =?UTF-8?q?=D0=B2=20=D0=9C=D0=B8=D1=80=D0=B0=D0=BD=D0=B4=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=D0=B2=D0=BE=D0=B4=D0=B8=D1=82=20=D0=BA=20=D0=BD?= =?UTF-8?q?=D0=B5=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=BE=D1=81=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D0=BE=D0=B1=D0=BD=D0=BE=D1=81=D1=82=D0=B8=20=D0=BF=D0=BB?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D0=BD=D0=B0=20=D0=B4=D0=BE=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D0=B7=D0=B0=D0=BF=D1=83=D1=81=D0=BA=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/GmailNotifier/src/main.cpp | 4 ++-- protocols/GmailNotifier/src/notify.cpp | 4 ++-- protocols/GmailNotifier/src/options.cpp | 7 ++++++- protocols/GmailNotifier/src/stdafx.h | 2 +- protocols/GmailNotifier/src/version.h | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) (limited to 'protocols/GmailNotifier/src') diff --git a/protocols/GmailNotifier/src/main.cpp b/protocols/GmailNotifier/src/main.cpp index 66c1bfaa63..55f05feef0 100644 --- a/protocols/GmailNotifier/src/main.cpp +++ b/protocols/GmailNotifier/src/main.cpp @@ -17,7 +17,7 @@ HNETLIBUSER hNetlibUser; NOTIFYICONDATA niData; OBJLIST g_accs(1); -BOOL optionWindowIsOpen = FALSE; +bool g_bOptionWindowIsOpen = false; short ID_STATUS_NONEW; ///////////////////////////////////////////////////////////////////////////////////////// @@ -81,7 +81,7 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) INT_PTR PluginMenuCommand(WPARAM hContact, LPARAM) { - if (!optionWindowIsOpen) + if (!g_bOptionWindowIsOpen) mir_forkthread(Check_ThreadFunc, GetAccountByContact(hContact)); return 0; diff --git a/protocols/GmailNotifier/src/notify.cpp b/protocols/GmailNotifier/src/notify.cpp index 99b26b8f55..5b797c221a 100644 --- a/protocols/GmailNotifier/src/notify.cpp +++ b/protocols/GmailNotifier/src/notify.cpp @@ -74,7 +74,7 @@ int OpenBrowser(WPARAM hContact, LPARAM) Account *curAcc = GetAccountByContact(hContact); PUDeletePopup(curAcc->popUpHwnd); Clist_RemoveEvent(curAcc->hContact, 1); - if (GetKeyState(VK_SHIFT) >> 8 || optionWindowIsOpen) + if (GetKeyState(VK_SHIFT) >> 8 || g_bOptionWindowIsOpen) return FALSE; if (curAcc->oldResults_num != 0) { @@ -121,7 +121,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA void NotifyUser(Account *curAcc) { - if (optionWindowIsOpen) + if (g_bOptionWindowIsOpen) return; db_set_s(curAcc->hContact, "CList", "MyHandle", curAcc->results.content); diff --git a/protocols/GmailNotifier/src/options.cpp b/protocols/GmailNotifier/src/options.cpp index b8b9a5955b..ee40329809 100644 --- a/protocols/GmailNotifier/src/options.cpp +++ b/protocols/GmailNotifier/src/options.cpp @@ -64,7 +64,7 @@ public: bool OnInitDialog() override { - optionWindowIsOpen = TRUE; + g_bOptionWindowIsOpen = true; BuildList(); for (auto &it : g_accs) @@ -142,6 +142,11 @@ public: return true; } + void OnDestroy() override + { + g_bOptionWindowIsOpen = false; + } + void onChange_Proxy(CCtrlCheck *) { int ShowControl = IsDlgButtonChecked(m_hwnd, IDC_STARTPRG) ? SW_SHOW : SW_HIDE; diff --git a/protocols/GmailNotifier/src/stdafx.h b/protocols/GmailNotifier/src/stdafx.h index 2140cb6aed..9a1c7c97ab 100644 --- a/protocols/GmailNotifier/src/stdafx.h +++ b/protocols/GmailNotifier/src/stdafx.h @@ -58,7 +58,7 @@ struct Account : public MZeroedObject extern HNETLIBUSER hNetlibUser; extern UINT hTimer; extern short ID_STATUS_NONEW; -extern BOOL optionWindowIsOpen; +extern bool g_bOptionWindowIsOpen; extern OBJLIST g_accs; INT_PTR Notifying(WPARAM, LPARAM); diff --git a/protocols/GmailNotifier/src/version.h b/protocols/GmailNotifier/src/version.h index 7e9d79cb11..5070fc3b32 100644 --- a/protocols/GmailNotifier/src/version.h +++ b/protocols/GmailNotifier/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 1 #define __MINOR_VERSION 0 #define __RELEASE_NUM 1 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #include -- cgit v1.2.3