Value for threaded list view is now saved via gnome-config. This means that you can FINALLY shut off the threaded view once and for all :)
svn path=/trunk/; revision=4621
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
2000-08-08 Jeremy Wise <jwise@pathwaynet.com>
|
||||
* mail-config.[ch], main.c, folder-browser-factory.c: State of the
|
||||
threaded list toggle is now saved via gnome_config
|
||||
|
||||
2000-08-08 Dan Winship <danw@helixcode.com>
|
||||
|
||||
* mail-config-gui.c (service_page_item_new): Attach a signal
|
||||
|
||||
@ -18,6 +18,7 @@
|
||||
#include "folder-browser.h"
|
||||
#include "mail.h"
|
||||
#include "shell/Evolution.h"
|
||||
#include "mail-config.h"
|
||||
|
||||
static GnomeUIInfo gnome_toolbar [] = {
|
||||
GNOMEUIINFO_ITEM_STOCK (N_("Get mail"), N_("Check for new mail"), fetch_mail, GNOME_STOCK_PIXMAP_MAIL_RCV),
|
||||
@ -60,7 +61,7 @@ control_activate (BonoboControl *control, BonoboUIHandler *uih,
|
||||
_("_Threaded Message List"),
|
||||
NULL, -1, 0, 0, NULL, NULL);
|
||||
bonobo_ui_handler_menu_set_toggle_state (uih, "/View/Threaded",
|
||||
threaded_view);
|
||||
mail_config_thread_list());
|
||||
bonobo_ui_handler_menu_set_callback (uih, "/View/Threaded",
|
||||
message_list_toggle_threads,
|
||||
FOLDER_BROWSER (folder_browser)->message_list,
|
||||
|
||||
@ -243,6 +243,12 @@ mail_config_read ()
|
||||
evolution_dir);
|
||||
config->send_html = gnome_config_get_bool (str);
|
||||
g_free (str);
|
||||
|
||||
/* Show Messages Threaded */
|
||||
str = g_strdup_printf ("=%s/config/Mail=/Display/thread_list",
|
||||
evolution_dir);
|
||||
config->thread_list = gnome_config_get_bool (str);
|
||||
g_free (str);
|
||||
|
||||
gnome_config_sync ();
|
||||
}
|
||||
@ -339,6 +345,20 @@ mail_config_write ()
|
||||
evolution_dir);
|
||||
gnome_config_set_bool (str, config->send_html);
|
||||
g_free (str);
|
||||
|
||||
gnome_config_sync ();
|
||||
}
|
||||
|
||||
void
|
||||
mail_config_write_on_exit ()
|
||||
{
|
||||
gchar *str;
|
||||
|
||||
/* Show Messages Threaded */
|
||||
str = g_strdup_printf ("=%s/config/Mail=/Display/thread_list",
|
||||
evolution_dir);
|
||||
gnome_config_set_bool (str, config->thread_list);
|
||||
g_free (str);
|
||||
|
||||
gnome_config_sync ();
|
||||
}
|
||||
@ -380,6 +400,18 @@ mail_config_send_html ()
|
||||
return config->send_html;
|
||||
}
|
||||
|
||||
gboolean
|
||||
mail_config_thread_list ()
|
||||
{
|
||||
return config->thread_list;
|
||||
}
|
||||
|
||||
void
|
||||
mail_config_set_thread_list (gboolean value)
|
||||
{
|
||||
config->thread_list = value;
|
||||
}
|
||||
|
||||
MailConfig *
|
||||
mail_config_fetch (void)
|
||||
{
|
||||
|
||||
@ -45,6 +45,7 @@ typedef struct
|
||||
GSList *news;
|
||||
MailConfigService *transport;
|
||||
gboolean send_html;
|
||||
gboolean thread_list;
|
||||
} MailConfig;
|
||||
|
||||
/* Identities */
|
||||
@ -62,6 +63,7 @@ void mail_config_init (void);
|
||||
void mail_config_clear (void);
|
||||
void mail_config_read (void);
|
||||
void mail_config_write (void);
|
||||
void mail_config_write_on_exit (void);
|
||||
|
||||
/* Accessor functions */
|
||||
gboolean mail_config_is_configured ();
|
||||
@ -69,7 +71,8 @@ MailConfigIdentity *mail_config_get_default_identity (void);
|
||||
MailConfigService *mail_config_get_default_source (void);
|
||||
MailConfigService *mail_config_get_transport (void);
|
||||
gboolean mail_config_send_html ();
|
||||
|
||||
gboolean mail_config_thread_list ();
|
||||
void mail_config_set_thread_list (gboolean value);
|
||||
MailConfig *mail_config_fetch (void);
|
||||
|
||||
#endif
|
||||
|
||||
@ -67,5 +67,7 @@ main (int argc, char *argv [])
|
||||
GDK_THREADS_LEAVE ();
|
||||
#endif
|
||||
|
||||
mail_config_write_on_exit ();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include <camel/camel-folder.h>
|
||||
#include "message-list.h"
|
||||
#include "message-thread.h"
|
||||
#include "mail-config.h"
|
||||
#include "mail.h"
|
||||
#include "Mail.h"
|
||||
#include "widgets/e-table/e-table-header-item.h"
|
||||
@ -848,7 +849,7 @@ message_list_regenerate (MessageList *message_list, const char *search)
|
||||
e_tree_model_node_insert(etm, NULL, 0, message_list);
|
||||
e_tree_model_node_set_expanded (etm, message_list->tree_root, TRUE);
|
||||
|
||||
if (threaded_view) {
|
||||
if (mail_config_thread_list()) {
|
||||
struct _container *head;
|
||||
|
||||
head = thread_messages (message_list->folder, uids);
|
||||
@ -1031,14 +1032,11 @@ message_list_foreach (MessageList *message_list,
|
||||
mlfe_callback, &mlfe_data);
|
||||
}
|
||||
|
||||
gboolean threaded_view = TRUE;
|
||||
|
||||
void
|
||||
message_list_toggle_threads (BonoboUIHandler *uih, void *user_data,
|
||||
const char *path)
|
||||
{
|
||||
MessageList *ml = user_data;
|
||||
|
||||
threaded_view = bonobo_ui_handler_menu_get_toggle_state (uih, path);
|
||||
mail_config_set_thread_list(bonobo_ui_handler_menu_get_toggle_state (uih, path));
|
||||
message_list_regenerate (ml, ml->search);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user