Skip to content

Commit

Permalink
src:update code
Browse files Browse the repository at this point in the history
Signed-off-by: xiaoming <2014500726@smail.xtu.edu.cn>
  • Loading branch information
QQxiaoming committed Dec 11, 2023
1 parent 86a9e59 commit 616a441
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ CentralWidget::CentralWidget(QString dir, StartupUIMode mode, QLocale lang, bool
sessionOptionsWindow->setSessionState(sessionsWindow->getStateInfo());
sessionOptionsWindow->show();
});
if(sessionsWindow->getState() == SessionsWindow::Disconnected ||
sessionsWindow->getState() == SessionsWindow::Error) {
menu->addAction(reconnectAction);
}
QAction *closeAction = new QAction(tr("Close"),this);
closeAction->setStatusTip(tr("Close current session"));
menu->addAction(closeAction);
Expand Down Expand Up @@ -676,7 +680,7 @@ void CentralWidget::moveToAnotherTab(int src,int dst, int index) {
mainWidgetGroupList.at(dst)->sessionTab->count()-1);
mainWidgetGroupList.at(src)->sessionTab->setCurrentIndex(
mainWidgetGroupList.at(src)->sessionTab->count()-1);
QTimer::singleShot(100, this, [=](){
QTimer::singleShot(1000, this, [=](){
sessionsWindow->setShowResizeNotificationEnabled(true);
});
};
Expand All @@ -690,9 +694,9 @@ void CentralWidget::terminalWidgetContextMenuBase(QMenu *menu,SessionsWindow *te
}
menu->addAction(copyAction);
menu->addAction(pasteAction);
menu->addSeparator();
menu->addAction(selectAllAction);
menu->addAction(findAction);
menu->addSeparator();
QAction *highlightAction = new QAction(tr("Highlight/Unhighlight"),this);
highlightAction->setStatusTip(tr("Highlight/Unhighlight selected text"));
menu->addAction(highlightAction);
Expand Down
3 changes: 3 additions & 0 deletions src/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ class MainWindow : public QGoodWindow
QTimer::singleShot(0, this, [this, laboratoryButton](){
laboratoryButton->setFixedSize(m_good_central_widget->titleBarHeight(),m_good_central_widget->titleBarHeight());
m_good_central_widget->setRightTitleBarWidget(laboratoryButton, false);
connect(m_good_central_widget,&QGoodCentralWidget::windowActiveChanged,this, [=](bool active){
laboratoryButton->setEnabled(active);
});
});
}

Expand Down

0 comments on commit 616a441

Please sign in to comment.