Browse Source

Manual refresh works

master
Julio Biason 15 years ago
parent
commit
ed504a7f6e
  1. 17
      mitterlib/ui/ui_pygtk.py

17
mitterlib/ui/ui_pygtk.py

@ -231,6 +231,7 @@ class Interface(object):
box = gtk.VBox(False, 1) box = gtk.VBox(False, 1)
box.pack_start(menu, False, True, 0) box.pack_start(menu, False, True, 0)
box.pack_start(toolbar, False, False, 0)
box.pack_start(update_box, True, True, 0) box.pack_start(update_box, True, True, 0)
box.pack_start(statusbar, False, False, 0) box.pack_start(statusbar, False, False, 0)
main_window.add(box) main_window.add(box)
@ -350,7 +351,7 @@ class Interface(object):
# Edit actions # Edit actions
refresh_action = gtk.Action('Refresh', '_Refresh', refresh_action = gtk.Action('Refresh', '_Refresh',
'Update the listing', gtk.STOCK_REFRESH) 'Update the listing', gtk.STOCK_REFRESH)
#refresh_action.connect('activate', self.refresh) refresh_action.connect('activate', self._refresh)
action_group.add_action_with_accel(refresh_action, None) action_group.add_action_with_accel(refresh_action, None)
self._update_action = gtk.Action('Update', '_Update', self._update_action = gtk.Action('Update', '_Update',
@ -583,7 +584,6 @@ class Interface(object):
def _count_chars(self, text_buffer): def _count_chars(self, text_buffer):
"""Count the number of chars in the edit field and update the """Count the number of chars in the edit field and update the
label that shows the available space.""" label that shows the available space."""
_log.debug('Counting chars')
text = _buffer_text(text_buffer) text = _buffer_text(text_buffer)
count = len(text) count = len(text)
@ -697,6 +697,14 @@ class Interface(object):
# Network related functions # Network related functions
# ------------------------------------------------------------ # ------------------------------------------------------------
def _refresh(self, widget=None):
"""Request a refresh. *widget* is the widget that called this
function (we basically ignore it.)"""
self._threads.add_work(self._post_get_messages,
self._exception_get_messages,
self._connection.messages)
return
### Results from the "messages" request ### Results from the "messages" request
def _post_get_messages(self, widget, results): def _post_get_messages(self, widget, results):
"""Function called after the data from the messages list is """Function called after the data from the messages list is
@ -804,10 +812,7 @@ class Interface(object):
self._threads = _ThreadManager() self._threads = _ThreadManager()
# queue the first fetch # queue the first fetch
self._threads.add_work(self._post_get_messages, self._refresh()
self._exception_get_messages,
self._connection.messages)
gtk.main() gtk.main()
@classmethod @classmethod

Loading…
Cancel
Save