Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar/0038-Improve-message-notification-behaviour.patch
diff options
context:
space:
mode:
Diffstat (limited to 'rpms/sugar/0038-Improve-message-notification-behaviour.patch')
-rw-r--r--rpms/sugar/0038-Improve-message-notification-behaviour.patch132
1 files changed, 132 insertions, 0 deletions
diff --git a/rpms/sugar/0038-Improve-message-notification-behaviour.patch b/rpms/sugar/0038-Improve-message-notification-behaviour.patch
new file mode 100644
index 0000000..b8ae4f3
--- /dev/null
+++ b/rpms/sugar/0038-Improve-message-notification-behaviour.patch
@@ -0,0 +1,132 @@
+From 2a7d9d90e963e4f7ba4ae28c8fac47176ff94efd Mon Sep 17 00:00:00 2001
+From: Martin Abente <martin.abente.lahaye@gmail.com>
+Date: Mon, 20 Dec 2010 14:27:32 -0300
+Subject: [PATCH sugar 38/74] Improve message notification behaviour
+
+Corner's notification icon will use the same icon
+as the frame notification button.
+
+Frame's notification button will pulse until
+the messages are read.
+---
+ src/jarabe/frame/frame.py | 9 +++++----
+ src/jarabe/frame/notification.py | 26 ++++++++++++++++++--------
+ 2 files changed, 23 insertions(+), 12 deletions(-)
+
+diff --git a/src/jarabe/frame/frame.py b/src/jarabe/frame/frame.py
+index 96e848b..6a9735b 100644
+--- a/src/jarabe/frame/frame.py
++++ b/src/jarabe/frame/frame.py
+@@ -380,22 +380,23 @@ def add_message(self, body, summary='', icon_name=_DEFAULT_ICON,
+
+ button = self._notif_by_message.get(corner, None)
+ if button is None:
+- button = NotificationButton(xo_color)
++ button = NotificationButton(_DEFAULT_ICON, xo_color)
+ button.show()
+ self._add_message_button(button, corner)
+ self._notif_by_message[corner] = button
+
+- button.start_pulsing()
+-
+ palette = button.get_palette()
+ if palette is None:
+ palette = HistoryPalette()
+ palette.set_group_id('frame')
+ palette.connect('clear-messages', self.remove_message, corner)
++ palette.connect('notice-messages', button.stop_pulsing)
+ button.set_palette(palette)
+
++ button.start_pulsing()
++
+ palette.push_message(body, summary, icon_name, xo_color)
+- self._launch_notification_icon(icon_name, xo_color, corner, duration)
++ self._launch_notification_icon(_DEFAULT_ICON, xo_color, corner, duration)
+
+
+ def remove_message(self, palette, corner):
+diff --git a/src/jarabe/frame/notification.py b/src/jarabe/frame/notification.py
+index b5724d5..99030e5 100644
+--- a/src/jarabe/frame/notification.py
++++ b/src/jarabe/frame/notification.py
+@@ -38,17 +38,18 @@
+ _PULSE_COLOR = XoColor('%s,%s' % \
+ (style.COLOR_BUTTON_GREY.get_svg(), style.COLOR_TRANSPARENT.get_svg()))
+ _BODY_FILTERS = "<img.*?/>"
+-_NOTIFICATION_ICON = 'emblem-notification'
+
+
+-def _create_pulsing_icon(icon_name, xo_color):
++def _create_pulsing_icon(icon_name, xo_color, timeout=None):
+ icon = PulsingIcon(
+ pixel_size=style.STANDARD_ICON_SIZE,
+ pulse_color=_PULSE_COLOR,
+- base_color=xo_color,
+- timeout=_PULSE_TIMEOUT,
++ base_color=xo_color
+ )
+
++ if timeout is not None:
++ icon.timeout = timeout
++
+ if icon_name.startswith(os.sep):
+ icon.props.file = icon_name
+ else:
+@@ -61,7 +62,7 @@ class _HistoryIconWidget(gtk.Alignment):
+ __gtype_name__ = 'SugarHistoryIconWidget'
+
+ def __init__(self, icon_name, xo_color):
+- icon = _create_pulsing_icon(icon_name, xo_color)
++ icon = _create_pulsing_icon(icon_name, xo_color, _PULSE_TIMEOUT)
+ icon.props.pulsing = True
+
+ gtk.Alignment.__init__(self, xalign=0.5, yalign=0.0)
+@@ -154,7 +155,8 @@ class HistoryPalette(Palette):
+ __gtype_name__ = 'SugarHistoryPalette'
+
+ __gsignals__ = {
+- 'clear-messages': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([]))
++ 'clear-messages': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([])),
++ 'notice-messages': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, ([]))
+ }
+
+ def __init__(self):
+@@ -177,18 +179,23 @@ def __init__(self):
+
+ self.menu.append(clear_option)
+
++ self.connect('popup', self.__notice_messages_cb)
++
+ def __clear_messages_cb(self, clear_option):
+ self.emit('clear-messages')
+
++ def __notice_messages_cb(self, palette):
++ self.emit('notice-messages')
++
+ def push_message(self, body, summary, icon_name, xo_color):
+ self._messages_box.push_message(body, summary, icon_name, xo_color)
+
+
+ class NotificationButton(ToolButton):
+
+- def __init__(self, xo_color):
++ def __init__(self, icon_name, xo_color):
+ ToolButton.__init__(self)
+- self._icon = _create_pulsing_icon(_NOTIFICATION_ICON, xo_color)
++ self._icon = _create_pulsing_icon(icon_name, xo_color)
+ self.set_icon_widget(self._icon)
+ self._icon.show()
+ self.set_palette_invoker(FrameWidgetInvoker(self))
+@@ -196,6 +203,9 @@ def __init__(self, xo_color):
+ def start_pulsing(self):
+ self._icon.props.pulsing = True
+
++ def stop_pulsing(self, widget):
++ self._icon.props.pulsing = False
++
+
+ class NotificationIcon(gtk.EventBox):
+ __gtype_name__ = 'SugarNotificationIcon'
+--
+1.7.6
+