- fix: button "run all problem cases" not disabled when compiling or debugging

This commit is contained in:
Roy Qu 2021-12-14 08:42:00 +08:00
parent c3ea1e6dd4
commit f0960f0dcb
2 changed files with 16 additions and 12 deletions

View File

@ -1,3 +1,6 @@
Version 0.11.2 For Dev-C++ 7 Beta
- fix: button "run all problem cases" not disabled when compiling or debugging
Version 0.11.1 For Dev-C++ 7 Beta
- enhancement: Problem's test case shouldn't accept rich text inputs
- enhancement: recalc layout info for code editors when dpi changed

View File

@ -456,13 +456,14 @@ void MainWindow::updateCompileActions()
ui->actionRun->setEnabled(false);
ui->actionRebuild->setEnabled(false);
ui->actionDebug->setEnabled(false);
ui->btnRunAllProblemCases->setEnabled(false);
} else {
ui->actionCompile->setEnabled(true);
ui->actionCompile_Run->setEnabled(true);
ui->actionRun->setEnabled(true);
ui->actionRebuild->setEnabled(true);
ui->actionDebug->setEnabled(true);
ui->btnRunAllProblemCases->setEnabled(true);
}
if (!mDebugger->executing()) {
disableDebugActions();
@ -1177,18 +1178,18 @@ void MainWindow::runExecutable(const QString &exeName,const QString &filename,Ru
}
} else {
if (!filename.isEmpty() && compareFileModifiedTime(filename,exeName)>=0) {
if (ui->actionCompile_Run->isEnabled()) {
if (QMessageBox::warning(this,tr("Confirm"),
tr("Source file is more recent than executable.")
+"<br /><br />"+tr("Recompile now?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
doCompileRun(runType);
return;
}
} else {
QMessageBox::warning(this,"Error",
tr("Source file is more recent than executable."));
// if (ui->actionCompile_Run->isEnabled()) {
if (QMessageBox::warning(this,tr("Confirm"),
tr("Source file is more recent than executable.")
+"<br /><br />"+tr("Recompile now?"),
QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
doCompileRun(runType);
return;
}
// } else {
// QMessageBox::warning(this,"Error",
// tr("Source file is more recent than executable."));
// }
}
}