mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 19:36:11 +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 {
|
do {
|
||||||
newThemeName = QInputDialog::getText(this, tr("Enter theme name"),
|
newThemeName = QInputDialog::getText(this, tr("Enter theme name"),
|
||||||
tr("Name:"), QLineEdit::Normal,
|
tr("Name:"), QLineEdit::Normal,
|
||||||
currColorTheme + tr(" - copy"));
|
currColorTheme + tr(" - copy"))
|
||||||
} while (!newThemeName.isEmpty() && ThemeWorker().isThemeExist(newThemeName));
|
.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);
|
ThemeWorker().copy(currColorTheme, newThemeName);
|
||||||
Config()->setColorTheme(newThemeName);
|
Config()->setColorTheme(newThemeName);
|
||||||
updateThemeFromConfig(false);
|
updateThemeFromConfig(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user