diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index 9c8807f..4611a91 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -337,6 +337,7 @@ class Interface(object): + @@ -353,6 +354,7 @@ class Interface(object): + @@ -410,6 +412,16 @@ class Interface(object): refresh_action.connect('activate', self._refresh) action_group.add_action_with_accel(refresh_action, None) + clear_action = gtk.Action('Clear', _('_Clear'), + _('Clear the message list'), gtk.STOCK_CLEAR) + clear_action.connect('activate', self._clear_posts) + action_group.add_action_with_accel(clear_action, 'l') + + all_read_action = gtk.Action('AllRead', _('_Mark All Read'), + _('Mark all messages as read'), gtk.STOCK_APPLY) + all_read_action.connect('activate', self._mark_all_read) + action_group.add_action(all_read_action) + self._update_action = gtk.Action('Update', _('_Update'), _('Update your status'), gtk.STOCK_ADD) self._update_action.set_property('sensitive', False) @@ -423,11 +435,6 @@ class Interface(object): 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) - action_group.add_action_with_accel(clear_action, 'l') - settings_action = gtk.Action('Settings', _('_Settings'), _('Settings'), gtk.STOCK_PREFERENCES) settings_action.connect('activate', self._show_settings) @@ -956,6 +963,31 @@ class Interface(object): self._message_count_updated() return + def _mark_all_read(self, widget, user_data=None): + """Mark all messages as read.""" + grid = self._get_current_grid() + model = grid.get_model() + if len(model) == 0: + # no messages, so we don't worry (if I recall correctly, + # get_iter_first will fail if the model is empty) + return + + iter = model.get_iter_first() + while iter: + message = model.get_value(iter, 0) + message.read = True + iter = model.iter_next(iter) + + # update the counters + page = self._main_tabs.get_current_page() + if page == 0: + self._new_message_count = 0 + else: + self._new_replies_count = 0 + self._message_count_updated() + + return + def _delete_message(self, widget, user_data=None): """Delete a message.""" grid = self._get_current_grid() @@ -1426,15 +1458,17 @@ class Interface(object): has_alpha=False, bits_per_sample=8, width=48, height=48) self._images = {} - self._images['icon'] = gtk.gdk.pixbuf_new_from_file( - find_image('mitter.png')) + self._images['avatar'] = default_pixmap self._images['logo'] = gtk.gdk.pixbuf_new_from_file( find_image('mitter-big.png')) + + # icons (app and statusicon) + self._images['icon'] = gtk.gdk.pixbuf_new_from_file( + find_image('mitter.png')) self._images['new-messages'] = gtk.gdk.pixbuf_new_from_file( find_image('mitter-new.png')) self._images['icon-error'] = gtk.gdk.pixbuf_new_from_file( find_image('mitter-error.png')) - self._images['avatar'] = default_pixmap # This is the ugly bit for speeding up things and making # interthread communication. diff --git a/pixmaps/reply.png b/pixmaps/reply.png deleted file mode 100644 index 37b120b..0000000 Binary files a/pixmaps/reply.png and /dev/null differ