diff options
author | George Hazan <ghazan@miranda.im> | 2016-10-29 17:35:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-10-29 17:35:02 +0300 |
commit | 2d0c87b679032430a0a23403d133f2a00ffcf790 (patch) | |
tree | 363b9075f70abe7b18055cc65b7e67604af64acf /plugins/WebView | |
parent | 55e72960be3926e041ac0baf00559ba46f59bba0 (diff) |
more useless macros removed
Diffstat (limited to 'plugins/WebView')
-rw-r--r-- | plugins/WebView/src/main.cpp | 4 | ||||
-rw-r--r-- | plugins/WebView/src/webview.h | 1 | ||||
-rw-r--r-- | plugins/WebView/src/webview_alerts.cpp | 12 | ||||
-rw-r--r-- | plugins/WebView/src/webview_datawnd.cpp | 2 | ||||
-rw-r--r-- | plugins/WebView/src/webview_opts.cpp | 38 | ||||
-rw-r--r-- | plugins/WebView/src/webview_services.cpp | 12 |
6 files changed, 34 insertions, 35 deletions
diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 57983be597..e8b7bfd899 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -164,7 +164,7 @@ extern "C" int __declspec(dllexport) Load() InitServices();
//add sound event to options
- SkinAddNewSoundExW("webviewalert", MODULENAMEW, LPGENW("Alert event"));
+ SkinAddNewSoundExW("webviewalert", _A2W(MODULENAME), LPGENW("Alert event"));
//value is 1 if menu is disabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1);
@@ -175,7 +175,7 @@ extern "C" int __declspec(dllexport) Load() //value is 0 if menu is enabled
db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 0);
- mi.root = Menu_CreateRoot(MO_MAIN, MODULENAMEW, 20200001);
+ mi.root = Menu_CreateRoot(MO_MAIN, _A2W(MODULENAME), 20200001);
Menu_ConfigureItem(mi.root, MCI_OPT_UID, "403BE07B-7954-4F3E-B318-4301571776B8");
/*DISABLE WEBVIEW*/
diff --git a/plugins/WebView/src/webview.h b/plugins/WebView/src/webview.h index 967645e4b8..837fa18083 100644 --- a/plugins/WebView/src/webview.h +++ b/plugins/WebView/src/webview.h @@ -23,7 +23,6 @@ #define CFM_BACKCOLOR 0x04000000
#define MODULENAME "WebView"
-#define MODULENAMEW L"WebView"
#define MENU_OFF "DisableMenu"
#define REFRESH_KEY "Refresh interval"
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index a816dfb319..525d9e8ba6 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -119,7 +119,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) mir_wstrncpy(ppd.lptzContactName, dbv.ptszVal, _countof(ppd.lptzContactName));
db_free(&dbv);
}
- else mir_wstrcpy(ppd.lptzContactName, MODULENAMEW);
+ else mir_wstrcpy(ppd.lptzContactName, _A2W(MODULENAME));
ppd.lchContact = wParam;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
@@ -332,7 +332,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Start/end strings not found or strings not set."));
}
- else MessageBox(NULL, TranslateT("Start/end strings not found or strings not set."), MODULENAMEW, MB_OK);
+ else MessageBox(NULL, TranslateT("Start/end strings not found or strings not set."), _A2W(MODULENAME), MB_OK);
}
if (eventIndex == 0) { // string present
@@ -405,7 +405,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn HWND hwndDlg = WindowList_Find(hWindowList, hContact);
SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Download successful; about to process data..."));
}
- else MessageBox(NULL, TranslateT("Unknown alert type."), MODULENAMEW, MB_OK);
+ else MessageBox(NULL, TranslateT("Unknown alert type."), _A2W(MODULENAME), MB_OK);
}
}
}
@@ -500,7 +500,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if ( db_get_b(hContact, MODULENAME, APND_DATE_NAME_KEY, 0))
db_set_s(hContact, "CList", "MyHandle", tstr);
}
- else MessageBox(NULL, TranslateT("Unknown alert type."), MODULENAMEW, MB_OK);
+ else MessageBox(NULL, TranslateT("Unknown alert type."), _A2W(MODULENAME), MB_OK);
}
}
}
@@ -616,7 +616,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn HWND hwndDlg = (WindowList_Find(hWindowList, hContact));
SetDlgItemText(hwndDlg, IDC_STATUSBAR, TranslateT("Alert start/end strings not found or strings not set."));
}
- else MessageBox(NULL, TranslateT("Alert start/end strings not found or strings not set."), MODULENAMEW, MB_OK);
+ else MessageBox(NULL, TranslateT("Alert start/end strings not found or strings not set."), _A2W(MODULENAME), MB_OK);
db_set_w(hContact, MODULENAME, "Status", ID_STATUS_AWAY);
}
@@ -710,7 +710,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if ( db_get_b(hContact, MODULENAME, APND_DATE_NAME_KEY, 0))
db_set_s(hContact, "CList", "MyHandle", tstr);
}
- else MessageBox(NULL, TranslateT("Unknown alert type."), MODULENAMEW, MB_OK);
+ else MessageBox(NULL, TranslateT("Unknown alert type."), _A2W(MODULENAME), MB_OK);
}
}
}
diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index 462b903628..bf79daf074 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -135,7 +135,7 @@ static MCONTACT FindContactByUrl(HWND hwndDlg) if (!mir_wstrcmp(urltext, db1) && !mir_wstrcmp(titlebartxt, db2)) {
contactcount++;
if (contactcount > 1) {
- MessageBox(NULL, TranslateT("ERROR: You have two or more Webview contacts with the same URL and contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("ERROR: You have two or more Webview contacts with the same URL and contact name."), _A2W(MODULENAME), MB_OK);
return NULL;
}
res = hContact;
diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index 393388ea34..66970dc59d 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -206,7 +206,7 @@ INT_PTR CALLBACK DlgPopUpOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) TextColour = TextClr;
}
ppd.lchContact = NULL;
- mir_wstrcpy(ppd.lptzContactName, MODULENAMEW);
+ mir_wstrcpy(ppd.lptzContactName, _A2W(MODULENAME));
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
mir_wstrcpy(ppd.lptzText, TranslateT("This is a preview popup."));
ppd.colorBack = BGColour;
@@ -715,18 +715,18 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (eventIndex == 0) // string present
if (!(GetWindowTextLength(GetDlgItem(hwndDlg, IDC_ALERT_STRING))))
if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)) {
- MessageBox(NULL, TranslateT("You need to supply a search string."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a search string."), _A2W(MODULENAME), MB_OK);
break;
}
if (eventIndex == 2) // part of web page changed
if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)) {
if (!(GetWindowTextLength(GetDlgItem(hwndDlg, IDC_START2)))) {
- MessageBox(NULL, TranslateT("You need to supply a start string."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a start string."), _A2W(MODULENAME), MB_OK);
break;
}
if (!(GetWindowTextLength(GetDlgItem(hwndDlg, IDC_END2)))) {
- MessageBox(NULL, TranslateT("You need to supply an end string."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply an end string."), _A2W(MODULENAME), MB_OK);
break;
}
}
@@ -734,14 +734,14 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l if (alertIndex == 1) // log to file
if (!(GetWindowTextLength(GetDlgItem(hwndDlg, IDC_FILENAME))))
if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)) {
- MessageBox(NULL, TranslateT("You need to supply a file name and path."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a file name and path."), _A2W(MODULENAME), MB_OK);
break;
}
if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYS_LOG))
if (!(GetWindowTextLength(GetDlgItem(hwndDlg, IDC_FILENAME))))
if (IsDlgButtonChecked(hwndDlg, IDC_ENABLE_ALERTS)) {
- MessageBox(NULL, TranslateT("You need to supply a file name and path."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a file name and path."), _A2W(MODULENAME), MB_OK);
break;
}
@@ -952,61 +952,61 @@ INT_PTR CALLBACK DlgProcContactOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
wchar_t str[128], contactname[128];
if (!GetWindowTextLength(GetDlgItem(hwndDlg, IDC_URL))) {
- MessageBox(NULL, TranslateT("You need to supply a URL."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a URL."), _A2W(MODULENAME), MB_OK);
break;
}
if (!GetWindowTextLength(GetDlgItem(hwndDlg, IDC_START))) {
if (IsDlgButtonChecked(hwndDlg, IDC_U_SE_STRINGS)) {
- MessageBox(NULL, TranslateT("You need to supply a start string."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a start string."), _A2W(MODULENAME), MB_OK);
break;
}
}
if (!GetWindowTextLength(GetDlgItem(hwndDlg, IDC_END))) {
if (IsDlgButtonChecked(hwndDlg, IDC_U_SE_STRINGS)) {
- MessageBox(NULL, TranslateT("You need to supply an end string."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply an end string."), _A2W(MODULENAME), MB_OK);
break;
}
}
if (!GetWindowTextLength(GetDlgItem(hwndDlg, IDC_SITE_NAME))) {
- MessageBox(NULL, TranslateT("You need to supply a name for the contact."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("You need to supply a name for the contact."), _A2W(MODULENAME), MB_OK);
break;
}
GetDlgItemText(hwndDlg, IDC_SITE_NAME, contactname, _countof(contactname));
if (wcschr(contactname, '\\') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '/') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, ':') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '*') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '?') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '\"') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '<') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '>') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
if (wcschr(contactname, '|') != NULL) {
- MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), MODULENAMEW, MB_OK);
+ MessageBox(NULL, TranslateT("Invalid symbol present in contact name."), _A2W(MODULENAME), MB_OK);
break;
}
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp index fc3fccb510..3fe04a9629 100644 --- a/plugins/WebView/src/webview_services.cpp +++ b/plugins/WebView/src/webview_services.cpp @@ -85,12 +85,12 @@ int DBSettingChanged(WPARAM wParam, LPARAM lParam) wchar_t *cacheend = wcsrchr(cachepath, '\\'); cacheend++; *cacheend = '\0'; - mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); + mir_snwprintf(cachedirectorypath, L"%s" _A2W(MODULENAME) L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); wchar_t newcachepath[MAX_PATH + 50], renamedcachepath[MAX_PATH + 50]; - mir_snwprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, oldName); - mir_snwprintf(renamedcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, nick); + mir_snwprintf(newcachepath, L"%s" _A2W(MODULENAME) L"cache\\%s.txt", cachepath, oldName); + mir_snwprintf(renamedcachepath, L"%s" _A2W(MODULENAME) L"cache\\%s.txt", cachepath, nick); // file exists? if ( _waccess(newcachepath, 0) != -1) { @@ -124,9 +124,9 @@ int SiteDeleted(WPARAM wParam, LPARAM) cacheend++; *cacheend = '\0'; - mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\", cachepath); + mir_snwprintf(cachedirectorypath, L"%s" _A2W(MODULENAME) L"cache\\", cachepath); CreateDirectory(cachedirectorypath, NULL); - mir_snwprintf(newcachepath, L"%s" MODULENAMEW L"cache\\%s.txt", cachepath, contactName); + mir_snwprintf(newcachepath, L"%s" _A2W(MODULENAME) L"cache\\%s.txt", cachepath, contactName); // file exists? if ( _waccess(newcachepath, 0) != -1) { FILE *pcachefile = _wfopen(newcachepath, L"r"); @@ -149,7 +149,7 @@ INT_PTR OpenCacheDir(WPARAM, LPARAM) cacheend++; *cacheend = '\0'; - mir_snwprintf(cachedirectorypath, L"%s" MODULENAMEW L"cache\\%s", cachepath, cacheend); + mir_snwprintf(cachedirectorypath, L"%s" _A2W(MODULENAME) L"cache\\%s", cachepath, cacheend); if( _waccess(cachedirectorypath, 0) != 0) WErrorPopup((UINT_PTR)"ERROR", TranslateT("Cache folder does not exist.")); |