diff options
author | George Hazan <ghazan@miranda.im> | 2018-09-03 18:25:42 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-09-03 18:25:42 +0300 |
commit | c0274fa5abfcfb59a4c8ae4d113d705ea0272c4c (patch) | |
tree | d8eda62b1e94d67f84a121295a3cb8f68b01849e /plugins | |
parent | 4db67c1a255bf379e63641eff1f3527ea6aa2759 (diff) |
popup code cleaning
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/BasicHistory/src/Scheduler.cpp | 4 | ||||
-rw-r--r-- | plugins/MirFox/src/MirandaInterface.cpp | 6 | ||||
-rw-r--r-- | plugins/Nudge/src/main.cpp | 3 | ||||
-rw-r--r-- | plugins/Ping/src/utils.cpp | 4 | ||||
-rw-r--r-- | plugins/Popup/src/notifications.cpp | 2 | ||||
-rw-r--r-- | plugins/Popup/src/services.cpp | 8 | ||||
-rw-r--r-- | plugins/Toaster/src/services.cpp | 2 | ||||
-rw-r--r-- | plugins/YAPP/src/options.cpp | 4 | ||||
-rw-r--r-- | plugins/YAPP/src/services.cpp | 6 |
9 files changed, 19 insertions, 20 deletions
diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index 57b93a97c8..9e15d37eeb 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -71,10 +71,10 @@ void InitScheduler() bPopupsEnabled = ServiceExists(MS_POPUP_ADDPOPUPT) || ServiceExists(MS_POPUP_ADDPOPUPCLASS);
POPUPCLASS test = { sizeof(test) };
- test.flags = PCF_TCHAR;
+ test.flags = PCF_UNICODE;
test.hIcon = Skin_LoadIcon(SKINICON_OTHER_HISTORY);
test.iSeconds = 10;
- test.pwszDescription = TranslateT("History task");
+ test.pszDescription.w = TranslateT("History task");
test.pszName = MODULENAME;
if (hPopupClass = Popup_RegisterClass(&test))
HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
diff --git a/plugins/MirFox/src/MirandaInterface.cpp b/plugins/MirFox/src/MirandaInterface.cpp index 09cb05058a..f72400a2f6 100644 --- a/plugins/MirFox/src/MirandaInterface.cpp +++ b/plugins/MirFox/src/MirandaInterface.cpp @@ -95,10 +95,10 @@ static int onModulesLoaded(WPARAM, LPARAM) //init popup classes
POPUPCLASS puc = { 0 };
puc.cbSize = sizeof(puc);
- puc.flags = PCF_TCHAR;
+ puc.flags = PCF_UNICODE;
puc.pszName = "MirFox_Notify";
- puc.pwszDescription = TranslateT("MirFox/Notification");
+ puc.pszDescription.w = TranslateT("MirFox/Notification");
puc.colorBack = RGB(173, 206, 247); //light blue
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
puc.iSeconds = 3;
@@ -106,7 +106,7 @@ static int onModulesLoaded(WPARAM, LPARAM) hPopupNotify = Popup_RegisterClass(&puc);
puc.pszName = "MirFox_Error";
- puc.pwszDescription = TranslateT("MirFox/Error");
+ puc.pszDescription.w = TranslateT("MirFox/Error");
puc.colorBack = RGB(255, 128, 128); //light red
puc.colorText = GetSysColor(COLOR_WINDOWTEXT);
puc.iSeconds = 20;
diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index c39c7d0a17..48b387bfca 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -222,9 +222,8 @@ static int OnShutdown(WPARAM, LPARAM) void LoadPopupClass()
{
POPUPCLASS ppc = { sizeof(ppc) };
- ppc.flags = PCF_TCHAR;
ppc.pszName = "Nudge";
- ppc.pwszDescription = LPGENW("Show Nudge");
+ ppc.pszDescription.a = LPGEN("Show Nudge");
ppc.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
ppc.colorBack = NULL;
ppc.colorText = NULL;
diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index 58111c7f15..b94fe07bce 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -312,10 +312,10 @@ void InitUtils() hIconDisabled = IcoLib_GetIcon("ping_disabled");
POPUPCLASS test = { sizeof(test) };
- test.flags = PCF_TCHAR;
+ test.flags = PCF_UNICODE;
test.hIcon = hIconResponding;
test.iSeconds = -1;
- test.pwszDescription = TranslateT("Ping");
+ test.pszDescription.w = TranslateT("Ping");
test.pszName = "pingpopups";
test.PluginWindowProc = NullWindowProc;
if (hPopupClass = Popup_RegisterClass(&test))
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index fdd18a93cc..f86d235189 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -73,7 +73,7 @@ void FreePopupClass(POPUPTREEDATA *ptd) {
if (ptd->typ == 2) {
mir_free(ptd->pupClass.pszName);
- mir_free(ptd->pupClass.pszDescription);
+ mir_free(ptd->pupClass.pszDescription.w);
}
mir_free(ptd->pszTreeRoot);
mir_free(ptd->pszDescription);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 77ab39de01..3490c2a25f 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -368,12 +368,12 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pszTreeRoot = mir_a2u(pc->pszName);
ptd->pupClass.pszName = mir_strdup(pc->pszName);
if (pc->flags & PCF_UNICODE) {
- ptd->pupClass.pwszDescription = mir_wstrdup(pc->pwszDescription);
- ptd->pszDescription = mir_wstrdup(pc->pwszDescription);
+ ptd->pupClass.pszDescription.w = mir_wstrdup(pc->pszDescription.w);
+ ptd->pszDescription = mir_wstrdup(pc->pszDescription.w);
}
else {
- ptd->pupClass.pszDescription = mir_strdup(pc->pszDescription);
- ptd->pszDescription = mir_a2u(pc->pszDescription);
+ ptd->pupClass.pszDescription.a = mir_strdup(pc->pszDescription.a);
+ ptd->pszDescription = mir_a2u(pc->pszDescription.a);
}
LoadClassSettings(ptd, PU_MODULCLASS);
diff --git a/plugins/Toaster/src/services.cpp b/plugins/Toaster/src/services.cpp index 3d1dbd2040..82c7572601 100644 --- a/plugins/Toaster/src/services.cpp +++ b/plugins/Toaster/src/services.cpp @@ -134,7 +134,7 @@ static INT_PTR CreateClassPopup(WPARAM, LPARAM lParam) {
ToastData *td = nullptr;
- if (it->second->iFlags & PCF_TCHAR)
+ if (it->second->iFlags & PCF_UNICODE)
{
td = new ToastData(ppc->hContact, ppc->pwszTitle, ppc->pwszText, it->second->hIcon);
}
diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index ac6877707c..1e2b70f3f8 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -361,9 +361,9 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam for (int i = 0; i < arNewClasses.getCount(); i++) {
POPUPCLASS *pc = arNewClasses[i];
if (pc->flags & PCF_UNICODE)
- index = SendDlgItemMessageW(hwndDlg, IDC_LST_CLASSES, LB_ADDSTRING, 0, (LPARAM)pc->pwszDescription);
+ index = SendDlgItemMessageW(hwndDlg, IDC_LST_CLASSES, LB_ADDSTRING, 0, (LPARAM)pc->pszDescription.w);
else
- index = SendDlgItemMessageA(hwndDlg, IDC_LST_CLASSES, LB_ADDSTRING, 0, (LPARAM)pc->pszDescription);
+ index = SendDlgItemMessageA(hwndDlg, IDC_LST_CLASSES, LB_ADDSTRING, 0, (LPARAM)pc->pszDescription.a);
SendDlgItemMessage(hwndDlg, IDC_LST_CLASSES, LB_SETITEMDATA, index, i);
}
diff --git a/plugins/YAPP/src/services.cpp b/plugins/YAPP/src/services.cpp index f507557c20..78c66f4f97 100644 --- a/plugins/YAPP/src/services.cpp +++ b/plugins/YAPP/src/services.cpp @@ -332,9 +332,9 @@ static INT_PTR RegisterPopupClass(WPARAM, LPARAM lParam) pc->pszName = mir_strdup(pc->pszName);
if (pc->flags & PCF_UNICODE)
- pc->pwszDescription = mir_wstrdup(pc->pwszDescription);
+ pc->pszDescription.w = mir_wstrdup(pc->pszDescription.w);
else
- pc->pszDescription = mir_strdup(pc->pszDescription);
+ pc->pszDescription.a = mir_strdup(pc->pszDescription.a);
char setting[256];
mir_snprintf(setting, "%s/Timeout", pc->pszName);
@@ -352,7 +352,7 @@ static INT_PTR RegisterPopupClass(WPARAM, LPARAM lParam) static void FreePopupClass(POPUPCLASS *pc)
{
mir_free(pc->pszName);
- mir_free(pc->pszDescription);
+ mir_free(pc->pszDescription.w);
mir_free(pc);
}
|