- fix: compiler settings not correctly saved

This commit is contained in:
Roy Qu 2022-06-13 16:31:41 +08:00
parent f258f56117
commit 9545ad9b6f
4 changed files with 20 additions and 7 deletions

View File

@ -13,6 +13,7 @@ Red Panda C++ Version 1.1.0
- enhancement: hide all menu actions in the option dialog's shortcut panel - 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: add 'run all problem cases' / 'run current problem case' / 'batch set cases' to the option dialog's shortcut panel
- enhancement: more templates for raylib - enhancement: more templates for raylib
- fix: compiler settings not correctly saved
Red Panda C++ Version 1.0.10 Red Panda C++ Version 1.0.10
- fix: modify watch doesn't work - fix: modify watch doesn't work

View File

@ -2229,11 +2229,12 @@ void MainWindow::buildContextMenus()
this, &MainWindow::onLstProblemSetContextMenu); this, &MainWindow::onLstProblemSetContextMenu);
mProblem_Properties = createActionFor( mProblem_Properties = createActionFor(
tr("Properties..."), tr("Properties..."),
ui->lstProblemSet this
); );
mProblem_Properties->setObjectName("Probelm_Properties"); mProblem_Properties->setObjectName("actionProbelm_Properties");
connect(mProblem_Properties, &QAction::triggered, this, connect(mProblem_Properties, &QAction::triggered, this,
&MainWindow::onProblemProperties); &MainWindow::onProblemProperties);
mProblem_OpenSource=createActionFor( mProblem_OpenSource=createActionFor(
tr("Open Source File"), tr("Open Source File"),
ui->lstProblemSet ui->lstProblemSet
@ -2247,7 +2248,7 @@ void MainWindow::buildContextMenus()
this, &MainWindow::onTableProblemCasesContextMenu); this, &MainWindow::onTableProblemCasesContextMenu);
mProblem_RunAllCases = createActionFor( mProblem_RunAllCases = createActionFor(
tr("Run All Cases"), tr("Run All Cases"),
ui->tblProblemCases this
); );
mProblem_RunAllCases->setObjectName("Problem_RunAllCases"); mProblem_RunAllCases->setObjectName("Problem_RunAllCases");
connect(mProblem_RunAllCases, &QAction::triggered, this, connect(mProblem_RunAllCases, &QAction::triggered, this,
@ -2255,7 +2256,7 @@ void MainWindow::buildContextMenus()
mProblem_RunCurrentCase = createActionFor( mProblem_RunCurrentCase = createActionFor(
tr("Run Current Case"), tr("Run Current Case"),
ui->tblProblemCases this
); );
mProblem_RunCurrentCase->setObjectName("Problem_RunCurrentCases"); mProblem_RunCurrentCase->setObjectName("Problem_RunCurrentCases");
connect(mProblem_RunCurrentCase, &QAction::triggered, this, connect(mProblem_RunCurrentCase, &QAction::triggered, this,
@ -2263,7 +2264,7 @@ void MainWindow::buildContextMenus()
mProblem_batchSetCases = createActionFor( mProblem_batchSetCases = createActionFor(
tr("Batch Set Cases"), tr("Batch Set Cases"),
ui->tblProblemCases); this);
mProblem_batchSetCases->setObjectName("Problem_BatchSetCases"); mProblem_batchSetCases->setObjectName("Problem_BatchSetCases");
connect(mProblem_batchSetCases, &QAction::triggered, this, connect(mProblem_batchSetCases, &QAction::triggered, this,
&MainWindow::onProblemBatchSetCases); &MainWindow::onProblemBatchSetCases);
@ -3260,12 +3261,16 @@ void MainWindow::onProblemNameChanged(int index)
void MainWindow::onProblemRunCurrentCase() void MainWindow::onProblemRunCurrentCase()
{ {
if (!ui->tblProblemCases->currentIndex().isValid())
return;
showHideMessagesTab(ui->tabProblem,ui->actionProblem);
applyCurrentProblemCaseChanges(); applyCurrentProblemCaseChanges();
runExecutable(RunType::CurrentProblemCase); runExecutable(RunType::CurrentProblemCase);
} }
void MainWindow::onProblemBatchSetCases() void MainWindow::onProblemBatchSetCases()
{ {
showHideMessagesTab(ui->tabProblem,ui->actionProblem);
if (mOJProblemModel.count()>0 && QMessageBox::question(this,tr("Batch Set Cases"), if (mOJProblemModel.count()>0 && QMessageBox::question(this,tr("Batch Set Cases"),
tr("This operation will remove all cases for the current problem.") tr("This operation will remove all cases for the current problem.")
+"<br />" +"<br />"
@ -3522,6 +3527,7 @@ void MainWindow::onFilesViewRename() {
void MainWindow::onProblemProperties() void MainWindow::onProblemProperties()
{ {
showHideMessagesTab(ui->tabProblem,ui->actionProblem);
QModelIndex idx = ui->lstProblemSet->currentIndex(); QModelIndex idx = ui->lstProblemSet->currentIndex();
if (!idx.isValid()) if (!idx.isValid())
return; return;
@ -6863,7 +6869,10 @@ void MainWindow::on_btnAddProblemCase_clicked()
} }
void MainWindow::on_btnRunAllProblemCases_clicked() void MainWindow::on_btnRunAllProblemCases_clicked()
{ {
if (mOJProblemModel.count()<=0)
return;
showHideMessagesTab(ui->tabProblem,ui->actionProblem);
applyCurrentProblemCaseChanges(); applyCurrentProblemCaseChanges();
runExecutable(RunType::ProblemCases); runExecutable(RunType::ProblemCases);
} }

View File

@ -2682,6 +2682,9 @@ void Settings::CompilerSets::saveSet(int index)
savePath("profiler", pSet->profiler()); savePath("profiler", pSet->profiler());
mSettings->mSettings.remove("Options"); mSettings->mSettings.remove("Options");
foreach(const PCompilerOption& option, pCompilerInfoManager->getCompilerOptions(pSet->compilerType())) {
mSettings->mSettings.remove(option->key);
}
// Save option string // Save option string
for (const QString& optionKey : pSet->compileOptions().keys()) { for (const QString& optionKey : pSet->compileOptions().keys()) {
mSettings->mSettings.setValue(optionKey, pSet->compileOptions().value(optionKey)); mSettings->mSettings.setValue(optionKey, pSet->compileOptions().value(optionKey));

View File

@ -110,7 +110,7 @@
<item> <item>
<widget class="QTabWidget" name="settingTabs"> <widget class="QTabWidget" name="settingTabs">
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<property name="movable"> <property name="movable">
<bool>false</bool> <bool>false</bool>