mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Improve Color Theme Copy Feature (#1560)
This commit is contained in:
parent
2012637922
commit
822034b392
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user