- enhancement: Confirm before remove a compiler set.
This commit is contained in:
parent
b0be83b006
commit
22e1339b1a
|
@ -295,17 +295,29 @@ 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()
|
||||
{
|
||||
pSettings->compilerSets().deleteSet(ui->cbCompilerSet->currentIndex());
|
||||
doLoad();
|
||||
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*/)
|
||||
|
|
|
@ -6471,6 +6471,14 @@
|
|||
<source>Error when writing file "%1".</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to remove "%1"?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RegisterModel</name>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -6120,6 +6120,14 @@
|
|||
<source>Error when writing file "%1".</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Remove</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Do you really want to remove "%1"?</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>RegisterModel</name>
|
||||
|
|
Loading…
Reference in New Issue