refactor: Message::showClearSettings, enable translations and simplify method
This commit is contained in:
parent
b8835a8a5a
commit
0f5a04825a
1 changed files with 6 additions and 10 deletions
|
|
@ -247,17 +247,13 @@ NewClientPromptResult showNewClientPrompt(QWidget *parent, const QString &client
|
||||||
|
|
||||||
bool showClearSettings(QWidget *parent)
|
bool showClearSettings(QWidget *parent)
|
||||||
{
|
{
|
||||||
QMessageBox message(parent);
|
const auto title = QObject::tr("%1 Clear Settings").arg(kAppName);
|
||||||
message.addButton(QObject::tr("Cancel"), QMessageBox::RejectRole);
|
const auto message = QObject::tr(
|
||||||
const auto clear = message.addButton(QObject::tr("Clear settings"), QMessageBox::AcceptRole);
|
"<p>Are you sure you want to clear all settings and restart %1?</p>"
|
||||||
message.setText(QString(
|
"<p>This action cannot be undone.</p>"
|
||||||
"<p>Are you sure you want to clear all settings and restart %1?</p>"
|
|
||||||
"<p>This action cannot be undone.</p>"
|
|
||||||
)
|
)
|
||||||
.arg(kAppName));
|
.arg(kAppName);
|
||||||
message.exec();
|
return QMessageBox::question(parent, title, message) == QMessageBox::Yes;
|
||||||
|
|
||||||
return message.clickedButton() == clear;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath)
|
void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue