From fb26fddf9d705446f73568cd1c99616bcb45f817 Mon Sep 17 00:00:00 2001 From: noguchi167 Date: Sun, 17 May 2015 17:06:29 +0800 Subject: [PATCH 1/2] fix reconnect will open a new tab --- src/mainframe.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mainframe.cpp b/src/mainframe.cpp index bebcf649..5ffd58eb 100644 --- a/src/mainframe.cpp +++ b/src/mainframe.cpp @@ -1724,10 +1724,9 @@ 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); + + /* Reconnect without opening a new tab */ + con->Reconnect(); } void CMainFrame::FlashWindow( bool flash ) From e044f22f45d5ae465fe9d6f6b647c9c1bf1a04bb Mon Sep 17 00:00:00 2001 From: noguchi167 Date: Sun, 17 May 2015 23:44:18 +0800 Subject: [PATCH 2/2] fix connect fail if title/url include string "telnet://" --- src/mainframe.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mainframe.cpp b/src/mainframe.cpp index 5ffd58eb..c2a1614e 100644 --- a/src/mainframe.cpp +++ b/src/mainframe.cpp @@ -318,6 +318,13 @@ CTelnetCon* CMainFrame::NewCon(string title, string url, CSite* site ) m_pView->m_CharPaddingX = AppConfig.CharPaddingX; m_pView->m_CharPaddingY = AppConfig.CharPaddingY; + /* if title/url include string "telnet://", remove it. */ + if ( !title.compare( 0, strlen("telnet://"), "telnet://" ) ) { + title = title.substr( strlen("telnet://") ); + } + if ( !url.compare( 0, strlen("telnet://"), "telnet://" ) ) { + url = url.substr( strlen("telnet://") ); + } pCon->m_Site.m_Name = title; pCon->m_Site.m_URL = url; pCon->m_Encoding = pCon->m_Site.m_Encoding;