summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-03-02 14:12:59 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-03-02 14:12:59 +0300
commitae93aa98b214f98a0e28df1bdaa8df18b3f6da02 (patch)
tree6856f13b902b45e8ea9971df1c380fc18793dfec /src
parent2fccd1a7a6f642c30fc4cbd2281c6feba5f8d82d (diff)
further SRMM window unification
- CSrmmBaseDialog received m_hContact as its common member; - less usage of CTabBaseDlg::m_bType in tabSRMM
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/chat_window.cpp37
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp4
-rw-r--r--src/core/stdmsg/src/msgs.h1
-rw-r--r--src/mir_app/src/srmm_base.cpp5
4 files changed, 24 insertions, 23 deletions
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index af4ea35a85..36dc59a92a 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -875,6 +875,7 @@ CChatRoomDlg::CChatRoomDlg(SESSION_INFO *si) :
{
m_pLog = &m_log;
m_pEntry = &m_message;
+ m_hContact = si->hContact;
m_autoClose = 0;
@@ -909,9 +910,9 @@ void CChatRoomDlg::OnInitDialog()
m_btnColor.OnInit(); m_btnBkColor.OnInit();
m_btnFilter.OnInit(); m_btnHistory.OnInit(); m_btnChannelMgr.OnInit();
- WindowList_Add(pci->hWindowList, m_hwnd, m_si->hContact);
+ WindowList_Add(pci->hWindowList, m_hwnd, m_hContact);
- NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_OPENING);
+ NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPENING);
mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERX), SplitterSubclassProc);
mir_subclassWindow(GetDlgItem(m_hwnd, IDC_SPLITTERY), SplitterSubclassProc);
mir_subclassWindow(m_log.GetHwnd(), LogSubclassProc);
@@ -943,12 +944,12 @@ void CChatRoomDlg::OnInitDialog()
SendMessage(m_hwnd, WM_SIZE, 0, 0);
- NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_OPEN);
+ NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_OPEN);
}
void CChatRoomDlg::OnDestroy()
{
- NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING);
+ NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSING);
SaveWindowPosition(true);
WindowList_Remove(pci->hWindowList, m_hwnd);
@@ -958,7 +959,7 @@ void CChatRoomDlg::OnDestroy()
m_si->wState &= ~STATE_TALK;
DestroyWindow(m_si->hwndStatus); m_si->hwndStatus = NULL;
- NotifyLocalWinEvent(m_si->hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE);
+ NotifyLocalWinEvent(m_hContact, m_hwnd, MSG_WINDOW_EVT_CLOSE);
}
void CChatRoomDlg::OnClick_Bold(CCtrlButton *pButton)
@@ -1146,7 +1147,7 @@ void CChatRoomDlg::SetWindowPosition()
}
if (db_get_b(NULL, CHAT_MODULE, "SavePosition", 0)) {
- if (RestoreWindowPosition(m_hwnd, m_si->hContact, true)) {
+ if (RestoreWindowPosition(m_hwnd, m_hContact, true)) {
ShowWindow(m_hwnd, SW_HIDE);
return;
}
@@ -1497,17 +1498,17 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (!g_Settings.bTabsEnable) {
SaveWindowPosition(true);
if (db_get_b(NULL, CHAT_MODULE, "SavePosition", 0)) {
- db_set_dw(m_si->hContact, CHAT_MODULE, "roomx", m_si->iX);
- db_set_dw(m_si->hContact, CHAT_MODULE, "roomy", m_si->iY);
- db_set_dw(m_si->hContact, CHAT_MODULE, "roomwidth", m_si->iWidth);
- db_set_dw(m_si->hContact, CHAT_MODULE, "roomheight", m_si->iHeight);
+ db_set_dw(m_hContact, CHAT_MODULE, "roomx", m_si->iX);
+ db_set_dw(m_hContact, CHAT_MODULE, "roomy", m_si->iY);
+ db_set_dw(m_hContact, CHAT_MODULE, "roomwidth", m_si->iWidth);
+ db_set_dw(m_hContact, CHAT_MODULE, "roomheight", m_si->iHeight);
}
}
- if (pcli->pfnGetEvent(m_si->hContact, 0))
- pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT);
+ if (pcli->pfnGetEvent(m_hContact, 0))
+ pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
m_si->wState &= ~STATE_TALK;
- db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0);
+ db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0);
SendMessage(m_hwnd, GC_CLOSEWINDOW, 0, 0);
return TRUE;
@@ -1673,10 +1674,10 @@ LABEL_SHOWWINDOW:
if (KillTimer(m_hwnd, TIMERID_FLASHWND))
FlashWindow(m_hwnd, FALSE);
- if (db_get_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0) != 0)
- db_set_w(m_si->hContact, m_si->pszModule, "ApparentMode", 0);
- if (pcli->pfnGetEvent(m_si->hContact, 0))
- pcli->pfnRemoveEvent(m_si->hContact, GC_FAKE_EVENT);
+ if (db_get_w(m_hContact, m_si->pszModule, "ApparentMode", 0) != 0)
+ db_set_w(m_hContact, m_si->pszModule, "ApparentMode", 0);
+ if (pcli->pfnGetEvent(m_hContact, 0))
+ pcli->pfnRemoveEvent(m_hContact, GC_FAKE_EVENT);
}
break;
@@ -1790,7 +1791,7 @@ LABEL_SHOWWINDOW:
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED)
if (LOWORD(wParam) >= MIN_CBUTTONID && LOWORD(wParam) <= MAX_CBUTTONID) {
- Srmm_ClickToolbarIcon(m_si->hContact, LOWORD(wParam), GetDlgItem(m_hwnd, LOWORD(wParam)), 0);
+ Srmm_ClickToolbarIcon(m_hContact, LOWORD(wParam), GetDlgItem(m_hwnd, LOWORD(wParam)), 0);
break;
}
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index d82a22d7bb..5eeacef419 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -419,11 +419,11 @@ CSrmmWindow::CSrmmWindow(MCONTACT hContact, bool noActivate, const char *szIniti
m_log(this, IDC_LOG),
m_message(this, IDC_MESSAGE),
m_cmdList(20),
- m_bNoActivate(noActivate),
- m_hContact(hContact)
+ m_bNoActivate(noActivate)
{
m_pLog = &m_log;
m_pEntry = &m_message;
+ m_hContact = hContact;
m_wszInitialText = (bIsUnicode) ? mir_wstrdup((wchar_t*)szInitialText) : mir_a2u(szInitialText);
}
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index 18ff6ba2e1..33983fe2eb 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -79,7 +79,6 @@ class CSrmmWindow : public CSrmmBaseDialog, public MZeroedObject
bool m_bIsMeta, m_bShowTyping, m_bNoActivate;
public:
- MCONTACT m_hContact;
MEVENT m_hDbEventFirst, m_hDbEventLast;
bool m_bIsAutoRTL;
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp
index b28549b6c0..5968514838 100644
--- a/src/mir_app/src/srmm_base.cpp
+++ b/src/mir_app/src/srmm_base.cpp
@@ -27,8 +27,9 @@ extern HCURSOR g_hCurHyperlinkHand;
CSrmmBaseDialog::CSrmmBaseDialog(HINSTANCE hInst, int idDialog) :
CDlgBase(hInst, idDialog),
- m_pLog(NULL),
- m_pEntry(NULL)
+ m_pLog(nullptr),
+ m_pEntry(nullptr),
+ m_hContact(0)
{
}