Skip to content

Commit

Permalink
Improve Color Theme Copy Feature (radareorg#1560)
Browse files Browse the repository at this point in the history
  • Loading branch information
optizone authored and thestr4ng3r committed May 19, 2019
1 parent 2012637 commit 822034b
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/dialogs/preferences/AppearanceOptionsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,19 @@ void AppearanceOptionsWidget::on_copyButton_clicked()
do {
newThemeName = QInputDialog::getText(this, tr("Enter theme name"),
tr("Name:"), QLineEdit::Normal,
currColorTheme + tr(" - copy"));
} while (!newThemeName.isEmpty() && ThemeWorker().isThemeExist(newThemeName));
currColorTheme + tr(" - copy"))
.trimmed();
if (newThemeName.isEmpty()) {
return;
}
if (ThemeWorker().isThemeExist(newThemeName)) {
QMessageBox::information(this, tr("Theme Copy"),
tr("Theme named %1 already exists.").arg(newThemeName));
} else {
break;
}
} while (true);

if (newThemeName.isEmpty()) {
return;
}
ThemeWorker().copy(currColorTheme, newThemeName);
Config()->setColorTheme(newThemeName);
updateThemeFromConfig(false);
Expand Down

0 comments on commit 822034b

Please sign in to comment.