From 0ebf6eee52c36fe139edb77730a835479cf0de21 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Jun 2018 20:23:37 +0300 Subject: StdMsg: option "Restore previously open tabs when showing the window" removed because it does nothing anyway. use plugin Sessions instead --- src/core/stdmsg/res/resource.rc | 4 +--- src/core/stdmsg/src/chat_manager.cpp | 1 - src/core/stdmsg/src/msgoptions.cpp | 8 ++------ src/core/stdmsg/src/resource.h | 1 - src/core/stdmsg/src/stdafx.h | 4 +--- src/core/stdmsg/src/tabs.cpp | 31 ------------------------------- 6 files changed, 4 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc index 4e1be5d546..cb7b963fa3 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 diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 2bad147761..4597554fd1 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -135,7 +135,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/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index f64e0361d6..f8d60c6be2 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_plugin, 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()); g_chatApi.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 dbb178d399..c9a59ce866 100644 --- a/src/core/stdmsg/src/stdafx.h +++ b/src/core/stdmsg/src/stdafx.h @@ -98,7 +98,7 @@ struct GlobalLogSettings : public GlobalLogSettingsBase { int iX, iY; int iSplitterX, iSplitterY; - bool bTabsEnable, bTabsAtBottom, bTabCloseOnDblClick, bTabRestore; + bool bTabsEnable, bTabsAtBottom, bTabCloseOnDblClick; HFONT MessageAreaFont; COLORREF MessageAreaColor; @@ -187,6 +187,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 995c14ae86..92b8ed0e46 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 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 = g_chatApi.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(); } -- cgit v1.2.3