diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-24 12:45:19 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-24 12:45:19 +0800 |
commit | cbb3a71adc5551f4c600cfc6f53fc112f3022a78 (patch) | |
tree | 74aee71ae289b726bb9c1e5097dbdc29aa22c610 | |
parent | bd9f473a896496b95b9896d30940f2ab27493432 (diff) | |
download | gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.tar gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.tar.gz gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.tar.bz2 gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.tar.lz gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.tar.xz gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.tar.zst gsoc2013-evolution-cbb3a71adc5551f4c600cfc6f53fc112f3022a78.zip |
Get automatic message selection working.
Add a tooltip to the online button.
svn path=/branches/kill-bonobo/; revision=37126
-rw-r--r-- | mail/e-mail-shell-content.c | 33 | ||||
-rw-r--r-- | mail/e-mail-shell-view-actions.c | 37 | ||||
-rw-r--r-- | mail/e-mail-shell-view-private.h | 1 | ||||
-rw-r--r-- | mail/em-folder-browser.c | 346 | ||||
-rw-r--r-- | widgets/misc/e-online-button.c | 10 |
5 files changed, 233 insertions, 194 deletions
diff --git a/mail/e-mail-shell-content.c b/mail/e-mail-shell-content.c index 68eafa1f6c..ece2e2ee3a 100644 --- a/mail/e-mail-shell-content.c +++ b/mail/e-mail-shell-content.c @@ -33,6 +33,7 @@ #include "em-search-context.h" #include "em-utils.h" #include "mail-config.h" +#include "mail-ops.h" #include "e-mail-reader.h" #include "e-mail-shell-module.h" @@ -60,8 +61,9 @@ struct _EMailShellContentPrivate { guint message_list_built_id; guint message_list_scrolled_id; - guint preview_visible : 1; - guint vertical_view : 1; + guint preview_visible : 1; + guint suppress_message_selection : 1; + guint vertical_view : 1; }; enum { @@ -485,6 +487,8 @@ mail_shell_content_set_folder (EMailReader *reader, EMailShellContentPrivate *priv; EMailReaderIface *default_iface; MessageList *message_list; + gboolean different_folder; + gchar *meta_data; priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); @@ -492,10 +496,34 @@ mail_shell_content_set_folder (EMailReader *reader, message_list_freeze (message_list); + different_folder = + message_list->folder != NULL && + folder != message_list->folder; + /* Chain up to interface's default set_folder() method. */ default_iface = g_type_default_interface_peek (E_TYPE_MAIL_READER); default_iface->set_folder (reader, folder, folder_uri); + if (folder == NULL) + goto exit; + + mail_refresh_folder (folder, NULL, NULL); + + /* This function gets triggered several times at startup, + * so we don't want to reset the message suppression state + * unless we're actually switching to a different folder. */ + if (different_folder) + priv->suppress_message_selection = FALSE; + + if (!priv->suppress_message_selection) + meta_data = camel_object_meta_get ( + folder, "evolution:selected_uid"); + else + meta_data = NULL; + + g_free (priv->selected_uid); + priv->selected_uid = meta_data; + /* This is a one-time-only callback. */ if (message_list->cursor_uid == NULL && priv->message_list_built_id == 0) priv->message_list_built_id = g_signal_connect_swapped ( @@ -503,6 +531,7 @@ mail_shell_content_set_folder (EMailReader *reader, G_CALLBACK (mail_shell_content_message_list_built_cb), reader); +exit: message_list_thaw (message_list); } diff --git a/mail/e-mail-shell-view-actions.c b/mail/e-mail-shell-view-actions.c index a3d7397372..5e923724a9 100644 --- a/mail/e-mail-shell-view-actions.c +++ b/mail/e-mail-shell-view-actions.c @@ -397,22 +397,10 @@ action_mail_preview_cb (GtkToggleAction *action, EMailShellView *mail_shell_view) { EMailShellContent *mail_shell_content; - MessageList *message_list; - CamelFolder *folder; - EMailReader *reader; - const gchar *state; gboolean active; mail_shell_content = mail_shell_view->priv->mail_shell_content; active = gtk_toggle_action_get_active (action); - state = active ? "1" : "0"; - - reader = E_MAIL_READER (mail_shell_content); - message_list = e_mail_reader_get_message_list (reader); - folder = message_list->folder; - - if (camel_object_meta_set (folder, "evolution:show_preview", state)) - camel_object_state_write (folder); e_mail_shell_content_set_preview_visible (mail_shell_content, active); } @@ -470,20 +458,13 @@ action_mail_threads_group_by_cb (GtkToggleAction *action, EMailShellContent *mail_shell_content; MessageList *message_list; EMailReader *reader; - CamelFolder *folder; - const gchar *state; gboolean active; mail_shell_content = mail_shell_view->priv->mail_shell_content; active = gtk_toggle_action_get_active (action); - state = active ? "1" : "0"; reader = E_MAIL_READER (mail_shell_content); message_list = e_mail_reader_get_message_list (reader); - folder = message_list->folder; - - if (camel_object_meta_set (folder, "evolution:thread_list", state)) - camel_object_state_write (folder); message_list_set_threaded (message_list, active); } @@ -1033,6 +1014,8 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view) GtkUIManager *ui_manager; GConfBridge *bridge; GObject *object; + GObject *src_object; + GObject *dst_object; const gchar *domain; const gchar *key; @@ -1083,4 +1066,20 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view) object = G_OBJECT (ACTION (MAIL_VIEW_VERTICAL)); key = "/apps/evolution/mail/display/layout"; gconf_bridge_bind_property (bridge, key, object, "current-value"); + + /* Fine tuning. */ + + src_object = G_OBJECT (ACTION (MAIL_THREADS_GROUP_BY)); + + dst_object = G_OBJECT (ACTION (MAIL_FOLDER_SELECT_THREAD)); + e_binding_new (src_object, "active", dst_object, "sensitive"); + + dst_object = G_OBJECT (ACTION (MAIL_FOLDER_SELECT_SUBTHREAD)); + e_binding_new (src_object, "active", dst_object, "sensitive"); + + dst_object = G_OBJECT (ACTION (MAIL_THREADS_COLLAPSE_ALL)); + e_binding_new (src_object, "active", dst_object, "sensitive"); + + dst_object = G_OBJECT (ACTION (MAIL_THREADS_EXPAND_ALL)); + e_binding_new (src_object, "active", dst_object, "sensitive"); } diff --git a/mail/e-mail-shell-view-private.h b/mail/e-mail-shell-view-private.h index a3f7b8d99e..0641fe5d5c 100644 --- a/mail/e-mail-shell-view-private.h +++ b/mail/e-mail-shell-view-private.h @@ -29,6 +29,7 @@ #include <camel/camel-vtrash-folder.h> #include "e-util/e-util.h" +#include "e-util/e-binding.h" #include "e-util/gconf-bridge.h" #include "widgets/misc/e-popup-action.h" #include "widgets/menus/gal-view-instance.h" diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c index 705e87269d..f7a6746e30 100644 --- a/mail/em-folder-browser.c +++ b/mail/em-folder-browser.c @@ -509,30 +509,30 @@ emfb_init(GObject *o) // emfb->priv->show_wide = gconf_client_get_bool(mail_config_get_gconf_client(), "/apps/evolution/mail/display/show_wide", NULL); // emfb->vpane = emfb->priv->show_wide?gtk_hpaned_new():gtk_vpaned_new(); - +// // g_signal_connect(emfb->vpane, "realize", G_CALLBACK(emfb_pane_realised), emfb); // emfb->priv->vpane_resize_id = g_signal_connect(emfb->vpane, "button_release_event", G_CALLBACK(emfb_pane_button_release_event), emfb); - +// // gtk_widget_show(emfb->vpane); - - gtk_box_pack_start_defaults((GtkBox *)emfb, emfb->vpane); - - gtk_paned_pack1 (GTK_PANED (emfb->vpane), GTK_WIDGET (emfb->view.list), FALSE, FALSE); - gtk_widget_show((GtkWidget *)emfb->view.list); - - /* currently: just use a scrolledwindow for preview widget */ - p->scroll = gtk_scrolled_window_new(NULL, NULL); - gtk_scrolled_window_set_policy((GtkScrolledWindow *)p->scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type((GtkScrolledWindow *)p->scroll, GTK_SHADOW_IN); - gtk_widget_show(p->scroll); - - p->preview = gtk_vbox_new (FALSE, 6); - gtk_container_add((GtkContainer *)p->scroll, (GtkWidget *)emfb->view.preview->formathtml.html); - gtk_widget_show((GtkWidget *)emfb->view.preview->formathtml.html); - gtk_box_pack_start ((GtkBox *)p->preview, p->scroll, TRUE, TRUE, 0); - gtk_box_pack_start ((GtkBox *)p->preview, em_format_html_get_search_dialog (emfb->view.preview), FALSE, FALSE, 0); - gtk_paned_pack2 (GTK_PANED (emfb->vpane), p->preview, TRUE, FALSE); - gtk_widget_show(p->preview); +// +// gtk_box_pack_start_defaults((GtkBox *)emfb, emfb->vpane); +// +// gtk_paned_pack1 (GTK_PANED (emfb->vpane), GTK_WIDGET (emfb->view.list), FALSE, FALSE); +// gtk_widget_show((GtkWidget *)emfb->view.list); +// +// /* currently: just use a scrolledwindow for preview widget */ +// p->scroll = gtk_scrolled_window_new(NULL, NULL); +// gtk_scrolled_window_set_policy((GtkScrolledWindow *)p->scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); +// gtk_scrolled_window_set_shadow_type((GtkScrolledWindow *)p->scroll, GTK_SHADOW_IN); +// gtk_widget_show(p->scroll); +// +// p->preview = gtk_vbox_new (FALSE, 6); +// gtk_container_add((GtkContainer *)p->scroll, (GtkWidget *)emfb->view.preview->formathtml.html); +// gtk_widget_show((GtkWidget *)emfb->view.preview->formathtml.html); +// gtk_box_pack_start ((GtkBox *)p->preview, p->scroll, TRUE, TRUE, 0); +// gtk_box_pack_start ((GtkBox *)p->preview, em_format_html_get_search_dialog (emfb->view.preview), FALSE, FALSE, 0); +// gtk_paned_pack2 (GTK_PANED (emfb->vpane), p->preview, TRUE, FALSE); +// gtk_widget_show(p->preview); g_signal_connect (((EMFolderView *) emfb)->list->tree, "key_press", G_CALLBACK(emfb_list_key_press), emfb); g_signal_connect (((EMFolderView *) emfb)->list, "message_selected", G_CALLBACK (emfb_list_message_selected), emfb); @@ -570,8 +570,8 @@ emfb_destroy(GtkObject *o) emfb->priv->idle_scroll_id = 0; } - if (emfb->view.folder && emfb->priv->folder_changed_id) - camel_object_remove_event(emfb->view.folder, emfb->priv->folder_changed_id); +// if (emfb->view.folder && emfb->priv->folder_changed_id) +// camel_object_remove_event(emfb->view.folder, emfb->priv->folder_changed_id); if (emfb->priv->labels_change_notify_id) { GConfClient *gconf = mail_config_get_gconf_client (); @@ -591,74 +591,74 @@ emfb_destroy(GtkObject *o) ((GtkObjectClass *)emfb_parent)->destroy(o); } -static void -emfb_class_init(GObjectClass *klass) -{ - klass->finalize = emfb_finalise; - - folder_browser_signals[ACCOUNT_SEARCH_ACTIVATED] = - g_signal_new ("account_search_activated", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMFolderBrowserClass, account_search_activated), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - folder_browser_signals[ACCOUNT_SEARCH_CLEARED] = - g_signal_new ("account_search_cleared", - G_TYPE_FROM_CLASS (klass), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (EMFolderBrowserClass, account_search_cleared), - NULL, - NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - - ((GtkObjectClass *)klass)->destroy = emfb_destroy; - ((EMFolderViewClass *)klass)->set_folder = emfb_set_folder; - ((EMFolderViewClass *)klass)->activate = emfb_activate; -} - -GType -em_folder_browser_get_type(void) -{ - static GType type = 0; - - if (type == 0) { - static const GTypeInfo info = { - sizeof(EMFolderBrowserClass), - NULL, NULL, - (GClassInitFunc)emfb_class_init, - NULL, NULL, - sizeof(EMFolderBrowser), 0, - (GInstanceInitFunc)emfb_init - }; - emfb_parent = g_type_class_ref(em_folder_view_get_type()); - type = g_type_register_static(em_folder_view_get_type(), "EMFolderBrowser", &info, 0); - } +//static void +//emfb_class_init(GObjectClass *klass) +//{ +// klass->finalize = emfb_finalise; +// +// folder_browser_signals[ACCOUNT_SEARCH_ACTIVATED] = +// g_signal_new ("account_search_activated", +// G_TYPE_FROM_CLASS (klass), +// G_SIGNAL_RUN_LAST, +// G_STRUCT_OFFSET (EMFolderBrowserClass, account_search_activated), +// NULL, +// NULL, +// g_cclosure_marshal_VOID__VOID, +// G_TYPE_NONE, 0); +// +// folder_browser_signals[ACCOUNT_SEARCH_CLEARED] = +// g_signal_new ("account_search_cleared", +// G_TYPE_FROM_CLASS (klass), +// G_SIGNAL_RUN_LAST, +// G_STRUCT_OFFSET (EMFolderBrowserClass, account_search_cleared), +// NULL, +// NULL, +// g_cclosure_marshal_VOID__VOID, +// G_TYPE_NONE, 0); +// +// +// ((GtkObjectClass *)klass)->destroy = emfb_destroy; +// ((EMFolderViewClass *)klass)->set_folder = emfb_set_folder; +// ((EMFolderViewClass *)klass)->activate = emfb_activate; +//} - return type; -} +//GType +//em_folder_browser_get_type(void) +//{ +// static GType type = 0; +// +// if (type == 0) { +// static const GTypeInfo info = { +// sizeof(EMFolderBrowserClass), +// NULL, NULL, +// (GClassInitFunc)emfb_class_init, +// NULL, NULL, +// sizeof(EMFolderBrowser), 0, +// (GInstanceInitFunc)emfb_init +// }; +// emfb_parent = g_type_class_ref(em_folder_view_get_type()); +// type = g_type_register_static(em_folder_view_get_type(), "EMFolderBrowser", &info, 0); +// } +// +// return type; +//} -GtkWidget *em_folder_browser_new(void) -{ - EMFolderBrowser *emfb = g_object_new(em_folder_browser_get_type(), 0); - - /** @HookPoint-EMMenu: Main Mail Menu - * @Id: org.gnome.evolution.mail.browser - * @Class: org.gnome.evolution.mail.bonobomenu:1.0 - * @Target: EMMenuTargetSelect - * - * The main menu of mail view of the main application window. - * If the folder is NULL (not selected), the target will be empty, not NULL. - */ - ((EMFolderView *)emfb)->menu = em_menu_new("org.gnome.evolution.mail.browser"); - - return (GtkWidget *)emfb; -} +//GtkWidget *em_folder_browser_new(void) +//{ +// EMFolderBrowser *emfb = g_object_new(em_folder_browser_get_type(), 0); +// +// /** @HookPoint-EMMenu: Main Mail Menu +// * @Id: org.gnome.evolution.mail.browser +// * @Class: org.gnome.evolution.mail.bonobomenu:1.0 +// * @Target: EMMenuTargetSelect +// * +// * The main menu of mail view of the main application window. +// * If the folder is NULL (not selected), the target will be empty, not NULL. +// */ +// ((EMFolderView *)emfb)->menu = em_menu_new("org.gnome.evolution.mail.browser"); +// +// return (GtkWidget *)emfb; +//} void em_folder_browser_show_preview(EMFolderBrowser *emfb, gboolean state) { @@ -1390,30 +1390,30 @@ emfb_hide_deleted(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_E // return FALSE; //} -static void -emfb_gui_folder_changed(CamelFolder *folder, void *dummy, EMFolderBrowser *emfb) -{ - if (emfb->priv->select_uid) { - CamelMessageInfo *mi; - - mi = camel_folder_get_message_info(emfb->view.folder, emfb->priv->select_uid); - if (mi) { - camel_folder_free_message_info(emfb->view.folder, mi); - em_folder_view_set_message(&emfb->view, emfb->priv->select_uid, FALSE); - g_free (emfb->priv->select_uid); - emfb->priv->select_uid = NULL; - } - } - - g_object_unref(emfb); -} +//static void +//emfb_gui_folder_changed(CamelFolder *folder, void *dummy, EMFolderBrowser *emfb) +//{ +// if (emfb->priv->select_uid) { +// CamelMessageInfo *mi; +// +// mi = camel_folder_get_message_info(emfb->view.folder, emfb->priv->select_uid); +// if (mi) { +// camel_folder_free_message_info(emfb->view.folder, mi); +// em_folder_view_set_message(&emfb->view, emfb->priv->select_uid, FALSE); +// g_free (emfb->priv->select_uid); +// emfb->priv->select_uid = NULL; +// } +// } +// +// g_object_unref(emfb); +//} -static void -emfb_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, EMFolderBrowser *emfb) -{ - g_object_ref(emfb); - mail_async_event_emit(emfb->view.async, MAIL_ASYNC_GUI, (MailAsyncFunc)emfb_gui_folder_changed, folder, NULL, emfb); -} +//static void +//emfb_folder_changed(CamelFolder *folder, CamelFolderChangeInfo *changes, EMFolderBrowser *emfb) +//{ +// g_object_ref(emfb); +// mail_async_event_emit(emfb->view.async, MAIL_ASYNC_GUI, (MailAsyncFunc)emfb_gui_folder_changed, folder, NULL, emfb); +//} //static void //emfb_etree_unfreeze (GtkWidget *widget, GdkEvent *event, EMFolderView *emfv) @@ -1488,10 +1488,10 @@ emfb_set_search_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) emfb->priv->idle_scroll_id = 0; } - if (emfb->view.folder) { - camel_object_remove_event(emfb->view.folder, emfb->priv->folder_changed_id); - emfb->priv->folder_changed_id = 0; - } +// if (emfb->view.folder) { +// camel_object_remove_event(emfb->view.folder, emfb->priv->folder_changed_id); +// emfb->priv->folder_changed_id = 0; +// } emfb_parent->set_folder(emfv, folder, uri); @@ -1514,7 +1514,7 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) struct _EMFolderBrowserPrivate *p = emfb->priv; gboolean different_folder; - message_list_freeze(emfv->list); +// message_list_freeze(emfv->list); if (emfb->priv->list_scrolled_id) { g_signal_handler_disconnect (emfv->list, emfb->priv->list_scrolled_id); @@ -1526,16 +1526,16 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) emfb->priv->idle_scroll_id = 0; } - if (emfb->view.folder && emfb->priv->folder_changed_id) { - camel_object_remove_event(emfb->view.folder, emfb->priv->folder_changed_id); - emfb->priv->folder_changed_id = 0; - } - - different_folder = - emfb->view.folder != NULL && - folder != emfb->view.folder; - - emfb_parent->set_folder(emfv, folder, uri); +// if (emfb->view.folder && emfb->priv->folder_changed_id) { +// camel_object_remove_event(emfb->view.folder, emfb->priv->folder_changed_id); +// emfb->priv->folder_changed_id = 0; +// } +// +// different_folder = +// emfb->view.folder != NULL && +// folder != emfb->view.folder; +// +// emfb_parent->set_folder(emfv, folder, uri); /* This is required since we get activated the first time before the folder is open and need to override the @@ -1557,32 +1557,32 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) gconf_client_set_bool (gconf, "/apps/evolution/mail/display/safe_list", FALSE, NULL); } - mail_refresh_folder(folder, NULL, NULL); - - emfb->priv->folder_changed_id = camel_object_hook_event(folder, "folder_changed", - (CamelObjectEventHookFunc)emfb_folder_changed, emfb); - - /* FIXME: this mostly copied from activate() */ - if ((sstate = camel_object_meta_get(folder, "evolution:show_preview"))) { - state = sstate[0] != '0'; - g_free(sstate); - } else - state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_preview", NULL); - em_folder_browser_show_preview(emfb, state); - if (emfv->uic) - bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewPreview", "state", state?"1":"0", NULL); - - if ((sstate = camel_object_meta_get(folder, "evolution:thread_list"))) { - state = sstate[0] != '0'; - g_free(sstate); - } else - state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/thread_list", NULL); - message_list_set_threaded(emfv->list, state); - if (emfv->uic) { - bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreaded", "state", state?"1":"0", NULL); - bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreadsCollapseAll", "sensitive", state?"1":"0", NULL); - bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreadsExpandAll", "sensitive", state?"1":"0", NULL); - } +// mail_refresh_folder(folder, NULL, NULL); +// +// emfb->priv->folder_changed_id = camel_object_hook_event(folder, "folder_changed", +// (CamelObjectEventHookFunc)emfb_folder_changed, emfb); +// +// /* FIXME: this mostly copied from activate() */ +// if ((sstate = camel_object_meta_get(folder, "evolution:show_preview"))) { +// state = sstate[0] != '0'; +// g_free(sstate); +// } else +// state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_preview", NULL); +// em_folder_browser_show_preview(emfb, state); +// if (emfv->uic) +// bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewPreview", "state", state?"1":"0", NULL); +// +// if ((sstate = camel_object_meta_get(folder, "evolution:thread_list"))) { +// state = sstate[0] != '0'; +// g_free(sstate); +// } else +// state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/thread_list", NULL); +// message_list_set_threaded(emfv->list, state); +// if (emfv->uic) { +// bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreaded", "state", state?"1":"0", NULL); +// bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreadsCollapseAll", "sensitive", state?"1":"0", NULL); +// bonobo_ui_component_set_prop(emfv->uic, "/commands/ViewThreadsExpandAll", "sensitive", state?"1":"0", NULL); +// } if (emfv->uic) { state = (folder->folder_flags & CAMEL_FOLDER_IS_TRASH) == 0; @@ -1618,26 +1618,26 @@ emfb_set_folder(EMFolderView *emfv, CamelFolder *folder, const char *uri) e_search_bar_paint ((ESearchBar *)emfb->search); } - /* This function gets triggered several times at startup, - * so we don't want to reset the message suppression state - * unless we're actually switching to a different folder. */ - if (different_folder) - p->suppress_message_selection = FALSE; - - if (!p->suppress_message_selection) - sstate = camel_object_meta_get ( - folder, "evolution:selected_uid"); - else - sstate = NULL; - - g_free (p->select_uid); - p->select_uid = sstate; - - if (emfv->list->cursor_uid == NULL && emfb->priv->list_built_id == 0) - p->list_built_id = g_signal_connect(emfv->list, "message_list_built", G_CALLBACK (emfb_list_built), emfv); - } - - message_list_thaw(emfv->list); +// /* This function gets triggered several times at startup, +// * so we don't want to reset the message suppression state +// * unless we're actually switching to a different folder. */ +// if (different_folder) +// p->suppress_message_selection = FALSE; +// +// if (!p->suppress_message_selection) +// sstate = camel_object_meta_get ( +// folder, "evolution:selected_uid"); +// else +// sstate = NULL; +// +// g_free (p->select_uid); +// p->select_uid = sstate; +// +// if (emfv->list->cursor_uid == NULL && emfb->priv->list_built_id == 0) +// p->list_built_id = g_signal_connect(emfv->list, "message_list_built", G_CALLBACK (emfb_list_built), emfv); +// } +// +// message_list_thaw(emfv->list); } static void diff --git a/widgets/misc/e-online-button.c b/widgets/misc/e-online-button.c index dec24a6587..fbfb850272 100644 --- a/widgets/misc/e-online-button.c +++ b/widgets/misc/e-online-button.c @@ -23,6 +23,12 @@ (G_TYPE_INSTANCE_GET_PRIVATE \ ((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate)) +#define ONLINE_TOOLTIP \ + "Evolution is currently online. Click this button to work offline." + +#define OFFLINE_TOOLTIP \ + "Evolution is currently offline. Click this button to work online." + struct _EOnlineButtonPrivate { GtkWidget *image; gboolean online; @@ -175,6 +181,7 @@ e_online_button_set_online (EOnlineButton *button, GtkIconTheme *icon_theme; const gchar *filename; const gchar *icon_name; + const gchar *tooltip; g_return_if_fail (E_IS_ONLINE_BUTTON (button)); @@ -191,5 +198,8 @@ e_online_button_set_online (EOnlineButton *button, gtk_image_set_from_file (image, filename); gtk_icon_info_free (icon_info); + tooltip = _(online ? ONLINE_TOOLTIP : OFFLINE_TOOLTIP); + gtk_widget_set_tooltip_text (GTK_WIDGET (button), tooltip); + g_object_notify (G_OBJECT (button), "online"); } |