summaryrefslogtreecommitdiff
path: root/plugins/Scriver/src/tabs.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-11 12:27:21 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-11 12:27:21 +0300
commite02f1e05b363226a48fe9a4b151748a5cbb295d9 (patch)
treee49e428ab703459d65ef7829187dd17b9af4154c /plugins/Scriver/src/tabs.cpp
parent432b115c1eaf6f74d7d4d8ac580f5de39c16a533 (diff)
GC_UPDATETITLE replaced with CSrmmBaseDlg::UpdateTitle
Diffstat (limited to 'plugins/Scriver/src/tabs.cpp')
-rw-r--r--plugins/Scriver/src/tabs.cpp61
1 files changed, 1 insertions, 60 deletions
diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp
index 63ece38006..dc77083ee8 100644
--- a/plugins/Scriver/src/tabs.cpp
+++ b/plugins/Scriver/src/tabs.cpp
@@ -33,65 +33,6 @@ static void DrawTab(ParentWindowData *dat, HWND hwnd, WPARAM wParam, LPARAM lPar
/////////////////////////////////////////////////////////////////////////////////////////
-static const wchar_t *titleTokenNames[] = { L"%name%", L"%status%", L"%statusmsg%", L"%account%" };
-
-wchar_t* GetWindowTitle(MCONTACT hContact, const char *szProto)
-{
- ptrW tmplt;
- const wchar_t* tokens[4] = { 0 };
-
- CMStringW tszTemplate, tszStatus, tszTitle;
- if (hContact && szProto) {
- tokens[0] = pcli->pfnGetContactDisplayName(hContact, 0);
- tokens[1] = pcli->pfnGetStatusModeDescription(db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
-
- tszStatus = ptrW(db_get_wsa(hContact, "CList", "StatusMsg"));
- tszStatus.Replace(L"\r\n", L" ");
- tokens[2] = tszStatus;
-
- char *accModule = Proto_GetBaseAccountName(hContact);
- if (accModule != nullptr) {
- PROTOACCOUNT* proto = Proto_GetAccount(accModule);
- if (proto != nullptr)
- tokens[3] = mir_wstrdup(proto->tszAccountName);
- }
-
- tmplt = db_get_wsa(0, SRMMMOD, SRMSGSET_WINDOWTITLE);
- if (tmplt != nullptr)
- tszTemplate = tmplt;
- else {
- if (g_dat.flags & SMF_STATUSICON)
- tszTemplate = L"%name% - ";
- else
- tszTemplate = L"%name% (%status%) : ";
- }
- }
-
- for (const wchar_t *p = tszTemplate; *p; p++) {
- if (*p == '%') {
- int i;
- for (i = 0; i < _countof(titleTokenNames); i++) {
- size_t tnlen = mir_wstrlen(titleTokenNames[i]);
- if (!wcsncmp(p, titleTokenNames[i], tnlen)) {
- if (tokens[i] != nullptr)
- tszTitle.Append(tokens[i]);
-
- p += tnlen - 1;
- break;
- }
- }
- if (i < _countof(titleTokenNames))
- continue;
- }
- tszTitle.AppendChar(*p);
- }
-
- if (tmplt == nullptr)
- tszTitle.Append(TranslateT("Message session"));
-
- return tszTitle.Detach();
-}
-
static int GetChildCount(ParentWindowData *dat)
{
return TabCtrl_GetItemCount(dat->hwndTabs);
@@ -253,7 +194,7 @@ static void ActivateChild(ParentWindowData *dat, HWND child)
dat->hwndActive = child;
SetupStatusBar(dat);
SendMessage(dat->hwndActive, GC_UPDATESTATUSBAR, 0, 0);
- SendMessage(dat->hwndActive, DM_UPDATETITLEBAR, 0, 0);
+ pDlg->UpdateTitle();
SendMessage(dat->hwndActive, WM_SIZE, 0, 0);
ShowWindow(dat->hwndActive, SW_SHOWNOACTIVATE);
SendMessage(dat->hwndActive, DM_SCROLLLOGTOBOTTOM, 0, 0);