diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-04 11:29:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-04 11:29:41 +0000 |
commit | fe2291a04dc5e9273fc430820b5c4151b0a3a1bb (patch) | |
tree | bf3f51a5ad9478ed9d3f6bf924486f0a430fe9e0 /plugins/Clist_modern | |
parent | 1e20b1b154d9716f9ff9fcc9c4398eb3f5762bf1 (diff) |
fix for the options conversion in clist_modern
git-svn-id: http://svn.miranda-ng.org/main/trunk@11765 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_defsettings.h | 2 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 41 |
2 files changed, 14 insertions, 29 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_defsettings.h b/plugins/Clist_modern/src/hdr/modern_defsettings.h index c36ba12ff4..92c9bd2784 100644 --- a/plugins/Clist_modern/src/hdr/modern_defsettings.h +++ b/plugins/Clist_modern/src/hdr/modern_defsettings.h @@ -37,7 +37,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SETTING_HIDEEMPTYGROUPS_DEFAULT 0 //"CList","HideEmptyGroups"
#define SETTING_USEGROUPS_DEFAULT 1 //"CList","UseGroups"
#define SETTING_PLACEOFFLINETOROOT_DEFAULT 0 //"CList","PlaceOfflineToRoot"
-#define SETTING_ALWAYSPRIMARY_DEFAULT 0 //! "CList","AlwaysPrimary"
#define SETTING_DISABLETRAYFLASH_DEFAULT 0 //! "CList","DisableTrayFlash"
#define SETTING_ICONFLASHTIME_DEFAULT 550 //! "CList","IconFlashTime"
#define SETTING_THINBORDER_DEFAULT 0 //! "CList","ThinBorder"
@@ -217,7 +216,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define SETTING_CYCLETIME_DEFAULT 4 //"CList","CycleTime"
#define SETTING_TRAYICON_DEFAULT SETTING_TRAYICON_SINGLE //"CList","TrayIcon"
#define SETTING_ALWAYSSTATUS_DEFAULT 0 //"CList","AlwaysStatus"
-#define SETTING_ALWAYSMULTI_DEFAULT 0 //"CList","AlwaysMulti"
#define SETTING_BLENDINACTIVESTATE_DEFAULT 0 //"CLC","BlendInActiveState"
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 9f41e7cf91..33dae2a0a1 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -407,15 +407,20 @@ VOID CALLBACK cliTrayCycleTimerProc(HWND, UINT, UINT_PTR, DWORD) void SettingsMigrate(void)
{
BYTE TrayIcon = db_get_b(NULL, "CList", "TrayIcon", 0);
- BYTE AlwaysPrimary = db_get_b(NULL, "CList", "AlwaysPrimary", 1);
+ BYTE AlwaysPrimary = db_get_b(NULL, "CList", "AlwaysPrimary", 0);
BYTE AlwaysMulti = db_get_b(NULL, "CList", "AlwaysMulti", 0);
- char *PrimaryStatus = db_get_sa(NULL, "CList", "PrimaryStatus");
+ ptrA PrimaryStatus(db_get_sa(NULL, "CList", "PrimaryStatus"));
// these strings must always be set
- db_set_s(NULL, "CList", "tiAccS", "");
- db_set_s(NULL, "CList", "tiAccV", "");
+ if (PrimaryStatus) {
+ db_set_s(NULL, "CList", "tiAccS", PrimaryStatus);
+ db_set_s(NULL, "CList", "tiAccV", PrimaryStatus);
+ }
+ else {
+ db_set_s(NULL, "CList", "tiAccS", "");
+ db_set_s(NULL, "CList", "tiAccV", "");
+ }
- // Нужно вычислить новый режим.
switch (TrayIcon) {
case 0: // global or single acc
if (AlwaysPrimary) {
@@ -426,21 +431,11 @@ void SettingsMigrate(void) else { // single acc always
db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_ACC);
db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ACC);
- db_set_s(NULL, "CList", "tiAccS", PrimaryStatus);
- db_set_s(NULL, "CList", "tiAccV", PrimaryStatus);
}
}
else {
- if (!PrimaryStatus) { // global if differ
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_ALL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_GLOBAL);
- }
- else { // single acc if differ
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ACC);
- db_set_s(NULL, "CList", "tiAccS", PrimaryStatus);
- db_set_s(NULL, "CList", "tiAccV", PrimaryStatus);
- }
+ db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
+ db_set_b(NULL, "CList", "tiModeV", (PrimaryStatus) ? TRAY_ICON_MODE_ACC : TRAY_ICON_MODE_GLOBAL);
}
break;
@@ -450,16 +445,8 @@ void SettingsMigrate(void) break;
case 2: // multiple
- switch (AlwaysMulti) {
- case 0: // all accs if differ
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_GLOBAL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
- break;
- case 1: // all accs always
- db_set_b(NULL, "CList", "tiModeS", TRAY_ICON_MODE_ALL);
- db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
- break;
- }
+ db_set_b(NULL, "CList", "tiModeS", (AlwaysMulti) ? TRAY_ICON_MODE_ALL : TRAY_ICON_MODE_GLOBAL);
+ db_set_b(NULL, "CList", "tiModeV", TRAY_ICON_MODE_ALL);
break;
}
}
|