Browse Source

the ok button now emits a signal so the interface can work properly

master
Julio Biason 14 years ago
parent
commit
19ae99386d
  1. 12
      mitterlib/ui/helpers/gtk_updatebox.py
  2. 2
      mitterlib/ui/ui_pygtk.py

12
mitterlib/ui/helpers/gtk_updatebox.py

@ -44,6 +44,10 @@ class UpdateBox(gtk.VBox):
__gsignals__ = { __gsignals__ = {
'text-focus': ( 'text-focus': (
gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE,
()),
'status-updated': (
gobject.SIGNAL_RUN_LAST, gobject.SIGNAL_RUN_LAST,
gobject.TYPE_NONE, gobject.TYPE_NONE,
())} ())}
@ -67,13 +71,14 @@ class UpdateBox(gtk.VBox):
add_button = gtk.Button(stock=gtk.STOCK_OK) add_button = gtk.Button(stock=gtk.STOCK_OK)
add_button.set_relief(gtk.RELIEF_NONE); add_button.set_relief(gtk.RELIEF_NONE);
add_button.connect('clicked', self.do_update)
status_bar = gtk.HBox(False, 0) status_bar = gtk.HBox(False, 0)
status_bar.pack_start(self._update_status, expand=True, fill=False, status_bar.pack_start(self._update_status, expand=True, fill=False,
padding=0) padding=0)
status_bar.pack_start(self._update_info, expand=True, fill=False, status_bar.pack_start(self._update_info, expand=True, fill=False,
padding=0) padding=0)
status_bar.pack_start(add_button, expand=false, fill=False, padding=0) status_bar.pack_start(add_button, expand=False, fill=False, padding=0)
status_bar.pack_start(close_button, expand=False, fill=False, status_bar.pack_start(close_button, expand=False, fill=False,
padding=0) padding=0)
@ -155,3 +160,8 @@ class UpdateBox(gtk.VBox):
self.avatar.set_from_pixbuf(pixbuf) self.avatar.set_from_pixbuf(pixbuf)
# pixbuf can only be set, not get. # pixbuf can only be set, not get.
pixbuf = property(None, _set_pixbuf) pixbuf = property(None, _set_pixbuf)
def do_update(self, widget=None):
text = self._text.get_buffer()
self.emit('status-updated')
return

2
mitterlib/ui/ui_pygtk.py

@ -89,6 +89,7 @@ class Interface(object):
self._update_field = UpdateBox( self._update_field = UpdateBox(
self._images['avatar'], self._images['avatar'],
self._options[self.NAMESPACE]['spell_check']) self._options[self.NAMESPACE]['spell_check'])
self._update_field.connect('status-updated', self._update_status)
self._statusbar = SmartStatusbar() self._statusbar = SmartStatusbar()
# the messages grid # the messages grid
@ -498,6 +499,7 @@ class Interface(object):
def _update_status(self, widget): def _update_status(self, widget):
"""Update your status.""" """Update your status."""
if not self._update_field.get_property('visible'): if not self._update_field.get_property('visible'):
# update box is not visible; show it.
self._update_field.show() self._update_field.show()
return return

Loading…
Cancel
Save