[Pkg-owncloud-commits] [owncloud-client] 23/120: Windows: Limit tray tooltip length #3412
Sandro Knauß
hefee-guest at moszumanska.debian.org
Mon Aug 24 00:02:39 UTC 2015
This is an automated email from the git hooks/post-receive script.
hefee-guest pushed a commit to branch master
in repository owncloud-client.
commit 3c82f662197c6bc5c661b2c00070c7c556efbd53
Author: Christian Kamm <mail at ckamm.de>
Date: Mon Aug 10 13:09:05 2015 +0200
Windows: Limit tray tooltip length #3412
---
src/gui/owncloudgui.cpp | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index 307c403..16cd535 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -230,6 +230,15 @@ void ownCloudGui::slotComputeOverallSyncStatus()
if (!problemAccounts.empty()) {
_tray->setIcon(Theme::instance()->folderOfflineIcon(true));
+#ifdef Q_OS_WIN
+ // Windows has a 128-char tray tooltip length limit.
+ QStringList accountNames;
+ foreach (AccountStatePtr a, problemAccounts) {
+ accountNames.append(a->account()->displayName());
+ }
+ _tray->setToolTip(tr("Disconnected from %1").arg(
+ accountNames.join(QLatin1String(", "))));
+#else
QStringList messages;
messages.append(tr("Disconnected from accounts:"));
foreach (AccountStatePtr a, problemAccounts) {
@@ -242,6 +251,7 @@ void ownCloudGui::slotComputeOverallSyncStatus()
messages.append(message);
}
_tray->setToolTip(messages.join(QLatin1String("\n\n")));
+#endif
return;
}
@@ -259,15 +269,19 @@ void ownCloudGui::slotComputeOverallSyncStatus()
// create the tray blob message, check if we have an defined state
if( overallResult.status() != SyncResult::Undefined ) {
- QStringList allStatusStrings;
if( map.count() > 0 ) {
+#ifdef Q_OS_WIN
+ // Windows has a 128-char tray tooltip length limit.
+ trayMessage = folderMan->statusToString(overallResult.status(), false);
+#else
+ QStringList allStatusStrings;
foreach(Folder* folder, map.values()) {
qDebug() << "Folder in overallStatus Message: " << folder << " with name " << folder->alias();
QString folderMessage = folderMan->statusToString(folder->syncResult().status(), folder->syncPaused());
allStatusStrings += tr("Folder %1: %2").arg(folder->alias(), folderMessage);
}
-
trayMessage = allStatusStrings.join(QLatin1String("\n"));
+#endif
} else {
trayMessage = tr("No sync folders configured.");
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git
More information about the Pkg-owncloud-commits
mailing list