From 4a81bcf87b6c64a3348fc782a2ab19a4235f47fb Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 20 Dec 2009 19:03:47 -0200 Subject: [PATCH] Changed the message format to display favourite status --- mitterlib/ui/ui_pygtk.py | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 0a021e9..8a63e66 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -41,6 +41,15 @@ _log = logging.getLogger('ui.pygtk') URL_RE = re.compile(r'(https?://[^\s\n\r]+)', re.I) +MESSAGE_FORMAT = '%s' \ + '%s' \ + '(%s' \ + '%s' \ + ':' \ + '%s\n' \ + '%s\n' \ + '%s' + # ---------------------------------------------------------------------- # Helper Functions (not related to objects or that don't need direct access to @@ -578,15 +587,18 @@ class Interface(object): else: read_status = '' + if data.favourited: + favourited = '★' + else: + favourited = '☆' + if data.reposted_by: - markup = '%s (%s — reposted by %s)' \ - ':%s\n%s\n%s' % \ - (data.name, username, data.reposted_by, read_status, - message, time) + reposted_message = ' — reposted by %s' else: - markup = '%s (%s):%s\n%s\n' \ - '%s' % \ - (data.name, username, read_status, message, time) + reposted_message = '' + + markup = MESSAGE_FORMAT % (favourited, data.name, username, + reposted_message, read_status, message, time) cell.set_property('markup', markup) @@ -1216,8 +1228,9 @@ class Interface(object): metavar='MINUTES', default=5, conflict_group='interface') - options.add_option('--use-statusicon', + options.add_option('--disable-statusicon', group=self.NAMESPACE, + action='store_false', option='statusicon', default=True, conflict_group='interface')