From 6692fa56366af4f85402b4eb00ca280a400aac77 Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Wed, 5 Aug 2026 23:16:24 -0400 Subject: [PATCH] refactor(SettingsDialog): move the Messages readonly dialog to the settingsDialog method --- src/lib/gui/Messages.cpp | 11 ----------- src/lib/gui/Messages.h | 2 -- src/lib/gui/dialogs/SettingsDialog.cpp | 7 +++++-- translations/deskflow_es.ts | 16 ++++++++-------- translations/deskflow_it.ts | 16 ++++++++-------- translations/deskflow_ja.ts | 16 ++++++++-------- translations/deskflow_ko.ts | 16 ++++++++-------- translations/deskflow_ru.ts | 16 ++++++++-------- translations/deskflow_zh_CN.ts | 16 ++++++++-------- 9 files changed, 53 insertions(+), 63 deletions(-) diff --git a/src/lib/gui/Messages.cpp b/src/lib/gui/Messages.cpp index 919eca21e..1071ce360 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; } -void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath) -{ - const auto title = QObject::tr("%1 Read-only settings").arg(kAppName); - const auto message = QObject::tr( - "

Settings are read-only because you only have read access " - "to the file:

%1

" - ) - .arg(QDir::toNativeSeparators(systemSettingsPath)); - QMessageBox::information(parent, title, message); -} - bool showUpdateCheckOption(QWidget *parent) { QMessageBox message(parent); diff --git a/src/lib/gui/Messages.h b/src/lib/gui/Messages.h index 0b05cf767..a4001f28a 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); -void showReadOnlySettings(QWidget *parent, const QString &systemSettingsPath); - bool showUpdateCheckOption(QWidget *parent); bool showDaemonOffline(QWidget *parent); diff --git a/src/lib/gui/dialogs/SettingsDialog.cpp b/src/lib/gui/dialogs/SettingsDialog.cpp index 2e306d745..eb655837f 100644 --- a/src/lib/gui/dialogs/SettingsDialog.cpp +++ b/src/lib/gui/dialogs/SettingsDialog.cpp @@ -13,7 +13,6 @@ #include "common/I18N.h" #include "common/Settings.h" -#include "gui/Messages.h" #include "gui/TlsUtility.h" #include "gui/core/NetworkMonitor.h" @@ -199,7 +198,11 @@ void SettingsDialog::showReadOnlyMessage() { if (Settings::isWritable()) return; - messages::showReadOnlySettings(this, Settings::settingsFile()); + QMessageBox::information( + this, tr("%1 Read-only settings").arg(kAppName), + tr("

Settings are read-only because you only have read access to the file:

%1

") + .arg(QDir::toNativeSeparators(Settings::settingsFile())) + ); } void SettingsDialog::resetAllSettings() diff --git a/translations/deskflow_es.ts b/translations/deskflow_es.ts index f0a6b9e97..6a9334a22 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 Read-only settings - %1 Configuración de solo lectura - - - <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> - <p>Las configuraciones son de solo lectura porque solo tiene acceso de lectura al archivo:</p><p>%1</p> - No thanks No, gracias @@ -1167,6 +1159,14 @@ Al habilitar esta opción, se deshabilitará la interfaz gráfica de usuario (GU <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + %1 Read-only settings + %1 Configuración de solo lectura + + + <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> + <p>Las configuraciones son de solo lectura porque solo tiene acceso de lectura al archivo:</p><p>%1</p> + Required messages Mensajes obligatorios diff --git a/translations/deskflow_it.ts b/translations/deskflow_it.ts index 178a51222..46ae2f298 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 Read-only settings - %1 Impostazioni di sola lettura - - - <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> - <p>Le impostazioni sono di sola lettura perché hai solo accesso in lettura al file:</p><p>%1</p> - No thanks No, grazie @@ -1167,6 +1159,14 @@ L'abilitazione di questa impostazione disabiliterà l'interfaccia graf <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + %1 Read-only settings + %1 Impostazioni di sola lettura + + + <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> + <p>Le impostazioni sono di sola lettura perché hai solo accesso in lettura al file:</p><p>%1</p> + Required messages Messaggi richiesti diff --git a/translations/deskflow_ja.ts b/translations/deskflow_ja.ts index 2354a43a8..a637d5000 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 Read-only settings - %1 読み取り専用設定 - - - <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> - <p>以下のファイルへの書き込み権限がないため、設定は読み取り専用です:</p><p>%1</p> - No thanks 不要です @@ -1193,6 +1185,14 @@ Enabling this setting will disable the server config GUI. <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + %1 Read-only settings + %1 読み取り専用設定 + + + <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> + <p>以下のファイルへの書き込み権限がないため、設定は読み取り専用です:</p><p>%1</p> + Required messages 必須のメッセージ diff --git a/translations/deskflow_ko.ts b/translations/deskflow_ko.ts index a813da719..e434b92b3 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 Read-only settings - %1 읽기 전용 설정 - - - <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> - <p>다음 파일에 대한 쓰기 권한이 없어 설정이 읽기 전용입니다:</p><p>%1</p> - No thanks 아니요 @@ -1191,6 +1183,14 @@ Enabling this setting will disable the server config GUI. <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + %1 Read-only settings + %1 읽기 전용 설정 + + + <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> + <p>다음 파일에 대한 쓰기 권한이 없어 설정이 읽기 전용입니다:</p><p>%1</p> + Required messages 필수 메시지 diff --git a/translations/deskflow_ru.ts b/translations/deskflow_ru.ts index 411d74f63..180f1a374 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 Read-only settings - %1 Настройки только для чтения - - - <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> - <p>Настройки доступны только для чтения, так как у вас есть доступ только на чтение к файлу:</p><p>%1</p> - No thanks Нет, спасибо @@ -1189,6 +1181,14 @@ Enabling this setting will disable the server config GUI. <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + %1 Read-only settings + %1 Настройки только для чтения + + + <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> + <p>Настройки доступны только для чтения, так как у вас есть доступ только на чтение к файлу:</p><p>%1</p> + Required messages Обязательные сообщения diff --git a/translations/deskflow_zh_CN.ts b/translations/deskflow_zh_CN.ts index b779e4bad..bc026fe9d 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 Read-only settings - %1 只读设置 - - - <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> - <p>设置是只读的,因为您对该文件只有读取权限:</p><p>%1</p> - No thanks 不,谢谢 @@ -1193,6 +1185,14 @@ Enabling this setting will disable the server config GUI. <p>Are you sure you want to clear all settings and restart %1?</p> <p>This action cannot be undone.</p> + + %1 Read-only settings + %1 只读设置 + + + <p>Settings are read-only because you only have read access to the file:</p><p>%1</p> + <p>设置是只读的,因为您对该文件只有读取权限:</p><p>%1</p> + Required messages 必要消息