summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src/chat/main.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-27 13:31:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-27 13:31:25 +0000
commit125d5bac9e4e10a4ac585df5840199739f88df32 (patch)
treed21dcaea58c396dc2dc7ef601e7474acc5686b03 /plugins/TabSRMM/src/chat/main.cpp
parent4439a8e4385108406c1c684debf3c8e29f9aa549 (diff)
revert #n+1 of nicklist colors in chats
git-svn-id: http://svn.miranda-ng.org/main/trunk@7915 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/chat/main.cpp')
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index e13811a375..5374f54858 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -193,7 +193,7 @@ static void OnLoadSettings()
int ih2 = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListFonts[CHAT_STATUS_AWAY], false);
g_Settings.iNickListFontHeight = max(M.GetByte(CHAT_MODULE, "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
- for (int i = 0; i < 7; i++) {
+ for (int i = 0; i < 5; i++) {
char szBuf[40];
mir_snprintf(szBuf, 20, "NickColor%d", i);
g_Settings.nickColors[i] = M.GetDword(CHAT_MODULE, szBuf, g_Settings.UserListColors[0]);
@@ -229,7 +229,7 @@ static void CheckUpdate()
{
// already converted?
int compat = db_get_b(NULL, "Compatibility", "TabChatFonts", 0);
- if (compat >= 2)
+ if (compat >= 3)
return;
if (compat == 0) {
@@ -251,13 +251,25 @@ static void CheckUpdate()
}
CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)CHAT_OLDFONTMODULE);
+ compat++;
}
- DWORD oldBackColor = db_get_dw(0, FONTMODULE, "BkgColourMUC", SRMSGDEFSET_BKGCOLOUR);
- db_set_dw(NULL, CHAT_MODULE, "ColorLogBG", oldBackColor);
- db_unset(0, FONTMODULE, "BkgColourMUC");
+ if (compat == 1) {
+ DWORD oldBackColor = db_get_dw(0, FONTMODULE, "BkgColourMUC", SRMSGDEFSET_BKGCOLOUR);
+ db_set_dw(NULL, CHAT_MODULE, "ColorLogBG", oldBackColor);
+ db_unset(0, FONTMODULE, "BkgColourMUC");
+ compat++;
+ }
+
+ if (compat == 2) {
+ COLORREF color0 = M.GetDword(CHAT_MODULE, "NickColor2", 0);
+ COLORREF color2 = M.GetDword(CHAT_MODULE, "NickColor0", 0);
+ db_set_dw(NULL, CHAT_MODULE, "NickColor0", color0);
+ db_set_dw(NULL, CHAT_MODULE, "NickColor2", color2);
+ compat++;
+ }
- db_set_b(NULL, "Compatibility", "TabChatFonts", 2);
+ db_set_b(NULL, "Compatibility", "TabChatFonts", 3);
}
int Chat_Load()