diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf6d4ff..261bfd34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ en-US: - Fix the issue that the SSH connection cannot be reconnected by tapping the Enter key in some cases - Fix the issue that the target session object is inaccurate when locking/unlocking the session - Fix the issue that some functions in the context menu of the floating window cannot be used +- Fix the issue of inconsistent new session names in different situations [#45](https://github.com/QQxiaoming/quardCRT/issues/45) - Update pre-built plugin [timestamp](https://github.com/QuardCRT-platform/plugin-timestamp) to V0.0.3 zh-CN: @@ -32,6 +33,7 @@ zh-CN: - 修复ssh连接部分情况下无法通过敲击回车键发起重连的问题 - 修复锁定/解锁会话时目标会话对象不准确 - 修复浮动窗口上下文菜单中部分功能无法使用的问题 +- 修复不同情况下新建会话名称不一致问题 [#45](https://github.com/QQxiaoming/quardCRT/issues/45) - 更新预构建插件[timestamp](https://github.com/QuardCRT-platform/plugin-timestamp)到V0.0.3版本,更新预构建插件CharacterCode到V0.0.4版本 ## [[V0.4.8](https://github.com/QQxiaoming/quardCRT/releases/tag/V0.4.8)] - 2024-07-26 diff --git a/docs/changelog.md b/docs/changelog.md index 3cb746cd..6647591d 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -16,6 +16,7 @@ - Fix the issue that the SSH connection cannot be reconnected by tapping the Enter key in some cases - Fix the issue that the target session object is inaccurate when locking/unlocking the session - Fix the issue that some functions in the context menu of the floating window cannot be used +- Fix the issue of inconsistent new session names in different situations [#45](https://github.com/QQxiaoming/quardCRT/issues/45) - Update pre-built plugin [timestamp](https://github.com/QuardCRT-platform/plugin-timestamp) to V0.0.3 ## [[V0.4.8](https://github.com/QQxiaoming/quardCRT/releases/tag/V0.4.8)] - 2024-07-26 diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ddce5fb..b66fc8c3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -4293,7 +4293,7 @@ QString CentralWidget::startSSH2Session(MainWidgetGroup *group, int groupIndex, int index = group->sessionTab->addTab(groupIndex,sessionsWindow->getMainWidget(), sessionsWindow->getTitle()); connectSessionStateChange(group->sessionTab,index,sessionsWindow); if(name.isEmpty()) { - name = "SSH2"; + name = hostname; checkSessionName(name); } sessionsWindow->setName(name); @@ -4334,7 +4334,7 @@ QString CentralWidget::startVNCSession(MainWidgetGroup *group, int groupIndex, Q int index = group->sessionTab->addTab(groupIndex,sessionsWindow->getMainWidget(), sessionsWindow->getTitle()); connectSessionStateChange(group->sessionTab,index,sessionsWindow); if(name.isEmpty()) { - name = "VNC"; + name = hostname; checkSessionName(name); } sessionsWindow->setName(name); @@ -4351,6 +4351,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo QString name = data.TelnetData.hostname; if(data.openInTab) { name = startTelnetSession(group,groupIndex,name,data.TelnetData.port,type); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab); @@ -4363,6 +4365,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo data.SerialData.dataBits,data.SerialData.parity, data.SerialData.stopBits,data.SerialData.flowControl, data.SerialData.xEnable); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab); @@ -4371,6 +4375,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo QString name = "Local Shell"; if(data.openInTab) { name = startLocalShellSession(group,groupIndex,data.LocalShellData.command,globalOptionsWindow->getNewTabWorkPath()); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab); @@ -4379,6 +4385,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo QString name = data.RawData.hostname; if(data.openInTab) { name = startRawSocketSession(group,groupIndex,name,data.RawData.port); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab); @@ -4387,6 +4395,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo QString name = data.NamePipeData.pipeName; if(data.openInTab) { name = startNamePipeSession(group,groupIndex,name); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab); @@ -4395,6 +4405,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo QString name = data.SSH2Data.hostname; if(data.openInTab) { name = startSSH2Session(group,groupIndex,name,data.SSH2Data.port,data.SSH2Data.username,data.SSH2Data.password); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab); @@ -4403,6 +4415,8 @@ void CentralWidget::startSession(MainWidgetGroup *group, int groupIndex, QuickCo QString name = data.VNCData.hostname; if(data.openInTab) { name = startVNCSession(group,groupIndex,name,data.VNCData.port,data.VNCData.password); + } else { + checkSessionName(name); } if(data.saveSession) { addSessionToSessionManager(data,name, !data.openInTab);