Show connected device names in additional status

This commit is contained in:
Martchus 2018-06-27 17:38:22 +02:00
parent 4d16967b23
commit db4b032179
11 changed files with 201 additions and 116 deletions

View File

@ -661,12 +661,13 @@ QString SyncthingConnection::deviceNameOrId(const QString &deviceId) const
* \brief Returns the number of devices Syncthing is currently connected to.
* \remarks Computed by looping devInfo().
*/
std::size_t SyncthingConnection::connectedDevices() const
std::vector<const SyncthingDev *> SyncthingConnection::connectedDevices() const
{
size_t connectedDevs = 0;
std::vector<const SyncthingDev *> connectedDevs;
connectedDevs.reserve(devInfo().size());
for (const SyncthingDev &dev : devInfo()) {
if (dev.isConnected()) {
++connectedDevs;
connectedDevs.emplace_back(&dev);
}
}
return connectedDevs;

View File

@ -83,7 +83,7 @@ class LIB_SYNCTHING_CONNECTOR_EXPORT SyncthingConnection : public QObject {
Q_PROPERTY(double totalIncomingRate READ totalIncomingRate NOTIFY trafficChanged)
Q_PROPERTY(double totalOutgoingRate READ totalOutgoingRate NOTIFY trafficChanged)
Q_PROPERTY(QList<QSslError> expectedSslErrors READ expectedSslErrors)
Q_PROPERTY(std::size_t connectedDevices READ connectedDevices)
Q_PROPERTY(std::vector<const SyncthingDev *> connectedDevices READ connectedDevices)
Q_PROPERTY(QStringList directoryIds READ directoryIds)
Q_PROPERTY(QStringList deviceIds READ deviceIds)
Q_PROPERTY(QJsonObject rawConfig READ rawConfig NOTIFY newConfig)
@ -136,7 +136,7 @@ public:
QStringList directoryIds() const;
QStringList deviceIds() const;
QString deviceNameOrId(const QString &deviceId) const;
std::size_t connectedDevices() const;
std::vector<const SyncthingDev *> connectedDevices() const;
const QJsonObject &rawConfig() const;
public Q_SLOTS:

View File

@ -65,153 +65,153 @@
<translation>Fehler beim Anfordern Gerät zu Pausieren/Fortzusetzen</translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="909"/>
<location filename="../syncthingconnection.cpp" line="910"/>
<source>Unable to request QR-Code: </source>
<translation>Fehler beim Abfragen des QR-Codes: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="929"/>
<location filename="../syncthingconnection.cpp" line="930"/>
<source>Unable to parse Syncthing log: </source>
<translation>Fehler beim Auslesen des Syncthing-Logs: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="944"/>
<location filename="../syncthingconnection.cpp" line="945"/>
<source>Unable to request Syncthing log: </source>
<translation>Fehler beim Abfragen des Syncthing-Logs: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="978"/>
<location filename="../syncthingconnection.cpp" line="979"/>
<source>Unable to locate certificate used by Syncthing.</source>
<translation>Das SSL-Zertifikat von Syncthing kann nicht gefunden werden.</translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="984"/>
<location filename="../syncthingconnection.cpp" line="985"/>
<source>Unable to load certificate used by Syncthing.</source>
<translation>Das SSL-Zertifikat von Syncthing kann nicht ausgelesen werden.</translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1059"/>
<location filename="../syncthingconnection.cpp" line="1060"/>
<source>Unable to parse Syncthing config: </source>
<translation>Fehler beim Auslesen der Syncthing-Konfiguration: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1079"/>
<location filename="../syncthingconnection.cpp" line="1080"/>
<source>Unable to request Syncthing config: </source>
<translation>Fehler beim Abfragen der Syncthing-Konfiguration: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1177"/>
<location filename="../syncthingconnection.cpp" line="1178"/>
<source>Unable to parse Syncthing status: </source>
<translation>Fehler beim Auslesen des Syncthing-Status: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1194"/>
<location filename="../syncthingconnection.cpp" line="1195"/>
<source>Unable to request Syncthing status: </source>
<translation>Fehler beim Abfragen des Syncthing-Status: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1238"/>
<location filename="../syncthingconnection.cpp" line="1239"/>
<source>Unable to parse connections: </source>
<translation>Fehler beim Auslesen der Verbindungen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1309"/>
<location filename="../syncthingconnection.cpp" line="1310"/>
<source>Unable to request connections: </source>
<translation>Fehler beim Abfragen der Verbindungen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1327"/>
<location filename="../syncthingconnection.cpp" line="1328"/>
<source>Unable to parse directory statistics: </source>
<translation>Fehler beim Auslesen der Verzeichnisstatistiken: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1373"/>
<location filename="../syncthingconnection.cpp" line="2109"/>
<location filename="../syncthingconnection.cpp" line="1374"/>
<location filename="../syncthingconnection.cpp" line="2111"/>
<source>Unable to request directory statistics: </source>
<translation>Fehler beim Abfragen der Verzeichnisstatistiken: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1391"/>
<location filename="../syncthingconnection.cpp" line="1392"/>
<source>Unable to parse device statistics: </source>
<translation>Fehler beim Auslesen der Gerätestatistiken: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1418"/>
<location filename="../syncthingconnection.cpp" line="1419"/>
<source>Unable to request device statistics: </source>
<translation>Fehler beim Abfragen der Gerätestatistiken: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1444"/>
<location filename="../syncthingconnection.cpp" line="1445"/>
<source>Unable to parse errors: </source>
<translation>Fehler beim Auslesen der Syncthing-Fehlermeldungen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1471"/>
<location filename="../syncthingconnection.cpp" line="1472"/>
<source>Unable to request errors: </source>
<translation>Fehler beim Abfragen der Syncthing-Fehlermeldungen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1487"/>
<location filename="../syncthingconnection.cpp" line="1488"/>
<source>Unable to request clearing errors: </source>
<translation>Fehler beim Löschen der Fehlermeldungen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1508"/>
<location filename="../syncthingconnection.cpp" line="1509"/>
<source>Unable to parse Syncthing events: </source>
<translation>Fehler beim Auslesen der Syncthing-Ereignisse: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1570"/>
<location filename="../syncthingconnection.cpp" line="1571"/>
<source>Unable to request Syncthing events: </source>
<translation>Fehler beim Abfragen der Syncthing-Ereignisse: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1979"/>
<location filename="../syncthingconnection.cpp" line="1981"/>
<source>Unable to post config: </source>
<translation>Fehler beim Senden der neuen Konfiguration: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1995"/>
<location filename="../syncthingconnection.cpp" line="1997"/>
<source>Unable to request rescan: </source>
<translation>Fehler beim Anfordern eines Verzeichnis-Rescans: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2019"/>
<location filename="../syncthingconnection.cpp" line="2021"/>
<source>Unable to request device pause/resume: </source>
<translation>Fehler beim Anfordern Gerät zu Pausieren/Fortzusetzen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2040"/>
<location filename="../syncthingconnection.cpp" line="2042"/>
<source>Unable to request directory pause/resume: </source>
<translation>Fehler beim Anfordern Verzeichnis zu Pausieren/Fortzusetzen: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2056"/>
<location filename="../syncthingconnection.cpp" line="2058"/>
<source>Unable to request restart: </source>
<translation>Fehler beim Anfordern eines Neustarts: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2072"/>
<location filename="../syncthingconnection.cpp" line="2074"/>
<source>Unable to request shutdown: </source>
<translation>Fehler beim Anfordern Syncthing zu beenden: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2099"/>
<location filename="../syncthingconnection.cpp" line="2101"/>
<source>Unable to parse status for directory %1: </source>
<translation>Fehler beim Auslesen des Status von Verzeichnis %1: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2227"/>
<location filename="../syncthingconnection.cpp" line="2229"/>
<source>Unable to parse completion for device/directory %1/%2: </source>
<translation>Fehler beim Auslesen des Fortschrittes von Verzeichnis %1/%2: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2236"/>
<location filename="../syncthingconnection.cpp" line="2238"/>
<source>Unable to request completion for device/directory %1/%2: </source>
<translation>Fehler beim Anfordern des Fortschrittes von Verzeichnis %1/%2: </translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2320"/>
<location filename="../syncthingconnection.cpp" line="2322"/>
<source>at offset %1</source>
<translation>bei Zeichen %1</translation>
</message>

View File

@ -65,153 +65,153 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="909"/>
<location filename="../syncthingconnection.cpp" line="910"/>
<source>Unable to request QR-Code: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="929"/>
<location filename="../syncthingconnection.cpp" line="930"/>
<source>Unable to parse Syncthing log: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="944"/>
<location filename="../syncthingconnection.cpp" line="945"/>
<source>Unable to request Syncthing log: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="978"/>
<location filename="../syncthingconnection.cpp" line="979"/>
<source>Unable to locate certificate used by Syncthing.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="984"/>
<location filename="../syncthingconnection.cpp" line="985"/>
<source>Unable to load certificate used by Syncthing.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1059"/>
<location filename="../syncthingconnection.cpp" line="1060"/>
<source>Unable to parse Syncthing config: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1079"/>
<location filename="../syncthingconnection.cpp" line="1080"/>
<source>Unable to request Syncthing config: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1177"/>
<location filename="../syncthingconnection.cpp" line="1178"/>
<source>Unable to parse Syncthing status: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1194"/>
<location filename="../syncthingconnection.cpp" line="1195"/>
<source>Unable to request Syncthing status: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1238"/>
<location filename="../syncthingconnection.cpp" line="1239"/>
<source>Unable to parse connections: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1309"/>
<location filename="../syncthingconnection.cpp" line="1310"/>
<source>Unable to request connections: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1327"/>
<location filename="../syncthingconnection.cpp" line="1328"/>
<source>Unable to parse directory statistics: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1373"/>
<location filename="../syncthingconnection.cpp" line="2109"/>
<location filename="../syncthingconnection.cpp" line="1374"/>
<location filename="../syncthingconnection.cpp" line="2111"/>
<source>Unable to request directory statistics: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1391"/>
<location filename="../syncthingconnection.cpp" line="1392"/>
<source>Unable to parse device statistics: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1418"/>
<location filename="../syncthingconnection.cpp" line="1419"/>
<source>Unable to request device statistics: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1444"/>
<location filename="../syncthingconnection.cpp" line="1445"/>
<source>Unable to parse errors: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1471"/>
<location filename="../syncthingconnection.cpp" line="1472"/>
<source>Unable to request errors: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1487"/>
<location filename="../syncthingconnection.cpp" line="1488"/>
<source>Unable to request clearing errors: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1508"/>
<location filename="../syncthingconnection.cpp" line="1509"/>
<source>Unable to parse Syncthing events: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1570"/>
<location filename="../syncthingconnection.cpp" line="1571"/>
<source>Unable to request Syncthing events: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1979"/>
<location filename="../syncthingconnection.cpp" line="1981"/>
<source>Unable to post config: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="1995"/>
<location filename="../syncthingconnection.cpp" line="1997"/>
<source>Unable to request rescan: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2019"/>
<location filename="../syncthingconnection.cpp" line="2021"/>
<source>Unable to request device pause/resume: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2040"/>
<location filename="../syncthingconnection.cpp" line="2042"/>
<source>Unable to request directory pause/resume: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2056"/>
<location filename="../syncthingconnection.cpp" line="2058"/>
<source>Unable to request restart: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2072"/>
<location filename="../syncthingconnection.cpp" line="2074"/>
<source>Unable to request shutdown: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2099"/>
<location filename="../syncthingconnection.cpp" line="2101"/>
<source>Unable to parse status for directory %1: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2227"/>
<location filename="../syncthingconnection.cpp" line="2229"/>
<source>Unable to parse completion for device/directory %1/%2: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2236"/>
<location filename="../syncthingconnection.cpp" line="2238"/>
<source>Unable to request completion for device/directory %1/%2: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../syncthingconnection.cpp" line="2320"/>
<location filename="../syncthingconnection.cpp" line="2322"/>
<source>at offset %1</source>
<translation type="unfinished"></translation>
</message>

View File

@ -212,17 +212,17 @@
<context>
<name>Plasmoid::SyncthingApplet</name>
<message>
<location filename="../lib/syncthingapplet.cpp" line="269"/>
<location filename="../lib/syncthingapplet.cpp" line="271"/>
<source>About</source>
<translation>Über Syncthing Plasmoid</translation>
</message>
<message>
<location filename="../lib/syncthingapplet.cpp" line="281"/>
<location filename="../lib/syncthingapplet.cpp" line="283"/>
<source>New notifications</source>
<translation>Neue Benachrichtigungen</translation>
</message>
<message>
<location filename="../lib/syncthingapplet.cpp" line="408"/>
<location filename="../lib/syncthingapplet.cpp" line="410"/>
<source>D-Bus error - unable to </source>
<translation type="unfinished"></translation>
</message>

View File

@ -212,17 +212,17 @@
<context>
<name>Plasmoid::SyncthingApplet</name>
<message>
<location filename="../lib/syncthingapplet.cpp" line="269"/>
<location filename="../lib/syncthingapplet.cpp" line="271"/>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lib/syncthingapplet.cpp" line="281"/>
<location filename="../lib/syncthingapplet.cpp" line="283"/>
<source>New notifications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../lib/syncthingapplet.cpp" line="408"/>
<location filename="../lib/syncthingapplet.cpp" line="410"/>
<source>D-Bus error - unable to </source>
<translation type="unfinished"></translation>
</message>

View File

@ -83,27 +83,27 @@
<translation>Beenden</translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="205"/>
<location filename="../gui/trayicon.cpp" line="209"/>
<source>Error</source>
<translation>Fehler</translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="223"/>
<location filename="../gui/trayicon.cpp" line="227"/>
<source>Syncthing notification - click to dismiss</source>
<translation>Neue Syncthing-Benachrichtigung</translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="251"/>
<location filename="../gui/trayicon.cpp" line="255"/>
<source>Syncthing device wants to connect - click for web UI</source>
<translation>Neues Gerät möchte verbinden</translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="267"/>
<location filename="../gui/trayicon.cpp" line="271"/>
<source>New Syncthing directory - click for web UI</source>
<translation>Neues Syncthing-Verzeichnis</translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="169"/>
<location filename="../gui/trayicon.cpp" line="173"/>
<source>Disconnected from Syncthing</source>
<translation>Verbindung zu Syncthing getrennt</translation>
</message>
@ -193,7 +193,7 @@ For &lt;i&gt;all&lt;/i&gt; notifications, checkout the log</source>
</message>
<message>
<location filename="../gui/traywidget.ui" line="311"/>
<location filename="../gui/traywidget.cpp" line="120"/>
<location filename="../gui/traywidget.cpp" line="123"/>
<location filename="../gui/traywidget.cpp" line="241"/>
<source>New notifications</source>
<translation>Neue Benachrichtigungen</translation>
@ -224,27 +224,27 @@ For &lt;i&gt;all&lt;/i&gt; notifications, checkout the log</source>
<translation>Ignorieren</translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="88"/>
<location filename="../gui/traywidget.cpp" line="91"/>
<source>View own device ID</source>
<translation>Eigene Geräte-ID anzeigen</translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="94"/>
<location filename="../gui/traywidget.cpp" line="97"/>
<source>Restart Syncthing</source>
<translation>Syncthing neustarten</translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="100"/>
<location filename="../gui/traywidget.cpp" line="103"/>
<source>Show Syncthing log</source>
<translation>Syncthing-Log zeigen</translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="106"/>
<location filename="../gui/traywidget.cpp" line="109"/>
<source>Rescan all directories</source>
<translation>Alle Verzeichnisse neu scannen</translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="114"/>
<location filename="../gui/traywidget.cpp" line="117"/>
<source>Connection</source>
<translation>Verbindung</translation>
</message>
@ -307,22 +307,22 @@ For &lt;i&gt;all&lt;/i&gt; notifications, checkout the log</source>
<translation>Fehler beim </translation>
</message>
<message>
<location filename="../application/main.cpp" line="85"/>
<location filename="../application/main.cpp" line="86"/>
<source>You must configure how to connect to Syncthing when using Syncthing Tray the first time.</source>
<translation>Vor der ersten Verwendung muss eingestellt werden, wie sich das Syncthing Tray mit Syncthing verbinden soll.</translation>
</message>
<message>
<location filename="../application/main.cpp" line="86"/>
<location filename="../application/main.cpp" line="87"/>
<source>Note that the settings dialog allows importing URL, credentials and API-key from the local Syncthing configuration.</source>
<translation>Der Einstellungsdialog ermöglicht es die URL, Zugangsdaten und den API-Key automatisch aus der lokalen Syncthing-Konfiguration auszulesen.</translation>
</message>
<message>
<location filename="../application/main.cpp" line="69"/>
<location filename="../application/main.cpp" line="70"/>
<source>The system tray is (currently) not available. You could open the tray menu as a regular window using the -w flag, though.</source>
<translation>Das System-Tray bzw. der Infobereich ist aktuell nicht verfügbar. Es wäre möglich, Syncthing Tray als normales Fenster zu starten (mit Option -w).</translation>
</message>
<message>
<location filename="../application/main.cpp" line="95"/>
<location filename="../application/main.cpp" line="96"/>
<source>The Qt libraries have not been built with tray icon support. You could open the tray menu as a regular window using the -w flag, though.</source>
<translation>Die verwendete Qt-Bibliothek wurde nicht mit Unterstützung für System-Tray konfiguriert. Es wäre möglich, Syncthing Tray als normales Fenster zu starten (mit Option -w).</translation>
</message>

View File

@ -88,27 +88,27 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="205"/>
<location filename="../gui/trayicon.cpp" line="209"/>
<source>Error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="223"/>
<location filename="../gui/trayicon.cpp" line="227"/>
<source>Syncthing notification - click to dismiss</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="251"/>
<location filename="../gui/trayicon.cpp" line="255"/>
<source>Syncthing device wants to connect - click for web UI</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="267"/>
<location filename="../gui/trayicon.cpp" line="271"/>
<source>New Syncthing directory - click for web UI</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/trayicon.cpp" line="169"/>
<location filename="../gui/trayicon.cpp" line="173"/>
<source>Disconnected from Syncthing</source>
<translation type="unfinished"></translation>
</message>
@ -192,7 +192,7 @@ For &lt;i&gt;all&lt;/i&gt; notifications, checkout the log</source>
</message>
<message>
<location filename="../gui/traywidget.ui" line="311"/>
<location filename="../gui/traywidget.cpp" line="120"/>
<location filename="../gui/traywidget.cpp" line="123"/>
<location filename="../gui/traywidget.cpp" line="241"/>
<source>New notifications</source>
<translation type="unfinished"></translation>
@ -223,27 +223,27 @@ For &lt;i&gt;all&lt;/i&gt; notifications, checkout the log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="88"/>
<location filename="../gui/traywidget.cpp" line="91"/>
<source>View own device ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="94"/>
<location filename="../gui/traywidget.cpp" line="97"/>
<source>Restart Syncthing</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="100"/>
<location filename="../gui/traywidget.cpp" line="103"/>
<source>Show Syncthing log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="106"/>
<location filename="../gui/traywidget.cpp" line="109"/>
<source>Rescan all directories</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../gui/traywidget.cpp" line="114"/>
<location filename="../gui/traywidget.cpp" line="117"/>
<source>Connection</source>
<translation type="unfinished"></translation>
</message>
@ -306,22 +306,22 @@ For &lt;i&gt;all&lt;/i&gt; notifications, checkout the log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../application/main.cpp" line="85"/>
<location filename="../application/main.cpp" line="86"/>
<source>You must configure how to connect to Syncthing when using Syncthing Tray the first time.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../application/main.cpp" line="86"/>
<location filename="../application/main.cpp" line="87"/>
<source>Note that the settings dialog allows importing URL, credentials and API-key from the local Syncthing configuration.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../application/main.cpp" line="69"/>
<location filename="../application/main.cpp" line="70"/>
<source>The system tray is (currently) not available. You could open the tray menu as a regular window using the -w flag, though.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../application/main.cpp" line="95"/>
<location filename="../application/main.cpp" line="96"/>
<source>The Qt libraries have not been built with tray icon support. You could open the tray menu as a regular window using the -w flag, though.</source>
<translation type="unfinished"></translation>
</message>

View File

@ -77,21 +77,57 @@ void StatusInfo::updateConnectionStatus(const SyncthingConnection &connection)
void StatusInfo::updateConnectedDevices(const SyncthingConnection &connection)
{
m_additionalStatusText.clear();
switch (connection.status()) {
case SyncthingStatus::Idle:
case SyncthingStatus::OutOfSync:
case SyncthingStatus::Scanning:
case SyncthingStatus::Synchronizing:
if (const size_t connectedDevices = connection.connectedDevices()) {
m_additionalStatusText
= QCoreApplication::translate("QtGui::StatusInfo", "Conntected to %1 devices", nullptr, trQuandity(connectedDevices))
.arg(connectedDevices);
} else {
case SyncthingStatus::Synchronizing: {
// find devices we're currently connected to
const auto connectedDevices(connection.connectedDevices());
// handle case when not connected to other devices
if (connectedDevices.empty()) {
m_additionalStatusText = QCoreApplication::translate("QtGui::StatusInfo", "Not connected to other devices");
return;
}
break;
default:
m_additionalStatusText.clear();
// get up to 2 device names
const auto deviceCount = trQuandity(connectedDevices.size());
const auto deviceNames = [&] {
QStringList deviceNames;
deviceNames.reserve(2);
for (const auto *dev : connectedDevices) {
if (dev->name.isEmpty()) {
continue;
}
deviceNames << dev->name;
if (deviceNames.size() > 2) {
break;
}
}
return deviceNames;
}();
// update status text
if (deviceNames.empty()) {
m_additionalStatusText
= QCoreApplication::translate("QtGui::StatusInfo", "Conntected to %1 devices", nullptr, deviceCount).arg(deviceCount);
} else if (deviceNames.size() < deviceCount) {
m_additionalStatusText
= QCoreApplication::translate("QtGui::StatusInfo", "Conntected to %1 and %2 other devices", nullptr, deviceCount - deviceNames.size())
.arg(deviceNames.join(QStringLiteral(", ")))
.arg(deviceCount - deviceNames.size());
} else if (deviceNames.size() == 2) {
m_additionalStatusText = QCoreApplication::translate("QtGui::StatusInfo", "Conntected to %1 and %2", nullptr, deviceCount)
.arg(deviceNames[0], deviceNames[1]);
} else if (deviceNames.size() == 1) {
m_additionalStatusText = QCoreApplication::translate("QtGui::StatusInfo", "Conntected to %1", nullptr, deviceCount).arg(deviceNames[0]);
}
return;
}
default:;
}
}
} // namespace QtGui

View File

@ -674,15 +674,39 @@
<translation>Status ist unbekannt</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="87"/>
<location filename="../misc/statusinfo.cpp" line="116"/>
<source>Conntected to %1 devices</source>
<translation>
<numerusform>Mit %1 Gerät verbunden</numerusform>
<numerusform>Mit %1 Geräten verbunden</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="119"/>
<source>Conntected to %1 and %2 other devices</source>
<translation>
<numerusform>Mit %1 und einem weiteren Gerät verbunden</numerusform>
<numerusform>Mit %1 und %2 weiteren Geräten verbunden</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="123"/>
<source>Conntected to %1 and %2</source>
<translation>
<numerusform>Mit %1 und %2 verbunden</numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="126"/>
<source>Conntected to %1</source>
<translation>
<numerusform>Mit %1 verbunden</numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location filename="../misc/statusinfo.cpp" line="90"/>
<location filename="../misc/statusinfo.cpp" line="92"/>
<source>Not connected to other devices</source>
<translation>Nicht mit anderen Geräten verbunden</translation>
</message>

View File

@ -672,15 +672,39 @@
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="87"/>
<location filename="../misc/statusinfo.cpp" line="116"/>
<source>Conntected to %1 devices</source>
<translation>
<numerusform>Conntected to %1 device</numerusform>
<numerusform>Conntected to %1 devices</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="119"/>
<source>Conntected to %1 and %2 other devices</source>
<translation>
<numerusform>Conntected to %1 and %2 other device</numerusform>
<numerusform>Conntected to %1 and %2 other devices</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="123"/>
<source>Conntected to %1 and %2</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../misc/statusinfo.cpp" line="126"/>
<source>Conntected to %1</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location filename="../misc/statusinfo.cpp" line="90"/>
<location filename="../misc/statusinfo.cpp" line="92"/>
<source>Not connected to other devices</source>
<translation type="unfinished"></translation>
</message>