From ec0fca1446b66ce7c4525f2c6cb9032302ce65a7 Mon Sep 17 00:00:00 2001 From: Martchus Date: Tue, 17 Mar 2020 19:36:10 +0100 Subject: [PATCH] Allow selecting the config file path manually in connection settings --- widgets/settings/connectionoptionpage.ui | 89 +++++++---- widgets/settings/settingsdialog.cpp | 8 +- widgets/settings/settingsdialog.h | 2 +- .../translations/syncthingwidgets_cs_CZ.ts | 139 +++++++++--------- .../translations/syncthingwidgets_de_DE.ts | 139 +++++++++--------- .../translations/syncthingwidgets_en_US.ts | 139 +++++++++--------- 6 files changed, 284 insertions(+), 232 deletions(-) diff --git a/widgets/settings/connectionoptionpage.ui b/widgets/settings/connectionoptionpage.ui index 3368e7c..1b8f2b9 100644 --- a/widgets/settings/connectionoptionpage.ui +++ b/widgets/settings/connectionoptionpage.ui @@ -264,20 +264,6 @@ - - - font-weight: bold; - - - Insert values from local Syncthing configuration - - - - :/icons/hicolor/scalable/actions/edit-paste.svg:/icons/hicolor/scalable/actions/edit-paste.svg - - - - @@ -290,7 +276,7 @@ - + Poll interval @@ -300,7 +286,7 @@ - + 10 @@ -440,22 +426,38 @@ - + + + + Whether to connect automatically on startup. This setting might be overruled by systemd and launcher settings. + + + Connect automatically on startup + + + + Status - + disconnected - + + + + 0 + 0 + + Apply connection settings and try to reconnect with the currently selected config @@ -465,15 +467,48 @@ - - - - Whether to connect automatically on startup. This setting might be overruled by systemd and launcher settings. + + + + 0 - - Connect automatically on startup - - + + + + + 0 + 0 + + + + font-weight: bold; + + + Insert values from local Syncthing configuration + + + + :/icons/hicolor/scalable/actions/edit-paste.svg:/icons/hicolor/scalable/actions/edit-paste.svg + + + + + + + + 0 + 0 + + + + Select config file manually + + + + + + + diff --git a/widgets/settings/settingsdialog.cpp b/widgets/settings/settingsdialog.cpp index 07dfb1c..4dba12f 100644 --- a/widgets/settings/settingsdialog.cpp +++ b/widgets/settings/settingsdialog.cpp @@ -93,7 +93,9 @@ QWidget *ConnectionOptionPage::setupWidget() ui()->reconnectLabel->setToolTip(ui()->reconnectSpinBox->toolTip()); QObject::connect(m_connection, &SyncthingConnection::statusChanged, bind(&ConnectionOptionPage::updateConnectionStatus, this)); QObject::connect(ui()->connectPushButton, &QPushButton::clicked, bind(&ConnectionOptionPage::applyAndReconnect, this)); - QObject::connect(ui()->insertFromConfigFilePushButton, &QPushButton::clicked, bind(&ConnectionOptionPage::insertFromConfigFile, this)); + QObject::connect(ui()->insertFromConfigFilePushButton, &QPushButton::clicked, bind(&ConnectionOptionPage::insertFromConfigFile, this, false)); + QObject::connect( + ui()->insertFromCustomConfigFilePushButton, &QPushButton::clicked, bind(&ConnectionOptionPage::insertFromConfigFile, this, true)); QObject::connect(ui()->selectionComboBox, static_cast(&QComboBox::currentIndexChanged), bind(&ConnectionOptionPage::showConnectionSettings, this, _1)); QObject::connect(ui()->selectionComboBox, static_cast(&QComboBox::editTextChanged), @@ -105,9 +107,9 @@ QWidget *ConnectionOptionPage::setupWidget() return widget; } -void ConnectionOptionPage::insertFromConfigFile() +void ConnectionOptionPage::insertFromConfigFile(bool forceFileSelection) { - auto configFile(SyncthingConfig::locateConfigFile()); + auto configFile(forceFileSelection ? QString() : SyncthingConfig::locateConfigFile()); if (configFile.isEmpty()) { // allow user to select config file manually if it could not be located configFile = QFileDialog::getOpenFileName( diff --git a/widgets/settings/settingsdialog.h b/widgets/settings/settingsdialog.h index bb3655a..bf02a2c 100644 --- a/widgets/settings/settingsdialog.h +++ b/widgets/settings/settingsdialog.h @@ -51,7 +51,7 @@ ConnectionOptionPage(Data::SyncthingConnection *connection, QWidget *parentWidge private: DECLARE_SETUP_WIDGETS -void insertFromConfigFile(); +void insertFromConfigFile(bool forceFileSelection); void updateConnectionStatus(); void applyAndReconnect(); bool showConnectionSettings(int index); diff --git a/widgets/translations/syncthingwidgets_cs_CZ.ts b/widgets/translations/syncthingwidgets_cs_CZ.ts index 861abff..7e26b39 100644 --- a/widgets/translations/syncthingwidgets_cs_CZ.ts +++ b/widgets/translations/syncthingwidgets_cs_CZ.ts @@ -163,27 +163,27 @@ - + This is achieved by adding a *.desktop file under <i>~/.config/autostart</i> so the setting only affects the current user. - + This is achieved by adding a registry key under <i>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</i> so the setting only affects the current user. Note that the startup entry is invalidated when moving <i>syncthingtray.exe</i>. - + This is achieved by adding a *.plist file under <i>~/Library/LaunchAgents</i> so the setting only affects the current user. - + This feature has not been implemented for your platform (yet). - + unable to modify startup entry @@ -256,90 +256,90 @@ - + Insert values from local Syncthing configuration - + Poll interval - + Frequency for updating traffic statistics and download speed - - - - + + + + ms - + Traffic - + Device statistics - + Frequency for updating device statistics - + Errors - + Frequency to poll for new errors - + Reconnect - + Time to wait for reconnecting again when the connection to Syncthing has been lost. This setting might be overruled by systemd and launcher settings. - + no - + Status - + disconnected - + Apply connection settings and try to reconnect with the currently selected config - + Whether to connect automatically on startup. This setting might be overruled by systemd and launcher settings. - + Connect automatically on startup @@ -349,22 +349,27 @@ - + + Select config file manually + + + + Select Syncthing config file - + Unable to parse the Syncthing config file. - + Unable to load specified certificate "%1". - + Instance %1 @@ -516,42 +521,42 @@ QtGui::IconsOptionPageBase - + UI icons - + These icon colors are used within Syncthing Tray's UI. - + System icons - + These icon colors are used for the system tray icon and the notifications. - + Use same colors as for UI icons - + Colorful background with gradient (default) - + Transparent background and dark foreground (for bright themes) - + Transparent background and bright foreground (for dark themes) @@ -674,7 +679,7 @@ - + Stop launched instance @@ -689,77 +694,77 @@ - + %1-launcher - + Launch %1 when starting the tray icon - + %1 executable - + %1 log (interleaved stdout/stderr) - + Restore default - + %1 exited with exit code %2 - + %1 crashed with exit code %2 - + failed to start (e.g. executable does not exist or not permission error) - + process crashed - + timeout error - + read error - + write error - + unknown process error - + An error occurred when running %1: %2 - + Kill launched instance @@ -852,7 +857,7 @@ - + Configured to use D-Bus notifications but D-Bus notification daemon seems unavailabe. @@ -878,22 +883,22 @@ QtGui::SettingsDialog - + Tray - + Web view - + Startup - + Settings @@ -1053,8 +1058,8 @@ This dialog closes automatically when the process finally terminates. - - + + unknown @@ -1094,22 +1099,22 @@ This dialog closes automatically when the process finally terminates. - + It is not possible to show the start/stop button for the systemd service and the internal launcher at the same time. The systemd service precedes. - + It is not possible to consider the systemd service and the internal launcher for reconnects at the same time. The systemd service precedes. - + specified unit is either inactive or doesn't exist - + since @@ -1143,7 +1148,7 @@ This dialog closes automatically when the process finally terminates. QtGui::WebViewOptionPage - + General @@ -1173,7 +1178,7 @@ This dialog closes automatically when the process finally terminates. - + Syncthing Tray has not been built with vieb view support utilizing either Qt WebKit or Qt WebEngine. The Web UI will be opened in the default web browser instead. @@ -1182,7 +1187,7 @@ The Web UI will be opened in the default web browser instead. Settings::restore - + Unable to load certificate "%1" when restoring settings. diff --git a/widgets/translations/syncthingwidgets_de_DE.ts b/widgets/translations/syncthingwidgets_de_DE.ts index f32dd56..eecbbdf 100644 --- a/widgets/translations/syncthingwidgets_de_DE.ts +++ b/widgets/translations/syncthingwidgets_de_DE.ts @@ -163,27 +163,27 @@ Tray-Icon beim Starten der Desktopumgebung automatisch starten - + This is achieved by adding a *.desktop file under <i>~/.config/autostart</i> so the setting only affects the current user. Durch das Hinzufügen einer *.desktop-Datei unter <i>~/.config/autostart</i> realisiert - betrifft also nur den aktuellen Benutzer. - + This is achieved by adding a registry key under <i>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</i> so the setting only affects the current user. Note that the startup entry is invalidated when moving <i>syncthingtray.exe</i>. Durch das Hinzufügen eines Registry-Schlüssels unter <i>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</i> realisiert - betrifft also nur den aktuellen Benutzer. - + This is achieved by adding a *.plist file under <i>~/Library/LaunchAgents</i> so the setting only affects the current user. Durch das Hinzufügen einer *.plist-Datei unter <i>~/Library/LaunchAgents</i> realisiert - betrifft also nur den aktuellen Benutzer. - + This feature has not been implemented for your platform (yet). Diese Funktion wurde für die aktuelle Plattform nicht nicht implementiert. - + unable to modify startup entry Fehler beim aktualisieren des Auto-Start-Eintrags @@ -246,75 +246,75 @@ HTTPS-Zertifikat - + Insert values from local Syncthing configuration Werte aus lokaler Syncthing-Konfiguration einfügen - + Frequency for updating traffic statistics and download speed Wie häufig die Traffic-Statistikien und die Downloadgeschwindigkeit aktualisiert werden sollen - + Frequency for updating device statistics Wie häufig die Gerätestatistiken aktualisiert werden sollen - + Errors Fehler - + Frequency to poll for new errors Wie häufig neue Fehler abgefragt werden sollen - + Time to wait for reconnecting again when the connection to Syncthing has been lost. This setting might be overruled by systemd and launcher settings. Wartezeit bis zum nächsten Verbindungsversuch, wenn die Verbindung zu Syncthing verloren gegangen ist; kann von Systemd- und Starter-Einstellungen überschrieben werden - + Status - + disconnected getrennt - + Apply connection settings and try to reconnect with the currently selected config Verbindungseinstellungen übernehmen und mit neuen Einstellungen verbinden - + Whether to connect automatically on startup. This setting might be overruled by systemd and launcher settings. Ob die Verbindung automatisch beim Starten hergestellt werden soll; kann von Systemd- und Starter-Einstellungen überschrieben werden - + Connect automatically on startup Beim Starten automatisch verbinden - + Poll interval Abfrageintervall - + Traffic - - - - + + + + ms @@ -329,17 +329,17 @@ Es ist möglich, mehrere Konfigurationen zu speichern. Zwischen diesen kann anschließend über das Verbindungsmenü rechts oben im Tray schnell hin- und hergewechselt werden. Der Name der Konfiguration muss nicht mit dem Namen des entsprechenden Syncthing-Gerätes übereinstimmen. Die erste Konfiguration in der Liste ist die Standardkonfiguration. - + Device statistics Gerätestatistiken - + Reconnect Verbindungsveruch - + no nicht neu verbinden @@ -349,22 +349,27 @@ Kann für lokale Instanz automatisch ermittelt werden - + + Select config file manually + Konfigurationsdatei manuell wählen + + + Select Syncthing config file Wähle die Syncthing-Konfigurationsdatei - + Unable to parse the Syncthing config file. Fehler beim Auslesen der Syncthing-Konfigurationsdatei. - + Unable to load specified certificate "%1". Fehler beim Auslesen des angegebenen Zertifikats: %1 - + Instance %1 Instanz %1 @@ -515,42 +520,42 @@ QtGui::IconsOptionPageBase - + UI icons UI-Icons - + These icon colors are used within Syncthing Tray's UI. Diese Icon-Farben werden innerhalb der Oberfläche von Syncthing Tray verwendet. - + System icons System-Icons - + These icon colors are used for the system tray icon and the notifications. Diese Icon-Farben werden für das System-Tray-Icon und Benachrichtigungen verwendet. - + Use same colors as for UI icons Die selben Farben wie für UI-Icons verwenden - + Colorful background with gradient (default) Hintergrund mit Farbverlauf (Standard) - + Transparent background and dark foreground (for bright themes) Transparenter Hintergrund und dunkler Vordergrund (für helle Themes) - + Transparent background and bright foreground (for dark themes) Transparenter Hintergrund und heller Vordergrund (für dunkle Themes) @@ -674,7 +679,7 @@ - + Stop launched instance Stoppen @@ -689,77 +694,77 @@ Log folgen - + %1-launcher %1-Starter - + Launch %1 when starting the tray icon Starte %1 beim Starten des Tray-Icons - + %1 executable Ausführbare Datei von %1 - + %1 log (interleaved stdout/stderr) %1-Log (stdout/stderr) - + Restore default Auf Vorgabe zurücksetzen - + %1 exited with exit code %2 %1 wurde mit dem Statuscode %2 beendet - + %1 crashed with exit code %2 %1 ist mit dem Statuscode %2 abgestürzt - + failed to start (e.g. executable does not exist or not permission error) Start fehlgeschlagen (z. B. weil Programmdatei nicht existiert oder nicht ausführbar ist) - + process crashed Prozess ist abgestürzt - + timeout error Time-out - + read error Lesefehler - + write error Schreibfehler - + unknown process error unbekannter Fehler - + An error occurred when running %1: %2 Beim Ausführen von %1 ist ein Fehler aufgetreten: %2 - + Kill launched instance Töten @@ -852,7 +857,7 @@ - + Configured to use D-Bus notifications but D-Bus notification daemon seems unavailabe. Benachrichtigungen via D-Bus wurden eingestellt, aber es scheint kein Daemon zu laufen der den Dienst bereitstellt. @@ -878,22 +883,22 @@ QtGui::SettingsDialog - + Tray - + Web view Weboberfläche - + Startup Starten - + Settings Einstellungen @@ -1059,8 +1064,8 @@ Dieser Dialog schließt sich automatisch, wenn der Prozess beendet wird. - - + + unknown unbekannt @@ -1094,22 +1099,22 @@ Dieser Dialog schließt sich automatisch, wenn der Prozess beendet wird.Stoppen - + It is not possible to show the start/stop button for the systemd service and the internal launcher at the same time. The systemd service precedes. Es ist nicht möglich, den Start-/Stop-Button für den Systemd-Dienst und den internen Starter gleichzeitig anzugeigen. Wenn verfügbar, wird der Button den Systemd-Dienst kontrollieren. - + It is not possible to consider the systemd service and the internal launcher for reconnects at the same time. The systemd service precedes. Es ist nicht möglich, den Status des Systemd-Dienstes und den des internen Starters gleichzeitig für Verbindungsveruche einzubeziehen. Wenn verfügbar, wird der Status des Systemd-Dienstes verwendet. - + specified unit is either inactive or doesn't exist angegebene Unit entweder nicht geladen oder existiert nicht - + since seit @@ -1143,7 +1148,7 @@ Dieser Dialog schließt sich automatisch, wenn der Prozess beendet wird.QtGui::WebViewOptionPage - + General Allgemein @@ -1173,7 +1178,7 @@ Dieser Dialog schließt sich automatisch, wenn der Prozess beendet wird.Lasse Weboberfläche im Hintgergrund weiter offen, wenn Fenster nicht offen - + Syncthing Tray has not been built with vieb view support utilizing either Qt WebKit or Qt WebEngine. The Web UI will be opened in the default web browser instead. Syncthing Tray wurde nicht mit Unterstützung für die eingebaute Anzeige der Weboberfläche unter Verwendung von Qt WebKit oder Qt WebEngine gebaut. @@ -1183,7 +1188,7 @@ Die Weboberfläche wird stattdessen im Standardwebrowser geöffnet. Settings::restore - + Unable to load certificate "%1" when restoring settings. Fehler beim laden des Zertifikats "%1" beim wiederherstellen der Einstellungen. diff --git a/widgets/translations/syncthingwidgets_en_US.ts b/widgets/translations/syncthingwidgets_en_US.ts index 8cad35e..52a0d96 100644 --- a/widgets/translations/syncthingwidgets_en_US.ts +++ b/widgets/translations/syncthingwidgets_en_US.ts @@ -163,27 +163,27 @@ - + This is achieved by adding a *.desktop file under <i>~/.config/autostart</i> so the setting only affects the current user. - + This is achieved by adding a registry key under <i>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run</i> so the setting only affects the current user. Note that the startup entry is invalidated when moving <i>syncthingtray.exe</i>. - + This is achieved by adding a *.plist file under <i>~/Library/LaunchAgents</i> so the setting only affects the current user. - + This feature has not been implemented for your platform (yet). - + unable to modify startup entry @@ -256,90 +256,90 @@ - + Insert values from local Syncthing configuration - + Poll interval - + Frequency for updating traffic statistics and download speed - - - - + + + + ms - + Traffic - + Device statistics - + Frequency for updating device statistics - + Errors - + Frequency to poll for new errors - + Reconnect - + Time to wait for reconnecting again when the connection to Syncthing has been lost. This setting might be overruled by systemd and launcher settings. - + no - + Status - + disconnected - + Apply connection settings and try to reconnect with the currently selected config - + Whether to connect automatically on startup. This setting might be overruled by systemd and launcher settings. - + Connect automatically on startup @@ -349,22 +349,27 @@ - + + Select config file manually + + + + Select Syncthing config file - + Unable to parse the Syncthing config file. - + Unable to load specified certificate "%1". - + Instance %1 @@ -515,42 +520,42 @@ QtGui::IconsOptionPageBase - + UI icons - + These icon colors are used within Syncthing Tray's UI. - + System icons - + These icon colors are used for the system tray icon and the notifications. - + Use same colors as for UI icons - + Colorful background with gradient (default) - + Transparent background and dark foreground (for bright themes) - + Transparent background and bright foreground (for dark themes) @@ -672,7 +677,7 @@ - + Stop launched instance @@ -687,77 +692,77 @@ - + %1-launcher - + Launch %1 when starting the tray icon - + %1 executable - + %1 log (interleaved stdout/stderr) - + Restore default - + %1 exited with exit code %2 - + %1 crashed with exit code %2 - + failed to start (e.g. executable does not exist or not permission error) - + process crashed - + timeout error - + read error - + write error - + unknown process error - + An error occurred when running %1: %2 - + Kill launched instance @@ -850,7 +855,7 @@ - + Configured to use D-Bus notifications but D-Bus notification daemon seems unavailabe. @@ -876,22 +881,22 @@ QtGui::SettingsDialog - + Tray - + Web view - + Startup - + Settings @@ -1047,8 +1052,8 @@ This dialog closes automatically when the process finally terminates. - - + + unknown @@ -1088,22 +1093,22 @@ This dialog closes automatically when the process finally terminates. - + It is not possible to show the start/stop button for the systemd service and the internal launcher at the same time. The systemd service precedes. - + It is not possible to consider the systemd service and the internal launcher for reconnects at the same time. The systemd service precedes. - + specified unit is either inactive or doesn't exist - + since @@ -1137,7 +1142,7 @@ This dialog closes automatically when the process finally terminates. QtGui::WebViewOptionPage - + General @@ -1167,7 +1172,7 @@ This dialog closes automatically when the process finally terminates. - + Syncthing Tray has not been built with vieb view support utilizing either Qt WebKit or Qt WebEngine. The Web UI will be opened in the default web browser instead. @@ -1176,7 +1181,7 @@ The Web UI will be opened in the default web browser instead. Settings::restore - + Unable to load certificate "%1" when restoring settings.