From c09a65cb4153f151ec2eb074614b4ccfe7c22bdb Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Mar 2019 17:14:40 +0300 Subject: popups: pascal code cleaning --- src/mir_app/src/popups.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mir_app/src/popups.cpp b/src/mir_app/src/popups.cpp index 67bee51a6e..d6958bcb46 100644 --- a/src/mir_app/src/popups.cpp +++ b/src/mir_app/src/popups.cpp @@ -24,13 +24,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h" +static bool bModuleInit = false, bPopupsEnabled = true; + MIR_APP_DLL(bool) Popup_Enabled() { - return db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0; + if (!bModuleInit) { + bModuleInit = true; + bPopupsEnabled = db_get_b(0, "Popup", "ModuleIsEnabled", 1) != 0; + } + + return bPopupsEnabled; } MIR_APP_DLL(void) Popup_Enable(bool bEnable) { + bPopupsEnabled = bEnable; db_set_b(0, "Popup", "ModuleIsEnabled", bEnable); } -- cgit v1.2.3