summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-14 21:05:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-14 21:05:30 +0000
commit45358c3507af7d4bb32c031eaa25708905effa91 (patch)
tree202fd149b18a39cfe6314f037421cf8d4fe2e842 /plugins/DbEditorPP
parentae5bb5cc96d0f0add1d1189c2a3293daaea83d6f (diff)
old ansi popups removed, noone used them anyway
git-svn-id: http://svn.miranda-ng.org/main/trunk@4034 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP')
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp65
1 files changed, 28 insertions, 37 deletions
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index 2bd929209c..66aef8654e 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -284,17 +284,14 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
void popupWatchedVar(HANDLE hContact,const char* module,const char* setting)
{
- POPUPDATAEX ppd = {0};
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
char lpzContactName[MAX_CONTACTNAME];
char lpzText[MAX_SECONDLINE];
COLORREF colorBack = DBGetContactSettingDword(NULL,modname,"PopupColour",RGB(255,0,0));
COLORREF colorText = RGB(0,0,0);
- DBVARIANT dbv;
int timeout = DBGetContactSettingByte(NULL,modname,"PopupDelay",3);
- if (hContact)
- {
+ if (hContact) {
// contacts nick
char szProto[256];
if (GetValue(hContact,"Protocol","p",szProto,SIZEOF(szProto)))
@@ -302,48 +299,42 @@ void popupWatchedVar(HANDLE hContact,const char* module,const char* setting)
else
mir_snprintf(lpzContactName, MAX_SECONDLINE, nick_unknown);
}
- else
- {
- strcpy(lpzContactName,Translate("Settings"));
- }
+ else strcpy(lpzContactName,Translate("Settings"));
+
// 2nd line
- if (!GetSetting(hContact, module, setting, &dbv))
- {
- switch (dbv.type)
- {
- case DBVT_BYTE:
- mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: (BYTE) %d"), module, setting, dbv.bVal);
- break;
- case DBVT_WORD:
- mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: (WORD) %d"), module, setting, dbv.wVal);
- break;
- case DBVT_DWORD:
- mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: (DWORD) 0x%X"), module, setting, dbv.dVal);
- break;
- case DBVT_ASCIIZ:
- mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: \"%s\""), module, setting, dbv.pszVal);
- break;
- case DBVT_UTF8:
- mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value (UTF8): \"%s\""), module, setting, dbv.pszVal);
- break;
- default:
- return;
- }
+ DBVARIANT dbv;
+ if ( GetSetting(hContact, module, setting, &dbv))
+ return;
+
+ switch (dbv.type) {
+ case DBVT_BYTE:
+ mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: (BYTE) %d"), module, setting, dbv.bVal);
+ break;
+ case DBVT_WORD:
+ mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: (WORD) %d"), module, setting, dbv.wVal);
+ break;
+ case DBVT_DWORD:
+ mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: (DWORD) 0x%X"), module, setting, dbv.dVal);
+ break;
+ case DBVT_ASCIIZ:
+ mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value: \"%s\""), module, setting, dbv.pszVal);
+ break;
+ case DBVT_UTF8:
+ mir_snprintf(lpzText, SIZEOF(lpzText), Translate("Database Setting Changed: \nModule: \"%s\" , Setting: \"%s\"\nNew Value (UTF8): \"%s\""), module, setting, dbv.pszVal);
+ break;
+ default:
+ return;
}
- else return;
DBFreeVariant(&dbv);
+ POPUPDATA ppd = { 0 };
ppd.lchContact = (HANDLE)hContact;
ppd.lchIcon = hIcon;
lstrcpyn(ppd.lpzContactName, lpzContactName,MAX_CONTACTNAME);
lstrcpyn(ppd.lpzText, lpzText,MAX_SECONDLINE);
ppd.colorBack = colorBack;
ppd.colorText = colorText;
- ppd.PluginWindowProc = NULL;
- ppd.PluginData = NULL;
- ppd.iSeconds = timeout?timeout:-1;
-
- //Now that every field has been filled, we want to see the popup.
- CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
+ ppd.iSeconds = timeout ? timeout : -1;
+ PUAddPopUp(&ppd);
}