- enhancement: Confirm before remove a compiler set.

This commit is contained in:
Roy Qu 2023-01-20 00:08:16 +08:00
parent b0be83b006
commit 22e1339b1a
4 changed files with 454 additions and 416 deletions

View File

@ -295,18 +295,30 @@ void CompilerSetOptionWidget::on_btnAddCompilerSetByFolder_clicked()
void CompilerSetOptionWidget::on_btnRenameCompilerSet_clicked()
{
Settings::PCompilerSet set=pSettings->compilerSets().getSet(ui->cbCompilerSet->currentIndex());
if (!set)
return;
QString name = QInputDialog::getText(this,tr("Compiler Set Name"),tr("New name"),QLineEdit::Normal,
pSettings->compilerSets().defaultSet()->name());
set->name());
if (!name.isEmpty())
pSettings->compilerSets().defaultSet()->setName(name);
set->setName(name);
doLoad();
}
void CompilerSetOptionWidget::on_btnRemoveCompilerSet_clicked()
{
Settings::PCompilerSet set=pSettings->compilerSets().getSet(ui->cbCompilerSet->currentIndex());
if (!set)
return;
if (QMessageBox::question(this,
QObject::tr("Remove"),
QString(QObject::tr("Do you really want to remove \"%1\"?")).arg(set->name()),
QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel)==QMessageBox::Yes) {
pSettings->compilerSets().deleteSet(ui->cbCompilerSet->currentIndex());
doLoad();
}
}
void CompilerSetOptionWidget::updateIcons(const QSize& /*size*/)
{

View File

@ -6471,6 +6471,14 @@
<source>Error when writing file &quot;%1&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want to remove &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RegisterModel</name>

File diff suppressed because it is too large Load Diff

View File

@ -6120,6 +6120,14 @@
<source>Error when writing file &quot;%1&quot;.</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Remove</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Do you really want to remove &quot;%1&quot;?</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RegisterModel</name>