Browse Source

Starting redesign to display replies/retweets

master
Julio Biason 15 years ago
parent
commit
59ca693759
  1. 31
      mitterlib/ui/ui_pygtk.py

31
mitterlib/ui/ui_pygtk.py

@ -304,8 +304,10 @@ class Interface(object):
</menu>
<menu action="Edit">
<menuitem action="Refresh" />
<menuitem action="Update" />
<menuitem action="Clear" />
<separator />
<menuitem action="Update" />
<menuitem action="Cancel" />
<menuitem action="ShrinkURL" />
<menuitem action="MuteNotify" />
<separator />
@ -361,6 +363,13 @@ class Interface(object):
action_group.add_action_with_accel(self._update_action,
'<Ctrl>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,
'<Ctrl>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

Loading…
Cancel
Save