- enhancement: Run all cases button not correct disabled when no case exits.

This commit is contained in:
Roy Qu 2022-12-17 13:40:13 +08:00
parent 4b9e51a925
commit efc7af7f46
2 changed files with 5 additions and 4 deletions

View File

@ -11,7 +11,8 @@ Red Panda C++ Version 2.7
- enhancement: Better error message when trying to debug with Release compile set. - enhancement: Better error message when trying to debug with Release compile set.
- enhancement: Add missing space char color settings in color schemes - enhancement: Add missing space char color settings in color schemes
- enhancement: Export FPS (free problem set) files. - 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 Red Panda C++ Version 2.6

View File

@ -3786,8 +3786,8 @@ void MainWindow::onTableProblemCasesContextMenu(const QPoint &pos)
QModelIndex idx = ui->tblProblemCases->currentIndex(); QModelIndex idx = ui->tblProblemCases->currentIndex();
menu.addAction(mProblem_RunAllCases); menu.addAction(mProblem_RunAllCases);
menu.addAction(mProblem_RunCurrentCase); menu.addAction(mProblem_RunCurrentCase);
mProblem_RunAllCases->setEnabled(mOJProblemModel.count()>0); mProblem_RunAllCases->setEnabled(mOJProblemModel.count()>0 && ui->actionRun->isEnabled());
mProblem_RunCurrentCase->setEnabled(idx.isValid()); mProblem_RunCurrentCase->setEnabled(idx.isValid() && ui->actionRun->isEnabled());
menu.exec(ui->tblProblemCases->mapToGlobal(pos)); menu.exec(ui->tblProblemCases->mapToGlobal(pos));
} }
@ -3846,7 +3846,7 @@ void MainWindow::onProblemCaseIndexChanged(const QModelIndex &current, const QMo
POJProblemCase problemCase = mOJProblemModel.getCase(idx.row()); POJProblemCase problemCase = mOJProblemModel.getCase(idx.row());
if (problemCase) { if (problemCase) {
ui->btnRemoveProblemCase->setEnabled(true); ui->btnRemoveProblemCase->setEnabled(true);
ui->btnRunAllProblemCases->setEnabled(true); ui->btnRunAllProblemCases->setEnabled(ui->actionRun->isEnabled());
fillProblemCaseInputAndExpected(problemCase); fillProblemCaseInputAndExpected(problemCase);
ui->txtProblemCaseOutput->clear(); ui->txtProblemCaseOutput->clear();
ui->txtProblemCaseOutput->setPlainText(problemCase->output); ui->txtProblemCaseOutput->setPlainText(problemCase->output);