summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src/Notifications.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2014-09-18 19:32:43 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2014-09-18 19:32:43 +0000
commitc72e3f9fe11a3d6b72a04af599b04fde82091dd5 (patch)
tree51a38dabcf65b28b8e2e6893b7e947b443583fef /plugins/PluginUpdater/src/Notifications.cpp
parent850eb8d3890ebd911fb8278114b7b93eba407cb0 (diff)
PluginUpdater:
- Show a notification when the update URL isn't available - small redesign of new components window - minor memory leaks fixecd git-svn-id: http://svn.miranda-ng.org/main/trunk@10509 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src/Notifications.cpp')
-rw-r--r--plugins/PluginUpdater/src/Notifications.cpp75
1 files changed, 34 insertions, 41 deletions
diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp
index 634ad80dae..489baf750d 100644
--- a/plugins/PluginUpdater/src/Notifications.cpp
+++ b/plugins/PluginUpdater/src/Notifications.cpp
@@ -94,51 +94,44 @@ static LRESULT CALLBACK PopupDlgProcRestart(HWND hPopup, UINT uMsg, WPARAM wPara
void ShowPopup(LPCTSTR ptszTitle, LPCTSTR ptszText, int Number)
{
- if(Number != POPUP_TYPE_MSG) {
+ if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
char setting[100];
mir_snprintf(setting, SIZEOF(setting), "Popups%d", Number);
- if(!db_get_b(NULL, MODNAME, setting, DEFAULT_POPUP_ENABLED))
+ if(db_get_b(NULL, MODNAME, setting, DEFAULT_POPUP_ENABLED)) {
+ POPUPDATAT pd = { 0 };
+ pd.lchContact = NULL;
+ pd.lchIcon = Skin_GetIcon("check_update");
+ if(Number == POPUP_TYPE_MSG) {
+ pd.PluginWindowProc = PopupDlgProcRestart;
+ pd.iSeconds = -1;
+ }
+ else {
+ pd.PluginWindowProc = PopupDlgProc;
+ pd.iSeconds = PopupOptions.Timeout;
+ }
+
+ lstrcpyn(pd.lptzText, ptszText, MAX_SECONDLINE);
+ lstrcpyn(pd.lptzContactName, ptszTitle, MAX_CONTACTNAME);
+
+ switch (PopupOptions.DefColors) {
+ case byCOLOR_WINDOWS:
+ pd.colorBack = GetSysColor(COLOR_BTNFACE);
+ pd.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ break;
+ case byCOLOR_OWN:
+ pd.colorBack = PopupsList[Number].colorBack;
+ pd.colorText = PopupsList[Number].colorText;
+ break;
+ case byCOLOR_POPUP:
+ pd.colorBack = pd.colorText = 0;
+ break;
+ }
+ PUAddPopupT(&pd);
return;
- }
-
- if (ServiceExists(MS_POPUP_ADDPOPUPT) && db_get_b(NULL, "Popup", "ModuleIsEnabled", 1)) {
- POPUPDATAT pd = { 0 };
- pd.lchContact = NULL;
- pd.lchIcon = Skin_GetIcon("check_update");
- if(Number == POPUP_TYPE_MSG) {
- pd.PluginWindowProc = PopupDlgProcRestart;
- pd.iSeconds = -1;
- }
- else {
- pd.PluginWindowProc = PopupDlgProc;
- pd.iSeconds = PopupOptions.Timeout;
- }
-
- lstrcpyn(pd.lptzText, ptszText, MAX_SECONDLINE);
- lstrcpyn(pd.lptzContactName, ptszTitle, MAX_CONTACTNAME);
-
- switch (PopupOptions.DefColors) {
- case byCOLOR_WINDOWS:
- pd.colorBack = GetSysColor(COLOR_BTNFACE);
- pd.colorText = GetSysColor(COLOR_WINDOWTEXT);
- break;
- case byCOLOR_OWN:
- pd.colorBack = PopupsList[Number].colorBack;
- pd.colorText = PopupsList[Number].colorText;
- break;
- case byCOLOR_POPUP:
- pd.colorBack = pd.colorText = 0;
- break;
- }
-
- PUAddPopupT(&pd);
- } else {
- if(Number != POPUP_TYPE_MSG) {
- char setting[100];
- mir_snprintf(setting, SIZEOF(setting), "Popups%dM", Number);
- if (!db_get_b(NULL, MODNAME, setting, DEFAULT_MESSAGE_ENABLED))
- return;
}
+ }
+
+ if(Number == POPUP_TYPE_ERROR) {
int iMsgType;
switch( Number ) {
case POPUP_TYPE_MSG: iMsgType = MB_ICONSTOP; break;