From 432e5e8677741f08aacfd019e75617d9085b5790 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 22 Aug 2012 12:02:05 +0000 Subject: popup actions support removed git-svn-id: http://svn.miranda-ng.org/main/trunk@1522 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/PluginUpdater/src/Notifications.cpp | 14 +++--- plugins/PluginUpdater/src/Options.cpp | 69 +++++++++++------------------ 2 files changed, 30 insertions(+), 53 deletions(-) (limited to 'plugins/PluginUpdater') diff --git a/plugins/PluginUpdater/src/Notifications.cpp b/plugins/PluginUpdater/src/Notifications.cpp index c3a83f802f..1df632713b 100644 --- a/plugins/PluginUpdater/src/Notifications.cpp +++ b/plugins/PluginUpdater/src/Notifications.cpp @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2010 Mataes This is free software; you can redistribute it and/or @@ -47,7 +47,7 @@ static INT_PTR CALLBACK PopupDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM EndDialog(pmpd->hDialog, LOWORD(wParam)); PUDeletePopUp(hDlg); break; - + case IDNO: if (IsWindow(pmpd->hDialog)) EndDialog(pmpd->hDialog, LOWORD(wParam)); @@ -244,7 +244,7 @@ static void ApplyUpdates(void* param) SetStringText(hwndList, i, TranslateT("Skipped")); continue; } - + // download update SetStringText(hwndList, i, TranslateT("Downloading...")); @@ -260,15 +260,11 @@ static void ApplyUpdates(void* param) return; } - int rc = -1; PopupDataText temp; temp.Title = TranslateT("Plugin Updater"); temp.Text = tszBuff; lstrcpyn(tszBuff, TranslateT("Download complete. Start updating? All your data will be saved and Miranda NG will be closed."), SIZEOF(tszBuff)); - if (ServiceExists(MS_POPUP_ADDPOPUPEX) && ServiceExists(MS_POPUP_REGISTERACTIONS) && DBGetContactSettingByte(NULL, "PopUp", "ModuleIsEnabled", 1) && DBGetContactSettingByte(NULL,MODNAME, "Popups0", DEFAULT_POPUP_ENABLED) && (DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1)) - rc = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_POPUPDUMMI), NULL, DlgMsgPop, (LPARAM)&temp); - else - rc = MessageBox(NULL, temp.Text, temp.Title, MB_YESNO | MB_ICONQUESTION); + int rc = MessageBox(NULL, temp.Text, temp.Title, MB_YESNO | MB_ICONQUESTION); if (rc != IDYES) { mir_sntprintf(tszBuff, SIZEOF(tszBuff), TranslateT("You have chosen not to install the plugin updates immediately.\nYou can install it manually from this location:\n\n%s"), tszFileTemp); ShowPopup(0, LPGENT("Plugin Updater"), tszBuff, 2, 0); @@ -434,7 +430,7 @@ INT_PTR CALLBACK DlgUpdate(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam hwndDialog = NULL; delete (OBJLIST *)GetWindowLongPtr(hDlg, GWLP_USERDATA); SetWindowLongPtr(hDlg, GWLP_USERDATA, 0); - break; + break; } return FALSE; diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 011692e5ae..478a8a73fa 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2010 Mataes This is free software; you can redistribute it and/or @@ -14,7 +14,7 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this file; see the file license.txt. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. +Boston, MA 02111-1307, USA. */ #include "common.h" @@ -95,7 +95,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA ood.pszGroup = "Customize"; ood.pszPage = "Hotkeys"; Options_Open(&ood); - } + } return true; } break; @@ -111,13 +111,13 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA opts.bOnlyOnceADay = IsDlgButtonChecked(hwndDlg, IDC_ONLYONCEADAY); opts.bUpdateOnPeriod = IsDlgButtonChecked(hwndDlg, IDC_UPDATEONPERIOD); - + char buffer[3] = {0}; Edit_GetText(GetDlgItem(hwndDlg, IDC_PERIOD), (LPWSTR)&buffer, 2); - opts.Period = atoi(buffer); + opts.Period = atoi(buffer); opts.bPeriodMeasure = ComboBox_GetCurSel(GetDlgItem(hwndDlg, IDC_PERIODMEASURE)); - + InitTimer(); DBWriteContactSettingByte(NULL, MODNAME, "UpdateOnStartup", opts.bUpdateOnStartup); @@ -134,7 +134,7 @@ INT_PTR CALLBACK UpdateNotifyOptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA return FALSE; } -INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) +INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) { int i; char str[20] = {0}, str2[20] = {0}; @@ -169,7 +169,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) } //Timeout SendDlgItemMessage(hdlg, IDC_TIMEOUT_VALUE, EM_LIMITTEXT, 4, 0); - SendDlgItemMessage(hdlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, -1, 9999); + SendDlgItemMessage(hdlg, IDC_TIMEOUT_VALUE_SPIN, UDM_SETRANGE32, -1, 9999); SetDlgItemInt(hdlg, IDC_TIMEOUT_VALUE, PopupOptions.Timeout, TRUE); //Mouse actions for (i = 0; i < SIZEOF(PopupActions); i++) { @@ -191,29 +191,15 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) EnableWindow(GetDlgItem(hdlg, (i+1024)), TRUE); } - if ( !(DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS)) { - EnableWindow(GetDlgItem(hdlg, (40071)), FALSE); - EnableWindow(GetDlgItem(hdlg, (41071)), FALSE); - EnableWindow(GetDlgItem(hdlg, (42071)), FALSE); - } - else { - EnableWindow(GetDlgItem(hdlg, (40071)), TRUE); - EnableWindow(GetDlgItem(hdlg, (41071)), (PopupOptions.DefColors == byCOLOR_OWN)); - EnableWindow(GetDlgItem(hdlg, (42071)), (PopupOptions.DefColors == byCOLOR_OWN)); - } + EnableWindow(GetDlgItem(hdlg, (40071)), FALSE); + EnableWindow(GetDlgItem(hdlg, (41071)), FALSE); + EnableWindow(GetDlgItem(hdlg, (42071)), FALSE); return TRUE; case WM_SHOWWINDOW: - if ( !(DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS)) { - EnableWindow(GetDlgItem(hdlg, (40071)), FALSE); - EnableWindow(GetDlgItem(hdlg, (41071)), FALSE); - EnableWindow(GetDlgItem(hdlg, (42071)), FALSE); - } - else { - EnableWindow(GetDlgItem(hdlg, (40071)), TRUE); - EnableWindow(GetDlgItem(hdlg, (41071)), (PopupOptions.DefColors == byCOLOR_OWN)); - EnableWindow(GetDlgItem(hdlg, (42071)), (PopupOptions.DefColors == byCOLOR_OWN)); - } + EnableWindow(GetDlgItem(hdlg, (40071)), FALSE); + EnableWindow(GetDlgItem(hdlg, (41071)), FALSE); + EnableWindow(GetDlgItem(hdlg, (42071)), FALSE); return TRUE; case WM_COMMAND: @@ -233,7 +219,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) } } - if (wNotifyCode == CBN_SELCHANGE) { + if (wNotifyCode == CBN_SELCHANGE) { if (idCtrl == IDC_LC) PopupOptions.LeftClickAction = (BYTE)SendDlgItemMessage(hdlg, IDC_LC, CB_GETCURSEL, 0, 0); else if(idCtrl == IDC_RC) @@ -243,20 +229,15 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) return TRUE; } switch(idCtrl) { - case IDC_USEOWNCOLORS: - if (wNotifyCode != BN_CLICKED) + case IDC_USEOWNCOLORS: + if (wNotifyCode != BN_CLICKED) break; PopupOptions.DefColors = byCOLOR_OWN; - if ( !(DBGetContactSettingDword(NULL, "PopUp", "Actions", 0) & 1) || !ServiceExists(MS_POPUP_REGISTERACTIONS)) { - EnableWindow(GetDlgItem(hdlg, (41071)), FALSE); - EnableWindow(GetDlgItem(hdlg, (42071)), FALSE); - } - else { - EnableWindow(GetDlgItem(hdlg, (41071)), TRUE); - EnableWindow(GetDlgItem(hdlg, (42071)), TRUE); - } + EnableWindow(GetDlgItem(hdlg, (41071)), FALSE); + EnableWindow(GetDlgItem(hdlg, (42071)), FALSE); + for (i = 1; i < POPUPS; i++) { EnableWindow(GetDlgItem(hdlg, (i+42071)), TRUE); //Background EnableWindow(GetDlgItem(hdlg, (i+41071)), TRUE); //Text @@ -264,8 +245,8 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); break; - case IDC_USEWINCOLORS: - if (wNotifyCode != BN_CLICKED) + case IDC_USEWINCOLORS: + if (wNotifyCode != BN_CLICKED) break; //Use Windows colors @@ -290,7 +271,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); break; - case IDC_PREVIEW: + case IDC_PREVIEW: {//Declarations and initializations LPCTSTR Title = TranslateT("Plugin Updater"); LPCTSTR Text = TranslateT("Test"); @@ -333,7 +314,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) }//end* case WM_COMMAND: break; - case WM_NOTIFY: + case WM_NOTIFY: switch (((LPNMHDR)lParam)->code) { case PSN_RESET: //Restore the options stored in memory. @@ -341,7 +322,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) InitPopupList(); return TRUE; - case PSN_APPLY: + case PSN_APPLY: { //Text color char szSetting[20] = {0}; -- cgit v1.2.3