[kupfer] uiutils: Optionally take an argument to replace a notification
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] uiutils: Optionally take an argument to replace a notification
- Date: Fri, 10 Dec 2010 21:03:47 +0000 (UTC)
commit 61f468cd836e75693ff1366cec827bd0e311a3c3
Author: William Friesen <wfriesen gmail com>
Date: Fri Nov 19 17:57:42 2010 +1100
uiutils: Optionally take an argument to replace a notification
kupfer/uiutils.py | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/kupfer/uiutils.py b/kupfer/uiutils.py
index 49a609c..dfbbd81 100644
--- a/kupfer/uiutils.py
+++ b/kupfer/uiutils.py
@@ -187,11 +187,17 @@ def _get_notification_iface():
iface_obj = dbus.Interface(proxy_obj, IFACE_NAME)
return iface_obj
-def show_notification(title, text="", icon_name=""):
+def show_notification(title, text="", icon_name="", nid=0):
+ """
+ @nid: If not 0, the id of the notification to replace.
+
+ Returns the id of the displayed notification.
+ """
notifications = _get_notification_iface()
if not notifications:
return None
- rid = notifications.Notify("kupfer", 0, icon_name, title, text, (), {}, -1)
+ rid = notifications.Notify("kupfer",
+ nid, icon_name, title, text, (), {}, -1)
return rid
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]