diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-11 08:59:52 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-11 08:59:52 +0000 |
commit | db3992b55d0616896da4f616dfd09fac6642b292 (patch) | |
tree | 8a6624e32dfa68b67e168e333c4f7df4701929ec /plugins/Clist_modern/modern_toolbar.cpp | |
parent | 48e3bbf926d0a676d0c5e338c31144ee4209e113 (diff) |
- modern toolbar bug emulation
- useless field privateIcon removed;
- another useless code removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@897 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_toolbar.cpp')
-rw-r--r-- | plugins/Clist_modern/modern_toolbar.cpp | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp index 079946d9bf..10a1bda377 100644 --- a/plugins/Clist_modern/modern_toolbar.cpp +++ b/plugins/Clist_modern/modern_toolbar.cpp @@ -50,6 +50,8 @@ static BTNS[] = { "Minimize","Minimize", "CList/ShowHide", "Minimize", NULL, 180 , IDI_RESETVIEW, IDI_RESETVIEW, FALSE }
};
+void SetButtonPressed(HANDLE hButton, int state);
+
static int Modern_InitButtons(WPARAM, LPARAM)
{
TTBButton tbb = { 0 };
@@ -81,10 +83,9 @@ static int Modern_InitButtons(WPARAM, LPARAM) BTNS[i].hButton = TopToolbar_AddButton(&tbb);
}
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[3].hButton, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? TTBST_PUSHED : TTBST_RELEASED);
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[6].hButton, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? TTBST_PUSHED : TTBST_RELEASED);
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[7].hButton, db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT) ? TTBST_PUSHED : TTBST_RELEASED);
-
+ SetButtonPressed(BTNS[3].hButton, db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
+ SetButtonPressed(BTNS[6].hButton, db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ SetButtonPressed(BTNS[7].hButton, db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
return 1;
}
@@ -125,13 +126,13 @@ static int ehhToolBarSettingsChanged(WPARAM wParam, LPARAM lParam) if (!mir_strcmp(cws->szModule,"CList")) {
if (!mir_strcmp(cws->szSetting,"HideOffline"))
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[3].hButton, cws->value.bVal ? TTBST_PUSHED : TTBST_RELEASED);
+ SetButtonPressed(BTNS[3].hButton, cws->value.bVal);
else if (!mir_strcmp(cws->szSetting,"UseGroups"))
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[6].hButton, cws->value.bVal ? TTBST_PUSHED : TTBST_RELEASED);
+ SetButtonPressed(BTNS[6].hButton, cws->value.bVal);
}
else if (!mir_strcmp(cws->szModule,"Skin")) {
if (!mir_strcmp(cws->szSetting,"UseSound"))
- CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)BTNS[7].hButton, cws->value.bVal ? TTBST_PUSHED : TTBST_RELEASED);
+ SetButtonPressed(BTNS[7].hButton, cws->value.bVal);
}
return 0;
@@ -336,7 +337,8 @@ static void CopySettings(const char* to, const char* from) HRESULT ToolbarLoadModule()
{
- if ( db_get_b(NULL, "CLUI", "ShowButtonBar", -1) != -1) {
+ BYTE bOldSetting = db_get_b(NULL, "CLUI", "ShowButtonBar", 255);
+ if (bOldSetting != 255) {
CopySettings("BUTTWIDTH", "option_Bar0_BtnWidth");
CopySettings("BUTTHEIGHT", "option_Bar0_BtnHeight");
CopySettings("BUTTGAP", "option_Bar0_BtnSpace");
@@ -347,8 +349,9 @@ HRESULT ToolbarLoadModule() CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)"ModernToolBar");
- if (IDYES == MessageBox(NULL, TranslateTS(szWarning), TranslateT("Toolbar upgrade"), MB_ICONQUESTION | MB_YESNO))
- CallService(MS_UTILS_OPENURL, 0, (LPARAM)szUrl);
+ if (bOldSetting == 1)
+ if (IDYES == MessageBox(NULL, TranslateTS(szWarning), TranslateT("Toolbar upgrade"), MB_ICONQUESTION | MB_YESNO))
+ CallService(MS_UTILS_OPENURL, 0, (LPARAM)szUrl);
}
ehhToolBarBackgroundSettingsChanged(0,0);
|