diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-19 12:02:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-19 12:02:16 +0000 |
commit | 085b45f2920353f055b036c00ebb27fb1b8148e9 (patch) | |
tree | 9b172d62bdbc8ac065368dd99d843899d9f10580 /plugins/Scriver/src | |
parent | bd79fceb18897a5cf49ac5175882dcbf03673847 (diff) |
boolean field names normalization
git-svn-id: http://svn.miranda-ng.org/main/trunk@7753 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Scriver/src')
-rw-r--r-- | plugins/Scriver/src/chat/chat.h | 6 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/main.cpp | 2 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/options.cpp | 41 | ||||
-rw-r--r-- | plugins/Scriver/src/chat/window.cpp | 10 |
4 files changed, 30 insertions, 29 deletions
diff --git a/plugins/Scriver/src/chat/chat.h b/plugins/Scriver/src/chat/chat.h index 44623a8f68..a36cb817f9 100644 --- a/plugins/Scriver/src/chat/chat.h +++ b/plugins/Scriver/src/chat/chat.h @@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define EM_ACTIVATE (WM_USER+202)
-#define TIMERID_MSGSEND 1
-#define TIMERID_TYPE 2
-#define TIMERID_UNREAD 3
+#define TIMERID_MSGSEND 201
+#define TIMERID_TYPE 202
+#define TIMERID_UNREAD 203
#define TIMEOUT_TYPEOFF 10000 // send type off after 10 seconds of inactivity
#define TIMEOUT_UNREAD 800 // multiple-send bombproofing: send max 3 messages every 4 seconds
diff --git a/plugins/Scriver/src/chat/main.cpp b/plugins/Scriver/src/chat/main.cpp index c5a3c2d8cb..b4a3de264b 100644 --- a/plugins/Scriver/src/chat/main.cpp +++ b/plugins/Scriver/src/chat/main.cpp @@ -108,7 +108,7 @@ static void OnSetStatus(SESSION_INFO *si, int wStatus) static void OnFlashWindow(SESSION_INFO *si, int bInactive)
{
- if (bInactive && si->hWnd && db_get_b(NULL, "Chat", "FlashWindowHighlight", 0) != 0)
+ if (bInactive && si->hWnd && g_Settings.bFlashWindowHighlight)
SendMessage(GetParent(si->hWnd), CM_STARTFLASHING, 0, 0);
if (bInactive && si->hWnd)
SendMessage(si->hWnd, GC_SETMESSAGEHIGHLIGHT, 0, 0);
diff --git a/plugins/Scriver/src/chat/options.cpp b/plugins/Scriver/src/chat/options.cpp index 0ba390c71b..565449481e 100644 --- a/plugins/Scriver/src/chat/options.cpp +++ b/plugins/Scriver/src/chat/options.cpp @@ -36,7 +36,7 @@ struct branch_t static struct branch_t branch1[] = {
{ LPGENT("Flash when someone speaks"), "FlashWindow", 0, 0, NULL },
- { LPGENT("Flash when a word is highlighted"), "FlashWindowHighlight", 0, 1, NULL },
+ { LPGENT("Flash when a word is highlighted"), "bFlashWindowHighlight", 0, 1, NULL },
{ LPGENT("Show chat user list"), "ShowNicklist", 0, 1, NULL },
{ LPGENT("Enable button context menus"), "RightClickFilter", 0, 0, NULL },
{ LPGENT("Show topic on your contact list (if supported)"), "TopicOnClist", 0, 0, NULL },
@@ -54,9 +54,9 @@ static struct branch_t branch2[] = { GC_EVENT_KICK | GC_EVENT_NOTICE | GC_EVENT_NICK | GC_EVENT_INFORMATION | GC_EVENT_ADDSTATUS, 0, NULL },
{ LPGENT("Prefix all events with a timestamp"), "ShowTimeStamp", 0, 1, NULL },
{ LPGENT("Only prefix with timestamp if it has changed"), "ShowTimeStampIfChanged", 0, 0, NULL },
- { LPGENT("Timestamp has same color as event"), "TimeStampEventColour", 0, 0, NULL },
- { LPGENT("Indent the second line of a message"), "LogIndentEnabled", 0, 1, NULL },
- { LPGENT("Limit user names to 20 characters"), "LogLimitNames", 0, 1, NULL },
+ { LPGENT("Timestamp has same color as event"), "bTimeStampEventColour", 0, 0, NULL },
+ { LPGENT("Indent the second line of a message"), "bLogIndentEnabled", 0, 1, NULL },
+ { LPGENT("Limit user names to 20 characters"), "bLogLimitNames", 0, 1, NULL },
{ LPGENT("Strip colors from messages"), "StripFormatting", 0, 0, NULL },
{ LPGENT("Enable \'event filter\' for new rooms"), "FilterEnabled", 0, 0, NULL }
};
@@ -76,7 +76,7 @@ static struct branch_t branch3[] = { };
static struct branch_t branch4[] = {
- { LPGENT("Show icons in tray only when the chat room is not active"), "TrayIconInactiveOnly", 0, 1, NULL },
+ { LPGENT("Show icons in tray only when the chat room is not active"), "bTrayIconInactiveOnly", 0, 1, NULL },
{ LPGENT("Show icon in tray for topic changes"), "TrayIconFlags", GC_EVENT_TOPIC, 0, NULL },
{ LPGENT("Show icon in tray for users joining"), "TrayIconFlags", GC_EVENT_JOIN, 0, NULL },
{ LPGENT("Show icon in tray for users disconnecting"), "TrayIconFlags", GC_EVENT_QUIT, 0, NULL },
@@ -326,6 +326,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch1, SIZEOF(branch1));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), branch4, SIZEOF(branch4));
+ pci->ReloadSettings();
pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
}
return TRUE;
@@ -405,13 +406,13 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa SetDlgItemText(hwndDlg, IDC_CHAT_TIMESTAMP, g_Settings.pszTimeStamp);
SetDlgItemText(hwndDlg, IDC_CHAT_OUTSTAMP, g_Settings.pszOutgoingNick);
SetDlgItemText(hwndDlg, IDC_CHAT_INSTAMP, g_Settings.pszIncomingNick);
- CheckDlgButton(hwndDlg, IDC_CHAT_HIGHLIGHT, g_Settings.HighlightEnabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS), g_Settings.HighlightEnabled ? TRUE : FALSE);
- CheckDlgButton(hwndDlg, IDC_CHAT_LOGGING, g_Settings.LoggingEnabled);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), g_Settings.LoggingEnabled ? TRUE : FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRCHOOSE), g_Settings.LoggingEnabled ? TRUE : FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMIT), g_Settings.LoggingEnabled ? TRUE : FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMITTEXT2), g_Settings.LoggingEnabled ? TRUE : FALSE);
+ CheckDlgButton(hwndDlg, IDC_CHAT_HIGHLIGHT, g_Settings.bHighlightEnabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_HIGHLIGHTWORDS), g_Settings.bHighlightEnabled ? TRUE : FALSE);
+ CheckDlgButton(hwndDlg, IDC_CHAT_LOGGING, g_Settings.bLoggingEnabled);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRECTORY), g_Settings.bLoggingEnabled ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LOGDIRCHOOSE), g_Settings.bLoggingEnabled ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMIT), g_Settings.bLoggingEnabled ? TRUE : FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHAT_LIMITTEXT2), g_Settings.bLoggingEnabled ? TRUE : FALSE);
hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Appearance"), db_get_b(NULL, "Chat", "Branch2Exp", 0) ? TRUE : FALSE);
hListHeading3 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHAT_CHECKBOXES), TranslateT("Default events to show in new chat rooms if the \'event filter\' is enabled"), db_get_b(NULL, "Chat", "Branch3Exp", 0) ? TRUE : FALSE);
@@ -579,11 +580,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa }
else db_unset(NULL, "Chat", "HeaderOutgoing");
- g_Settings.HighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_HIGHLIGHT) == BST_CHECKED ? TRUE : FALSE;
- db_set_b(NULL, "Chat", "HighlightEnabled", (BYTE)g_Settings.HighlightEnabled);
+ g_Settings.bHighlightEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_HIGHLIGHT) == BST_CHECKED ? TRUE : FALSE;
+ db_set_b(NULL, "Chat", "bHighlightEnabled", (BYTE)g_Settings.bHighlightEnabled);
- g_Settings.LoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE;
- db_set_b(NULL, "Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
+ g_Settings.bLoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_CHAT_LOGGING) == BST_CHECKED ? TRUE : FALSE;
+ db_set_b(NULL, "Chat", "bLoggingEnabled", (BYTE)g_Settings.bLoggingEnabled);
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_GETPOS, 0, 0);
db_set_w(NULL, "Chat", "LogLimit", (WORD)iLen);
@@ -598,11 +599,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lPa g_Settings.dwIconFlags = db_get_dw(NULL, "Chat", "IconFlags", 0x0000);
g_Settings.dwTrayIconFlags = db_get_dw(NULL, "Chat", "TrayIconFlags", 0x1000);
g_Settings.dwPopupFlags = db_get_dw(NULL, "Chat", "PopupFlags", 0x0000);
- g_Settings.StripFormat = (BOOL)db_get_b(NULL, "Chat", "TrimFormatting", 0);
- g_Settings.TrayIconInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "TrayIconInactiveOnly", 1);
- g_Settings.PopupInactiveOnly = (BOOL)db_get_b(NULL, "Chat", "PopUpInactiveOnly", 1);
+ g_Settings.bStripFormat = db_get_b(NULL, "Chat", "TrimFormatting", 0) != 0;
+ g_Settings.bTrayIconInactiveOnly = db_get_b(NULL, "Chat", "bTrayIconInactiveOnly", 1) != 0;
+ g_Settings.bPopupInactiveOnly = db_get_b(NULL, "Chat", "PopUpInactiveOnly", 1) != 0;
+ g_Settings.bLogIndentEnabled = (db_get_b(NULL, "Chat", "bLogIndentEnabled", 1) != 0) ? TRUE : FALSE;
- g_Settings.LogIndentEnabled = (db_get_b(NULL, "Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
pci->MM_FontsChanged();
pci->SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
return TRUE;
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index e32ff87438..6058e281c8 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -284,7 +284,7 @@ LBL_SkipEnd: dat->szSearchResult = mir_tstrdup(pszName);
if (end != start) {
ptrT szReplace;
- if (!isRoom && !isTopic && g_Settings.AddColonToAutoComplete && start == 0) {
+ if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
szReplace = (TCHAR *)mir_alloc((_tcslen(pszName) + 4) * sizeof(TCHAR));
_tcscpy(szReplace, pszName);
_tcscat(szReplace, _T(": "));
@@ -1341,14 +1341,14 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR si->wState |= GC_EVENT_HIGHLIGHT;
SendMessage(si->hWnd, GC_FIXTABICONS, 0, 0);
SendMessage(hwndDlg, DM_UPDATETITLEBAR, 0, 0);
- if (db_get_b(NULL, "Chat", "FlashWindowHighlight", 0) != 0 && GetActiveWindow() != hwndDlg && GetForegroundWindow() != GetParent(hwndDlg))
+ if (g_Settings.bFlashWindowHighlight && GetActiveWindow() != hwndDlg && GetForegroundWindow() != GetParent(hwndDlg))
SendMessage(GetParent(si->hWnd), CM_STARTFLASHING, 0, 0);
break;
case GC_SETTABHIGHLIGHT:
SendMessage(si->hWnd, GC_FIXTABICONS, 0, 0);
SendMessage(hwndDlg, DM_UPDATETITLEBAR, 0, 0);
- if (g_Settings.FlashWindow && GetActiveWindow() != GetParent(hwndDlg) && GetForegroundWindow() != GetParent(hwndDlg))
+ if (g_Settings.bFlashWindow && GetActiveWindow() != GetParent(hwndDlg) && GetForegroundWindow() != GetParent(hwndDlg))
SendMessage(GetParent(si->hWnd), CM_STARTFLASHING, 0, 0);
break;
@@ -1425,7 +1425,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR else //if (dis->itemState & ODS_INACTIVE)
FillRect(dis->hDC, &dis->rcItem, pci->hListBkgBrush);
- if (g_Settings.ShowContactStatus && g_Settings.ContactStatusFirst && ui->ContactStatus) {
+ if (g_Settings.bShowContactStatus && g_Settings.bContactStatusFirst && ui->ContactStatus) {
HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 3, hIcon, 16, 16, 0, NULL, DI_NORMAL);
Skin_ReleaseIcon(hIcon);
@@ -1433,7 +1433,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR }
DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset, hIcon, 10, 10, 0, NULL, DI_NORMAL);
x_offset += 12;
- if (g_Settings.ShowContactStatus && !g_Settings.ContactStatusFirst && ui->ContactStatus) {
+ if (g_Settings.bShowContactStatus && !g_Settings.bContactStatusFirst && ui->ContactStatus) {
HICON hIcon = LoadSkinnedProtoIcon(si->pszModule, ui->ContactStatus);
DrawIconEx(dis->hDC, x_offset, dis->rcItem.top + offset - 3, hIcon, 16, 16, 0, NULL, DI_NORMAL);
Skin_ReleaseIcon(hIcon);
|