diff options
author | Not Zed <NotZed@Ximian.com> | 2004-04-08 16:00:06 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-04-08 16:00:06 +0800 |
commit | 60f26ddd1a06fc251a56b34c4fc7aac0d0171cec (patch) | |
tree | 71fedcf8e6729cf66ce018dccd39ae8c33af39cb /mail/mail-component.c | |
parent | 313439d717171d45c9e2444e2128939c524f2d9c (diff) | |
download | gsoc2013-evolution-60f26ddd1a06fc251a56b34c4fc7aac0d0171cec.tar.gz gsoc2013-evolution-60f26ddd1a06fc251a56b34c4fc7aac0d0171cec.tar.zst gsoc2013-evolution-60f26ddd1a06fc251a56b34c4fc7aac0d0171cec.zip |
VJUNK_FOLDER's dont exist, they're VTRASH folders now.
2004-04-08 Not Zed <NotZed@Ximian.com>
* mail-folder-cache.c:
(update_1folder): VJUNK_FOLDER's dont exist, they're VTRASH
folders now.
* em-folder-view.c: remove message_changed stuff from camel folder
stuff.
* mail-component.c (mail_component_init): don't setup the search
context here, wait till its requested. Fixes #56672.
2004-04-07 Not Zed <NotZed@Ximian.com>
* mail-component.c (view_changed_cb): hook to update the info
label when the folderview changes.
* em-folder-view.c (emfv_class_init): added 2 signals 'loaded' and
'changed'. For when a folder is set/cleared or when some state
changes.
(emfv_set_folder): emit LOADED signal when we set the folder.
(emfv_list_message_selected): emit changed event.
(emfv_gui_folder_changed): emit changed event.
svn path=/trunk/; revision=25369
Diffstat (limited to 'mail/mail-component.c')
-rw-r--r-- | mail/mail-component.c | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/mail/mail-component.c b/mail/mail-component.c index bb7c19979f..ee1bfccc74 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -44,6 +44,8 @@ #include "em-folder-selection.h" #include "em-migrate.h" +#include "widgets/misc/e-info-label.h" + #include "filter/rule-context.h" #include "mail-config.h" #include "mail-component.h" @@ -448,6 +450,24 @@ view_on_url (GObject *emitter, const char *url, const char *nice_url, MailCompon e_activity_handler_set_message (priv->activity_handler, nice_url); } +static void +view_changed_cb(EMFolderView *emfv, EInfoLabel *el) +{ + if (emfv->folder) { + char *tmp, *name; + guint32 total, unread; + + camel_object_get(emfv->folder, NULL, CAMEL_FOLDER_NAME, &name, CAMEL_FOLDER_TOTAL, &total, CAMEL_FOLDER_UNREAD, &unread, NULL); + /* Format of text for component information area */ + tmp = g_strdup_printf(_("%d total, %d unread"), total, unread); + e_info_label_set_info(el, name, tmp); + g_free(tmp); + camel_object_free(emfv->folder, CAMEL_FOLDER_NAME, name); + } else { + e_info_label_set_info(el, _("Mail"), ""); + } +} + /* Evolution::Component CORBA methods. */ static void @@ -462,7 +482,7 @@ impl_createControls (PortableServer_Servant servant, BonoboControl *tree_control; BonoboControl *view_control; BonoboControl *statusbar_control; - GtkWidget *tree_widget; + GtkWidget *tree_widget, *vbox, *info; GtkWidget *view_widget; GtkWidget *statusbar_widget; @@ -484,8 +504,19 @@ impl_createControls (PortableServer_Servant servant, gtk_widget_show (tree_widget); gtk_widget_show (view_widget); gtk_widget_show (statusbar_widget); - - tree_control = bonobo_control_new (tree_widget); + + printf("setting up info area\n"); + + vbox = gtk_vbox_new(FALSE, 0); + info = e_info_label_new("evolution-inbox-mini.png"); + e_info_label_set_info((EInfoLabel *)info, _("Mail"), ""); + gtk_box_pack_start((GtkBox *)vbox, info, FALSE, TRUE, 0); + gtk_box_pack_start((GtkBox *)vbox, tree_widget, TRUE, TRUE, 0); + + gtk_widget_show(info); + gtk_widget_show(vbox); + + tree_control = bonobo_control_new (vbox); view_control = bonobo_control_new (view_widget); statusbar_control = bonobo_control_new (statusbar_widget); @@ -494,8 +525,10 @@ impl_createControls (PortableServer_Servant servant, *corba_statusbar_control = CORBA_Object_duplicate (BONOBO_OBJREF (statusbar_control), ev); g_signal_connect (view_control, "activate", G_CALLBACK (view_control_activate_cb), view_widget); - g_signal_connect (tree_widget, "folder-selected", G_CALLBACK (folder_selected_cb), view_widget); + + g_signal_connect(view_widget, "changed", G_CALLBACK(view_changed_cb), info); + g_signal_connect(view_widget, "loaded", G_CALLBACK(view_changed_cb), info); } static CORBA_boolean @@ -731,8 +764,6 @@ mail_component_init (MailComponent *component) mail_autoreceive_setup(); - setup_search_context (component); - offline = mail_offline_handler_new(); bonobo_object_add_interface((BonoboObject *)component, (BonoboObject *)offline); } |