summaryrefslogtreecommitdiff
path: root/plugins/ProxySwitch/src/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-05 21:10:22 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-05 21:10:22 +0300
commitd9fddc0cfa9066eb1b5ad3f4807b37426ae6ca88 (patch)
treef09baaf9b91477d009cedc5bd77449b0fa3e3af7 /plugins/ProxySwitch/src/main.cpp
parent8a1ff32e54b39ceef22df61bda17bbfda94918fc (diff)
Popup:
- wiping out checks for service presence; - code cleaning
Diffstat (limited to 'plugins/ProxySwitch/src/main.cpp')
-rw-r--r--plugins/ProxySwitch/src/main.cpp38
1 files changed, 13 insertions, 25 deletions
diff --git a/plugins/ProxySwitch/src/main.cpp b/plugins/ProxySwitch/src/main.cpp
index b5c8f01d3e..30a452c6a6 100644
--- a/plugins/ProxySwitch/src/main.cpp
+++ b/plugins/ProxySwitch/src/main.cpp
@@ -53,8 +53,6 @@ UINT opt_not_restarted;
COLORREF opt_bgColor;
COLORREF opt_txtColor;
-UINT opt_popupPluginInstalled;
-
static HANDLE hEventConnect = NULL;
static HANDLE hEventDisconnect = NULL;
static HANDLE hSvcPopupSwitch = NULL;
@@ -77,17 +75,12 @@ void PopupMyIPAddrs(const wchar_t *msg)
POPUPDATAW ppd = {};
wcsncpy_s(ppd.lpwzText, Print_NIF_List(list, msg), _TRUNCATE);
- if (opt_popupPluginInstalled) {
- LoadSettings();
- ppd.lchIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_PROXY));
- wcsncpy_s(ppd.lpwzContactName, TranslateT("Current IP address"), _TRUNCATE);
- ppd.colorBack = opt_defaultColors ? 0 : opt_bgColor;
- ppd.colorText = opt_defaultColors ? 0 : opt_txtColor;
- PUAddPopupW(&ppd);
- }
- else {
- MessageBox(NULL, ppd.lpwzText, _A2T(MODULENAME), MB_OK | MB_ICONINFORMATION);
- }
+ LoadSettings();
+ ppd.lchIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_PROXY));
+ wcsncpy_s(ppd.lpwzContactName, TranslateT("Current IP address"), _TRUNCATE);
+ ppd.colorBack = opt_defaultColors ? 0 : opt_bgColor;
+ ppd.colorText = opt_defaultColors ? 0 : opt_txtColor;
+ PUAddPopupW(&ppd);
}
}
@@ -248,8 +241,6 @@ int CMPlugin::Load()
int Init(WPARAM, LPARAM)
{
- opt_popupPluginInstalled = ServiceExists(MS_POPUP_ADDPOPUP);
-
hEventRebound = CreateEvent(NULL, TRUE, FALSE, NULL);
mir_forkthread(IP_WatchDog, 0);
@@ -295,17 +286,14 @@ int Init(WPARAM, LPARAM)
UpdateInterfacesMenu();
- if (opt_popupPluginInstalled) {
- mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0xC0000000);
- mi.name.w = LPGENW("IP change notification");
- mi.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LOGO));
- mi.pszService = MS_PROXYSWITCH_POPUPSWITCH;
- hEnableDisablePopupMenu = Menu_AddMainMenuItem(&mi);
- hSvcPopupSwitch = CreateServiceFunction(mi.pszService, PopupSwitch);
-
- UpdatePopupMenu(opt_popups);
- }
+ mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0xC0000000);
+ mi.name.w = LPGENW("IP change notification");
+ mi.hIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LOGO));
+ mi.pszService = MS_PROXYSWITCH_POPUPSWITCH;
+ hEnableDisablePopupMenu = Menu_AddMainMenuItem(&mi);
+ hSvcPopupSwitch = CreateServiceFunction(mi.pszService, PopupSwitch);
+ UpdatePopupMenu(opt_popups);
return 0;
}