diff --git a/src/lib/gui/MainWindow.cpp b/src/lib/gui/MainWindow.cpp index b609eaaa4..8cf76a25c 100644 --- a/src/lib/gui/MainWindow.cpp +++ b/src/lib/gui/MainWindow.cpp @@ -424,10 +424,7 @@ void MainWindow::stopCore() void MainWindow::clearSettings() { - if (!messages::showClearSettings(this)) { - qDebug() << "clear settings cancelled"; - return; - } + qDebug() << "clearing settings"; m_networkMonitor->stopMonitoring(); diff --git a/src/lib/gui/Messages.cpp b/src/lib/gui/Messages.cpp index 7e59ae490..919eca21e 100644 --- a/src/lib/gui/Messages.cpp +++ b/src/lib/gui/Messages.cpp @@ -205,17 +205,6 @@ bool showNewClientPrompt(QWidget *parent, const QString &clientName) return message.buttonRole(message.clickedButton()) == QMessageBox::AcceptRole; } -bool showClearSettings(QWidget *parent) -{ - const auto title = QObject::tr("%1 Clear Settings").arg(kAppName); - const auto message = QObject::tr( - "

Are you sure you want to clear all settings and restart %1?

" - "

This action cannot be undone.

" - ) - .arg(kAppName); - return QMessageBox::question(parent, title, message) == QMessageBox::Yes; -} - void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath) { const auto title = QObject::tr("%1 Read-only settings").arg(kAppName); diff --git a/src/lib/gui/Messages.h b/src/lib/gui/Messages.h index 31f04beb5..0b05cf767 100644 --- a/src/lib/gui/Messages.h +++ b/src/lib/gui/Messages.h @@ -27,8 +27,6 @@ void showCloseReminder(QWidget *parent); bool showNewClientPrompt(QWidget *parent, const QString &clientName); -bool showClearSettings(QWidget *parent); - void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath); bool showUpdateCheckOption(QWidget *parent); diff --git a/src/lib/gui/dialogs/SettingsDialog.cpp b/src/lib/gui/dialogs/SettingsDialog.cpp index 3dd383087..2e306d745 100644 --- a/src/lib/gui/dialogs/SettingsDialog.cpp +++ b/src/lib/gui/dialogs/SettingsDialog.cpp @@ -109,7 +109,7 @@ void SettingsDialog::initConnections() const connect(ui->groupSecurity, &QGroupBox::toggled, this, &SettingsDialog::updateTlsControlsEnabled); connect(ui->groupService, &QGroupBox::toggled, this, &SettingsDialog::updateControls); - connect(ui->btnClearAllSettings, &QPushButton::clicked, this, &SettingsDialog::requestRemoveAllSettings); + connect(ui->btnClearAllSettings, &QPushButton::clicked, this, &SettingsDialog::resetAllSettings); connect(ui->btnTlsRegenCert, &QPushButton::clicked, this, &SettingsDialog::regenCertificates); connect(ui->comboTlsKeyLength, &QComboBox::currentIndexChanged, this, &SettingsDialog::updateRequestedKeySize); connect(ui->btnTlsCertPath, &QPushButton::clicked, this, &SettingsDialog::browseCertificatePath); @@ -202,6 +202,17 @@ void SettingsDialog::showReadOnlyMessage() messages::showReadOnlySettings(this, Settings::settingsFile()); } +void SettingsDialog::resetAllSettings() +{ + auto result = QMessageBox::question( + this, tr("%1 Clear Settings").arg(kAppName), + tr("

Are you sure you want to clear all settings and restart %1?

This action cannot be undone.

") + .arg(kAppName) + ); + if (result == QMessageBox::Yes) + Q_EMIT requestRemoveAllSettings(); +} + void SettingsDialog::updateText() { const auto logLevels = LogLevel::logLevelNames().count(); diff --git a/src/lib/gui/dialogs/SettingsDialog.h b/src/lib/gui/dialogs/SettingsDialog.h index 48704ea50..b6a8e6a55 100644 --- a/src/lib/gui/dialogs/SettingsDialog.h +++ b/src/lib/gui/dialogs/SettingsDialog.h @@ -43,6 +43,7 @@ private: void updateTlsControls(); void updateTlsControlsEnabled(); void showReadOnlyMessage(); + void resetAllSettings(); void updateText(); /// @brief Load all settings. diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index 53c5f5d3e..f0a6b9e97 100644 --- a/translations/deskflow_es.ts +++ b/translations/deskflow_es.ts @@ -700,14 +700,6 @@ Además, verifique que puede %1 el archivo de configuración del servidor: %2A new client called '%1' wants to connect Un nuevo cliente llamado '%1' quiere conectarse - - %1 Clear Settings - %1 Borrar configuración - - - <p>Are you sure you want to clear all settings and restart %1?</p><p>This action cannot be undone.</p> - <p>¿Está seguro de que desea borrar todas las configuraciones y reiniciar %1?</p><p>Esta acción no se puede deshacer.</p> - %1 Read-only settings %1 Configuración de solo lectura @@ -1167,6 +1159,14 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU Always run as system (work at login screen and UAC) Ejecutar siempre como sistema (funcionar en la pantalla de inicio de sesión y UAC) + + %1 Clear Settings + %1 Borrar configuración + + + <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + Required messages Mensajes obligatorios diff --git a/translations/deskflow_it.ts b/translations/deskflow_it.ts index 44c8ebd33..178a51222 100644 --- a/translations/deskflow_it.ts +++ b/translations/deskflow_it.ts @@ -700,14 +700,6 @@ Inoltre, verifica di poter %1 il file di configurazione del server: %2A new client called '%1' wants to connect Un nuovo client chiamato "%1" vuole connettersi - - %1 Clear Settings - %1 Azzera Impostazioni - - - <p>Are you sure you want to clear all settings and restart %1?</p><p>This action cannot be undone.</p> - <p>Sei sicuro di voler azzerare tutte le impostazioni e riavviare %1?</p><p>Questa azione non può essere annullata.</p> - %1 Read-only settings %1 Impostazioni di sola lettura @@ -1167,6 +1159,14 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf Always run as system (work at login screen and UAC) Esegui sempre come sistema (funziona nella schermata di accesso e UAC) + + %1 Clear Settings + %1 Azzera Impostazioni + + + <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + Required messages Messaggi richiesti diff --git a/translations/deskflow_ja.ts b/translations/deskflow_ja.ts index 62732aef6..2354a43a8 100644 --- a/translations/deskflow_ja.ts +++ b/translations/deskflow_ja.ts @@ -702,14 +702,6 @@ Additionally, check you are able to %1 the server config file: %2 A new client called '%1' wants to connect 新しいクライアント '%1' が接続を求めています - - %1 Clear Settings - %1 設定消去 - - - <p>Are you sure you want to clear all settings and restart %1?</p><p>This action cannot be undone.</p> - <p>全ての設定を消去して %1 を再起動しますか?</p><p>この操作は取り消せません。</p> - %1 Read-only settings %1 読み取り専用設定 @@ -1193,6 +1185,14 @@ Enabling this setting will disable the server config GUI. Save log file to... ログをファイルに保存… + + %1 Clear Settings + %1 設定消去 + + + <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + Required messages 必須のメッセージ diff --git a/translations/deskflow_ko.ts b/translations/deskflow_ko.ts index 727b97d47..a813da719 100644 --- a/translations/deskflow_ko.ts +++ b/translations/deskflow_ko.ts @@ -700,14 +700,6 @@ Additionally, check you are able to %1 the server config file: %2 A new client called '%1' wants to connect 새 클라이언트 '%1'이(가) 연결을 요청합니다 - - %1 Clear Settings - %1 설정 초기화 - - - <p>Are you sure you want to clear all settings and restart %1?</p><p>This action cannot be undone.</p> - <p>모든 설정을 초기화하고 %1을(를) 재시작할까요?</p><p>이 작업은 번복될 수 없습니다.</p> - %1 Read-only settings %1 읽기 전용 설정 @@ -1191,6 +1183,14 @@ Enabling this setting will disable the server config GUI. Save log file to... 로그 파일 저장 위치... + + %1 Clear Settings + %1 설정 초기화 + + + <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + Required messages 필수 메시지 diff --git a/translations/deskflow_ru.ts b/translations/deskflow_ru.ts index c4de5ed55..411d74f63 100644 --- a/translations/deskflow_ru.ts +++ b/translations/deskflow_ru.ts @@ -700,14 +700,6 @@ Additionally, check you are able to %1 the server config file: %2 A new client called '%1' wants to connect Новый клиент '%1' хочет подключиться - - %1 Clear Settings - %1 Сброс настроек - - - <p>Are you sure you want to clear all settings and restart %1?</p><p>This action cannot be undone.</p> - <p>Вы уверены, что хотите сбросить все настройки и перезапустить %1?</p><p>Это действие нельзя отменить.</p> - %1 Read-only settings %1 Настройки только для чтения @@ -1189,6 +1181,14 @@ Enabling this setting will disable the server config GUI. Save log file to... Сохранить файл журнала в... + + %1 Clear Settings + %1 Сброс настроек + + + <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + Required messages Обязательные сообщения diff --git a/translations/deskflow_zh_CN.ts b/translations/deskflow_zh_CN.ts index 00295865f..b779e4bad 100644 --- a/translations/deskflow_zh_CN.ts +++ b/translations/deskflow_zh_CN.ts @@ -702,14 +702,6 @@ Additionally, check you are able to %1 the server config file: %2 A new client called '%1' wants to connect 名为“%1”的新客户端请求连接 - - %1 Clear Settings - %1 清除设置 - - - <p>Are you sure you want to clear all settings and restart %1?</p><p>This action cannot be undone.</p> - <p>您确定要清除所有设置并重启 %1 吗?</p><p>此操作无法撤销。</p> - %1 Read-only settings %1 只读设置 @@ -1193,6 +1185,14 @@ Enabling this setting will disable the server config GUI. Save log file to... 保存日志文件到... + + %1 Clear Settings + %1 清除设置 + + + <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + Required messages 必要消息