diff --git a/src/lib/gui/MainWindow.cpp b/src/lib/gui/MainWindow.cpp index 4c83f21d8..b609eaaa4 100644 --- a/src/lib/gui/MainWindow.cpp +++ b/src/lib/gui/MainWindow.cpp @@ -70,7 +70,6 @@ MainWindow::MainWindow() m_menuView{new QMenu(this)}, m_menuHelp{new QMenu(this)}, m_actionAbout{new QAction(this)}, - m_actionClearSettings{new QAction(this)}, m_actionMinimize{new QAction(this)}, m_actionQuit{new QAction(this)}, m_actionTrayQuit{new QAction(this)}, @@ -106,9 +105,6 @@ MainWindow::MainWindow() m_actionTrayQuit->setIcon(QIcon::fromTheme("application-exit")); m_actionTrayQuit->setMenuRole(QAction::NoRole); - m_actionClearSettings->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear-all"))); - m_actionClearSettings->setMenuRole(QAction::NoRole); - m_actionSettings->setIcon(QIcon::fromTheme(QStringLiteral("configure"))); m_actionSettings->setMenuRole(QAction::PreferencesRole); @@ -259,7 +255,6 @@ void MainWindow::connectSlots() connect(&m_coreProcess, &CoreProcess::securityLevelChanged, m_statusBar, &StatusBar::setSecurityLevel); connect(m_actionAbout, &QAction::triggered, this, &MainWindow::openAboutDialog); - connect(m_actionClearSettings, &QAction::triggered, this, &MainWindow::clearSettings); connect(m_actionMinimize, &QAction::triggered, this, &MainWindow::hide); connect(m_actionQuit, &QAction::triggered, this, &MainWindow::close); @@ -476,8 +471,10 @@ void MainWindow::openSettings() { auto dialog = SettingsDialog(this, m_serverConfig); + connect(&dialog, &SettingsDialog::requestRemoveAllSettings, this, &MainWindow::clearSettings, Qt::UniqueConnection); if (dialog.exec() == QDialog::Accepted) { Settings::save(); + disconnect(&dialog, &SettingsDialog::requestRemoveAllSettings, nullptr, nullptr); applyConfig(); @@ -675,8 +672,6 @@ void MainWindow::createMenuBar() m_menuHelp->addAction(m_actionAbout); m_menuHelp->addAction(m_actionShowHelp); - m_menuHelp->addSeparator(); - m_menuHelp->addAction(m_actionClearSettings); auto menuBar = new QMenuBar(this); menuBar->addMenu(m_menuFile); @@ -1060,7 +1055,6 @@ void MainWindow::updateText() m_menuView->setTitle(tr("&View")); m_menuHelp->setTitle(tr("&Help")); - m_actionClearSettings->setText(tr("Clear settings")); m_actionMinimize->setText(tr("&Minimize to tray")); m_actionQuit->setText(tr("&Quit")); m_actionTrayQuit->setText(tr("&Quit")); diff --git a/src/lib/gui/MainWindow.h b/src/lib/gui/MainWindow.h index c8b1ea8d4..0e6c6d623 100644 --- a/src/lib/gui/MainWindow.h +++ b/src/lib/gui/MainWindow.h @@ -193,7 +193,6 @@ private: // Window Actions QAction *m_actionAbout = nullptr; - QAction *m_actionClearSettings = nullptr; QAction *m_actionMinimize = nullptr; QAction *m_actionQuit = nullptr; QAction *m_actionTrayQuit = nullptr; diff --git a/src/lib/gui/dialogs/SettingsDialog.cpp b/src/lib/gui/dialogs/SettingsDialog.cpp index bd9cf4360..3dd383087 100644 --- a/src/lib/gui/dialogs/SettingsDialog.cpp +++ b/src/lib/gui/dialogs/SettingsDialog.cpp @@ -44,6 +44,8 @@ SettingsDialog::SettingsDialog(QWidget *parent, const ServerConfig &serverConfig updateText(); + ui->btnClearAllSettings->setIcon(QIcon::fromTheme(QStringLiteral("edit-clear-all"))); + ui->comboTlsKeyLength->setItemIcon(0, QIcon::fromTheme(QStringLiteral("security-medium"))); ui->comboTlsKeyLength->setItemIcon(1, QIcon::fromTheme(QIcon::ThemeIcon::SecurityHigh)); ui->lblTlsCertInfo->setFixedSize(28, 28); @@ -107,6 +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->btnTlsRegenCert, &QPushButton::clicked, this, &SettingsDialog::regenCertificates); connect(ui->comboTlsKeyLength, &QComboBox::currentIndexChanged, this, &SettingsDialog::updateRequestedKeySize); connect(ui->btnTlsCertPath, &QPushButton::clicked, this, &SettingsDialog::browseCertificatePath); diff --git a/src/lib/gui/dialogs/SettingsDialog.h b/src/lib/gui/dialogs/SettingsDialog.h index a2a003738..48704ea50 100644 --- a/src/lib/gui/dialogs/SettingsDialog.h +++ b/src/lib/gui/dialogs/SettingsDialog.h @@ -26,6 +26,7 @@ public: Q_SIGNALS: void shown(); + void requestRemoveAllSettings(); protected: void changeEvent(QEvent *e) override; diff --git a/src/lib/gui/dialogs/SettingsDialog.ui b/src/lib/gui/dialogs/SettingsDialog.ui index 5f3e5ed50..051a81096 100644 --- a/src/lib/gui/dialogs/SettingsDialog.ui +++ b/src/lib/gui/dialogs/SettingsDialog.ui @@ -853,6 +853,13 @@ + + + + Remove all settings + + + diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index d1690922a..53c5f5d3e 100644 --- a/translations/deskflow_es.ts +++ b/translations/deskflow_es.ts @@ -380,10 +380,6 @@ Do you want to connect to the server? Restart Reanudar - - Clear settings - Borrar configuración - &Minimize to tray &Minimizar a la bandeja @@ -1295,6 +1291,10 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU Using a log level higher than Info may affect performance. Utilizar un nivel de registro superior a Info puede afectar el rendimiento. + + Remove all settings + Eliminar todas las configuraciones + StatusBar diff --git a/translations/deskflow_it.ts b/translations/deskflow_it.ts index 9416104ea..44c8ebd33 100644 --- a/translations/deskflow_it.ts +++ b/translations/deskflow_it.ts @@ -368,10 +368,6 @@ Vuoi connetterti al server? Restart Riavvia - - Clear settings - Cancella impostazioni - &Minimize to tray &Minimizza a icona @@ -1295,6 +1291,10 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf Using a log level higher than Info may affect performance. L'utilizzo di un livello di log superiore a Info potrebbe influire sulle prestazioni. + + Remove all settings + Rimuovi tutte le impostazioni + StatusBar diff --git a/translations/deskflow_ja.ts b/translations/deskflow_ja.ts index 488d0461f..62732aef6 100644 --- a/translations/deskflow_ja.ts +++ b/translations/deskflow_ja.ts @@ -482,10 +482,6 @@ A bound IP is now invalid, you may need to restart the server. &Help ヘルプ(&H) - - Clear settings - 設定を消去 - &Minimize to tray トレイに最小化(&M) @@ -1297,6 +1293,10 @@ Enabling this setting will disable the server config GUI. Using a log level higher than Info may affect performance. Infoよりも高いログレベルを使用すると、パフォーマンスに影響を及ぼす可能性があります。 + + Remove all settings + すべての設定を削除する + StatusBar diff --git a/translations/deskflow_ko.ts b/translations/deskflow_ko.ts index 93e59b657..727b97d47 100644 --- a/translations/deskflow_ko.ts +++ b/translations/deskflow_ko.ts @@ -482,10 +482,6 @@ A bound IP is now invalid, you may need to restart the server. &Help 도움말(&H) - - Clear settings - 설정 초기화 - &Minimize to tray 트레이로 최소화(&M) @@ -1295,6 +1291,10 @@ Enabling this setting will disable the server config GUI. Using a log level higher than Info may affect performance. Info보다 높은 로그 레벨을 사용하면 성능에 영향을 미칠 수 있습니다. + + Remove all settings + 모든 설정 제거 + StatusBar diff --git a/translations/deskflow_ru.ts b/translations/deskflow_ru.ts index ce468fd04..c4de5ed55 100644 --- a/translations/deskflow_ru.ts +++ b/translations/deskflow_ru.ts @@ -482,10 +482,6 @@ A bound IP is now invalid, you may need to restart the server. &Help &Справка - - Clear settings - Сбросить настройки - &Minimize to tray &Свернуть в трей @@ -1293,6 +1289,10 @@ Enabling this setting will disable the server config GUI. Using a log level higher than Info may affect performance. Использование уровня логирования выше Info может повлиять на производительность. + + Remove all settings + Удалить все настройки + StatusBar diff --git a/translations/deskflow_zh_CN.ts b/translations/deskflow_zh_CN.ts index 2dac5f129..00295865f 100644 --- a/translations/deskflow_zh_CN.ts +++ b/translations/deskflow_zh_CN.ts @@ -482,10 +482,6 @@ A bound IP is now invalid, you may need to restart the server. &Help 帮助(&H) - - Clear settings - 清除设置 - &Minimize to tray 最小化到托盘(&M) @@ -1297,6 +1293,10 @@ Enabling this setting will disable the server config GUI. Using a log level higher than Info may affect performance. 使用高于 Info 级别的日志级别可能会影响性能。 + + Remove all settings + 移除所有设置 + StatusBar