From 7d1c3df6c0aabdd02ee48f644d4b2f5fcb5b1796 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Fri, 3 Nov 2023 21:16:00 +0100 Subject: [PATCH] MyFrameMain: don't show empty host,port on reverse conn disconnect --- src/gui/MyFrameMain.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/MyFrameMain.cpp b/src/gui/MyFrameMain.cpp index db3580d1..aaa87415 100644 --- a/src/gui/MyFrameMain.cpp +++ b/src/gui/MyFrameMain.cpp @@ -411,15 +411,22 @@ void MyFrameMain::onVNCConnDisconnectNotify(wxCommandEvent& event) // get sender VNCConn* c = static_cast(event.GetEventObject()); - wxLogStatus( _("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str()); - + if (!c->getServerHost().IsEmpty()) { + wxLogStatus(_("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str()); + } else { + wxLogStatus(_("Reverse connection terminated.")); + } + wxArrayString log = VNCConn::getLog(); // show last 3 log strings for(size_t i = log.GetCount() >= 3 ? log.GetCount()-3 : 0; i < log.GetCount(); ++i) wxLogMessage(log[i]); - wxLogMessage( _("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str() ); - - + if (!c->getServerHost().IsEmpty()) { + wxLogMessage(_("Connection to %s:%s terminated."), c->getServerHost().c_str(), c->getServerPort().c_str()); + } else { + wxLogMessage(_("Reverse connection terminated.")); + } + // find index of this connection vector::iterator it = connections.begin(); size_t index = 0;