diff options
author | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-05-14 11:00:15 +0000 |
---|---|---|
committer | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-05-14 11:00:15 +0000 |
commit | f8488f8e2388b609e56df6da750c40d4661163ab (patch) | |
tree | 90b5d0c5aa3887438fca76c65dd60873a61e40b5 | |
parent | 06f248c0af42404f8a87a327ed0098241c85efea (diff) |
removed News form
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@81 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
-rw-r--r-- | popup/resource.h | 6 | ||||
-rw-r--r-- | popup/resource.rc | 18 | ||||
-rw-r--r-- | popup/src/config.cpp | 133 |
3 files changed, 1 insertions, 156 deletions
diff --git a/popup/resource.h b/popup/resource.h index f6ce149..4ab7ccb 100644 --- a/popup/resource.h +++ b/popup/resource.h @@ -2,7 +2,6 @@ // Microsoft Visual C++ generated include file.
// Used by resource.rc
//
-#define IDD_WELCOME 102
#define IDD_OPT_POPUP 107
#define IDD_OPT_POPUP_ADVANCED 117
#define IDI_POPUP 118
@@ -96,7 +95,6 @@ #define IDC_SONLINE2 1112
#define IDC_SAWAY2 1113
#define IDC_SNA2 1114
-#define ID_OK 1115
#define IDC_SOCCUPIED2 1115
#define IDC_SDND2 1116
#define IDC_TREE1 1117
@@ -120,10 +118,6 @@ #define IDC_HISTORY_STATIC1 1147
#define IDC_HISTORY_STATIC2 1148
#define IDC_TITLE 1150
-#define IDC_VERSION 1151
-#define IDC_RESET 1153
-#define IDC_WHATSNEW 1154
-#define IDC_NONEWS 1157
#define IDC_TXT_TOP 1164
#define IDC_TIMEOUT_SPIN 1164
#define IDC_TXT_LEFT 1165
diff --git a/popup/resource.rc b/popup/resource.rc index bb72927..1d01f2c 100644 --- a/popup/resource.rc +++ b/popup/resource.rc @@ -153,24 +153,6 @@ BEGIN LISTBOX IDC_POPUP_LIST,5,5,283,226,LBS_OWNERDRAWVARIABLE | LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
END
-IDD_WELCOME DIALOGEX 0, 0, 195, 199
-STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
-CAPTION "Popup Plus"
-CLASS "PopupPlusDlgBox"
-FONT 8, "MS Shell Dlg", 0, 0, 0x0
-BEGIN
- LTEXT "",IDC_STATIC,-1,0,196,171
- LTEXT "Popup Plus",IDC_TITLE,42,0,132,20,SS_CENTERIMAGE
- LTEXT "Static",IDC_VERSION,42,20,153,12,SS_CENTERIMAGE
- DEFPUSHBUTTON "Ok",ID_OK,138,179,50,14
- PUSHBUTTON "Reset PopUp",IDC_RESET,83,179,50,14
- EDITTEXT IDC_WHATSNEW,14,40,165,131,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
- CONTROL "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,171,193,1
- LTEXT "",IDC_STATIC,21,32,153,8
- ICON IDI_POPUP,IDC_STATIC,21,0,20,20,SS_CENTERIMAGE | SS_REALSIZEIMAGE
- CONTROL "Never show news",IDC_NONEWS,"Button",BS_AUTOCHECKBOX | BS_LEFT | BS_VCENTER | BS_MULTILINE | WS_TABSTOP,7,179,72,13
-END
-
IDD_POSITION DIALOGEX 0, 0, 190, 128
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP
EXSTYLE WS_EX_TOOLWINDOW
diff --git a/popup/src/config.cpp b/popup/src/config.cpp index 1702829..8649676 100644 --- a/popup/src/config.cpp +++ b/popup/src/config.cpp @@ -104,102 +104,12 @@ HRESULT (WINAPI *MyDwmEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurB //====== Common Vars ========================
-static int NukePopupSettings(const char* szModul);
-static INT_PTR __stdcall DlgProcPopupWelcome(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwnd);
-
- LOGFONT lf;
- GetObject((HFONT)SendMessage(GetDlgItem(hwnd, IDC_TITLE), WM_GETFONT, 0, 0), sizeof(lf), &lf);
- lf.lfWeight = FW_BOLD;
- lf.lfHeight *= 1.8;
- SendMessage(GetDlgItem(hwnd, IDC_TITLE), WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);
-
- GetObject((HFONT)SendMessage(GetDlgItem(hwnd, IDC_VERSION), WM_GETFONT, 0, 0), sizeof(lf), &lf);
- lf.lfHeight *= 1.3;
- SendMessage(GetDlgItem(hwnd, IDC_VERSION), WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);
- SetWindowText(GetDlgItem(hwnd, IDC_VERSION), _T(__VERSION_STRING_DOT));
-
- HRSRC hRes = FindResource(hInst, MAKEINTRESOURCE(IDR_WHATSNEW), _T("TEXT"));
- DWORD ResSize = SizeofResource(hInst,hRes);
- HRSRC hResLoad = (HRSRC)LoadResource(hInst, hRes);
- char *lpResLock = (char *)LockResource(hResLoad);
-// lpResLock [ResSize] = 0;
- TCHAR* ptszMsg = mir_a2t(lpResLock);
- SetWindowText(GetDlgItem(hwnd, IDC_WHATSNEW), ptszMsg);
- mir_free(ptszMsg);
- UnlockResource(lpResLock);
- FreeResource(hRes);
- CheckDlgButton(hwnd, IDC_NONEWS, DBGetContactSettingByte(NULL, MODULNAME, "NeverShowNews", 0));
-
- return TRUE;
- }
- case WM_CTLCOLORSTATIC:
- {
- if (GetWindowLongPtr((HWND)lParam, GWLP_ID) != IDC_NONEWS)
- return (INT_PTR)GetStockObject(WHITE_BRUSH);
- break;
- }
- case WM_COMMAND:
- {
- switch (LOWORD(wParam)) // control id
- {
- case ID_OK:
- {
- DBWriteContactSettingByte(NULL, MODULNAME, "NeverShowNews", IsDlgButtonChecked(hwnd, IDC_NONEWS)?1:0);
- SendMessage(hwnd, WM_CLOSE, 0, 0);
- return TRUE;
- }
- case IDC_RESET:
- {
- if (MessageBox(hwnd, TranslateT("Do you really want to reset Popup Plus settings?"), _T(MODULNAME_LONG), MB_ICONWARNING|MB_YESNO) == IDYES)
- {
- NukePopupSettings(MODULNAME);
- OptionLoaded = false;
- LoadOptions();
- }
- return TRUE;
- }
- }
- break;
- }
- case WM_CLOSE:
- {
- DestroyWindow(hwnd);
- return TRUE;
- }
- }
- return FALSE;
-}
-
// common funcs
void LoadOptions() {
ZeroMemory(&PopUpOptions, sizeof(PopUpOptions));
#if defined(_DEBUG)
PopUpOptions.debug = DBGetContactSettingByte(NULL, MODULNAME, "debug", FALSE);
#endif
- DWORD prevVersion = DBGetContactSettingDword(NULL, MODULNAME, "PopupPlusVersion", 0);
- if ( (prevVersion < pluginInfoEx.version) &&
- !PopUpOptions.debug &&
- !DBGetContactSettingByte(NULL, MODULNAME, "NeverShowNews", 0)
- ) {
- HWND hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_WELCOME), NULL, DlgProcPopupWelcome, prevVersion);
- RECT rc, rcDesk;
- GetWindowRect(hwnd, &rc);
- SystemParametersInfo(SPI_GETWORKAREA, 0, &rcDesk, 0);
- SetWindowPos(hwnd, HWND_TOP,
- rcDesk.left + (rcDesk.right - rcDesk.left - (rc.right - rc.left)) / 2,
- rcDesk.top + (rcDesk.bottom - rcDesk.top - (rc.bottom - rc.top)) / 2,
- rc.right - rc.left,
- rc.bottom - rc.top,
- SWP_SHOWWINDOW);
- ShowWindow(hwnd, SW_SHOWNORMAL);
- }
- DBWriteContactSettingDword(NULL, MODULNAME, "PopupPlusVersion", pluginInfoEx.version);
//Load PopUp Options
if(!OptionLoaded){
@@ -298,45 +208,4 @@ void PopUpPreview() if (PopUpOptions.UseAnimations || PopUpOptions.UseEffect) Sleep((ANIM_TIME*2)/3); //Pause
PUShowMessageT(TranslateT("This is an error message"), (DWORD)SM_ERROR|0x80000000);
-}
-
-// nuke settings:
-struct NukeSettingsList
-{
- char *name;
- NukeSettingsList *next;
-} *setting_items = NULL;
-
-int SettingsEnumProc(const char *szSetting, LPARAM lParam)
-{
- NukeSettingsList *newItem = (NukeSettingsList *)mir_alloc(sizeof(NukeSettingsList));
- newItem->name = mir_strdup(szSetting);
- newItem->next = setting_items;
- setting_items = newItem;
- return 0;
-}
-
-static int NukePopupSettings(const char* szModul)
-{
- DBCONTACTENUMSETTINGS dbces;
- setting_items = 0;
- dbces.pfnEnumProc = SettingsEnumProc;
- dbces.szModule = szModul;
- CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)(DBCONTACTENUMSETTINGS*)&dbces);
- while (setting_items)
- {
- NukeSettingsList *next = setting_items->next;
-
- DBCONTACTGETSETTING dbcgs;
- dbcgs.szModule = szModul;
- dbcgs.szSetting = setting_items->name;
- CallService(MS_DB_CONTACT_DELETESETTING, 0, (LPARAM)&dbcgs);
-
- mir_free(setting_items->name);
- mir_free(setting_items);
- setting_items = next;
- }
- DBWriteContactSettingDword(NULL, MODULNAME, "PopupPlusVersion", pluginInfoEx.version);
-
- return 0;
-}
+}
\ No newline at end of file |