- fix: Restore project's original compiler set if user choose 'No' in the confirm project compiler set change dialog.

This commit is contained in:
Roy Qu 2022-10-26 08:45:18 +08:00
parent 3cbd323f97
commit 6bf443d3d8
2 changed files with 10 additions and 5 deletions

View File

@ -30,6 +30,7 @@ Red Panda C++ Version 2.0
- enhancement: when new header in the project view, auto select basename in the filename dialog
- enhancement: when add file in the project view, auto select basename in the filename dialog
- change: Don't generate localized filename when new header/add file in the project view
- fix: Restore project's original compiler set if user choose 'No' in the confirm project compiler set change dialog.
Red Panda C++ Version 1.5

View File

@ -1493,9 +1493,9 @@ void MainWindow::updateCompilerSet()
if ( !e || e->inProject()) {
index = mProject->options().compilerSet;
}
}
if (index < 0 || index>=mCompilerSet->count()) {
index = pSettings->compilerSets().defaultIndex();
if (index < 0 || index>=mCompilerSet->count()) {
index = pSettings->compilerSets().defaultIndex();
}
}
mCompilerSet->setCurrentIndex(index);
mCompilerSet->blockSignals(false);
@ -5030,7 +5030,10 @@ void MainWindow::onCompilerSetChanged(int index)
if (index<0)
return;
Editor *e = mEditorList->getEditor();
if (mProject && (!e || e->inProject())) {
if ( mProject && (!e || e->inProject())
) {
if (index==mProject->options().compilerSet)
return;
if(QMessageBox::warning(
e,
tr("Change Project Compiler Set"),
@ -5039,9 +5042,10 @@ void MainWindow::onCompilerSetChanged(int index)
+ tr("Do you really want to do that?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No) != QMessageBox::Yes) {
mCompilerSet->setCurrentIndex(mProject->options().compilerSet);
return;
}
mProject->setCompilerSet(index);
mProject->setCompilerSet(mProject->options().compilerSet);
mProject->saveOptions();
scanActiveProject(true);
return;