summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2013-02-01 05:46:36 +0000
committerKirill Volinsky <mataes2007@gmail.com>2013-02-01 05:46:36 +0000
commit84dedc9d7c81e97c9fc07f0ca97e34300b706e19 (patch)
tree80d5a1f424830a2b84340b54524eb7e2138cebb8 /plugins/TabSRMM/src
parentdf60e52a47f80d89de55affae33d93f79e077885 (diff)
common options for all logs moved to always visible settings
git-svn-id: http://svn.miranda-ng.org/main/trunk@3383 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp2
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TabSRMM/src/include/msgs.h6
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp4
-rw-r--r--plugins/TabSRMM/src/translator.cpp21
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp9
6 files changed, 25 insertions, 21 deletions
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 4f86fe2654..47a8f6b536 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -1370,7 +1370,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
POINT pt={LOWORD(lParam), HIWORD(lParam)};
CheckCustomLink(hwnd, &pt, msg, wParam, lParam, TRUE);
}
- if (true || M->GetByte("autocopy", 0)) {
+ if (M->GetByte("autocopy", 0)) {
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM) &sel);
if (sel.cpMin != sel.cpMax) {
SendMessage(hwnd, WM_COPY, 0, 0);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 16e335c2c8..f05f0f9ff3 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -248,7 +248,7 @@ void CGlobals::reloadSettings(bool fReloadSkins)
m_CutContactNameTo = (int) DBGetContactSettingWord(NULL, SRMSGMOD_T, "cut_at", 15);
m_CutContactNameOnTabs = (int)M->GetByte("cuttitle", 0);
m_StatusOnTabs = (int)M->GetByte("tabstatus", 1);
- m_LogStatusChanges = (int)dwFlags & MWF_LOG_STATUSCHANGES;
+ m_LogStatusChanges = (int)M->GetByte("logstatuschanges", 0);
m_UseDividers = (int)M->GetByte("usedividers", 0);
m_DividersUsePopupConfig = (int)M->GetByte("div_popupconfig", 0);
m_MsgTimeout = (int)M->GetDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
@@ -746,7 +746,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
DWORD dwMask = M->GetDword(hContact, SRMSGMOD_T, "mwmask", 0);
DWORD dwFlags = M->GetDword(hContact, SRMSGMOD_T, "mwflags", 0);
- bool fLocal = ((dwMask & MWF_LOG_STATUSCHANGES) ? (dwFlags & MWF_LOG_STATUSCHANGES ? true : false) : false);
+ bool fLocal = M->GetByte(hContact, "logstatuschanges", 0);
if (fGlobal || fLocal) {
/*
diff --git a/plugins/TabSRMM/src/include/msgs.h b/plugins/TabSRMM/src/include/msgs.h
index 60fb8e6487..fe24199adb 100644
--- a/plugins/TabSRMM/src/include/msgs.h
+++ b/plugins/TabSRMM/src/include/msgs.h
@@ -82,10 +82,8 @@
#define MWF_LOG_SWAPNICK 131072
//
//#define MWF_LOG_BBCODE 65536
-//#define MWF_LOG_STATUSCHANGES 131072
//#define MWF_LOG_LOCALTIME 8192
#define MWF_LOG_BBCODE 1
-#define MWF_LOG_STATUSCHANGES 32
#define MWF_LOG_LOCALTIME 64
#define MWF_LOG_SHOWICONS 262144
@@ -506,9 +504,9 @@ struct TNewWindowData {
MWF_LOG_SHOWDATES | MWF_LOG_INDENT | MWF_LOG_TEXTFORMAT | MWF_LOG_SYMBOLS | MWF_LOG_INOUTICONS | \
MWF_LOG_SHOWICONS | MWF_LOG_GRID | MWF_LOG_GROUPMODE | \
MWF_LOG_RTL | MWF_LOG_BBCODE | MWF_LOG_LOCALTIME/*MAD:*/ | \
- MWF_LOG_STATUSCHANGES|MWF_LOG_NEWLINE|MWF_LOG_UNDERLINE|MWF_LOG_SWAPNICK /*_MAD*/)
+ MWF_LOG_NEWLINE|MWF_LOG_UNDERLINE|MWF_LOG_SWAPNICK /*_MAD*/)
-#define MWF_LOG_DEFAULT (MWF_LOG_SHOWTIME | MWF_LOG_NORMALTEMPLATES | MWF_LOG_SHOWDATES | MWF_LOG_SYMBOLS | MWF_LOG_GRID | MWF_LOG_STATUSCHANGES | MWF_LOG_INOUTICONS)
+#define MWF_LOG_DEFAULT (MWF_LOG_SHOWTIME | MWF_LOG_NORMALTEMPLATES | MWF_LOG_SHOWDATES | MWF_LOG_SYMBOLS | MWF_LOG_GRID | MWF_LOG_INOUTICONS)
/*
* custom dialog window messages
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 918fb3afde..3b394d5975 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -310,7 +310,7 @@ void TSAPI WriteStatsOnClose(TWindowData *dat)
return;
- if (dat->hContact != 0 &&(PluginConfig.m_LogStatusChanges != 0) && dat->dwFlags & MWF_LOG_STATUSCHANGES) {
+ if (dat->hContact != 0 &&(PluginConfig.m_LogStatusChanges != 0) && M->GetByte(dat->hContact, "logstatuschanges", 0)) {
mir_snprintf(buffer, sizeof(buffer), "Session close - active for: %d:%02d:%02d, Sent: %d (%d), Rcvd: %d (%d)", now / 3600, now / 60, now % 60, dat->stats.iSent, dat->stats.iSentBytes, dat->stats.iReceived, dat->stats.iReceivedBytes);
dbei.cbSize = sizeof(dbei);
dbei.pBlob = (PBYTE) buffer;
@@ -472,7 +472,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
} else if (menuId == MENU_LOGMENU) {
int iLocalTime = 0;
int iRtl = (PluginConfig.m_RTLDefault == 0 ? M->GetByte(dat->hContact, "RTL", 0) : M->GetByte(dat->hContact, "RTL", 1));
- int iLogStatus = (PluginConfig.m_LogStatusChanges != 0) && dat->dwFlags & MWF_LOG_STATUSCHANGES;
+ int iLogStatus = (PluginConfig.m_LogStatusChanges != 0) && M->GetByte(dat->hContact, "logstatuschanges", 0);
DWORD dwOldFlags = dat->dwFlags;
diff --git a/plugins/TabSRMM/src/translator.cpp b/plugins/TabSRMM/src/translator.cpp
index a9986c97d7..7b7d5ebdb2 100644
--- a/plugins/TabSRMM/src/translator.cpp
+++ b/plugins/TabSRMM/src/translator.cpp
@@ -114,13 +114,14 @@ TOptionListItem m_lvItemsMsg[] = {
0, LPGENT("Enable \"Paste and send\" feature"), 0, LOI_TYPE_SETTING, (UINT_PTR)"pasteandsend", 1,
0, LPGENT("Allow BBCode formatting in outgoing messages"), 0, LOI_TYPE_SETTING, (UINT_PTR)"sendformat", 1,
0, LPGENT("Automatically split long messages (experimental, use with care)"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autosplit", 2,
+ 0, LPGENT("Log status changes"), 0, LOI_TYPE_SETTING, (UINT_PTR)"logstatuschanges", 2,
+ 0, LPGENT("Automatically copy selected text"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2,
0, NULL, 0, 0, 0, 0
};
TOptionListGroup m_lvGroupsLog[] = {
0, LPGENT("Message log appearance"),
0, LPGENT("Support for external plugins"),
- 0, LPGENT("Other options"),
0, LPGENT("Additional events to show"),
0, LPGENT("Timestamp settings (note: timstamps also depend on your templates)"),
0, LPGENT("Message log icons"),
@@ -128,15 +129,15 @@ TOptionListGroup m_lvGroupsLog[] = {
};
TOptionListItem m_lvItemsLog[] = {
- 0, LPGENT("Show file events"), 1, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SHOWFILES, 3,
- 0, LPGENT("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 4,
- 0, LPGENT("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 4,
- 0, LPGENT("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 4,
- 0, LPGENT("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 4,
+ 0, LPGENT("Show file events"), 1, LOI_TYPE_SETTING, (UINT_PTR)SRMSGSET_SHOWFILES, 2,
+ 0, LPGENT("Show timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWTIME, 3,
+ 0, LPGENT("Show dates in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWDATES, 3,
+ 0, LPGENT("Show seconds in timestamps"), 1, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_SHOWSECONDS, 3,
+ 0, LPGENT("Use contacts local time (if timezone info available)"), 0, LOI_TYPE_FLAG, (UINT_PTR)MWF_LOG_LOCALTIME, 3,
0, LPGENT("Draw grid lines"), 1, LOI_TYPE_FLAG, MWF_LOG_GRID, 0,
- 0, LPGENT("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 5,
- 0, LPGENT("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 5,
- 0, LPGENT("Use Incoming/Outgoing Icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 5,
+ 0, LPGENT("Event type icons in the message log"), 1, LOI_TYPE_FLAG, MWF_LOG_SHOWICONS, 4,
+ 0, LPGENT("Text symbols as event markers"), 0, LOI_TYPE_FLAG, MWF_LOG_SYMBOLS, 4,
+ 0, LPGENT("Use Incoming/Outgoing Icons"), 1, LOI_TYPE_FLAG, MWF_LOG_INOUTICONS, 4,
0, LPGENT("Use Message Grouping"), 1, LOI_TYPE_FLAG, MWF_LOG_GROUPMODE, 0,
0, LPGENT("Indent message body"), 1, LOI_TYPE_FLAG, MWF_LOG_INDENT, 0,
0, LPGENT("Simple text formatting (*bold* etc.)"), 0, LOI_TYPE_FLAG, MWF_LOG_TEXTFORMAT, 0,
@@ -150,8 +151,6 @@ TOptionListItem m_lvItemsLog[] = {
0, LPGENT("Underline timestamp/nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_UNDERLINE, 1,
0, LPGENT("Show timestamp after nickname (IEView Compatibility Mode)"), 0, LOI_TYPE_FLAG, MWF_LOG_SWAPNICK, 1,
//
- 0, LPGENT("Log status changes"), 1, LOI_TYPE_FLAG, MWF_LOG_STATUSCHANGES, 2,
- 0, LPGENT("Automatically copy selected text"), 0, LOI_TYPE_SETTING, (UINT_PTR)"autocopy", 2,
0, LPGENT("Use normal templates (uncheck to use simple templates if your template set supports them)"), 1, LOI_TYPE_FLAG, MWF_LOG_NORMALTEMPLATES, 0,
0, NULL, 0, 0, 0, 0
};
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 164191d833..e176f14dbd 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -329,7 +329,6 @@ static struct _checkboxes {
IDC_UPREFS_GROUPING, MWF_LOG_GROUPMODE,
IDC_UPREFS_BBCODE, MWF_LOG_BBCODE,
IDC_UPREFS_RTL, MWF_LOG_RTL,
- IDC_UPREFS_LOGSTATUS, MWF_LOG_STATUSCHANGES,
IDC_UPREFS_NORMALTEMPLATES, MWF_LOG_NORMALTEMPLATES,
0, 0
};
@@ -406,6 +405,10 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
CheckDlgButton(hwndDlg, checkboxes[i].uId, BST_INDETERMINATE);
i++;
}
+ if (M->GetByte("logstatuschanges", 0) == M->GetByte(hContact, "logstatuschanges", 0))
+ CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, BST_INDETERMINATE);
+ else
+ CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, M->GetByte(hContact, "logstatuschanges", 0) ? BST_CHECKED : BST_UNCHECKED);
break;
}
case WM_USER + 100: {
@@ -428,6 +431,10 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
}
i++;
}
+ state = IsDlgButtonChecked(hwndDlg, IDC_UPREFS_LOGSTATUS);
+ if (state != BST_INDETERMINATE) {
+ M->WriteByte(hContact, SRMSGMOD_T, "logstatuschanges", (BYTE)state);
+ }
if (dwMask) {
M->WriteDword(hContact, SRMSGMOD_T, "mwmask", dwMask);
M->WriteDword(hContact, SRMSGMOD_T, "mwflags", dwFlags);