diff options
author | George Hazan <george.hazan@gmail.com> | 2015-08-24 20:46:45 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-08-24 20:46:45 +0000 |
commit | fa55da74f9c335b460e1f8e4b702e3b2ca567702 (patch) | |
tree | 35f746d13c4e3bfed2ff5964ad34854a4a8dd242 /plugins/ListeningTo | |
parent | 1c5dd07bc13a9dcd77ea7ad907cc2bc5ac93472c (diff) |
warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@15026 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ListeningTo')
-rw-r--r-- | plugins/ListeningTo/src/listeningto.cpp | 24 | ||||
-rw-r--r-- | plugins/ListeningTo/src/options.cpp | 10 |
2 files changed, 15 insertions, 19 deletions
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index d409406370..e504f142d2 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -201,6 +201,7 @@ void RebuildMenu() | (opts.enable_sending ? 0 : CMIF_GRAYED);
info->hMenu = Menu_AddMainMenuItem(&mi);
+ Menu_ConfigureItem(info->hMenu, MCI_OPT_EXECPARAM, i);
}
UpdateGlobalStatusMenus();
@@ -460,11 +461,8 @@ INT_PTR MainMenuClicked(WPARAM wParam, LPARAM) if (!loaded)
return -1;
- unsigned pos = wParam == 0 ? 0 : wParam - 500080000;
- if (pos >= proto_items.size() || pos < 0)
- return 0;
-
- EnableListeningTo(proto_items[pos].proto, !ListeningToEnabled(proto_items[pos].proto, TRUE));
+ if (wParam < proto_items.size())
+ EnableListeningTo(proto_items[wParam].proto, !ListeningToEnabled(proto_items[wParam].proto, TRUE));
return 0;
}
@@ -475,18 +473,16 @@ bool ListeningToEnabled(char *proto, bool ignoreGlobal) if (proto == NULL || proto[0] == 0) {
// Check all protocols
- for (unsigned int i = 1; i < proto_items.size(); ++i) {
- if (!ListeningToEnabled(proto_items[i].proto, TRUE)) {
+ for (unsigned int i = 1; i < proto_items.size(); ++i)
+ if (!ListeningToEnabled(proto_items[i].proto, TRUE))
return FALSE;
- }
- }
+
return TRUE;
}
- else {
- char setting[256];
- mir_snprintf(setting, "%sEnabled", proto);
- return db_get_b(NULL, MODULE_NAME, setting, false) != 0;
- }
+
+ char setting[256];
+ mir_snprintf(setting, "%sEnabled", proto);
+ return db_get_b(NULL, MODULE_NAME, setting, false) != 0;
}
INT_PTR ListeningToEnabled(WPARAM wParam, LPARAM)
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index dce4ddc50c..90c9c58293 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -51,11 +51,11 @@ static OptPageControl optionsControls[] = { };
static OptPageControl formatControls[] = {
- { &opts.templ, CONTROL_TEXT, IDC_TEMPLATE, "Template", (DWORD)_T("%artist% - %title%") },
- { &opts.unknown, CONTROL_TEXT, IDC_UNKNOWN, "Unknown", (DWORD)LPGENT("<Unknown>"), 0, 0, 128 },
- { &opts.xstatus_name, CONTROL_TEXT, IDC_XSTATUS_NAME, "XStatusName", (DWORD)LPGENT("Listening to") },
- { &opts.xstatus_message, CONTROL_TEXT, IDC_XSTATUS_MESSAGE, "XStatusMessage", (DWORD)_T("%listening%") },
- { &opts.nothing, CONTROL_TEXT, IDC_NOTHING, "Nothing", (DWORD)LPGENT("<Nothing is playing now>"), 0, 0, 128 }
+ { &opts.templ, CONTROL_TEXT, IDC_TEMPLATE, "Template", (ULONG_PTR)_T("%artist% - %title%") },
+ { &opts.unknown, CONTROL_TEXT, IDC_UNKNOWN, "Unknown", (ULONG_PTR)LPGENT("<Unknown>"), 0, 0, 128 },
+ { &opts.xstatus_name, CONTROL_TEXT, IDC_XSTATUS_NAME, "XStatusName", (ULONG_PTR)LPGENT("Listening to") },
+ { &opts.xstatus_message, CONTROL_TEXT, IDC_XSTATUS_MESSAGE, "XStatusMessage", (ULONG_PTR)_T("%listening%") },
+ { &opts.nothing, CONTROL_TEXT, IDC_NOTHING, "Nothing", (ULONG_PTR)LPGENT("<Nothing is playing now>"), 0, 0, 128 }
};
static OptPageControl playersControls[] = {
|