Add notification images (DBus-only)
This commit is contained in:
parent
107c8c2603
commit
71bcdd0c45
|
@ -0,0 +1,157 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 16 16"
|
||||
version="1.1"
|
||||
id="svg28"
|
||||
sodipodi:docname="syncthing-sync-complete.svg"
|
||||
inkscape:version="0.92.2 2405546, 2018-03-11">
|
||||
<metadata
|
||||
id="metadata32">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1263"
|
||||
inkscape:window-height="838"
|
||||
id="namedview30"
|
||||
showgrid="false"
|
||||
inkscape:zoom="14.75"
|
||||
inkscape:cx="0.13559322"
|
||||
inkscape:cy="8"
|
||||
inkscape:window-x="209"
|
||||
inkscape:window-y="128"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg28" />
|
||||
<defs
|
||||
id="defs12">
|
||||
<linearGradient
|
||||
id="grad"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
x1="8"
|
||||
y1="0"
|
||||
x2="8"
|
||||
y2="16">
|
||||
<stop
|
||||
offset="0"
|
||||
style="stop-color:#26B6DB"
|
||||
id="stop2" />
|
||||
<stop
|
||||
offset="1"
|
||||
style="stop-color:#0882C8"
|
||||
id="stop4" />
|
||||
</linearGradient>
|
||||
<mask
|
||||
id="bitemask"
|
||||
maskUnits="userSpaceOnUse">
|
||||
<g
|
||||
id="g9">
|
||||
<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:#27ae60;fill-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
d="m 13.661017,9.2966105 -3,2.9999995 -1,-1 -1,1 1,1 1,1 4,-4 z"
|
||||
id="path4945" />
|
||||
</svg>
|
After Width: | Height: | Size: 3.7 KiB |
|
@ -9,5 +9,6 @@
|
|||
<file>icons/hicolor/scalable/status/syncthing-error.svg</file>
|
||||
<file>icons/hicolor/scalable/mimetypes/text-x-generic.svg</file>
|
||||
<file>icons/hicolor/scalable/status/syncthing-error-sync.svg</file>
|
||||
<file>icons/hicolor/scalable/status/syncthing-sync-complete.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
@ -27,6 +27,7 @@ StatusIcons::StatusIcons()
|
|||
, notify(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-notify.svg"))))
|
||||
, pause(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-pause.svg"))))
|
||||
, sync(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-sync.svg"))))
|
||||
, syncComplete(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-sync-complete.svg"))))
|
||||
, error(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-error.svg"))))
|
||||
, errorSync(QIcon(renderSvgImage(QStringLiteral(":/icons/hicolor/scalable/status/syncthing-error-sync.svg"))))
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@ struct StatusIcons {
|
|||
QIcon notify;
|
||||
QIcon pause;
|
||||
QIcon sync;
|
||||
QIcon syncComplete;
|
||||
QIcon error;
|
||||
QIcon errorSync;
|
||||
};
|
||||
|
|
|
@ -77,7 +77,7 @@ find_package(c++utilities 4.6.0 REQUIRED)
|
|||
use_cpp_utilities()
|
||||
|
||||
# find qtutilities
|
||||
find_package(qtutilities 5.8.0 REQUIRED)
|
||||
find_package(qtutilities 5.9.0 REQUIRED)
|
||||
use_qt_utilities()
|
||||
|
||||
# find backend libraries
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
#ifdef QT_UTILITIES_SUPPORT_DBUS_NOTIFICATIONS
|
||||
#include "./dbusstatusnotifier.h"
|
||||
|
||||
#include "../../model/syncthingicons.h"
|
||||
|
||||
// use meta-data of syncthingtray application here
|
||||
#include "resources/../../tray/resources/config.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QPixmap>
|
||||
|
||||
using namespace Data;
|
||||
using namespace MiscUtils;
|
||||
|
@ -22,8 +25,11 @@ DBusStatusNotifier::DBusStatusNotifier(QObject *parent)
|
|||
m_disconnectedNotification.setActions(QStringList({ QStringLiteral("reconnect"), tr("Try to reconnect") }));
|
||||
connect(&m_disconnectedNotification, &DBusNotification::actionInvoked, this, &DBusStatusNotifier::connectRequested);
|
||||
m_internalErrorNotification.setActions(QStringList({ QStringLiteral("details"), tr("View details") }));
|
||||
m_syncthingNotification.setImage(statusIcons().error.pixmap(QSize(128, 128)).toImage());
|
||||
connect(&m_internalErrorNotification, &DBusNotification::actionInvoked, this, &DBusStatusNotifier::errorDetailsRequested);
|
||||
m_syncthingNotification.setActions(QStringList({ QStringLiteral("show"), tr("Show"), QStringLiteral("dismiss"), tr("Dismiss") }));
|
||||
m_syncthingNotification.setImage(statusIcons().notify.pixmap(QSize(128, 128)).toImage());
|
||||
m_syncCompleteNotification.setImage(statusIcons().syncComplete.pixmap(QSize(128, 128)).toImage());
|
||||
connect(&m_syncthingNotification, &DBusNotification::actionInvoked, this, &DBusStatusNotifier::handleSyncthingNotificationAction);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue