From f580be3d9dcccb14831d6bed9e7dfca600f5b6f8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Mar 2019 16:15:45 +0300 Subject: popups: - internal implementation details & all service declarations moved to m_popup_int.h; - all service calls removed and replaced with function calls; - direct access to popup serttings replaced with Popup_Enable / Popup_Enabled; --- plugins/BossKeyPlus/src/BossKey.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/BossKeyPlus/src') diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index f2212539c2..b247bb4ef6 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -262,7 +262,7 @@ static void CreateTrayIcon(bool create) static void RestoreOldSettings(void) { if (g_bOldSetting & OLD_POPUP) - CallService(MS_POPUP_QUERY, PUQS_ENABLEPOPUPS, 0); + Popup_Enable(true); if (g_bOldSetting & OLD_SOUND) db_set_b(0, "Skin", "UseSound", 1); @@ -331,10 +331,10 @@ LRESULT CALLBACK ListenWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara CreateTrayIcon(true); // disable popups - if (CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) == 1) { + if (Popup_Enabled()) { // save current g_bOldSetting |= OLD_POPUP; - CallService(MS_POPUP_QUERY, PUQS_DISABLEPOPUPS, 0); + Popup_Enable(false); } // disable sounds @@ -667,13 +667,13 @@ int CMPlugin::Load() if ((g_bOldSetting & OLD_POPUP) && !(g_wMaskAdv & OPT_RESTORE)) // Restore popup settings if Miranda was crushed or killed in hidden mode and "Restore hiding on startup after failure" option is disabled { - if (db_get_b(0, "Popup", "ModuleIsEnabled", 1) == 0) - db_set_b(0, "Popup", "ModuleIsEnabled", 1); + if (Popup_Enabled() == 0) + Popup_Enable(true); } - if (g_wMaskAdv & OPT_HIDEONSTART && db_get_b(0, "Popup", "ModuleIsEnabled", 0)) // hack for disabling popup on startup if "Hide Miranda on startup" is enabled + if (g_wMaskAdv & OPT_HIDEONSTART && Popup_Enabled()) // hack for disabling popup on startup if "Hide Miranda on startup" is enabled { g_bOldSetting |= OLD_POPUP; - db_set_b(0, "Popup", "ModuleIsEnabled", 0); + Popup_Enable(false); } g_plugin.registerIcon("BossKey", iconList); -- cgit v1.2.3