From 40086f4fc370ca92218c805fe5cee10c09f57f2c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 14 May 2018 18:29:31 +0300 Subject: merge with master till: fixes #1358 (StdMsg: "Send on Ctrl+Enter" setting is lost after upgrade) --- plugins/Scriver/src/globals.cpp | 9 ++++-- plugins/Scriver/src/globals.h | 58 +++++++++++++++++++------------------- plugins/Scriver/src/msgdialog.cpp | 7 ++--- plugins/Scriver/src/msgoptions.cpp | 11 ++++++++ plugins/Scriver/src/resource.h | 17 +++++++++-- 5 files changed, 64 insertions(+), 38 deletions(-) (limited to 'plugins/Scriver/src') diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index 0886f048cc..d63e8f29ec 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -423,10 +423,13 @@ void ReloadGlobals() if (db_get_b(0, SRMM_MODULE, SRMSGSET_USEIEVIEW, SRMSGDEFSET_USEIEVIEW)) g_dat.flags |= SMF_USEIEVIEW; - g_dat.buttonVisibility = db_get_dw(0, SRMM_MODULE, SRMSGSET_BUTTONVISIBILITY, SRMSGDEFSET_BUTTONVISIBILITY); - g_dat.chatBbuttonVisibility = db_get_dw(0, SRMM_MODULE, SRMSGSET_CHATBUTTONVISIBILITY, SRMSGDEFSET_CHATBUTTONVISIBILITY); - g_dat.limitNamesLength = db_get_dw(0, SRMM_MODULE, SRMSGSET_LIMITNAMESLEN, SRMSGDEFSET_LIMITNAMESLEN); g_dat.limitTabsNum = db_get_dw(0, SRMM_MODULE, SRMSGSET_LIMITTABSNUM, SRMSGDEFSET_LIMITTABSNUM); g_dat.limitChatsTabsNum = db_get_dw(0, SRMM_MODULE, SRMSGSET_LIMITCHATSTABSNUM, SRMSGDEFSET_LIMITCHATSTABSNUM); + + ptrW wszTitleFormat(db_get_wsa(0, SRMM_MODULE, SRMSGSET_WINDOWTITLE)); + if (wszTitleFormat == nullptr) + g_dat.wszTitleFormat[0] = 0; + else + wcsncpy_s(g_dat.wszTitleFormat, wszTitleFormat, _TRUNCATE); } diff --git a/plugins/Scriver/src/globals.h b/plugins/Scriver/src/globals.h index 652a077f86..eb84086dc3 100644 --- a/plugins/Scriver/src/globals.h +++ b/plugins/Scriver/src/globals.h @@ -79,40 +79,40 @@ typedef struct ImageListUsageEntry_tag struct GlobalMessageData { - unsigned int flags; - unsigned int flags2; - DWORD openFlags; - MWindowList hParentWindowList; - ParentWindowData *lastParent; - ParentWindowData *lastChatParent; - DWORD limitNamesLength; - int activeAlpha; - int inactiveAlpha; - int tabIconListUsageSize; - ImageListUsageEntry *tabIconListUsage; - int smileyAddInstalled; - int popupInstalled; - int ieviewInstalled; - int buttonVisibility; - int chatBbuttonVisibility; - int limitTabsNum; - int limitChatsTabsNum; - int indentSize; + unsigned flags; + unsigned flags2; + DWORD openFlags; + DWORD limitNamesLength; + int activeAlpha; + int inactiveAlpha; + int tabIconListUsageSize; + int smileyAddInstalled; + int popupInstalled; + int ieviewInstalled; + int limitTabsNum; + int limitChatsTabsNum; + int indentSize; HIMAGELIST hTabIconList; HIMAGELIST hButtonIconList; HIMAGELIST hChatButtonIconList; HIMAGELIST hHelperIconList; HIMAGELIST hSearchEngineIconList; - HBRUSH hInfobarBrush; - int toolbarPosition; - HWND hFocusWnd; - DWORD logLineColour; - int logPixelSX; - int logPixelSY; - HICON hMsgIcon; - HICON hMsgIconBig; - HICON hIconChatBig; - int minInputAreaHeight; + HBRUSH hInfobarBrush; + int toolbarPosition; + HWND hFocusWnd; + DWORD logLineColour; + int logPixelSX; + int logPixelSY; + HICON hMsgIcon; + HICON hMsgIconBig; + HICON hIconChatBig; + int minInputAreaHeight; + wchar_t wszTitleFormat[200]; + + MWindowList hParentWindowList; + ParentWindowData *lastParent; + ParentWindowData *lastChatParent; + ImageListUsageEntry *tabIconListUsage; }; int IconsChanged(WPARAM wParam, LPARAM lParam); diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index a9110a2e03..8bc0ff50cc 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -781,9 +781,8 @@ static const wchar_t *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg void CSrmmWindow::UpdateTitle() { CMStringW wszTitle; - ptrW tmplt(db_get_wsa(0, SRMM_MODULE, SRMSGSET_WINDOWTITLE)); - if (tmplt != nullptr) - wszTitle = tmplt; + if (g_dat.wszTitleFormat[0]) + wszTitle = g_dat.wszTitleFormat; else wszTitle = L"%name% - "; @@ -803,7 +802,7 @@ void CSrmmWindow::UpdateTitle() } } - if (tmplt == nullptr) + if (g_dat.wszTitleFormat[0] == 0) wszTitle.Append(TranslateT("Message session")); TitleBarData tbd = {}; diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 0ddefba75d..e8876170e3 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -376,6 +376,7 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar TranslateDialogDefault(hwndDlg); CheckDlgButton(hwndDlg, IDC_SHOWSTATUSBAR, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWSTATUSBAR, SRMSGDEFSET_SHOWSTATUSBAR) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SHOWTITLEBAR, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWTITLEBAR, SRMSGDEFSET_SHOWTITLEBAR) ? BST_CHECKED : BST_UNCHECKED); + SetWindowText(GetDlgItem(hwndDlg, IDC_TITLEFORMAT), g_dat.wszTitleFormat); CheckDlgButton(hwndDlg, IDC_SHOWTOOLBAR, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWBUTTONLINE, SRMSGDEFSET_SHOWBUTTONLINE) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_SHOWINFOBAR, db_get_b(0, SRMM_MODULE, SRMSGSET_SHOWINFOBAR, SRMSGDEFSET_SHOWINFOBAR) ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton(hwndDlg, IDC_TRANSPARENCY, db_get_b(0, SRMM_MODULE, SRMSGSET_USETRANSPARENCY, SRMSGDEFSET_USETRANSPARENCY) ? BST_CHECKED : BST_UNCHECKED); @@ -390,6 +391,9 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETRANGE, 0, MAKELONG(100, 1)); SendDlgItemMessage(hwndDlg, IDC_INPUTLINESSPIN, UDM_SETPOS, 0, db_get_w(0, SRMM_MODULE, SRMSGSET_AUTORESIZELINES, SRMSGDEFSET_AUTORESIZELINES)); + bChecked = IsDlgButtonChecked(hwndDlg, IDC_SHOWTITLEBAR); + EnableWindow(GetDlgItem(hwndDlg, IDC_TITLEFORMAT), bChecked); + bChecked = IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENCY); EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYVALUE), bChecked); EnableWindow(GetDlgItem(hwndDlg, IDC_ATRANSPARENCYPERC), bChecked); @@ -414,6 +418,10 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENCYTEXT2), bChecked); break; + case IDC_SHOWTITLEBAR: + bChecked = IsDlgButtonChecked(hwndDlg, IDC_SHOWTITLEBAR); + EnableWindow(GetDlgItem(hwndDlg, IDC_TITLEFORMAT), bChecked); + case IDC_INPUTLINES: if (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; @@ -439,6 +447,9 @@ static INT_PTR CALLBACK DlgProcLayoutOptions(HWND hwndDlg, UINT msg, WPARAM wPar break; case PSN_APPLY: + GetWindowText(GetDlgItem(hwndDlg, IDC_TITLEFORMAT), g_dat.wszTitleFormat, _countof(g_dat.wszTitleFormat)); + db_set_ws(0, SRMM_MODULE, SRMSGSET_WINDOWTITLE, g_dat.wszTitleFormat); + db_set_b(0, SRMM_MODULE, SRMSGSET_SHOWSTATUSBAR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUSBAR)); db_set_b(0, SRMM_MODULE, SRMSGSET_SHOWTITLEBAR, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTITLEBAR)); db_set_b(0, SRMM_MODULE, SRMSGSET_SHOWBUTTONLINE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWTOOLBAR)); diff --git a/plugins/Scriver/src/resource.h b/plugins/Scriver/src/resource.h index 7b429acd80..37bb17e72b 100644 --- a/plugins/Scriver/src/resource.h +++ b/plugins/Scriver/src/resource.h @@ -73,6 +73,7 @@ #define IDC_HYPERLINKHAND 600 #define IDC_DRAGCURSOR 601 #define IDC_TABS 1000 +#define IDC_TITLEFORMAT 1002 #define IDC_AUTOPOPUP 1003 #define IDC_AUTOMIN 1005 #define IDC_STAYMINIMIZED 1006 @@ -165,6 +166,18 @@ #define IDC_XSTATUSICON 1646 #define IDC_INPUTLINES 1647 #define IDC_INPUTLINESSPIN 1648 +#define IDC_SRMM_COLOR 3001 +#define IDC_SRMM_BKGCOLOR 3002 +#define IDC_SRMM_BOLD 3003 +#define IDC_SRMM_ITALICS 3004 +#define IDC_SRMM_UNDERLINE 3005 +#define IDC_SRMM_FILTER 3006 +#define IDC_SRMM_CHANMGR 3007 +#define IDC_SRMM_SHOWNICKLIST 3008 +#define IDC_SRMM_HISTORY 3009 +#define IDC_SRMM_NICKLIST 3010 +#define IDC_SRMM_LOG 3011 +#define IDC_SRMM_MESSAGE 3012 #define IDC_SPLITTERX 5006 #define IDC_SPLITTERY 5008 #define IDC_CHAT_CHECKBOXES 5021 @@ -234,9 +247,9 @@ // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 +#define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1002 +#define _APS_NEXT_CONTROL_VALUE 1003 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif -- cgit v1.2.3