raphgro pushed to hamster-time-tracker (epel7). "New patch that fixes notifications (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Mon Mar 30 20:58:59 UTC 2015


>From 707ee1a221a66401530ff715b42560921bcd5ef3 Mon Sep 17 00:00:00 2001
From: "Ankur Sinha (Ankur Sinha Gmail)" <sanjay.ankur at gmail.com>
Date: Mon, 30 Dec 2013 04:12:28 +1100
Subject: New patch that fixes notifications

https://bugzilla.redhat.com/show_bug.cgi?id=1046991

diff --git a/hamster-time-tracker-1.03.3-notification-fix.patch b/hamster-time-tracker-1.03.3-notification-fix.patch
new file mode 100644
index 0000000..02e47d5
--- /dev/null
+++ b/hamster-time-tracker-1.03.3-notification-fix.patch
@@ -0,0 +1,38 @@
+--- src/hamster/lib/desktop.py.orig	2013-12-28 11:18:50.279437922 +1100
++++ src/hamster/lib/desktop.py	2013-12-28 21:26:44.456425009 +1100
+@@ -32,6 +32,7 @@
+ class DesktopIntegrations(object):
+     def __init__(self, storage):
+         self.storage = storage # can't use client as then we get in a dbus loop
++        self._last_notification = None
+ 
+         dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
+         self.bus = dbus.SessionBus()
+@@ -88,15 +89,21 @@
+ 
+ 
+     def notify_user(self, summary="", details=""):
+-        if not hasattr(self, "notification_conn"):
++        if not hasattr(self, "_notification_conn"):
+             self._notification_conn = dbus.Interface(self.bus.get_object('org.freedesktop.Notifications',
+-                                                                         '/org/freedesktop/Notifications'),
+-                                                    dbus_interface='org.freedesktop.Notifications')
++                                                                         '/org/freedesktop/Notifications',
++                                                                         follow_name_owner_changes=True),
++                                                     dbus_interface='org.freedesktop.Notifications')
++
+         conn = self._notification_conn
+ 
+-        conn.Notify("Project Hamster", 5, "hamster-time-tracker",
+-                    summary, details,
+-                    [], {"urgency": 0}, -1)
++        notification = conn.Notify("Project Hamster", self._last_notification or
++                                   0, "hamster-time-tracker", summary, details,
++                                   [], {"urgency": dbus.Byte(0), "transient":
++                                        True}, -1)
++
++        self._last_notification = notification
++
+ 
+ 
+     def on_idle_changed(self, event, state):
diff --git a/hamster-time-tracker.spec b/hamster-time-tracker.spec
index be02982..299dbb5 100644
--- a/hamster-time-tracker.spec
+++ b/hamster-time-tracker.spec
@@ -1,6 +1,6 @@
-Name:        hamster-time-tracker
+Name:       hamster-time-tracker
 Version:    1.03.3
-Release:    4%{?dist}
+Release:    5%{?dist}
 Summary:    The Linux time tracker
 
 License:    GPLv3+
@@ -23,6 +23,9 @@ Patch0:     %{name}-1.03.3-file-locations.patch
 Patch2:     %{name}-1.03.3-service-dbus1.patch
 Patch3:     %{name}-1.03.3-service-dbus2.patch
 
+# Notification fixes. See URLs in changelog for details
+Patch4:     %{name}-1.03.3-notification-fix.patch
+
 BuildArch:  noarch
 BuildRequires:    desktop-file-utils
 BuildRequires:    gettext intltool
@@ -55,6 +58,7 @@ is a request of your employee.
 #%patch1
 %patch2
 %patch3
+%patch4
 
 # remove shebang
 sed -ibackup '1d' src/hamster/today.py
@@ -120,6 +124,12 @@ fi
 
 
 %changelog
+* Sat Dec 28 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.03.3-5
+- Add patch for notification fix
+- https://bugzilla.redhat.com/show_bug.cgi?id=1046991
+- https://github.com/projecthamster/hamster/pull/127
+- https://github.com/projecthamster/hamster/pull/117
+
 * Tue Dec 24 2013 Ankur Sinha <ankursinha AT fedoraproject DOT org> 1.03.3-4
 - Add wnck dependency so users can use workspaces out of the box
 - https://bugzilla.redhat.com/show_bug.cgi?id=1046077
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/hamster-time-tracker.git/commit/?h=epel7&id=707ee1a221a66401530ff715b42560921bcd5ef3


More information about the scm-commits mailing list