diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-11 12:27:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-11 12:27:21 +0300 |
commit | e02f1e05b363226a48fe9a4b151748a5cbb295d9 (patch) | |
tree | e49e428ab703459d65ef7829187dd17b9af4154c /plugins/TabSRMM/src/generic_msghandlers.cpp | |
parent | 432b115c1eaf6f74d7d4d8ac580f5de39c16a533 (diff) |
GC_UPDATETITLE replaced with CSrmmBaseDlg::UpdateTitle
Diffstat (limited to 'plugins/TabSRMM/src/generic_msghandlers.cpp')
-rw-r--r-- | plugins/TabSRMM/src/generic_msghandlers.cpp | 105 |
1 files changed, 3 insertions, 102 deletions
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 88cc78091c..40bcd17ce3 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1080,9 +1080,9 @@ void CTabBaseDlg::DM_Typing(bool fForceOff) HandleIconFeedback(this, (HICON)-1); CTabBaseDlg *dat_active = (CTabBaseDlg*)GetWindowLongPtr(m_pContainer->hwndActive, GWLP_USERDATA); if (dat_active && !dat_active->isChat()) - SendMessage(hwndContainer, DM_UPDATETITLE, 0, 0); + m_pContainer->UpdateTitle(0); else - SendMessage(hwndContainer, DM_UPDATETITLE, (WPARAM)m_pContainer->hwndActive, 1); + m_pContainer->UpdateTitle(0, dat_active); if (!(m_pContainer->dwFlags & CNT_NOFLASH) && PluginConfig.m_FlashOnMTN) ReflashContainer(m_pContainer); } @@ -1302,7 +1302,7 @@ void CTabBaseDlg::DM_EventAdded(WPARAM hContact, LPARAM lParam) TabCtrl_SetCurSel(m_hwndParent, iItem); ShowWindow(m_pContainer->hwndActive, SW_HIDE); m_pContainer->hwndActive = m_hwnd; - SendMessage(m_pContainer->hwnd, DM_UPDATETITLE, m_hContact, 0); + m_pContainer->UpdateTitle(m_hContact); m_pContainer->dwFlags |= CNT_DEFERREDTABSELECT; } } @@ -1365,105 +1365,6 @@ void CTabBaseDlg::DM_HandleAutoSizeRequest(REQRESIZE* rr) DM_ScrollToBottom(1, 0); } -void CTabBaseDlg::DM_UpdateTitle(WPARAM, LPARAM lParam) -{ - DWORD dwOldIdle = m_idle; - const char *szActProto = 0; - - m_wszStatus[0] = 0; - - if (m_iTabID == -1) - return; - - TCITEM item = {}; - - wchar_t newtitle[128]; - if (m_hContact) { - const wchar_t *szNick = m_cache->getNick(); - - if (m_szProto) { - szActProto = m_cache->getProto(); - - bool bHasName = (m_cache->getUIN()[0] != 0); - m_idle = m_cache->getIdleTS(); - m_dwFlagsEx = m_idle ? m_dwFlagsEx | MWF_SHOW_ISIDLE : m_dwFlagsEx & ~MWF_SHOW_ISIDLE; - - m_wStatus = m_cache->getStatus(); - wcsncpy_s(m_wszStatus, pcli->pfnGetStatusModeDescription(m_szProto == nullptr ? ID_STATUS_OFFLINE : m_wStatus, 0), _TRUNCATE); - - if (lParam != 0) { - wchar_t newcontactname[128]; newcontactname[0] = 0; - if (PluginConfig.m_bCutContactNameOnTabs) - CutContactName(szNick, newcontactname, _countof(newcontactname)); - else - wcsncpy_s(newcontactname, szNick, _TRUNCATE); - - Utils::DoubleAmpersands(newcontactname, _countof(newcontactname)); - - if (newcontactname[0] != 0) { - if (PluginConfig.m_bStatusOnTabs) - mir_snwprintf(newtitle, L"%s (%s)", newcontactname, m_wszStatus); - else - wcsncpy_s(newtitle, newcontactname, _TRUNCATE); - } - else wcsncpy_s(newtitle, L"Forward", _TRUNCATE); - - item.mask |= TCIF_TEXT; - } - SendMessage(m_hwnd, DM_UPDATEWINICON, 0, 0); - - wchar_t fulluin[256]; - if (m_bIsMeta) - mir_snwprintf(fulluin, - TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."), - bHasName ? m_cache->getUIN() : TranslateT("No UID")); - else - mir_snwprintf(fulluin, - TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."), - bHasName ? m_cache->getUIN() : TranslateT("No UID")); - - SendDlgItemMessage(m_hwnd, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_UNICODE); - } - } - else wcsncpy_s(newtitle, L"Message Session", _TRUNCATE); - - if (m_idle != dwOldIdle || lParam != 0) { - if (item.mask & TCIF_TEXT) { - item.pszText = m_wszTitle; - wcsncpy_s(m_wszTitle, newtitle, _TRUNCATE); - if (m_pWnd) - m_pWnd->updateTitle(m_cache->getNick()); - } - if (m_iTabID >= 0) { - TabCtrl_SetItem(m_hwndParent, m_iTabID, &item); - if (m_pContainer->dwFlags & CNT_SIDEBAR) - m_pContainer->SideBar->updateSession(this); - } - if (m_pContainer->hwndActive == m_hwnd && lParam) - SendMessage(m_pContainer->hwnd, DM_UPDATETITLE, m_hContact, 0); - - UpdateTrayMenuState(this, TRUE); - if (m_cache->isFavorite()) - AddContactToFavorites(m_hContact, m_cache->getNick(), szActProto, m_wszStatus, m_wStatus, - Skin_LoadProtoIcon(m_cache->getProto(), m_cache->getStatus()), 0, PluginConfig.g_hMenuFavorites); - - if (m_cache->isRecent()) - AddContactToFavorites(m_hContact, m_cache->getNick(), szActProto, m_wszStatus, m_wStatus, - Skin_LoadProtoIcon(m_cache->getProto(), m_cache->getStatus()), 0, PluginConfig.g_hMenuRecent); - - m_pPanel.Invalidate(); - if (m_pWnd) - m_pWnd->Invalidate(); - } - - // care about MetaContacts and update the statusbar icon with the currently "most online" contact... - if (m_bIsMeta) { - PostMessage(m_hwnd, DM_OWNNICKCHANGED, 0, 0); - if (m_pContainer->dwFlags & CNT_UINSTATUSBAR) - DM_UpdateLastMessage(); - } -} - ///////////////////////////////////////////////////////////////////////////////////////// // status icon stuff (by sje, used for indicating encryption status in the status bar // this is now part of the message window api |