[Xfce4-commits] [apps/xfce4-notifyd] 03/24: panel-plugin: Add a do-not-disturb menuitem and icon-status

noreply at xfce.org noreply at xfce.org
Fri Sep 8 23:27:34 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-notifyd.

commit 17f9469f427b1e40947d84ba2ea78f5d107420fa
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Mon Aug 21 20:55:57 2017 +0200

    panel-plugin: Add a do-not-disturb menuitem and icon-status
    
    The main icon now reflects the state of the do
    not disturb mode of xfce4-notifyd.
---
 icons/48x48/Makefile.am                           |  10 -
 icons/48x48/xfce4-sample-plugin.png               | Bin 2899 -> 0 bytes
 icons/Makefile.am                                 |   1 -
 icons/scalable/Makefile.am                        |   4 +-
 icons/scalable/notification-disabled-symbolic.svg |  60 ++++
 icons/scalable/notification-new-symbolic.svg      |  63 +++++
 icons/scalable/notification-symbolic.svg          |  60 ++++
 icons/scalable/xfce4-sample-plugin.svg            | 316 ----------------------
 panel-plugin/Makefile.am                          |   4 +-
 panel-plugin/notification-plugin.c                |  68 +++--
 panel-plugin/notification-plugin.h                |   4 +-
 11 files changed, 233 insertions(+), 357 deletions(-)

diff --git a/icons/48x48/Makefile.am b/icons/48x48/Makefile.am
deleted file mode 100644
index 17d0fc3..0000000
--- a/icons/48x48/Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
-# $Id$
-
-iconsdir = $(datadir)/icons/hicolor/48x48/apps
-icons_DATA =								\
-	xfce4-sample-plugin.png
-
-EXTRA_DIST =								\
-	$(icons_DATA)
-
-# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/icons/48x48/xfce4-sample-plugin.png b/icons/48x48/xfce4-sample-plugin.png
deleted file mode 100644
index d1f05ea..0000000
Binary files a/icons/48x48/xfce4-sample-plugin.png and /dev/null differ
diff --git a/icons/Makefile.am b/icons/Makefile.am
index 2caedee..725f229 100644
--- a/icons/Makefile.am
+++ b/icons/Makefile.am
@@ -1,7 +1,6 @@
 # $Id$
 
 SUBDIRS =								\
-	48x48								\
 	scalable
 
 gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
diff --git a/icons/scalable/Makefile.am b/icons/scalable/Makefile.am
index 7442c40..970a55c 100644
--- a/icons/scalable/Makefile.am
+++ b/icons/scalable/Makefile.am
@@ -2,7 +2,9 @@
 
 iconsdir = $(datadir)/icons/hicolor/scalable/apps
 icons_DATA =								\
-	xfce4-sample-plugin.svg
+	notification-disabled-symbolic.svg		\
+	notification-new-symbolic.svg			\
+	notification-symbolic.svg
 
 EXTRA_DIST =								\
 	$(icons_DATA)
diff --git a/icons/scalable/notification-disabled-symbolic.svg b/icons/scalable/notification-disabled-symbolic.svg
new file mode 100644
index 0000000..fab429f
--- /dev/null
+++ b/icons/scalable/notification-disabled-symbolic.svg
@@ -0,0 +1,60 @@
+<?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"
+   version="1.0"
+   width="16"
+   height="16"
+   id="svg3197"
+   viewBox="0 0 16 16"
+   sodipodi:docname="notification-disabled-symbolic.svg"
+   inkscape:version="0.92.1 r15371">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1338"
+     inkscape:window-height="839"
+     id="namedview6"
+     showgrid="true"
+     inkscape:zoom="27.812867"
+     inkscape:cx="12.20339"
+     inkscape:cy="6.2472669"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg3197">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4483" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata12">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs3199" />
+  <path
+     style="color:#bebebe;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:0.4;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.82310748;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-renderi [...]
+     d="M 2.3813797,0.76686522 1.4419265,1.7082715 14.984903,15.251242 15.924356,14.309835 14.006387,12.391867 c 0.0069,-0.04087 0.02344,-0.07807 0.02344,-0.121094 0,-0.12171 -0.03491,-0.232546 -0.08594,-0.333984 -0.01437,-0.02865 -0.03495,-0.04979 -0.05273,-0.07617 -0.04554,-0.06784 -0.09739,-0.126199 -0.162109,-0.175782 -0.01552,-0.01193 -0.02261,-0.03226 -0.03906,-0.04297 C 12.030339,11.02092 12.029825,6.0207715 12.029825,6.0207715 12.028025,4.1982093 10.794514,2.486177 9.0298174,2.03 [...]
+     id="path3347"
+     inkscape:connector-curvature="0" />
+</svg>
diff --git a/icons/scalable/notification-new-symbolic.svg b/icons/scalable/notification-new-symbolic.svg
new file mode 100644
index 0000000..6eb0a6e
--- /dev/null
+++ b/icons/scalable/notification-new-symbolic.svg
@@ -0,0 +1,63 @@
+<?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"
+   version="1.1"
+   width="16"
+   height="16"
+   id="svg7384"
+   sodipodi:docname="notification-new-symbolic.svg"
+   inkscape:version="0.92.1 r15371">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1651"
+     inkscape:window-height="926"
+     id="namedview8"
+     showgrid="false"
+     inkscape:zoom="9.8333333"
+     inkscape:cx="-6.2033898"
+     inkscape:cy="12"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg7384" />
+  <title
+     id="title9167">elementary Symbolic Icon Theme</title>
+  <metadata
+     id="metadata90">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>elementary Symbolic Icon Theme</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs7386" />
+  <path
+     id="path3355"
+     d="m 7.5644919,1.7014656 c -1.142683,0.3676665 -2.1237693,1.2320849 -2.5976561,2.373047 0,0 -1.9146213,4.6200292 -3.6855469,4.5585932 -0.019301,0.0035 -0.03383,0.02032 -0.052734,0.02539 -0.078769,0.02104 -0.1487633,0.05436 -0.2167968,0.09961 -0.026525,0.01757 -0.05389,0.02981 -0.078125,0.05078 -0.085966,0.07418 -0.1604545,0.162944 -0.2070313,0.27539 -0.1590049,0.38387 0.022378,0.821465 0.40625,0.9804692 l 9.7011712,4.017577 c 0.383872,0.159006 0.81951,-0.02238 0.978516,-0.40625 0.04 [...]
+     style="color:#bebebe;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;sha [...]
+     inkscape:connector-curvature="0" />
+  <path
+     style="color:#bebebe;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#009dff;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.78124988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering [...]
+     id="path3009"
+     d="m 16.000039,4.0002938 a 4.0000001,4.0000002 0 0 1 -8.0000001,0 4.0000001,4.0000002 0 1 1 8.0000001,0 z"
+     class="error"
+     inkscape:connector-curvature="0" />
+</svg>
diff --git a/icons/scalable/notification-symbolic.svg b/icons/scalable/notification-symbolic.svg
new file mode 100644
index 0000000..77bc8a5
--- /dev/null
+++ b/icons/scalable/notification-symbolic.svg
@@ -0,0 +1,60 @@
+<?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"
+   id="svg3197"
+   height="16"
+   width="16"
+   version="1.0"
+   sodipodi:docname="notification-symbolic.svg"
+   inkscape:version="0.92.1 r15371">
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1443"
+     inkscape:window-height="807"
+     id="namedview6"
+     showgrid="true"
+     inkscape:zoom="27.812867"
+     inkscape:cx="12"
+     inkscape:cy="9.1236334"
+     inkscape:window-x="0"
+     inkscape:window-y="25"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="svg3197">
+    <inkscape:grid
+       type="xygrid"
+       id="grid4483" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata12">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs
+     id="defs3199" />
+  <path
+     id="path3347"
+     d="M 8,1 C 7.447715,1 7,1.4477153 7,2 V 2.00977 C 5.235311,2.4654011 4.001751,4.1774378 4,6 c 0,0 -5.246e-4,5.000147 -1.6601562,5.621094 -0.016454,0.01071 -0.023543,0.03104 -0.039063,0.04297 -0.064724,0.04958 -0.1165691,0.107944 -0.1621093,0.175782 -0.017784,0.02638 -0.038367,0.04753 -0.052734,0.07617 C 2.0349059,12.017454 2,12.12829 2,12.25 2,12.6655 2.3345,13 2.75,13 h 10.5 c 0.4155,0 0.75,-0.3345 0.75,-0.75 0,-0.12171 -0.03491,-0.232546 -0.08594,-0.333984 -0.01437,-0.02865 -0.034 [...]
+     style="color:#bebebe;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;sha [...]
+     inkscape:connector-curvature="0" />
+</svg>
diff --git a/icons/scalable/xfce4-sample-plugin.svg b/icons/scalable/xfce4-sample-plugin.svg
deleted file mode 100644
index 1331ecb..0000000
--- a/icons/scalable/xfce4-sample-plugin.svg
+++ /dev/null
@@ -1,316 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg
-   xmlns:dc="http://purl.org/dc/elements/1.1/"
-   xmlns:cc="http://web.resource.org/cc/"
-   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:xlink="http://www.w3.org/1999/xlink"
-   xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
-   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
-   width="48.000000px"
-   height="48.000000px"
-   id="svg4376"
-   sodipodi:version="0.32"
-   inkscape:version="0.42+devel"
-   sodipodi:docbase="/home/jimmac/src/cvs/tango-icon-theme/scalable/emotes"
-   sodipodi:docname="face-grin.svg"
-   inkscape:export-filename="/home/tigert/Desktop/face-grin.png"
-   inkscape:export-xdpi="90.000000"
-   inkscape:export-ydpi="90.000000">
-  <defs
-     id="defs3">
-    <linearGradient
-       id="linearGradient2102">
-      <stop
-         style="stop-color:#000000;stop-opacity:1;"
-         offset="0"
-         id="stop2104" />
-      <stop
-         style="stop-color:#000000;stop-opacity:0;"
-         offset="1"
-         id="stop2106" />
-    </linearGradient>
-    <linearGradient
-       id="linearGradient3290">
-      <stop
-         style="stop-color:#fffcde;stop-opacity:1.0000000;"
-         offset="0.0000000"
-         id="stop3292" />
-      <stop
-         id="stop3294"
-         offset="0.64485979"
-         style="stop-color:#f6e76a;stop-opacity:1.0000000;" />
-      <stop
-         style="stop-color:#ffb738;stop-opacity:1.0000000;"
-         offset="1.0000000"
-         id="stop3296" />
-    </linearGradient>
-    <linearGradient
-       id="linearGradient3068">
-      <stop
-         style="stop-color:#cccccc;stop-opacity:1.0000000;"
-         offset="0.0000000"
-         id="stop3070" />
-      <stop
-         id="stop3076"
-         offset="0.34579438"
-         style="stop-color:#ffffff;stop-opacity:1.0000000;" />
-      <stop
-         style="stop-color:#ffffff;stop-opacity:1.0000000;"
-         offset="0.72486681"
-         id="stop3078" />
-      <stop
-         style="stop-color:#cecece;stop-opacity:1.0000000;"
-         offset="1.0000000"
-         id="stop3072" />
-    </linearGradient>
-    <linearGradient
-       inkscape:collect="always"
-       id="linearGradient4565">
-      <stop
-         style="stop-color:#000000;stop-opacity:1;"
-         offset="0"
-         id="stop4567" />
-      <stop
-         style="stop-color:#000000;stop-opacity:0;"
-         offset="1"
-         id="stop4569" />
-    </linearGradient>
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient4565"
-       id="radialGradient1360"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.000000,0.000000,0.000000,0.333333,0.000000,25.71429)"
-       cx="24.714285"
-       cy="38.571430"
-       fx="24.714285"
-       fy="38.571430"
-       r="19.714285" />
-    <radialGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3290"
-       id="radialGradient1362"
-       gradientUnits="userSpaceOnUse"
-       cx="29.288071"
-       cy="15.720984"
-       fx="29.158466"
-       fy="15.755712"
-       r="8.9020796" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient2102"
-       id="linearGradient2108"
-       x1="14.000000"
-       y1="21.062500"
-       x2="14.000000"
-       y2="32.875000"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.000000,0.000000,0.000000,1.033654,1.500000,-0.627404)" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient2102"
-       id="linearGradient2112"
-       gradientUnits="userSpaceOnUse"
-       x1="14.000000"
-       y1="21.062500"
-       x2="14"
-       y2="34.305527"
-       gradientTransform="matrix(1.000000,0.000000,0.000000,1.404523,10.50000,-7.966331)" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient2102"
-       id="linearGradient2116"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.000000,0.000000,0.000000,1.171895,2.500000,-3.141166)"
-       x1="14.000000"
-       y1="21.062500"
-       x2="13.500000"
-       y2="33.426670" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient2102"
-       id="linearGradient2120"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.000000,0.000000,0.000000,1.159815,18.50000,-2.815047)"
-       x1="14.000000"
-       y1="21.062500"
-       x2="14.500000"
-       y2="33.431156" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient2102"
-       id="linearGradient2124"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.000000,0.000000,0.000000,1.071351,-22.50000,-3.854623)"
-       x1="14.000000"
-       y1="21.062500"
-       x2="14.000000"
-       y2="35.744175" />
-    <linearGradient
-       inkscape:collect="always"
-       xlink:href="#linearGradient3068"
-       id="linearGradient2132"
-       x1="9.7892637"
-       y1="29.629091"
-       x2="38.390732"
-       y2="29.629091"
-       gradientUnits="userSpaceOnUse"
-       gradientTransform="matrix(1.048897,0.000000,0.000000,1.000000,-1.267931,0.000000)" />
-  </defs>
-  <sodipodi:namedview
-     fill="#a40000"
-     id="base"
-     pagecolor="#ffffff"
-     bordercolor="#666666"
-     borderopacity="0.19607843"
-     inkscape:pageopacity="0.0"
-     inkscape:pageshadow="2"
-     inkscape:zoom="1"
-     inkscape:cx="23.514119"
-     inkscape:cy="28.588454"
-     inkscape:current-layer="layer1"
-     showgrid="false"
-     inkscape:grid-bbox="true"
-     inkscape:document-units="px"
-     inkscape:showpageshadow="false"
-     inkscape:window-width="1010"
-     inkscape:window-height="1181"
-     inkscape:window-x="123"
-     inkscape:window-y="34"
-     stroke="#8f5902" />
-  <metadata
-     id="metadata4">
-    <rdf:RDF>
-      <cc:Work
-         rdf:about="">
-        <dc:format>image/svg+xml</dc:format>
-        <dc:type
-           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title>Face - Laughing</dc:title>
-        <dc:subject>
-          <rdf:Bag>
-            <rdf:li>emoticon</rdf:li>
-            <rdf:li>emote</rdf:li>
-            <rdf:li>smiley</rdf:li>
-            <rdf:li>laughing</rdf:li>
-            <rdf:li>:-D</rdf:li>
-            <rdf:li>:D</rdf:li>
-          </rdf:Bag>
-        </dc:subject>
-        <cc:license
-           rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/" />
-        <dc:creator>
-          <cc:Agent>
-            <dc:title>Jakub Steiner</dc:title>
-          </cc:Agent>
-        </dc:creator>
-        <dc:source>http://jimmac.musichall.cz</dc:source>
-        <dc:contributor>
-          <cc:Agent>
-            <dc:title>Tuomas Kuosmanen</dc:title>
-          </cc:Agent>
-        </dc:contributor>
-      </cc:Work>
-      <cc:License
-         rdf:about="http://creativecommons.org/licenses/by-sa/2.0/">
-        <cc:permits
-           rdf:resource="http://web.resource.org/cc/Reproduction" />
-        <cc:permits
-           rdf:resource="http://web.resource.org/cc/Distribution" />
-        <cc:requires
-           rdf:resource="http://web.resource.org/cc/Notice" />
-        <cc:requires
-           rdf:resource="http://web.resource.org/cc/Attribution" />
-        <cc:permits
-           rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
-        <cc:requires
-           rdf:resource="http://web.resource.org/cc/ShareAlike" />
-      </cc:License>
-    </rdf:RDF>
-  </metadata>
-  <g
-     id="layer1"
-     inkscape:label="Layer 1"
-     inkscape:groupmode="layer">
-    <path
-       sodipodi:type="arc"
-       style="opacity:0.53164560;color:#000000;fill:url(#radialGradient1360);fill-opacity:1.0000000;fill-rule:evenodd;stroke:none;stroke-width:0.40487173;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
-       id="path4563"
-       sodipodi:cx="24.714285"
-       sodipodi:cy="38.571430"
-       sodipodi:rx="19.714285"
-       sodipodi:ry="6.5714288"
-       d="M 44.428570 38.571430 A 19.714285 6.5714288 0 1 1  5.0000000,38.571430 A 19.714285 6.5714288 0 1 1  44.428570 38.571430 z" />
-    <path
-       sodipodi:type="arc"
-       style="opacity:1.0000000;color:#000000;fill:url(#radialGradient1362);fill-opacity:1.0000000;fill-rule:evenodd;stroke:#9c8c0a;stroke-width:0.48004404;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
-       id="path4320"
-       sodipodi:cx="31.112698"
-       sodipodi:cy="19.008621"
-       sodipodi:rx="8.6620579"
-       sodipodi:ry="8.6620579"
-       d="M 39.774755 19.008621 A 8.6620579 8.6620579 0 1 1  22.450640,19.008621 A 8.6620579 8.6620579 0 1 1  39.774755 19.008621 z"
-       transform="matrix(2.083142,0.000000,0.000000,2.083142,-40.54715,-16.49224)" />
-    <path
-       d="M 39.774755 19.008621 A 8.6620579 8.6620579 0 1 1  22.450640,19.008621 A 8.6620579 8.6620579 0 1 1  39.774755 19.008621 z"
-       sodipodi:ry="8.6620579"
-       sodipodi:rx="8.6620579"
-       sodipodi:cy="19.008621"
-       sodipodi:cx="31.112698"
-       id="path4322"
-       style="opacity:0.67721522;color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:evenodd;stroke:#ffffff;stroke-width:0.50510627;stroke-linecap:round;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
-       sodipodi:type="arc"
-       transform="matrix(1.979782,0.000000,0.000000,1.979782,-37.33128,-14.52746)" />
-    <path
-       sodipodi:type="arc"
-       style="fill:none;fill-opacity:1.0000000;stroke:#555753;stroke-width:1.0000000;stroke-linecap:butt;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000"
-       id="path1364"
-       sodipodi:cx="-3.8125000"
-       sodipodi:cy="1.8750000"
-       sodipodi:rx="2.9375000"
-       sodipodi:ry="2.8750000"
-       d="M -0.87500000,1.8750000 A 2.9375000,2.8750000 0 0 1 -6.3564497,3.3124999"
-       sodipodi:start="0.0000000"
-       sodipodi:end="2.6179939"
-       sodipodi:open="true"
-       transform="matrix(-0.965926,-0.258819,0.258819,-0.965926,24.53442,17.20131)" />
-    <path
-       transform="matrix(-0.965926,-0.258819,0.258819,-0.965926,15.78442,17.20131)"
-       sodipodi:open="true"
-       sodipodi:end="2.6179939"
-       sodipodi:start="0.0000000"
-       d="M -0.87500000,1.8750000 A 2.9375000,2.8750000 0 0 1 -6.3564497,3.3124999"
-       sodipodi:ry="2.8750000"
-       sodipodi:rx="2.9375000"
-       sodipodi:cy="1.8750000"
-       sodipodi:cx="-3.8125000"
-       id="path2094"
-       style="fill:none;fill-opacity:1.0000000;stroke:#555753;stroke-width:1.0000000;stroke-linecap:butt;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000"
-       sodipodi:type="arc" />
-    <path
-       sodipodi:nodetypes="czcc"
-       id="path2096"
-       d="M 9.1875355,21.044769 C 7.6485541,28.612147 13.879571,38.212295 24.038687,38.212295 C 34.286185,38.212295 40.544215,29.781871 38.758727,21.107269 L 9.1875355,21.044769 z "
-       style="opacity:1.0000000;color:#000000;fill:url(#linearGradient2132);fill-opacity:1.0000000;fill-rule:nonzero;stroke:none;stroke-width:1.0000001;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible" />
-    <path
-       id="path2110"
-       d="M 24.500000,21.528657 L 24.500000,38.382936"
-       style="opacity:0.18181818;fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:url(#linearGradient2112);stroke-width:0.99999988px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1.0000000" />
-    <path
-       style="opacity:0.18181818;fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:url(#linearGradient2116);stroke-width:1.0000002px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1.0000000"
-       d="M 16.500000,21.468635 L 16.500000,35.531381"
-       id="path2114" />
-    <path
-       id="path2118"
-       d="M 32.500000,21.541107 L 32.500000,35.458909"
-       style="opacity:0.18181818;fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:url(#linearGradient2120);stroke-width:1.0000005px;stroke-linecap:square;stroke-linejoin:miter;stroke-opacity:1.0000000" />
-    <path
-       style="opacity:1.0000000;color:#000000;fill:none;fill-opacity:1.0000000;fill-rule:nonzero;stroke:#8f5902;stroke-width:0.99999994;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4.0000000;stroke-dasharray:none;stroke-dashoffset:0.0000000;stroke-opacity:1.0000000;visibility:visible;display:inline;overflow:visible"
-       d="M 9.4409398,20.615864 C 7.6602852,29.43779 14.599952,38.703673 24.250001,38.703673 C 34.253546,38.703673 40.902217,29.12529 38.621563,20.553364 L 9.4409398,20.615864 z "
-       id="path2756"
-       sodipodi:nodetypes="czcc" />
-  </g>
-</svg>
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index ab43965..9f44106 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -23,6 +23,7 @@ libnotification_plugin_la_CFLAGS = \
 	$(LIBXFCE4UTIL_CFLAGS) \
 	$(LIBXFCE4UI_CFLAGS) \
 	$(LIBXFCE4PANEL_CFLAGS) \
+	$(XFCONF_CFLAGS) \
 	$(PLATFORM_CFLAGS)
 
 libnotification_plugin_la_LDFLAGS = \
@@ -35,7 +36,8 @@ libnotification_plugin_la_LDFLAGS = \
 libnotification_plugin_la_LIBADD = \
 	$(LIBXFCE4UTIL_LIBS) \
 	$(LIBXFCE4UI_LIBS) \
-	$(LIBXFCE4PANEL_LIBS)
+	$(LIBXFCE4PANEL_LIBS)	\
+	$(XFCONF_LIBS)
 
 #
 # Desktop file
diff --git a/panel-plugin/notification-plugin.c b/panel-plugin/notification-plugin.c
index 8da135d..09c5d25 100644
--- a/panel-plugin/notification-plugin.c
+++ b/panel-plugin/notification-plugin.c
@@ -25,6 +25,7 @@
 #endif
 
 #include <gtk/gtk.h>
+#include <xfconf/xfconf.h>
 #include <libxfce4util/libxfce4util.h>
 #include <libxfce4panel/xfce-panel-plugin.h>
 
@@ -130,22 +131,41 @@ notification_plugin_read (NotificationPlugin *notification_plugin)
 
 
 
+static void
+dnd_toggled_cb (GtkCheckMenuItem *checkmenuitem,
+                gpointer          user_data)
+{
+  NotificationPlugin *notification_plugin = user_data;
+
+  if (gtk_check_menu_item_get_active (checkmenuitem))
+    gtk_image_set_from_icon_name (GTK_IMAGE (notification_plugin->image), "notification-disabled-symbolic", GTK_ICON_SIZE_MENU);
+  else
+    gtk_image_set_from_icon_name (GTK_IMAGE (notification_plugin->image), "notification-symbolic", GTK_ICON_SIZE_MENU);
+}
+
+
+
 GtkWidget *
-notification_plugin_menu_new ()
+notification_plugin_menu_new (NotificationPlugin *notification_plugin)
 {
   GtkWidget *menu;
   GtkWidget *mi;
   GtkWidget *label;
 
   menu = gtk_menu_new ();
+
   /* Footer items */
   mi = gtk_separator_menu_item_new ();
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
-  mi = gtk_menu_item_new ();
-  label = gtk_label_new_with_mnemonic (_("_Settings..."));
-  gtk_label_set_xalign (GTK_LABEL (label), 0.0);
-  gtk_container_add (GTK_CONTAINER (mi), GTK_WIDGET (label));
+
+  /* checkmenuitem for the do not disturb mode of xfce4-notifyd */
+  mi = gtk_check_menu_item_new_with_mnemonic (_("_Do not disturb"));
+  xfconf_g_property_bind (notification_plugin->channel, "/do-not-disturb", G_TYPE_BOOLEAN,
+                          G_OBJECT (mi), "active");
   gtk_menu_shell_append (GTK_MENU_SHELL (menu), mi);
+  g_signal_connect (mi, "toggled",
+                    G_CALLBACK (dnd_toggled_cb), notification_plugin);
+
   /* Show all the items */
   gtk_widget_show_all (GTK_WIDGET (menu));
   return menu;
@@ -157,8 +177,6 @@ void
 notification_plugin_popup_menu (NotificationPlugin *notification_plugin)
 {
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (notification_plugin->button), TRUE);
-  gtk_menu_set_screen (GTK_MENU (notification_plugin->menu),
-                       gtk_widget_get_screen (notification_plugin->button));
   gtk_menu_popup_at_widget (GTK_MENU (notification_plugin->menu), notification_plugin->button,
                             GDK_GRAVITY_NORTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
   xfce_panel_plugin_register_menu (notification_plugin->plugin,
@@ -195,30 +213,31 @@ static NotificationPlugin *
 notification_plugin_new (XfcePanelPlugin *panel_plugin)
 {
   NotificationPlugin   *notification_plugin;
-  GtkOrientation  orientation;
-  GtkWidget      *label;
+  GError *error = NULL;
 
   /* allocate memory for the plugin structure */
   notification_plugin = panel_slice_new0 (NotificationPlugin);
-
-  /* pointer to plugin */
   notification_plugin->plugin = panel_plugin;
 
   /* read the user settings */
   notification_plugin_read (notification_plugin);
 
+  /* xfconf */
+  xfconf_init (NULL);
+  notification_plugin->channel = xfconf_channel_new ("xfce4-notifyd");
+
   /* create some panel widgets */
   xfce_panel_plugin_set_small (panel_plugin, TRUE);
   notification_plugin->button = xfce_panel_create_toggle_button ();
   gtk_widget_set_tooltip_text (GTK_WIDGET (notification_plugin->button), _("Notifications"));
-  notification_plugin->image = gtk_image_new_from_icon_name (ICON_NAME, GTK_ICON_SIZE_MENU);
+  notification_plugin->image = gtk_image_new_from_icon_name ("notification-symbolic", GTK_ICON_SIZE_MENU);
   gtk_container_add (GTK_CONTAINER (notification_plugin->button), notification_plugin->image);
   gtk_container_add (GTK_CONTAINER (panel_plugin), notification_plugin->button);
   gtk_widget_show_all (GTK_WIDGET (notification_plugin->button));
   gtk_widget_set_name (GTK_WIDGET (notification_plugin->button), "xfce4-notification-plugin");
 
   /* create the menu */
-  notification_plugin->menu = notification_plugin_menu_new ();
+  notification_plugin->menu = notification_plugin_menu_new (notification_plugin);
   gtk_widget_set_name (GTK_WIDGET (notification_plugin->menu), "xfce4-notification-plugin-menu");
 
   g_signal_connect (notification_plugin->button, "button-press-event",
@@ -233,7 +252,7 @@ notification_plugin_new (XfcePanelPlugin *panel_plugin)
 
 static void
 notification_plugin_free (XfcePanelPlugin *plugin,
-             NotificationPlugin    *notification_plugin)
+                          NotificationPlugin    *notification_plugin)
 {
   GtkWidget *dialog;
 
@@ -256,22 +275,17 @@ notification_plugin_free (XfcePanelPlugin *plugin,
 
 
 static gboolean
-notification_plugin_size_changed (XfcePanelPlugin *plugin,
-                     gint             size,
-                     NotificationPlugin    *notification_plugin)
+notification_plugin_size_changed (XfcePanelPlugin       *plugin,
+                                  gint                   size,
+                                  NotificationPlugin    *notification_plugin)
 {
-  GtkOrientation orientation;
+  gint icon_size;
 
-  /* get the orientation of the plugin */
-  orientation = xfce_panel_plugin_get_orientation (plugin);
-
-  /* set the widget size */
-  if (orientation == GTK_ORIENTATION_HORIZONTAL)
-    gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, size);
-  else
-    gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1);
+  size /= xfce_panel_plugin_get_nrows (notification_plugin->plugin);
+  gtk_widget_set_size_request (GTK_WIDGET (notification_plugin->button), size, size);
+  icon_size = xfce_panel_plugin_get_icon_size (XFCE_PANEL_PLUGIN (plugin));
+  gtk_image_set_pixel_size (GTK_IMAGE (notification_plugin->image), icon_size);
 
-  /* we handled the orientation */
   return TRUE;
 }
 
diff --git a/panel-plugin/notification-plugin.h b/panel-plugin/notification-plugin.h
index 2692a0e..030dd10 100644
--- a/panel-plugin/notification-plugin.h
+++ b/panel-plugin/notification-plugin.h
@@ -22,18 +22,20 @@
 
 G_BEGIN_DECLS
 
+#include <xfconf/xfconf.h>
+
 #define ICON_NAME "preferences-system-notifications"
 
 /* plugin structure */
 typedef struct
 {
     XfcePanelPlugin *plugin;
+    XfconfChannel   *channel;
 
     /* panel widgets */
     GtkWidget       *button;
     GtkWidget       *image;
     GtkWidget       *menu;
-    GtkMenuPositionFunc   menu_position_func;
 
     /* sample settings */
     gchar           *setting1;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list