changeset 0f13f6f2b647 in /home/hg/repos/gajim

details:http://hg.gajim.org/gajim?cmd=changeset;node=0f13f6f2b647
description: merge

diffstat:

 src/common/config.py              |  12 ++++++++++++
 src/common/connection_handlers.py |   2 +-
 src/tooltips.py                   |  39 ++++++++++++++++++++++++---------------
 3 files changed, 37 insertions(+), 16 deletions(-)

diffs (121 lines):

diff -r 61f42e72a6fc -r 0f13f6f2b647 src/common/config.py
--- a/src/common/config.py      Sat Jun 16 18:41:33 2012 -0400
+++ b/src/common/config.py      Sat Jun 16 18:46:21 2012 -0400
@@ -222,6 +222,18 @@
             'roster_avatar_height': [opt_int, 32],
             'tooltip_avatar_width': [opt_int, 125],
             'tooltip_avatar_height': [opt_int, 125],
+            'tooltip_status_online_color': [opt_color, '#73D216'],
+            'tooltip_status_free_for_chat_color': [opt_color, '#3465A4'],
+            'tooltip_status_away_color': [opt_color, '#EDD400'],
+            'tooltip_status_busy_color': [opt_color, '#F57900'],
+            'tooltip_status_na_color': [opt_color, '#CC0000'],
+            'tooltip_status_offline_color': [opt_color, '#555753'],
+            'tooltip_affiliation_none_color': [opt_color, '#555753'],
+            'tooltip_affiliation_member_color': [opt_color, '#73D216'],
+            'tooltip_affiliation_administrator_color': [opt_color, '#F57900'],
+            'tooltip_affiliation_owner_color': [opt_color, '#CC0000'],
+            'tooltip_account_name_color': [opt_color, '#888A85'],
+            'tooltip_idle_color': [opt_color, '#888A85'],
             'vcard_avatar_width': [opt_int, 200],
             'vcard_avatar_height': [opt_int, 200],
             'notification_preview_message': [opt_bool, True, _('Preview new 
messages in notification popup?')],
diff -r 61f42e72a6fc -r 0f13f6f2b647 src/common/connection_handlers.py
--- a/src/common/connection_handlers.py Sat Jun 16 18:41:33 2012 -0400
+++ b/src/common/connection_handlers.py Sat Jun 16 18:46:21 2012 -0400
@@ -2024,7 +2024,7 @@
     def _StreamCB(self, con, obj):
         log.debug('StreamCB')
         gajim.nec.push_incoming_event(StreamReceivedEvent(None,
-            conn=self, stanza=iq_obj))
+            conn=self, stanza=obj))
 
     def _register_handlers(self, con, con_type):
         # try to find another way to register handlers in each class
diff -r 61f42e72a6fc -r 0f13f6f2b647 src/tooltips.py
--- a/src/tooltips.py   Sat Jun 16 18:41:33 2012 -0400
+++ b/src/tooltips.py   Sat Jun 16 18:46:21 2012 -0400
@@ -181,18 +181,21 @@
         semantics. Color palette is the Tango.
         """
         formatted = "<span foreground='%s'>%s</span>"
+        color = None
         if status.startswith(Q_("?user status:Available")):
-            status = formatted % ('#73D216', status)
+            color = gajim.config.get('tooltip_status_online_color')
         elif status.startswith(_("Free for Chat")):
-            status = formatted % ('#3465A4', status)
+            color = gajim.config.get('tooltip_status_free_for_chat_color')
         elif status.startswith(_("Away")):
-            status = formatted % ('#EDD400', status)
+            color = gajim.config.get('tooltip_status_away_color')
         elif status.startswith(_("Busy")):
-            status = formatted % ('#F57900', status)
+            color = gajim.config.get('tooltip_status_busy_color')
         elif status.startswith(_("Not Available")):
-            status = formatted % ('#CC0000', status)
+            color = gajim.config.get('tooltip_status_na_color')
         elif status.startswith(_("Offline")):
-            status = formatted % ('#555753', status)
+            color = gajim.config.get('tooltip_status_offline_color')
+        if color:
+            status = formatted % (color, status)
         return status
 
     @staticmethod
@@ -202,14 +205,17 @@
         it's semantics. Color palette is the Tango.
         """
         formatted = "<span foreground='%s'>%s</span>"
+        color = None
         if affiliation.startswith(Q_("?Group Chat Contact Affiliation:None")):
-            affiliation = formatted % ('#555753', affiliation)
+            color = gajim.conig.get('tooltip_affiliation_none_color')
         elif affiliation.startswith(_("Member")):
-            affiliation = formatted % ('#73D216', affiliation)
+            color = gajim.conig.get('tooltip_affiliation_member_color')
         elif affiliation.startswith(_("Administrator")):
-            affiliation = formatted % ('#F57900', affiliation)
+            color = gajim.conig.get('tooltip_affiliation_administrator_color')
         elif affiliation.startswith(_("Owner")):
-            affiliation = formatted % ('#CC0000', affiliation)
+            color = gajim.conig.get('tooltip_affiliation_owner_color')
+        if color:
+            affiliation = formatted % (color, affiliation)
         return affiliation
 
 class StatusTable:
@@ -493,9 +499,9 @@
                 gobject.markup_escape_text(prim_contact.get_shown_name())\
                 + '</span>'
         if gajim.config.get('mergeaccounts'):
-          name_markup += u" <span foreground='#888A85'>(" + \
-                gobject.markup_escape_text(prim_contact.account.name) \
-                + ')</span>'
+            name_markup += u" <span foreground='%s'>(%s)</span>" % (
+                gajim.config.get('tooltip_account_name_color'),
+                gobject.markup_escape_text(prim_contact.account.name))
 
         if self.account and helpers.jid_is_blocked(self.account,
         prim_contact.jid):
@@ -528,7 +534,8 @@
                 iconset = gajim.config.get('iconset')
                 if not iconset:
                     iconset = 'dcraven'
-                file_path = os.path.join(helpers.get_iconset_path(iconset), 
'16x16')
+                file_path = os.path.join(helpers.get_iconset_path(iconset),
+                    '16x16')
 
             contact_keys = sorted(contacts_dict.keys())
             contact_keys.reverse()
@@ -641,7 +648,9 @@
             # is no meaningful difference between last activity time and
             # current time.
             if diff.days > 0 or diff.seconds > 0:
-                cs = "<span foreground='#888A85'>%s</span>"
+                cs = "<span foreground='%s'>" % gajim.config.get(
+                    'tooltip_idle_color')
+                cs += '%s</span>'
                 properties.append((str(), None))
                 properties.append(((cs % _("Idle since %s")) % formatted, 
None))
                 properties.append(((cs % _("Idle for %s")) % str(diff), None))
_______________________________________________
Commits mailing list
[email protected]
http://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to