From efc7af7f46e11e5916e7a66879a05e0208f0a42c Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Sat, 17 Dec 2022 13:40:13 +0800 Subject: [PATCH] - enhancement: Run all cases button not correct disabled when no case exits. --- NEWS.md | 3 ++- RedPandaIDE/mainwindow.cpp | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 76ca5369..73490fd5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -11,7 +11,8 @@ Red Panda C++ Version 2.7 - enhancement: Better error message when trying to debug with Release compile set. - enhancement: Add missing space char color settings in color schemes - enhancement: Export FPS (free problem set) files. - - enhancement: Improve context menus. + - enhancement: Run all cases button not correct disabled when no case exits. + - enhancement: Speed up remove problems. Red Panda C++ Version 2.6 diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index 34a30421..250f002d 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -3786,8 +3786,8 @@ void MainWindow::onTableProblemCasesContextMenu(const QPoint &pos) QModelIndex idx = ui->tblProblemCases->currentIndex(); menu.addAction(mProblem_RunAllCases); menu.addAction(mProblem_RunCurrentCase); - mProblem_RunAllCases->setEnabled(mOJProblemModel.count()>0); - mProblem_RunCurrentCase->setEnabled(idx.isValid()); + mProblem_RunAllCases->setEnabled(mOJProblemModel.count()>0 && ui->actionRun->isEnabled()); + mProblem_RunCurrentCase->setEnabled(idx.isValid() && ui->actionRun->isEnabled()); menu.exec(ui->tblProblemCases->mapToGlobal(pos)); } @@ -3846,7 +3846,7 @@ void MainWindow::onProblemCaseIndexChanged(const QModelIndex ¤t, const QMo POJProblemCase problemCase = mOJProblemModel.getCase(idx.row()); if (problemCase) { ui->btnRemoveProblemCase->setEnabled(true); - ui->btnRunAllProblemCases->setEnabled(true); + ui->btnRunAllProblemCases->setEnabled(ui->actionRun->isEnabled()); fillProblemCaseInputAndExpected(problemCase); ui->txtProblemCaseOutput->clear(); ui->txtProblemCaseOutput->setPlainText(problemCase->output);