From 59ca69375964f4a0301d718f3b21e9a5c1aa5280 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Wed, 9 Dec 2009 22:28:19 -0200 Subject: [PATCH] Starting redesign to display replies/retweets --- mitterlib/ui/ui_pygtk.py | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 7cfb579..a2ecbf0 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -304,8 +304,10 @@ class Interface(object): - + + + @@ -361,6 +363,13 @@ class Interface(object): action_group.add_action_with_accel(self._update_action, 'Return') + self._cancel_action = gtk.Action('Cancel', '_Cancel', + 'Cancel the update', gtk.STOCK_CANCEL) + self._cancel_action.set_property('sensitive', False) + self._cancel_action.connect('activate', self._clear_text) + action_group.add_action_with_accel(self._cancel_action, + 'Escape') + clear_action = gtk.Action('Clear', '_Clear', 'Clear the message list', gtk.STOCK_CLEAR) clear_action.connect('activate', self._clear_posts) @@ -431,7 +440,7 @@ class Interface(object): text_buffer = self._update_text.get_buffer() text_buffer.connect('changed', self._count_chars) - self._update_button = gtk.Button(label='(140)') + self._update_button = gtk.Button(label='Send') self._update_button.connect('clicked', self._update_status) self._update_button.set_property('sensitive', False) @@ -439,8 +448,16 @@ class Interface(object): self._cancel_button.connect('clicked', self._clear_text) self._cancel_button.set_property('sensitive', False) - # TODO: We'll need a cancel button to cancel replies/repost. - + info_box = gtk.HBox(True, 0) + self._count_label = gtk.Label() + self._count_label.set_justify(gtk.JUSTIFY_LEFT) + self._reply_label = gtk.Label() + + info_box.pack_start(self._count_label) + info_box.pack_start(self._reply_label) + + self._count_chars(text_buffer) + update_box = gtk.HBox(False, 0) update_box.pack_start(self._update_text, expand=True, fill=True, padding=0) @@ -450,6 +467,7 @@ class Interface(object): padding=0) update_area = gtk.VBox(True, 0) + update_area.pack_start(info_box) update_area.pack_start(update_box) """ Spell checking the update box """ @@ -583,6 +601,7 @@ class Interface(object): self._update_button.set_property('sensitive', enabled) self._update_action.set_property('sensitive', enabled) self._cancel_button.set_property('sensitive', enabled) + self._cancel_action.set_property('sensitive', enabled) return # ------------------------------------------------------------ @@ -594,7 +613,9 @@ class Interface(object): text = _buffer_text(text_buffer) count = len(text) - self._update_button.set_label('(%d)' % (140 - count)) + # TODO: gettext to properly use "characters"/"character" + self._count_label.set_text('%d characters available' % (140 - count)) + #self._update_button.set_label('(%d)' % (140 - count)) self._update_sensitivity(not (count == 0)) return True