Show ongoing sync depite of dir is out of sync

Note: Computing overall status needs further improvement
This commit is contained in:
Martchus 2016-10-06 23:41:40 +02:00
parent ae325e0a6f
commit 1742af28bf
4 changed files with 43 additions and 4 deletions

View File

@ -29,7 +29,8 @@ TrayIcon::TrayIcon(QObject *parent) :
m_statusIconNotify(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-notify.svg")))),
m_statusIconPause(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-pause.svg")))),
m_statusIconSync(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-sync.svg")))),
m_statusIconOutOfSync(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-error.svg")))),
m_statusIconError(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-error.svg")))),
m_statusIconErrorSync(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-error-sync.svg")))),
m_trayMenu(this),
m_status(SyncthingStatus::Disconnected)
{
@ -113,8 +114,13 @@ void TrayIcon::updateStatusIconAndText(SyncthingStatus status)
break;
default:
if(connection.hasOutOfSyncDirs()) {
setIcon(m_statusIconOutOfSync);
setToolTip(tr("At least one directory is out of sync"));
if(status == SyncthingStatus::Synchronizing) {
setIcon(m_statusIconErrorSync);
setToolTip(tr("Synchronization is ongoing but at least one directory is out of sync"));
} else {
setIcon(m_statusIconError);
setToolTip(tr("At least one directory is out of sync"));
}
} else if(connection.hasUnreadNotifications()) {
setIcon(m_statusIconNotify);
setToolTip(tr("Notifications available"));

View File

@ -41,7 +41,8 @@ private:
const QIcon m_statusIconNotify;
const QIcon m_statusIconPause;
const QIcon m_statusIconSync;
const QIcon m_statusIconOutOfSync;
const QIcon m_statusIconError;
const QIcon m_statusIconErrorSync;
TrayMenu m_trayMenu;
QMenu m_contextMenu;
Data::SyncthingStatus m_status;

View File

@ -27,5 +27,6 @@
<file>icons/hicolor/scalable/places/network-workgroup.svg</file>
<file>icons/hicolor/scalable/apps/system-run.svg</file>
<file>icons/hicolor/scalable/actions/network-connect.svg</file>
<file>icons/hicolor/scalable/status/syncthing-error-sync.svg</file>
</qresource>
</RCC>

View File

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16">
<defs>
<linearGradient id="grad" gradientUnits="userSpaceOnUse" x1="8" y1="0" x2="8" y2="16">
<stop offset="0" style="stop-color:#DB3C26"/>
<stop offset="1" style="stop-color:#C80828"/>
</linearGradient>
<mask id="bitemask" maskUnits="userSpaceOnUse">
<g>
<rect id="mask-bg" x="0" y="0" width="16" height="16" style="fill:#ffffff"/>
<circle id="mask-subtract" cx="11.5" cy="11.5" r="5.5" style="fill:#000000"/>
</g>
</mask>
</defs>
<g id="syncthing-logo" mask="url(#bitemask)">
<circle id="outer" cx="8" cy="8" r="8" style="fill:url(#grad)"/>
<circle id="inner" cx="8" cy="7.9727402" r="5.9557071" style="fill:none;stroke:#ffffff;stroke-width:0.81771719"/>
<line id="arm-l" x1="9.1993189" y1="8.776825" x2="2.262351" y2="9.4173737" style="stroke:#ffffff;stroke-width:0.81771719"/>
<line id="arm-tr" x1="9.1993189" y1="8.776825" x2="13.301533" y2="5.3696747" style="stroke:#ffffff;stroke-width:0.81771719"/>
<line id="arm-br" x1="9.1993189" y1="8.776825" x2="11.788756" y2="12.51107" style="stroke:#ffffff;stroke-width:0.81771719"/>
<circle id="node-c" cx="9.1993189" cy="8.776825" r="1.22" style="fill:#ffffff"/>
<circle id="node-l" cx="2.262351" cy="9.4173737" r="1.22" style="fill:#ffffff"/>
<circle id="node-tr" cx="13.301533" cy="5.3696747" r="1.22" style="fill:#ffffff"/>
<circle id="node-br" cx="11.788756" cy="12.51107" r="1.22" style="fill:#ffffff"/>
</g>
<circle id="bubble" cx="11.5" cy="11.5" r="4.5" style="fill:#000000"/>
<g id="arrows" transform="rotate(0 11.5 11.5)">
<path id="arrow-left" d="m 11.5,14 0,-1 c -1.5,0 -1.5,0 -1.5,-2 l 1,0 -1.5,-2 -1.5,2 1,0 c 0,3 0,3 2.5,3 z" style="fill:#ffffff" />
<path id="arrow-right" d="m 11.5,9 0,1 c 1.5,0 1.5,0 1.5,2 l -1,0 1.5,2 1.5,-2 -1,0 C 14,9 14,9 11.5,9 Z" style="fill:#ffffff" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB