From a2b41fd31eb956d4c798e87d5dd36dce8017a2cb Mon Sep 17 00:00:00 2001 From: NCTULouis Date: Tue, 7 Jun 2016 14:24:48 +0800 Subject: [PATCH] Instead of creating a new tab, use current connection to do reconnection When click the reconnect button, the previous version will create a new tab(a new connection) to do reconnection. Instead of doing this, we use the current connection(current tab) to do reconnection. Fix issue #33 --- src/mainframe.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mainframe.cpp b/src/mainframe.cpp index 4aeea823..880a0a1f 100644 --- a/src/mainframe.cpp +++ b/src/mainframe.cpp @@ -1759,12 +1759,11 @@ void CMainFrame::OnEmoticons(GtkMenuItem* mitem UNUSED, CMainFrame* _this) void CMainFrame::OnReconnect(GtkMenuItem* mitem UNUSED, CMainFrame* _this) { CTelnetCon* con = _this->GetCurCon(); + if( !con ) return; - if( con->IsClosed() ) - con->Reconnect(); - else - _this->NewCon( con->m_Site.m_Name, con->m_Site.m_URL, &con->m_Site); + + con->Reconnect(); } void CMainFrame::FlashWindow( bool flash )