From f59a84dc9b6e843da1024f108cba16aa9544b10c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 22 Mar 2017 17:54:29 +0300 Subject: - more SRMM buttons went to mir_app; - history button handler also moved to mir_app; --- plugins/TabSRMM/src/buttonsbar.cpp | 7 +++---- plugins/TabSRMM/src/chat_window.cpp | 22 +--------------------- plugins/TabSRMM/src/generic_msghandlers.cpp | 4 ++-- plugins/TabSRMM/src/infopanel.cpp | 10 +++++----- plugins/TabSRMM/src/msgs.h | 3 +-- plugins/TabSRMM/src/resource.h | 3 --- 6 files changed, 12 insertions(+), 37 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index 832f985288..5531463a5a 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -74,7 +74,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) Srmm_AddButton(&bbd); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_HISTORY; + bbd.dwButtonID = IDC_SRMM_HISTORY; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; bbd.pwszTooltip = LPGENW("View user's history"); @@ -119,7 +119,7 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) Srmm_AddButton(&bbd); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; - bbd.dwButtonID = IDC_SHOWNICKLIST; + bbd.dwButtonID = IDC_SRMM_NICKLIST; bbd.dwDefPos = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; bbd.pwszTooltip = LPGENW("Toggle nick list"); @@ -131,12 +131,11 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate"); Srmm_AddButton(&bbd); - bbd.dwButtonID = IDC_CHANMGR; + bbd.dwButtonID = IDC_SRMM_CHANMGR; bbd.dwDefPos = 33; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; bbd.pwszTooltip = LPGENW("Channel manager"); Srmm_AddButton(&bbd); - return 0; } diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp index 331bd3da2e..b9e94532df 100644 --- a/plugins/TabSRMM/src/chat_window.cpp +++ b/plugins/TabSRMM/src/chat_window.cpp @@ -1379,10 +1379,7 @@ static void __cdecl phase2(void * lParam) CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) : CTabBaseDlg(IDD_CHANNEL, si), m_btnOk(this, IDOK), - m_list(this, IDC_LIST), - m_btnHistory(this, IDC_HISTORY), - m_btnChannelMgr(this, IDC_CHANMGR), - m_btnNickList(this, IDC_SHOWNICKLIST) + m_list(this, IDC_LIST) { m_szProto = GetContactProto(m_hContact); m_bFilterEnabled = db_get_b(m_hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled) != 0; @@ -1390,7 +1387,6 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) m_btnOk.OnClick = Callback(this, &CChatRoomDlg::onClick_OK); m_btnFilter.OnClick = Callback(this, &CChatRoomDlg::onClick_Filter); - m_btnHistory.OnClick = Callback(this, &CChatRoomDlg::onClick_History); m_btnNickList.OnClick = Callback(this, &CChatRoomDlg::onClick_ShowNickList); m_btnChannelMgr.OnClick = Callback(this, &CChatRoomDlg::onClick_ChanMgr); @@ -1618,22 +1614,6 @@ void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton) db_set_b(m_si->hContact, CHAT_MODULE, "FilterEnabled", m_bFilterEnabled); } -void CChatRoomDlg::onClick_History(CCtrlButton *pButton) -{ - if (!pButton->Enabled()) - return; - - MODULEINFO *pInfo = pci->MM_FindModule(m_si->pszModule); - if (ServiceExists("MSP/HTMLlog/ViewLog") && strstr(m_si->pszModule, "IRC")) { - char szName[MAX_PATH]; - WideCharToMultiByte(CP_ACP, 0, m_si->ptszName, -1, szName, MAX_PATH, 0, 0); - szName[MAX_PATH - 1] = 0; - CallService("MSP/HTMLlog/ViewLog", (WPARAM)m_si->pszModule, (LPARAM)szName); - } - else if (pInfo) - ShellExecute(m_hwnd, nullptr, pci->GetChatLogsFilename(m_si, 0), nullptr, nullptr, SW_SHOW); -} - void CChatRoomDlg::onClick_ShowNickList(CCtrlButton *pButton) { if (!pButton->Enabled()) diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 4855dc94c7..7b1ebaedf1 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -126,7 +126,7 @@ bool CTabBaseDlg::DM_GenericHotkeysCheck(MSG *message) return true; case TABSRMM_HK_HISTORY: - SendMessage(m_hwnd, WM_COMMAND, IDC_HISTORY, 0); + m_btnHistory.OnClick(&m_btnHistory); return true; case TABSRMM_HK_CONTAINEROPTIONS: @@ -237,7 +237,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)(m_cache->getActiveContact()), 0); break; - case IDC_HISTORY: + case IDC_SRMM_HISTORY: CallService(MS_HISTORY_SHOWCONTACTHISTORY, m_hContact, 0); break; diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index fd806a7b25..e75a5d13a1 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -713,13 +713,13 @@ HMENU CInfoPanel::constructContextualMenu() const if (m_hoverFlags & HOVER_NICK) { Utils::addMenuItem(m, mii, ::Skin_LoadIcon(SKINICON_OTHER_USERDETAILS), TranslateT("Open user details..."), IDC_NAME, 0); - Utils::addMenuItem(m, mii, ::Skin_LoadIcon(SKINICON_OTHER_HISTORY), TranslateT("Open history..."), m_isChat ? IDC_HISTORY : IDC_HISTORY, 0); + Utils::addMenuItem(m, mii, ::Skin_LoadIcon(SKINICON_OTHER_HISTORY), TranslateT("Open history..."), IDC_SRMM_HISTORY, 0); if (!m_isChat) Utils::addMenuItem(m, mii, PluginConfig.g_iconContainer, TranslateT("Messaging settings..."), ID_MESSAGELOGSETTINGS_FORTHISCONTACT, 1); else { - ::AppendMenu(m, MF_STRING, IDC_CHANMGR, TranslateT("Room settings...")); + ::AppendMenu(m, MF_STRING, IDC_SRMM_CHANMGR, TranslateT("Room settings...")); if (GCW_SERVER & m_dat->m_si->iType) - ::EnableMenuItem(m, IDC_CHANMGR, MF_BYCOMMAND | MF_GRAYED); + ::EnableMenuItem(m, IDC_SRMM_CHANMGR, MF_BYCOMMAND | MF_GRAYED); } ::AppendMenu(m, MF_SEPARATOR, 1000, 0); Utils::addMenuItem(m, mii, PluginConfig.g_buttonBarIcons[6], TranslateT("Close session"), IDC_SAVE, 4); @@ -752,8 +752,8 @@ LRESULT CInfoPanel::cmdHandler(UINT cmd) } break; - case IDC_HISTORY: - case IDC_CHANMGR: + case IDC_SRMM_HISTORY: + case IDC_SRMM_CHANMGR: if (m_isChat) { SendMessage(m_dat->GetHwnd(), WM_COMMAND, cmd, 0); return(S_OK); diff --git a/plugins/TabSRMM/src/msgs.h b/plugins/TabSRMM/src/msgs.h index c009e50a5d..cbd24d1ca3 100644 --- a/plugins/TabSRMM/src/msgs.h +++ b/plugins/TabSRMM/src/msgs.h @@ -483,7 +483,7 @@ public: class CChatRoomDlg : public CTabBaseDlg { HWND m_hwndFilter; - CCtrlButton m_btnHistory, m_btnChannelMgr, m_btnNickList, m_btnOk; + CCtrlButton m_btnOk; CCtrlListBox m_list; static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -520,7 +520,6 @@ public: void onClick_OK(CCtrlButton*); void onClick_Filter(CCtrlButton*); - void onClick_History(CCtrlButton*); void onClick_ChanMgr(CCtrlButton*); void onClick_ShowNickList(CCtrlButton*); diff --git a/plugins/TabSRMM/src/resource.h b/plugins/TabSRMM/src/resource.h index 4bff4ada73..648645486d 100644 --- a/plugins/TabSRMM/src/resource.h +++ b/plugins/TabSRMM/src/resource.h @@ -81,7 +81,6 @@ #define IDC_FASTGRADIENT 1008 #define IDC_SPLITTERY 1008 #define IDC_CHKNOTIFY_URL 1009 -#define IDC_CHANMGR 1010 #define IDC_USESKIN 1011 #define IDC_AUTOCLOSE 1012 #define IDC_CHKNOTIFY_OTHER 1013 @@ -101,7 +100,6 @@ #define IDC_CHKACTR_DISMISS 1026 #define IDC_CHKACTR_OPEN 1028 #define IDC_CONTACTPIC 1029 -#define IDC_SHOWNICKLIST 1030 #define IDC_ST_ENTERMSG 1031 #define IDC_PANELNICK 1032 #define IDC_CHKWINDOWCHECK 1032 @@ -181,7 +179,6 @@ #define IDC_DELAY_ERR 1102 #define IDC_RTL 1103 #define IDC_PIC 1104 -#define IDC_HISTORY 1111 #define IDC_CANCELADD 1112 #define IDC_FONTSTRIKEOUT 1113 #define IDC_MATH_BKGCOLOUR 1124 -- cgit v1.2.3