diff --git a/NEWS.md b/NEWS.md index 4517a26a..0511ddd4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -13,6 +13,7 @@ Red Panda C++ Version 1.1.0 - enhancement: hide all menu actions in the option dialog's shortcut panel - enhancement: add 'run all problem cases' / 'run current problem case' / 'batch set cases' to the option dialog's shortcut panel - enhancement: more templates for raylib + - fix: compiler settings not correctly saved Red Panda C++ Version 1.0.10 - fix: modify watch doesn't work diff --git a/RedPandaIDE/mainwindow.cpp b/RedPandaIDE/mainwindow.cpp index aa01aa17..504f7fcb 100644 --- a/RedPandaIDE/mainwindow.cpp +++ b/RedPandaIDE/mainwindow.cpp @@ -2229,11 +2229,12 @@ void MainWindow::buildContextMenus() this, &MainWindow::onLstProblemSetContextMenu); mProblem_Properties = createActionFor( tr("Properties..."), - ui->lstProblemSet + this ); - mProblem_Properties->setObjectName("Probelm_Properties"); + mProblem_Properties->setObjectName("actionProbelm_Properties"); connect(mProblem_Properties, &QAction::triggered, this, &MainWindow::onProblemProperties); + mProblem_OpenSource=createActionFor( tr("Open Source File"), ui->lstProblemSet @@ -2247,7 +2248,7 @@ void MainWindow::buildContextMenus() this, &MainWindow::onTableProblemCasesContextMenu); mProblem_RunAllCases = createActionFor( tr("Run All Cases"), - ui->tblProblemCases + this ); mProblem_RunAllCases->setObjectName("Problem_RunAllCases"); connect(mProblem_RunAllCases, &QAction::triggered, this, @@ -2255,7 +2256,7 @@ void MainWindow::buildContextMenus() mProblem_RunCurrentCase = createActionFor( tr("Run Current Case"), - ui->tblProblemCases + this ); mProblem_RunCurrentCase->setObjectName("Problem_RunCurrentCases"); connect(mProblem_RunCurrentCase, &QAction::triggered, this, @@ -2263,7 +2264,7 @@ void MainWindow::buildContextMenus() mProblem_batchSetCases = createActionFor( tr("Batch Set Cases"), - ui->tblProblemCases); + this); mProblem_batchSetCases->setObjectName("Problem_BatchSetCases"); connect(mProblem_batchSetCases, &QAction::triggered, this, &MainWindow::onProblemBatchSetCases); @@ -3260,12 +3261,16 @@ void MainWindow::onProblemNameChanged(int index) void MainWindow::onProblemRunCurrentCase() { + if (!ui->tblProblemCases->currentIndex().isValid()) + return; + showHideMessagesTab(ui->tabProblem,ui->actionProblem); applyCurrentProblemCaseChanges(); runExecutable(RunType::CurrentProblemCase); } void MainWindow::onProblemBatchSetCases() { + showHideMessagesTab(ui->tabProblem,ui->actionProblem); if (mOJProblemModel.count()>0 && QMessageBox::question(this,tr("Batch Set Cases"), tr("This operation will remove all cases for the current problem.") +"
" @@ -3522,6 +3527,7 @@ void MainWindow::onFilesViewRename() { void MainWindow::onProblemProperties() { + showHideMessagesTab(ui->tabProblem,ui->actionProblem); QModelIndex idx = ui->lstProblemSet->currentIndex(); if (!idx.isValid()) return; @@ -6863,7 +6869,10 @@ void MainWindow::on_btnAddProblemCase_clicked() } void MainWindow::on_btnRunAllProblemCases_clicked() -{ +{ + if (mOJProblemModel.count()<=0) + return; + showHideMessagesTab(ui->tabProblem,ui->actionProblem); applyCurrentProblemCaseChanges(); runExecutable(RunType::ProblemCases); } diff --git a/RedPandaIDE/settings.cpp b/RedPandaIDE/settings.cpp index 98902eb6..a946c186 100644 --- a/RedPandaIDE/settings.cpp +++ b/RedPandaIDE/settings.cpp @@ -2682,6 +2682,9 @@ void Settings::CompilerSets::saveSet(int index) savePath("profiler", pSet->profiler()); mSettings->mSettings.remove("Options"); + foreach(const PCompilerOption& option, pCompilerInfoManager->getCompilerOptions(pSet->compilerType())) { + mSettings->mSettings.remove(option->key); + } // Save option string for (const QString& optionKey : pSet->compileOptions().keys()) { mSettings->mSettings.setValue(optionKey, pSet->compileOptions().value(optionKey)); diff --git a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui index bcc48cf5..edfb6b0d 100644 --- a/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui +++ b/RedPandaIDE/settingsdialog/compilersetoptionwidget.ui @@ -110,7 +110,7 @@ - 1 + 0 false