summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-06 22:53:11 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-06 22:53:11 +0300
commitbf888032ef5235a8c6fa9d692f8d0e8a84ade592 (patch)
treefff383d03ad01d0cc02673044fe4744e21416770 /src
parent78b151bd848de61d4d1285484ba25c516441a802 (diff)
merge from master till
fixes #1408 (StdMsg: window caption bug)
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/res/resource.rc6
-rw-r--r--src/core/stdmsg/src/chat_manager.cpp1
-rw-r--r--src/core/stdmsg/src/chat_window.cpp3
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp4
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp8
-rw-r--r--src/core/stdmsg/src/resource.h1
-rw-r--r--src/core/stdmsg/src/stdafx.h4
-rw-r--r--src/core/stdmsg/src/tabs.cpp31
-rw-r--r--src/mir_core/src/CCtrlPages.cpp16
-rw-r--r--src/mir_core/src/mir_core.def1
-rw-r--r--src/mir_core/src/mir_core64.def1
11 files changed, 27 insertions, 49 deletions
diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc
index 4e1be5d546..aebd57bef9 100644
--- a/src/core/stdmsg/res/resource.rc
+++ b/src/core/stdmsg/res/resource.rc
@@ -127,9 +127,7 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
CONTROL "Use a tabbed interface",IDC_USETABS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,11,263,13
CONTROL "Close tab on double click",IDC_CLOSETABS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,26,246,10
- CONTROL "Restore previously open tabs when showing the window",IDC_RESTORETABS,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,39,250,10
- CONTROL "Show tabs at the bottom",IDC_TABSBOTTOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,52,233,10
+ CONTROL "Show tabs at the bottom",IDC_TABSBOTTOM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,39,250,10
END
IDD_OPT_MSGTYPE DIALOGEX 0, 0, 283, 234
@@ -167,7 +165,7 @@ IDD_CONTAINER DIALOGEX 0, 0, 275, 200
STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- CONTROL "Tab1",IDC_TAB,"SysTabControl32",TCS_MULTILINE,0,0,275,200
+ CONTROL "Tab1",IDC_TAB,"SysTabControl32",TCS_MULTILINE | TCS_FOCUSNEVER | WS_CLIPSIBLINGS,0,0,275,200
END
IDD_FILTER DIALOGEX 0, 0, 83, 125
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp
index b4b8c880c3..288c306ec3 100644
--- a/src/core/stdmsg/src/chat_manager.cpp
+++ b/src/core/stdmsg/src/chat_manager.cpp
@@ -137,7 +137,6 @@ static void OnLoadSettings()
g_Settings.iY = db_get_dw(0, CHAT_MODULE, "roomy", -1);
g_Settings.bTabsEnable = db_get_b(0, CHAT_MODULE, "Tabs", 1) != 0;
- g_Settings.bTabRestore = db_get_b(0, CHAT_MODULE, "TabRestore", 0) != 0;
g_Settings.bTabsAtBottom = db_get_b(0, CHAT_MODULE, "TabBottom", 0) != 0;
g_Settings.bTabCloseOnDblClick = db_get_b(0, CHAT_MODULE, "TabCloseOnDblClick", 0) != 0;
diff --git a/src/core/stdmsg/src/chat_window.cpp b/src/core/stdmsg/src/chat_window.cpp
index 99c2e2fd1e..5df7a4fb4f 100644
--- a/src/core/stdmsg/src/chat_window.cpp
+++ b/src/core/stdmsg/src/chat_window.cpp
@@ -1152,7 +1152,8 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
case DM_UPDATETITLE:
- UpdateTitle();
+ if (lParam == 0 || lParam == m_hContact)
+ UpdateTitle();
break;
case DM_CLOSETAB:
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 572ae73bec..90029de1c6 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -1196,8 +1196,10 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_TIMER:
if (wParam == TIMERID_FLASHWND) {
- if (m_nFlash > 2 * g_dat.nFlashMax)
+ if (m_nFlash > 2 * g_dat.nFlashMax) {
StopFlash();
+ return 0;
+ }
}
else if (wParam == TIMERID_TYPE) {
ShowTime(false);
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index 917de61ce3..34ccdf45dc 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -527,15 +527,14 @@ public:
class COptionsTabDlg : public CDlgBase
{
- CCtrlCheck m_chkTabs, m_chkTabsBottom, m_chkTabsClose, m_chkTabsRestore;
+ CCtrlCheck m_chkTabs, m_chkTabsBottom, m_chkTabsClose;
public:
COptionsTabDlg() :
CDlgBase(g_hInst, IDD_OPT_TABS),
m_chkTabs(this, IDC_USETABS),
m_chkTabsBottom(this, IDC_TABSBOTTOM),
- m_chkTabsClose(this, IDC_CLOSETABS),
- m_chkTabsRestore(this, IDC_RESTORETABS)
+ m_chkTabsClose(this, IDC_CLOSETABS)
{
m_chkTabs.OnChange = Callback(this, &COptionsTabDlg::onChange_Tabs);
}
@@ -545,7 +544,6 @@ public:
m_chkTabs.SetState(g_Settings.bTabsEnable);
m_chkTabsBottom.SetState(g_Settings.bTabsAtBottom);
m_chkTabsClose.SetState(g_Settings.bTabCloseOnDblClick);
- m_chkTabsRestore.SetState(g_Settings.bTabRestore);
onChange_Tabs(&m_chkTabs);
}
@@ -556,7 +554,6 @@ public:
db_set_b(0, CHAT_MODULE, "Tabs", m_chkTabs.GetState());
db_set_b(0, CHAT_MODULE, "TabBottom", m_chkTabsBottom.GetState());
db_set_b(0, CHAT_MODULE, "TabCloseOnDblClick", m_chkTabsClose.GetState());
- db_set_b(0, CHAT_MODULE, "TabRestore", m_chkTabsRestore.GetState());
pci->ReloadSettings();
@@ -573,7 +570,6 @@ public:
bool bEnabled = pCheck->GetState() != 0;
m_chkTabsBottom.Enable(bEnabled);
m_chkTabsClose.Enable(bEnabled);
- m_chkTabsRestore.Enable(bEnabled);
}
};
diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h
index affe1f1b02..2464723183 100644
--- a/src/core/stdmsg/src/resource.h
+++ b/src/core/stdmsg/src/resource.h
@@ -155,7 +155,6 @@
#define IDC_POPLIST 1616
#define IDC_USETABS 1620
#define IDC_CLOSETABS 1621
-#define IDC_RESTORETABS 1622
#define IDC_TABSBOTTOM 1623
#define IDM_CUT 40000
#define IDM_COPY 40001
diff --git a/src/core/stdmsg/src/stdafx.h b/src/core/stdmsg/src/stdafx.h
index 00b1304b57..3baa9a50a5 100644
--- a/src/core/stdmsg/src/stdafx.h
+++ b/src/core/stdmsg/src/stdafx.h
@@ -101,7 +101,7 @@ struct GlobalLogSettings : public GlobalLogSettingsBase
{
int iX, iY;
int iSplitterX, iSplitterY;
- bool bTabsEnable, bTabsAtBottom, bTabCloseOnDblClick, bTabRestore;
+ bool bTabsEnable, bTabsAtBottom, bTabCloseOnDblClick;
HFONT MessageAreaFont;
COLORREF MessageAreaColor;
@@ -181,6 +181,4 @@ extern CTabbedWindow *g_pTabDialog;
void UninitTabs(void);
CTabbedWindow* GetContainer();
-void TB_SaveSession(SESSION_INFO *si);
-
#pragma comment(lib,"comctl32.lib")
diff --git a/src/core/stdmsg/src/tabs.cpp b/src/core/stdmsg/src/tabs.cpp
index 67544cb86f..06b77e6c0d 100644
--- a/src/core/stdmsg/src/tabs.cpp
+++ b/src/core/stdmsg/src/tabs.cpp
@@ -22,25 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
#include "statusicon.h"
-struct CSavedTab
-{
- CSavedTab(const char *szModule, const wchar_t *wszId) :
- m_szModule(mir_strdup(szModule)),
- m_id(mir_wstrdup(wszId))
- {}
-
- ptrW m_id;
- ptrA m_szModule;
-};
-
-static OBJLIST<CSavedTab> arSavedTabs(1);
-
-void TB_SaveSession(SESSION_INFO *si)
-{
- if (si)
- arSavedTabs.insert(new CSavedTab(si->pszModule, si->ptszID));
-}
-
CTabbedWindow *g_pTabDialog = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
@@ -187,16 +168,6 @@ void CTabbedWindow::OnInitDialog()
TabCtrl_SetMinTabWidth(m_tab.GetHwnd(), 80);
TabCtrl_SetImageList(m_tab.GetHwnd(), Clist_GetImageList());
-
- // restore previous tabs
- if (g_Settings.bTabRestore) {
- for (auto &p : arSavedTabs) {
- SESSION_INFO *si = pci->SM_FindSession(p->m_id, p->m_szModule);
- if (si)
- AddPage(si);
- }
- arSavedTabs.destroy();
- }
}
void CTabbedWindow::OnDestroy()
@@ -694,6 +665,4 @@ void UninitTabs()
g_pTabDialog->Close();
g_pTabDialog = nullptr;
}
-
- arSavedTabs.destroy();
}
diff --git a/src/mir_core/src/CCtrlPages.cpp b/src/mir_core/src/CCtrlPages.cpp
index d51b7af35a..88e6a9d59c 100644
--- a/src/mir_core/src/CCtrlPages.cpp
+++ b/src/mir_core/src/CCtrlPages.cpp
@@ -135,7 +135,7 @@ void CCtrlPages::AddPage(const wchar_t *ptszName, HICON hIcon, CDlgBase *pDlg)
ShowPage(m_pActivePage);
}
}
- else m_pages.insert(info);
+ m_pages.insert(info);
}
void CCtrlPages::ActivatePage(int iPage)
@@ -160,6 +160,16 @@ void CCtrlPages::ActivatePage(int iPage)
::SendMessage(m_pActivePage->GetHwnd(), WM_MOUSEACTIVATE, 0, 0);
}
+void CCtrlPages::CheckRowCount()
+{
+ int iRowCount = TabCtrl_GetRowCount(m_hwnd);
+ if (m_numRows != iRowCount) {
+ m_numRows = iRowCount;
+ for (auto &p : m_pages)
+ p->m_bScheduledResize = true;
+ }
+}
+
int CCtrlPages::GetCount()
{
return TabCtrl_GetItemCount(m_hwnd);
@@ -226,6 +236,8 @@ void CCtrlPages::InsertPage(TPageInfo *pPage)
}
TabCtrl_InsertItem(m_hwnd, TabCtrl_GetItemCount(m_hwnd), &tci);
+
+ CheckRowCount();
}
void CCtrlPages::RemovePage(int iPage)
@@ -236,6 +248,8 @@ void CCtrlPages::RemovePage(int iPage)
TabCtrl_DeleteItem(m_hwnd, iPage);
delete p;
+
+ CheckRowCount();
}
void CCtrlPages::ShowPage(CDlgBase *pDlg)
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def
index 2936dbf410..38eb3db4d1 100644
--- a/src/mir_core/src/mir_core.def
+++ b/src/mir_core/src/mir_core.def
@@ -1069,3 +1069,4 @@ IsTerminalDisconnected @1245
CallObjectEventHook @1259
?db_get_sm@@YG?AV?$CMStringT@DV?$ChTraitsCRT@D@@@@IPBD0@Z @1260 NONAME
?db_get_wsm@@YG?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@IPBD0@Z @1261 NONAME
+?CheckRowCount@CCtrlPages@@AAEXXZ @1262 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def
index ed12967625..61a559f477 100644
--- a/src/mir_core/src/mir_core64.def
+++ b/src/mir_core/src/mir_core64.def
@@ -1069,3 +1069,4 @@ IsTerminalDisconnected @1245
CallObjectEventHook @1259
?db_get_sm@@YA?AV?$CMStringT@DV?$ChTraitsCRT@D@@@@IPEBD0@Z @1260 NONAME
?db_get_wsm@@YA?AV?$CMStringT@_WV?$ChTraitsCRT@_W@@@@IPEBD0@Z @1261 NONAME
+?CheckRowCount@CCtrlPages@@AEAAXXZ @1262 NONAME