From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: less TCHARs: - TCHAR is replaced with wchar_t everywhere; - LPGENT replaced with either LPGENW or LPGEN; - fixes for ANSI plugins that improperly used _t functions; - TCHAR *t removed from MAllStrings; - ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz* git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/NotesAndReminders/src/globals.h | 2 +- plugins/NotesAndReminders/src/hotkeys.cpp | 10 +- plugins/NotesAndReminders/src/main.cpp | 32 +-- plugins/NotesAndReminders/src/notes.cpp | 58 ++--- plugins/NotesAndReminders/src/options.cpp | 319 +++++++++++++--------------- plugins/NotesAndReminders/src/reminders.cpp | 10 +- 6 files changed, 204 insertions(+), 227 deletions(-) (limited to 'plugins/NotesAndReminders/src') diff --git a/plugins/NotesAndReminders/src/globals.h b/plugins/NotesAndReminders/src/globals.h index ce75e5cbd7..b918255061 100644 --- a/plugins/NotesAndReminders/src/globals.h +++ b/plugins/NotesAndReminders/src/globals.h @@ -122,7 +122,7 @@ extern int g_Transparency; extern char *g_RemindSMS; -extern TCHAR *g_lpszAltBrowser; +extern char *g_lpszAltBrowser; extern int g_reminderListGeom[4]; extern int g_reminderListColGeom[2]; diff --git a/plugins/NotesAndReminders/src/hotkeys.cpp b/plugins/NotesAndReminders/src/hotkeys.cpp index 052e8d4dfd..2e96dd1608 100644 --- a/plugins/NotesAndReminders/src/hotkeys.cpp +++ b/plugins/NotesAndReminders/src/hotkeys.cpp @@ -15,32 +15,32 @@ void RegisterKeyBindings() memset(&desc, 0, sizeof(desc)); desc.cbSize = sizeof(desc); - desc.ptszSection = _T(SECTIONNAME); + desc.ptszSection = _A2W(SECTIONNAME); desc.dwFlags = HKD_TCHAR; desc.pszName = MODULENAME"/NewNote"; - desc.ptszDescription = LPGENT("New Note"); + desc.ptszDescription = LPGENW("New Note"); desc.lParam = KB_NEW_NOTE; desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_INSERT); desc.pszService = MODULENAME"/MenuCommandAddNew"; Hotkey_Register(&desc); desc.pszName = MODULENAME"/ToggleNotesVis"; - desc.ptszDescription = LPGENT("Toggle Notes Visibility"); + desc.ptszDescription = LPGENW("Toggle Notes Visibility"); desc.lParam = KB_TOGGLE_NOTES; desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_ADD); desc.pszService = MODULENAME"/MenuCommandShowHide"; Hotkey_Register(&desc); desc.pszName = MODULENAME"/BringNotesFront"; - desc.ptszDescription = LPGENT("Bring All Notes to Front"); + desc.ptszDescription = LPGENW("Bring All Notes to Front"); desc.lParam = KB_TOGGLE_NOTES; desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_HOME); desc.pszService = MODULENAME"/MenuCommandBringAllFront"; Hotkey_Register(&desc); desc.pszName = MODULENAME"/NewReminder"; - desc.ptszDescription = LPGENT("New Reminder"); + desc.ptszDescription = LPGENW("New Reminder"); desc.lParam = KB_NEW_REMINDER; desc.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL|HOTKEYF_SHIFT, VK_SUBTRACT); desc.pszService = MODULENAME"/MenuCommandNewReminder"; diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index 30ee8282a4..ca2511778d 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -47,7 +47,7 @@ INT_PTR PluginMenuCommandAddNew(WPARAM w, LPARAM l) INT_PTR PluginMenuCommandDeleteAll(WPARAM w, LPARAM l) { - if (g_Stickies && MessageBox(NULL, TranslateT("Are you sure you want to delete all notes?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) + if (g_Stickies && MessageBox(NULL, Translate("Are you sure you want to delete all notes?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK) DeleteNotes(); return 0; } @@ -84,7 +84,7 @@ INT_PTR PluginMenuCommandViewReminders(WPARAM w, LPARAM l) INT_PTR PluginMenuCommandDeleteReminders(WPARAM w, LPARAM l) { - if (RemindersList && MessageBox(NULL, TranslateT("Are you sure you want to delete all reminders?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) + if (RemindersList && MessageBox(NULL, Translate("Are you sure you want to delete all reminders?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK) DeleteReminders(); return 0; } @@ -120,8 +120,8 @@ int OnOptInitialise(WPARAM w, LPARAM L) odp.position = 900002000; odp.hInstance = hinstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_STNOTEOPTIONS); - odp.ptszTitle = SECTIONNAME; - odp.ptszGroup = LPGENT("Plugins"); + odp.pszTitle = SECTIONNAME; + odp.pszGroup = LPGEN("Plugins"); odp.pfnDlgProc = DlgProcOptions; odp.flags = ODPF_TCHAR; Options_AddPage(w, &odp); @@ -151,9 +151,9 @@ static void InitServices() { // register sounds - SkinAddNewSoundExT("AlertReminder", LPGENT("Alerts"), LPGENT("Reminder triggered")); - SkinAddNewSoundExT("AlertReminder2", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 1)")); - SkinAddNewSoundExT("AlertReminder3", LPGENT("Alerts"), LPGENT("Reminder triggered (Alternative 2)")); + SkinAddNewSoundEx("AlertReminder", LPGEN("Alerts"), LPGEN("Reminder triggered")); + SkinAddNewSoundEx("AlertReminder2", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 1)")); + SkinAddNewSoundEx("AlertReminder3", LPGEN("Alerts"), LPGEN("Reminder triggered (Alternative 2)")); // register menu command services @@ -202,49 +202,49 @@ int OnModulesLoaded(WPARAM wparam, LPARAM lparam) mi.position = 1600000000; mi.hIcolibItem = iconList[2].hIcolib; - mi.name.t = LPGENT("New &Note"); + mi.name.w = LPGENW("New &Note"); mi.pszService = MODULENAME"/MenuCommandAddNew"; addMenuItem(mi); mi.position = 1600000001; mi.hIcolibItem = iconList[0].hIcolib; - mi.name.t = LPGENT("New &Reminder"); + mi.name.w = LPGENW("New &Reminder"); mi.pszService = MODULENAME"/MenuCommandNewReminder"; addMenuItem(mi); mi.position = 1600100000; mi.hIcolibItem = iconList[3].hIcolib; - mi.name.t = LPGENT("&Show / Hide Notes"); + mi.name.w = LPGENW("&Show / Hide Notes"); mi.pszService = MODULENAME"/MenuCommandShowHide"; addMenuItem(mi); mi.position = 1600100001; mi.hIcolibItem = iconList[13].hIcolib; - mi.name.t = LPGENT("Vie&w Notes"); + mi.name.w = LPGENW("Vie&w Notes"); mi.pszService = MODULENAME"/MenuCommandViewNotes"; addMenuItem(mi); mi.position = 1600100002; mi.hIcolibItem = iconList[1].hIcolib; - mi.name.t = LPGENT("&Delete All Notes"); + mi.name.w = LPGENW("&Delete All Notes"); mi.pszService = MODULENAME"/MenuCommandDeleteAll"; addMenuItem(mi); mi.position = 1600100003; mi.hIcolibItem = iconList[11].hIcolib; - mi.name.t = LPGENT("&Bring All to Front"); + mi.name.w = LPGENW("&Bring All to Front"); mi.pszService = MODULENAME"/MenuCommandBringAllFront"; addMenuItem(mi); mi.position = 1600200000; mi.hIcolibItem = iconList[6].hIcolib; - mi.name.t = LPGENT("&View Reminders"); + mi.name.w = LPGENW("&View Reminders"); mi.pszService = MODULENAME"/MenuCommandViewReminders"; addMenuItem(mi); mi.position = 1600200001; mi.hIcolibItem = iconList[5].hIcolib; - mi.name.t = LPGENT("D&elete All Reminders"); + mi.name.w = LPGENW("D&elete All Reminders"); mi.pszService = MODULENAME"/MenuCommandDeleteReminders"; addMenuItem(mi); @@ -310,7 +310,7 @@ extern "C" __declspec(dllexport) int Load(void) hRichedDll = LoadLibrary("Msftedit.dll"); if (!hRichedDll) { - if (MessageBox(0, TranslateT("Miranda could not load the Notes & Reminders plugin, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), _T(SECTIONNAME), MB_YESNO | MB_ICONINFORMATION) != IDYES) + if (MessageBox(0, Translate("Miranda could not load the Notes & Reminders plugin, Msftedit.dll is missing. If you are using WINE, please make sure you have Msftedit.dll installed. Press 'Yes' to continue loading Miranda."), SECTIONNAME, MB_YESNO | MB_ICONINFORMATION) != IDYES) return 1; return 0; } diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp index 8b752336ed..706e245013 100644 --- a/plugins/NotesAndReminders/src/notes.cpp +++ b/plugins/NotesAndReminders/src/notes.cpp @@ -59,29 +59,29 @@ static HWND LV; struct ColorPreset { - TCHAR *szName; + char *szName; COLORREF color; }; static struct ColorPreset clrPresets[] = { - {LPGENT("Black"), RGB(0,0,0)}, - {LPGENT("Maroon"), RGB(128,0,0)}, - {LPGENT("Green"), RGB(0,128,0)}, - {LPGENT("Olive"), RGB(128,128,0)}, - {LPGENT("Navy"), RGB(0,0,128)}, - {LPGENT("Purple"), RGB(128,0,128)}, - {LPGENT("Teal"), RGB(0,128,128)}, - {LPGENT("Gray"), RGB(128,128,128)}, - {LPGENT("Silver"), RGB(192,192,192)}, - {LPGENT("Red"), RGB(255,0,0)}, - {LPGENT("Orange"), RGB(255,155,0)}, - {LPGENT("Lime"), RGB(0,255,0)}, - {LPGENT("Yellow"), RGB(255,255,0)}, - {LPGENT("Blue"), RGB(0,0,255)}, - {LPGENT("Fuchsia"), RGB(255,0,255)}, - {LPGENT("Aqua"), RGB(0,255,255)}, - {LPGENT("White"), RGB(255,255,255)} + { LPGEN("Black"), RGB(0,0,0) }, + { LPGEN("Maroon"), RGB(128,0,0) }, + { LPGEN("Green"), RGB(0,128,0) }, + { LPGEN("Olive"), RGB(128,128,0) }, + { LPGEN("Navy"), RGB(0,0,128) }, + { LPGEN("Purple"), RGB(128,0,128) }, + { LPGEN("Teal"), RGB(0,128,128) }, + { LPGEN("Gray"), RGB(128,128,128) }, + { LPGEN("Silver"), RGB(192,192,192) }, + { LPGEN("Red"), RGB(255,0,0) }, + { LPGEN("Orange"), RGB(255,155,0) }, + { LPGEN("Lime"), RGB(0,255,0) }, + { LPGEN("Yellow"), RGB(255,255,0) }, + { LPGEN("Blue"), RGB(0,0,255) }, + { LPGEN("Fuchsia"), RGB(255,0,255) }, + { LPGEN("Aqua"), RGB(0,255,255) }, + { LPGEN("White"), RGB(255,255,255) } }; @@ -701,7 +701,7 @@ void PurgeNotes(void) void OnDeleteNote(HWND hdlg, STICKYNOTE *SN) { - if (MessageBox(hdlg, TranslateT("Are you sure you want to delete this note?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) + if (MessageBoxW(hdlg, TranslateT("Are you sure you want to delete this note?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) { if (SN->SNHwnd) DestroyWindow(SN->SNHwnd); @@ -975,7 +975,7 @@ __inline void JustSaveNotes(void) static int FindMenuItem(HMENU h, LPTSTR lpszName) { UINT i; - TCHAR s[128]; + char s[128]; int n = GetMenuItemCount(h); @@ -1040,7 +1040,7 @@ static BOOL DoContextMenu(HWND AhWnd,WPARAM wParam,LPARAM lParam) static void MeasureColorPresetMenuItem(HWND hdlg, LPMEASUREITEMSTRUCT lpMeasureItem, struct ColorPreset *clrPresets) { HDC hdc = GetDC(hdlg); - LPTSTR lpsz = TranslateTS(clrPresets->szName); + LPSTR lpsz = TranslateTS(clrPresets->szName); SIZE sz; GetTextExtentPoint32(hdc, lpsz, (int)mir_tstrlen(lpsz), &sz); ReleaseDC(hdlg, hdc); @@ -1567,7 +1567,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l SN->pCustomFont = NULL; } - // clear text first to force a reformatting w.r.t scrollbar + // clear text first to force a reformatting w.r.w scrollbar SetWindowText(H, ""); SendMessage(H, WM_SETFONT, (WPARAM)(SN->pCustomFont ? SN->pCustomFont->hFont : hBodyFont), FALSE); SetNoteTextControl(SN); @@ -1604,7 +1604,7 @@ INT_PTR CALLBACK StickyNoteWndProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM l free(SN->pCustomFont); SN->pCustomFont = NULL; - // clear text first to force a reformatting w.r.t scrollbar + // clear text first to force a reformatting w.r.w scrollbar SetWindowText(H, ""); SendMessage(H, WM_SETFONT, (WPARAM)hBodyFont, FALSE); SetNoteTextControl(SN); @@ -1873,7 +1873,7 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM { LV_COLUMN lvCol; NMLISTVIEW *NM; - TCHAR *S; + char *S; int I; switch (Message) @@ -1923,7 +1923,7 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM { Window_SetIcon_IcoLib(Dialog, iconList[13].hIcolib); - SetWindowText(Dialog, LPGENT("Notes")); + SetWindowText(Dialog, LPGEN("Notes")); TranslateDialogDefault(Dialog); @@ -1932,25 +1932,25 @@ INT_PTR CALLBACK DlgProcViewNotes(HWND Dialog,UINT Message,WPARAM wParam,LPARAM HWND H = GetDlgItem(Dialog,IDC_LISTREMINDERS); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Note text"); + S = Translate("Note text"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[3]; ListView_InsertColumn(H,0,&lvCol); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Top"); + S = Translate("Top"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[2]; ListView_InsertColumn(H,0,&lvCol); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Visible"); + S = Translate("Visible"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[1]; ListView_InsertColumn(H,0,&lvCol); lvCol.mask = LVCF_TEXT | LVCF_WIDTH; - S = TranslateT("Date/Title"); + S = Translate("Date/Title"); lvCol.pszText = S; lvCol.cx = g_notesListColGeom[0]; ListView_InsertColumn(H,0,&lvCol); diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index d8c013fa40..a4e498823b 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -19,7 +19,7 @@ int g_NoteWidth,g_NoteHeight; int g_Transparency; char *g_RemindSMS = NULL; -TCHAR *g_lpszAltBrowser = NULL; +char *g_lpszAltBrowser = NULL; int g_reminderListGeom[4] = {0}; int g_reminderListColGeom[2] = { 150, 205 }; @@ -72,32 +72,32 @@ static timeFormats[] = struct FontOptionsList { - TCHAR *szDescr; + char *szDescr; COLORREF defColour; - TCHAR *szDefFace; + char *szDefFace; BYTE defStyle; - char defSize; - TCHAR *szBkgName; + int defSize; + char *szBkgName; } static fontOptionsList[] = { - {LPGENT("Sticky Note Caption"), RGB(0,0,0), "Small Fonts", 0, 7, LPGENT("Sticky Note Background Color")}, - //{LPGENT("Sticky Note Caption"), RGB(0,0,0), L"Terminal", 0, 6, LPGENT("Sticky Note Background Color")}, - //{LPGENT("Sticky Note Caption"), RGB(0,0,0), L"MS Serif", 0, 7, LPGENT("Sticky Note Background Color")}, - //{LPGENT("Sticky Note Body"), RGB(0,0,0), L"Tahoma", 0, 8, LPGENT("Sticky Note Background Color")}, - {LPGENT("Sticky Note Body"), RGB(0,0,0), "System", DBFONTF_BOLD, 10, LPGENT("Sticky Note Background Color")}, + { LPGEN("Sticky Note Caption"), RGB(0,0,0), "Small Fonts", 0, 7, LPGEN("Sticky Note Background Color")}, +// { LPGEN("Sticky Note Caption"), RGB(0,0,0), L"Terminal", 0, 6, LPGEN("Sticky Note Background Color")}, +// { LPGEN("Sticky Note Caption"), RGB(0,0,0), L"MS Serif", 0, 7, LPGEN("Sticky Note Background Color")}, +// { LPGEN("Sticky Note Body"), RGB(0,0,0), L"Tahoma", 0, 8, LPGEN("Sticky Note Background Color")}, + { LPGEN("Sticky Note Body"), RGB(0,0,0), "System", DBFONTF_BOLD, 10, LPGEN("Sticky Note Background Color")}, }; struct ColourOptionsList { - TCHAR *szName; + char *szName; char *szSettingName; COLORREF defColour; } static colourOptionsList[] = { - {LPGENT("Sticky Note Background Color"), "BodyColor", NRCDEFAULT_BODYCLR} + { LPGEN("Sticky Note Background Color"), "BodyColor", NRCDEFAULT_BODYCLR} }; @@ -112,7 +112,7 @@ LPCSTR GetTimeFormatStr() } #if defined( _UNICODE ) -static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont) +static BYTE MsgDlgGetFontDefaultCharset(const wchar_t* szFont) { return DEFAULT_CHARSET; } @@ -161,12 +161,12 @@ static int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *l } // get font charset according to current CP, if available for specified font -static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont) +static BYTE MsgDlgGetFontDefaultCharset(const char *szFont) { LOGFONT lf = {0}; int found = 0; - mir_tstrcpy(lf.lfFaceName, szFont); + mir_strcpy(lf.lfFaceName, szFont); lf.lfCharSet = MsgDlgGetCPDefaultCharset(); // check if the font supports specified charset @@ -227,11 +227,11 @@ void RegisterFontServiceFonts() { char szTemp[100]; - FontIDT fontid = {0}; + FontID fontid = { 0 }; fontid.cbSize = sizeof(FontIDT); - _tcsncpy(fontid.group, _T(SECTIONNAME), _countof(fontid.group)); - _tcsncpy(fontid.backgroundGroup, _T(SECTIONNAME), _countof(fontid.backgroundGroup) ); + strncpy(fontid.group, _T(SECTIONNAME), _countof(fontid.group)); + strncpy(fontid.backgroundGroup, _T(SECTIONNAME), _countof(fontid.backgroundGroup)); strncpy(fontid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup)); fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_SAVEPOINTSIZE; @@ -239,12 +239,11 @@ void RegisterFontServiceFonts() int nFontScale = GetDeviceCaps(hDC, LOGPIXELSY); ReleaseDC(NULL, hDC); - for (int i = 0; i < _countof(fontOptionsList); i++) - { + for (int i = 0; i < _countof(fontOptionsList); i++) { fontid.order = i; mir_snprintf(szTemp, "Font%d", i); strncpy(fontid.prefix, szTemp, _countof(fontid.prefix)); - _tcsncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name)); + strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name)); fontid.deffontsettings.colour = fontOptionsList[i].defColour; fontid.deffontsettings.size = (char)-MulDiv(fontOptionsList[i].defSize, nFontScale, 72); @@ -252,23 +251,22 @@ void RegisterFontServiceFonts() fontid.deffontsettings.style = fontOptionsList[i].defStyle; fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace); - _tcsncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace)); - _tcsncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName)); + strncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace)); + strncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName)); FontRegisterT(&fontid); } - ColourIDT colorid = {0}; + ColourIDT colorid = { 0 }; colorid.cbSize = sizeof(ColourIDT); - _tcsncpy(colorid.group, _T(SECTIONNAME), _countof(colorid.group)); + strncpy(colorid.group, _T(SECTIONNAME), _countof(colorid.group)); strncpy(colorid.dbSettingsGroup, MODULENAME, _countof(fontid.dbSettingsGroup)); colorid.flags = 0; - for (int i = 0; i < _countof(colourOptionsList); i++) - { + for (int i = 0; i < _countof(colourOptionsList); i++) { colorid.order = i; - _tcsncpy(colorid.name, colourOptionsList[i].szName, _countof(colorid.name)); + strncpy(colorid.name, colourOptionsList[i].szName, _countof(colorid.name)); colorid.defcolour = colourOptionsList[i].defColour; strncpy(colorid.setting, colourOptionsList[i].szSettingName, _countof(colorid.setting)); @@ -281,101 +279,94 @@ void RegisterFontServiceFonts() void LoadNRFont(int i, LOGFONT *lf, COLORREF *colour) { - FontIDT fontid = {0}; + FontIDT fontid = { 0 }; - fontid.cbSize = sizeof(fontid); - _tcsncpy(fontid.group, LPGENT(SECTIONNAME), _countof(fontid.group)); - _tcsncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name)); - - COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf); + fontid.cbSize = sizeof(fontid); + strncpy(fontid.group, LPGEN(SECTIONNAME), _countof(fontid.group)); + strncpy(fontid.name, fontOptionsList[i].szDescr, _countof(fontid.name)); + COLORREF col = CallService(MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf); if (colour) - { *colour = col; - } } -static void TrimString(TCHAR *s) +static void TrimString(char *s) { if (!s || !*s) return; - TCHAR *start = s; - UINT n = UINT(mir_tstrlen(s) - 1); + char *start = s; + UINT n = UINT(mir_strlen(s) - 1); - TCHAR *end = s + n; + char *end = s + n; - if (!_istspace(*start) && !_istspace(*end)) - { + if (!iswspace(*start) && !iswspace(*end)) { // nothing to trim return; } // scan past leading spaces - while (*start && _istspace(*start)) start++; + while (*start && iswspace(*start)) start++; - if (!*start) - { + if (!*start) { // empty string *s = 0; return; } // trim trailing spaces - while ( _istspace(*end) ) end--; + while (iswspace(*end)) end--; end[1] = 0; - if (start > s) - { + if (start > s) { // remove leading spaces - memmove(s, start, ((UINT)(end-start)+2)*sizeof(TCHAR)); + memmove(s, start, ((UINT)(end - start) + 2) * sizeof(wchar_t)); } } -INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam) +INT_PTR CALLBACK DlgProcOptions(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) { BOOL LB; WORD SzT; void *P; int i; - switch (message) - { - case WM_INITDIALOG: + switch (message) { + case WM_INITDIALOG: { TranslateDialogDefault(hdlg); - SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETRANGE,TRUE,MAKELONG(0,255-MIN_ALPHA)); - SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETPOS,TRUE,255-g_Transparency); - + SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETRANGE, TRUE, MAKELONG(0, 255 - MIN_ALPHA)); + SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 255 - g_Transparency); + CheckDlgButton(hdlg, IDC_CHECK_HIDENOTES, !g_ShowNotesAtStart ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_MENUS, g_AddContListMI ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_BUTTONS, g_ShowNoteButtons ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_SCROLLBARS, g_ShowScrollbar ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_CLOSE, g_CloseAfterAddReminder ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_MSI, !g_UseDefaultPlaySound ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE); - SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE); - - SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_RESETCONTENT,0,0); - SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_RESETCONTENT,0,0); - for (i=0; i<_countof(dateFormats); i++) - SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_ADDSTRING,0,(LPARAM)dateFormats[i].lpszUI); - for (i=0; i<_countof(timeFormats); i++) - SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_ADDSTRING,0,(LPARAM)timeFormats[i].lpszUI); - SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_ADDSTRING,0,(LPARAM)Translate("None")); - SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_ADDSTRING,0,(LPARAM)Translate("None")); - - SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_SETCURSEL,(WPARAM)(g_NoteTitleDate ? g_NoteTitleDate-1 : SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCOUNT,0,0)-1),0); - SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_SETCURSEL,(WPARAM)(g_NoteTitleTime ? g_NoteTitleTime-1 : SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCOUNT,0,0)-1),0); - - if (g_RemindSMS) - SetDlgItemText(hdlg,IDC_EDIT_EMAILSMS,g_RemindSMS); - else - SetDlgItemText(hdlg,IDC_EDIT_EMAILSMS,""); - - SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : ""); + SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE); + SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE); + + SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_RESETCONTENT, 0, 0); + for (i = 0; i < _countof(dateFormats); i++) + SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_ADDSTRING, 0, (LPARAM)dateFormats[i].lpszUI); + for (i = 0; i < _countof(timeFormats); i++) + SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_ADDSTRING, 0, (LPARAM)timeFormats[i].lpszUI); + SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_ADDSTRING, 0, (LPARAM)Translate("None")); + SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_ADDSTRING, 0, (LPARAM)Translate("None")); + + SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_SETCURSEL, (WPARAM)(g_NoteTitleDate ? g_NoteTitleDate - 1 : SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCOUNT, 0, 0) - 1), 0); + SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_SETCURSEL, (WPARAM)(g_NoteTitleTime ? g_NoteTitleTime - 1 : SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCOUNT, 0, 0) - 1), 0); + + if (g_RemindSMS) + SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, g_RemindSMS); + else + SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, ""); + + SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser ? g_lpszAltBrowser : ""); return TRUE; } case WM_HSCROLL: @@ -384,99 +375,90 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar return TRUE; } case WM_NOTIFY: - if (((LPNMHDR)lParam)->code == PSN_APPLY) - { - g_ShowNotesAtStart = !(BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_HIDENOTES); - g_ShowNoteButtons = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_BUTTONS); - g_ShowScrollbar = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_SCROLLBARS); - g_AddContListMI = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_MENUS); - g_NoteWidth = GetDlgItemInt(hdlg,IDC_EDIT_WIDTH,&LB,FALSE); - g_NoteHeight = GetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,&LB,FALSE); - g_Transparency = 255-SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_GETPOS,0,0); - g_CloseAfterAddReminder = (BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_CLOSE); - g_UseDefaultPlaySound = !(BOOL)IsDlgButtonChecked(hdlg,IDC_CHECK_MSI); - g_NoteTitleDate = (SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCURSEL,0,0) + 1) % SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_GETCOUNT,0,0); - g_NoteTitleTime = (SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCURSEL,0,0) + 1) % SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_GETCOUNT,0,0); - if (g_NoteWidth < 179) - { + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + g_ShowNotesAtStart = !(BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_HIDENOTES); + g_ShowNoteButtons = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_BUTTONS); + g_ShowScrollbar = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_SCROLLBARS); + g_AddContListMI = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_MENUS); + g_NoteWidth = GetDlgItemInt(hdlg, IDC_EDIT_WIDTH, &LB, FALSE); + g_NoteHeight = GetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, &LB, FALSE); + g_Transparency = 255 - SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_GETPOS, 0, 0); + g_CloseAfterAddReminder = (BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_CLOSE); + g_UseDefaultPlaySound = !(BOOL)IsDlgButtonChecked(hdlg, IDC_CHECK_MSI); + g_NoteTitleDate = (SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCURSEL, 0, 0) + 1) % SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_GETCOUNT, 0, 0); + g_NoteTitleTime = (SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCURSEL, 0, 0) + 1) % SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_GETCOUNT, 0, 0); + if (g_NoteWidth < 179) { g_NoteWidth = 179; - SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE); + SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE); } - if (g_NoteHeight < 35) - { + if (g_NoteHeight < 35) { g_NoteHeight = 35; - SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE); + SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE); } - SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_EMAILSMS,WM_GETTEXTLENGTH,0,0); - if (SzT != 0) - { + SzT = (WORD)SendDlgItemMessage(hdlg, IDC_EDIT_EMAILSMS, WM_GETTEXTLENGTH, 0, 0); + if (SzT != 0) { g_RemindSMS = (char*)realloc(g_RemindSMS, SzT + 1); GetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, g_RemindSMS, SzT + 1); } P = g_RemindSMS; - db_set_blob(0,MODULENAME,"RemindEmail",P,SzT); + db_set_blob(0, MODULENAME, "RemindEmail", P, SzT); - SzT = (WORD)SendDlgItemMessage(hdlg,IDC_EDIT_ALTBROWSER,WM_GETTEXTLENGTH,0,0); - if (SzT != 0) - { - g_lpszAltBrowser = (TCHAR*)mir_realloc(g_lpszAltBrowser, SzT + 1); + SzT = (WORD)SendDlgItemMessage(hdlg, IDC_EDIT_ALTBROWSER, WM_GETTEXTLENGTH, 0, 0); + if (SzT != 0) { + g_lpszAltBrowser = (char*)mir_realloc(g_lpszAltBrowser, SzT + 1); GetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser, SzT + 1); TrimString(g_lpszAltBrowser); - if (!*g_lpszAltBrowser) - { + if (!*g_lpszAltBrowser) { mir_free(g_lpszAltBrowser); g_lpszAltBrowser = NULL; } } - else if (g_lpszAltBrowser) - { + else if (g_lpszAltBrowser) { mir_free(g_lpszAltBrowser); g_lpszAltBrowser = NULL; } - SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,g_lpszAltBrowser ? g_lpszAltBrowser : ""); + SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, g_lpszAltBrowser ? g_lpszAltBrowser : ""); if (g_lpszAltBrowser) - db_set_s(0,MODULENAME,"AltBrowser",g_lpszAltBrowser); + db_set_s(0, MODULENAME, "AltBrowser", g_lpszAltBrowser); else - db_unset(0,MODULENAME,"AltBrowser"); - - db_set_dw(0,MODULENAME,"ShowNotesAtStart",g_ShowNotesAtStart); - db_set_dw(0,MODULENAME,"ShowNoteButtons",g_ShowNoteButtons); - db_set_dw(0,MODULENAME,"ShowScrollbar",g_ShowScrollbar); - db_set_dw(0,MODULENAME,"AddContactMenuItems",g_AddContListMI); - db_set_dw(0,MODULENAME,"NoteWidth",g_NoteWidth); - db_set_dw(0,MODULENAME,"NoteHeight",g_NoteHeight); - db_set_dw(0,MODULENAME,"Transparency",g_Transparency); - db_set_dw(0,MODULENAME,"NoteTitleDate",g_NoteTitleDate); - db_set_dw(0,MODULENAME,"NoteTitleTime",g_NoteTitleTime); - db_set_dw(0,MODULENAME,"CloseAfterAddReminder",g_CloseAfterAddReminder); - db_set_dw(0,MODULENAME,"UseMCI",!g_UseDefaultPlaySound); + db_unset(0, MODULENAME, "AltBrowser"); + + db_set_dw(0, MODULENAME, "ShowNotesAtStart", g_ShowNotesAtStart); + db_set_dw(0, MODULENAME, "ShowNoteButtons", g_ShowNoteButtons); + db_set_dw(0, MODULENAME, "ShowScrollbar", g_ShowScrollbar); + db_set_dw(0, MODULENAME, "AddContactMenuItems", g_AddContListMI); + db_set_dw(0, MODULENAME, "NoteWidth", g_NoteWidth); + db_set_dw(0, MODULENAME, "NoteHeight", g_NoteHeight); + db_set_dw(0, MODULENAME, "Transparency", g_Transparency); + db_set_dw(0, MODULENAME, "NoteTitleDate", g_NoteTitleDate); + db_set_dw(0, MODULENAME, "NoteTitleTime", g_NoteTitleTime); + db_set_dw(0, MODULENAME, "CloseAfterAddReminder", g_CloseAfterAddReminder); + db_set_dw(0, MODULENAME, "UseMCI", !g_UseDefaultPlaySound); SaveNotes(); LoadNotes(FALSE); return TRUE; } break; case WM_COMMAND: - switch (LOWORD(wParam)) - { + switch (LOWORD(wParam)) { case IDC_BTN_BROWSEBROWSER: { - TCHAR s[MAX_PATH]; + char s[MAX_PATH]; - OPENFILENAME ofn = {0}; + OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = hdlg; - ofn.lpstrFilter = TranslateT("Executable Files\0*.exe\0All Files\0*.*\0\0"); + ofn.lpstrFilter = Translate("Executable Files\0*.exe\0All Files\0*.*\0\0"); ofn.lpstrFile = s; ofn.nMaxFile = _countof(s); - ofn.lpstrTitle = TranslateT("Select Executable"); + ofn.lpstrTitle = Translate("Select Executable"); ofn.lpstrInitialDir = "."; ofn.Flags = OFN_FILEMUSTEXIST | OFN_LONGNAMES | OFN_ENABLESIZING | OFN_DONTADDTORECENT; GetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, s, ofn.nMaxFile); - if ( GetOpenFileName(&ofn) ) - { - SetDlgItemText(hdlg,IDC_EDIT_ALTBROWSER,s); + if (GetOpenFileName(&ofn)) { + SetDlgItemText(hdlg, IDC_EDIT_ALTBROWSER, s); SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); } } @@ -485,8 +467,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar { SAFE_FREE((void**)&g_RemindSMS); SetDlgItemText(hdlg, IDC_EDIT_EMAILSMS, ""); - if (g_lpszAltBrowser) - { + if (g_lpszAltBrowser) { mir_free(g_lpszAltBrowser); g_lpszAltBrowser = NULL; } @@ -505,16 +486,16 @@ INT_PTR CALLBACK DlgProcOptions(HWND hdlg,UINT message,WPARAM wParam,LPARAM lPar CheckDlgButton(hdlg, IDC_CHECK_BUTTONS, g_ShowNoteButtons ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_CLOSE, g_CloseAfterAddReminder ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hdlg, IDC_CHECK_MSI, !g_UseDefaultPlaySound ? BST_CHECKED : BST_UNCHECKED); - SendDlgItemMessage(hdlg,IDC_COMBODATE,CB_SETCURSEL,(WPARAM)(g_NoteTitleDate-1),0); - SendDlgItemMessage(hdlg,IDC_COMBOTIME,CB_SETCURSEL,(WPARAM)(g_NoteTitleTime-1),0); + SendDlgItemMessage(hdlg, IDC_COMBODATE, CB_SETCURSEL, (WPARAM)(g_NoteTitleDate - 1), 0); + SendDlgItemMessage(hdlg, IDC_COMBOTIME, CB_SETCURSEL, (WPARAM)(g_NoteTitleTime - 1), 0); g_NoteWidth = 179; g_NoteHeight = 35; - SetDlgItemInt(hdlg,IDC_EDIT_WIDTH,g_NoteWidth,FALSE); - SetDlgItemInt(hdlg,IDC_EDIT_HEIGHT,g_NoteHeight,FALSE); + SetDlgItemInt(hdlg, IDC_EDIT_WIDTH, g_NoteWidth, FALSE); + SetDlgItemInt(hdlg, IDC_EDIT_HEIGHT, g_NoteHeight, FALSE); g_Transparency = 255; - SendDlgItemMessage(hdlg,IDC_SLIDER_TRANSPARENCY,TBM_SETPOS,TRUE,0); + SendDlgItemMessage(hdlg, IDC_SLIDER_TRANSPARENCY, TBM_SETPOS, TRUE, 0); SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); // JK optim - return TRUE; + return TRUE; } case IDC_EDIT_ALTBROWSER: case IDC_EDIT_EMAILSMS: @@ -549,34 +530,33 @@ void InitSettings(void) Sz1 = MAX_PATH; P = NULL; ReadSettingBlob(0, MODULENAME, "RemindEmail", (WORD*)&Sz1, &P); - if (!(Sz1 && P)) + if (!(Sz1 && P)) g_RemindSMS = NULL; - else - { + else { g_RemindSMS = (char*)malloc(Sz1 + 1); memcpy(g_RemindSMS, P, Sz1); g_RemindSMS[Sz1] = 0; FreeSettingBlob(Sz1, P); } - g_lpszAltBrowser = db_get_sa(0,MODULENAME,"AltBrowser"); - - g_ShowNotesAtStart = (BOOL)db_get_dw(0,MODULENAME,"ShowNotesAtStart",1); - g_ShowNoteButtons = (BOOL)db_get_dw(0,MODULENAME,"ShowNoteButtons",1); - g_ShowScrollbar = (BOOL)db_get_dw(0,MODULENAME,"ShowScrollbar",1); - g_AddContListMI = (BOOL)db_get_dw(0,MODULENAME,"AddContactMenuItems",1); - g_NoteWidth = db_get_dw(0,MODULENAME,"NoteWidth",179); - g_NoteHeight = db_get_dw(0,MODULENAME,"NoteHeight",50); - g_Transparency = db_get_dw(0,MODULENAME,"Transparency",255); - g_NoteTitleDate = db_get_dw(0,MODULENAME,"NoteTitleDate",1); - g_NoteTitleTime = db_get_dw(0,MODULENAME,"NoteTitleTime",1); - g_CloseAfterAddReminder = (BOOL)db_get_dw(0,MODULENAME,"CloseAfterAddReminder",1); - g_UseDefaultPlaySound = !(BOOL)db_get_dw(0,MODULENAME,"UseMCI",1); - - ReadSettingIntArray(0,MODULENAME,"ReminderListGeom",g_reminderListGeom,_countof(g_reminderListGeom)); - ReadSettingIntArray(0,MODULENAME,"ReminderListColGeom",g_reminderListColGeom,_countof(g_reminderListColGeom)); - ReadSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,_countof(g_notesListGeom)); - ReadSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,_countof(g_notesListColGeom)); + g_lpszAltBrowser = db_get_sa(0, MODULENAME, "AltBrowser"); + + g_ShowNotesAtStart = (BOOL)db_get_dw(0, MODULENAME, "ShowNotesAtStart", 1); + g_ShowNoteButtons = (BOOL)db_get_dw(0, MODULENAME, "ShowNoteButtons", 1); + g_ShowScrollbar = (BOOL)db_get_dw(0, MODULENAME, "ShowScrollbar", 1); + g_AddContListMI = (BOOL)db_get_dw(0, MODULENAME, "AddContactMenuItems", 1); + g_NoteWidth = db_get_dw(0, MODULENAME, "NoteWidth", 179); + g_NoteHeight = db_get_dw(0, MODULENAME, "NoteHeight", 50); + g_Transparency = db_get_dw(0, MODULENAME, "Transparency", 255); + g_NoteTitleDate = db_get_dw(0, MODULENAME, "NoteTitleDate", 1); + g_NoteTitleTime = db_get_dw(0, MODULENAME, "NoteTitleTime", 1); + g_CloseAfterAddReminder = (BOOL)db_get_dw(0, MODULENAME, "CloseAfterAddReminder", 1); + g_UseDefaultPlaySound = !(BOOL)db_get_dw(0, MODULENAME, "UseMCI", 1); + + ReadSettingIntArray(0, MODULENAME, "ReminderListGeom", g_reminderListGeom, _countof(g_reminderListGeom)); + ReadSettingIntArray(0, MODULENAME, "ReminderListColGeom", g_reminderListColGeom, _countof(g_reminderListColGeom)); + ReadSettingIntArray(0, MODULENAME, "NotesListGeom", g_notesListGeom, _countof(g_notesListGeom)); + ReadSettingIntArray(0, MODULENAME, "NotesListColGeom", g_notesListColGeom, _countof(g_notesListColGeom)); BodyColor = db_get_dw(NULL, MODULENAME, colourOptionsList[0].szSettingName, colourOptionsList[0].defColour); @@ -592,19 +572,16 @@ void InitSettings(void) void TermSettings(void) { - if (g_reminderListGeom[2] > 0 && g_reminderListGeom[3] > 0) - { - WriteSettingIntArray(0,MODULENAME,"ReminderListGeom",g_reminderListGeom,_countof(g_reminderListGeom)); - WriteSettingIntArray(0,MODULENAME,"ReminderListColGeom",g_reminderListColGeom,_countof(g_reminderListColGeom)); + if (g_reminderListGeom[2] > 0 && g_reminderListGeom[3] > 0) { + WriteSettingIntArray(0, MODULENAME, "ReminderListGeom", g_reminderListGeom, _countof(g_reminderListGeom)); + WriteSettingIntArray(0, MODULENAME, "ReminderListColGeom", g_reminderListColGeom, _countof(g_reminderListColGeom)); } - if (g_notesListGeom[2] > 0 && g_notesListGeom[3] > 0) - { - WriteSettingIntArray(0,MODULENAME,"NotesListGeom",g_notesListGeom,_countof(g_notesListGeom)); - WriteSettingIntArray(0,MODULENAME,"NotesListColGeom",g_notesListColGeom,_countof(g_notesListColGeom)); + if (g_notesListGeom[2] > 0 && g_notesListGeom[3] > 0) { + WriteSettingIntArray(0, MODULENAME, "NotesListGeom", g_notesListGeom, _countof(g_notesListGeom)); + WriteSettingIntArray(0, MODULENAME, "NotesListColGeom", g_notesListColGeom, _countof(g_notesListColGeom)); } - if (g_lpszAltBrowser) - { + if (g_lpszAltBrowser) { mir_free(g_lpszAltBrowser); g_lpszAltBrowser = NULL; } diff --git a/plugins/NotesAndReminders/src/reminders.cpp b/plugins/NotesAndReminders/src/reminders.cpp index f0a141fd44..cf4e43f807 100644 --- a/plugins/NotesAndReminders/src/reminders.cpp +++ b/plugins/NotesAndReminders/src/reminders.cpp @@ -1786,7 +1786,7 @@ INT_PTR CALLBACK DlgProcNotifyReminder(HWND Dialog,UINT Message,WPARAM wParam,LP m += h * 60; if (!m) { - MessageBox(Dialog, TranslateT("The specified time offset is invalid."), _T(SECTIONNAME), MB_OK | MB_ICONWARNING); + MessageBox(Dialog, Translate("The specified time offset is invalid."), _T(SECTIONNAME), MB_OK | MB_ICONWARNING); return TRUE; } @@ -1881,8 +1881,8 @@ INT_PTR CALLBACK DlgProcNewReminder(HWND Dialog,UINT Message,WPARAM wParam,LPARA if (NewReminderVisible == 2) { // opening the edit reminder dialog (uses same dialog resource as add reminder) - SetWindowText(Dialog, TranslateT("Reminder")); - SetDlgItemText(Dialog, IDC_ADDREMINDER, TranslateT("&Update Reminder")); + SetWindowText(Dialog, Translate("Reminder")); + SetDlgItemText(Dialog, IDC_ADDREMINDER, Translate("&Update Reminder")); ShowWindow(GetDlgItem(Dialog, IDC_VIEWREMINDERS), SW_HIDE); li = pEditReminder->When; @@ -2510,7 +2510,7 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA return TRUE; } case IDM_DELETEALLREMINDERS: - if (RemindersList && MessageBox(Dialog, TranslateT("Are you sure you want to delete all reminders?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) + if (RemindersList && MessageBox(Dialog, Translate("Are you sure you want to delete all reminders?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK) { SetDlgItemText(Dialog, IDC_REMINDERDATA, ""); DeleteReminders(); @@ -2526,7 +2526,7 @@ INT_PTR CALLBACK DlgProcViewReminders(HWND Dialog,UINT Message,WPARAM wParam,LPA { I = ListView_GetSelectionMark(H); if (I != -1 - && MessageBox(Dialog, TranslateT("Are you sure you want to delete this reminder?"), TranslateT(SECTIONNAME), MB_OKCANCEL) == IDOK) + && MessageBox(Dialog, Translate("Are you sure you want to delete this reminder?"), Translate(SECTIONNAME), MB_OKCANCEL) == IDOK) { SetDlgItemText(Dialog, IDC_REMINDERDATA, ""); DeleteReminder((REMINDERDATA*)TreeGetAt(RemindersList, I)); -- cgit v1.2.3