From d10273a642fbbb79d3dd39e5ae62d32854c0efb9 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sat, 23 Jan 2010 08:03:35 -0200 Subject: [PATCH] Moved special chars to the config file. fixes #179 --- CHEAT-CODES | 15 +++++++++++++++ mitterlib/ui/ui_pygtk.py | 32 +++++++++++++++++++++++++++++--- 2 files changed, 44 insertions(+), 3 deletions(-) diff --git a/CHEAT-CODES b/CHEAT-CODES index 330e5b0..797fca7 100644 --- a/CHEAT-CODES +++ b/CHEAT-CODES @@ -127,3 +127,18 @@ options: checked once and, if PyAspell is not installed, will be set as False and not checked again. If you install PyAspell after Mitter is run the first time, you must manually update this value. + +*unread_char* + The character to indicate a message is unread. The default value is + '●', which is a bullet in HTML. Beware that not all HTML + characters are accepted. + +*unfavourite_char* + The character to indicate that a message is not marked as favourite. + The default value is '★', which is a hallow star. Beware that + not all HTML characters are accepted. + +*favourite_char* + The character to indicate that a message is marked as favourite. The + defualt value is '☆', which is a filled star. Beware that not + all HTML charcters are accepted. diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 4797c1b..92c87f7 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -606,14 +606,17 @@ class Interface(object): # message) if not data.read: - message_values['read_status'] = ' ●' + message_values['read_status'] = (' ' + + self._options[self.NAMESPACE]['unread_char']) else: message_values['read_status'] = '' if data.favourite: - message_values['favourite_star'] = '★' + message_values['favourite_star'] = ( + self._options[self.NAMESPACE]['unfavourite_char']) else: - message_values['favourite_star'] = '☆' + message_values['favourite_star'] = ( + self._options[self.NAMESPACE]['favourite_char']) info = [] if data.reposted_by: @@ -1517,3 +1520,26 @@ class Interface(object): default=False, conflict_group='interface', is_cmd_option=False) + options.add_option( + group=self.NAMESPACE, + option='unread_char', + help='String to be used to indicate a message is unread.', + metavar='CHAR', + default='●', + is_cmd_option=False) + options.add_option( + group=self.NAMESPACE, + option='unfavourite_char', + help='String to be used to indicate a message is not ' \ + 'marked as favourite.', + metavar='CHAR', + default='★', + is_cmd_option=False) + options.add_option( + group=self.NAMESPACE, + option='favourite_char', + help='String to be used to indicate a message is marked ' \ + 'as favourite.', + metavar='CHAR', + default='☆', + is_cmd_option=False)