diff options
author | Peter Williams <peterw@ximian.com> | 2001-07-17 02:32:10 +0800 |
---|---|---|
committer | Peter Williams <peterw@src.gnome.org> | 2001-07-17 02:32:10 +0800 |
commit | 53996fb55905d1a25df383b4ce12e64c572b58db (patch) | |
tree | 5b354892c86b2356f4aa18f0e39a2ec69237b233 | |
parent | af019dc03bac8bafb77b5cb4a98bdc17fd733b49 (diff) | |
download | gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.tar gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.tar.gz gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.tar.bz2 gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.tar.lz gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.tar.xz gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.tar.zst gsoc2013-evolution-53996fb55905d1a25df383b4ce12e64c572b58db.zip |
Use our own display_style member instead of the global setting.
2001-07-16 Peter Williams <peterw@ximian.com>
* mail-display.c (mail_display_redisplay): Use our own display_style
member instead of the global setting.
(mail_display_init): Initialize display_style.
* mail-display.h: Include "mail-config.h" and add a display_style member.
* mail-format.c (write_headers): Look at the MailDisplay's display_style
instead of using the full_headers data.
* folder-browser.c (folder_browser_set_message_display_style): Set
the MailDisplay's display style as well as the global display
style.
(my_folder_browser_init): Don't save preference changes by default. (This
is only observered wrt. the message display style but should apply to other
items.)
* folder-browser-factory.c (folder_browser_factory_new_control): Set this
FB to save the preferences set in it.
* folder-browser-ui.c (folder_browser_ui_add_message): Read our display's
state instead of the global setting.
svn path=/trunk/; revision=11131
-rw-r--r-- | mail/ChangeLog | 24 | ||||
-rw-r--r-- | mail/folder-browser-factory.c | 2 | ||||
-rw-r--r-- | mail/folder-browser-ui.c | 2 | ||||
-rw-r--r-- | mail/folder-browser.c | 9 | ||||
-rw-r--r-- | mail/folder-browser.h | 3 | ||||
-rw-r--r-- | mail/mail-display.c | 9 | ||||
-rw-r--r-- | mail/mail-display.h | 3 | ||||
-rw-r--r-- | mail/mail-format.c | 2 |
8 files changed, 44 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index a816a8843a..e9132ae068 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,29 @@ 2001-07-16 Peter Williams <peterw@ximian.com> + * mail-display.c (mail_display_redisplay): Use our own display_style + member instead of the global setting. + (mail_display_init): Initialize display_style. + + * mail-display.h: Include "mail-config.h" and add a display_style member. + + * mail-format.c (write_headers): Look at the MailDisplay's display_style + instead of using the full_headers data. + + * folder-browser.c (folder_browser_set_message_display_style): Set + the MailDisplay's display style as well as the global display + style. + (my_folder_browser_init): Don't save preference changes by default. (This + is only observered wrt. the message display style but should apply to other + items.) + + * folder-browser-factory.c (folder_browser_factory_new_control): Set this + FB to save the preferences set in it. + + * folder-browser-ui.c (folder_browser_ui_add_message): Read our display's + state instead of the global setting. + +2001-07-16 Peter Williams <peterw@ximian.com> + * mail-folder-cache.c (mail_folder_cache_set_folder_browser): DUH. No need to update every folder if we set the folder browser to NULL. diff --git a/mail/folder-browser-factory.c b/mail/folder-browser-factory.c index a52f3cd28e..ff7e8d649a 100644 --- a/mail/folder-browser-factory.c +++ b/mail/folder-browser-factory.c @@ -170,6 +170,8 @@ folder_browser_factory_new_control (const char *uri, if (folder_browser == NULL) return NULL; + FOLDER_BROWSER (folder_browser)->pref_master = TRUE; /* save UI settings changed in this FB */ + if (!folder_browser_set_uri (FOLDER_BROWSER (folder_browser), uri)) { gtk_object_sink (GTK_OBJECT (folder_browser)); return NULL; diff --git a/mail/folder-browser-ui.c b/mail/folder-browser-ui.c index 37fc12cf07..29a9af5cfc 100644 --- a/mail/folder-browser-ui.c +++ b/mail/folder-browser-ui.c @@ -280,7 +280,7 @@ folder_browser_ui_add_message (FolderBrowser *fb) /* Display Style */ - state = mail_config_get_message_display_style (); + state = fb->mail_display->display_style; bonobo_ui_component_set_prop (uic, message_display_styles[state], "state", "1", NULL); bonobo_ui_component_add_listener (uic, "ViewNormal", folder_browser_set_message_display_style, fb); diff --git a/mail/folder-browser.c b/mail/folder-browser.c index c682b850d6..05d363cdb6 100644 --- a/mail/folder-browser.c +++ b/mail/folder-browser.c @@ -1029,8 +1029,11 @@ folder_browser_set_message_display_style (BonoboUIComponent *component for (i = 0; i < MAIL_CONFIG_DISPLAY_MAX; i++) { if (strstr (message_display_styles[i], path)) { - mail_config_set_message_display_style (i); + fb->mail_display->display_style = i; mail_display_redisplay (fb->mail_display, TRUE); + + if (fb->pref_master) + mail_config_set_message_display_style (i); return; } } @@ -1763,7 +1766,9 @@ my_folder_browser_init (GtkObject *object) fb->view_collection = NULL; fb->view_menus = NULL; - + + fb->pref_master = FALSE; + /* * Setup parent class fields. */ diff --git a/mail/folder-browser.h b/mail/folder-browser.h index a6e2f42ec9..332da56000 100644 --- a/mail/folder-browser.h +++ b/mail/folder-browser.h @@ -61,7 +61,8 @@ struct _FolderBrowser { gboolean preview_shown; gboolean threaded; - + gboolean pref_master; + /* View collection and the menu handler object */ GalViewCollection *view_collection; GalViewMenus *view_menus; diff --git a/mail/mail-display.c b/mail/mail-display.c index a7fd33dc64..2a0748eb39 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1199,13 +1199,10 @@ mail_display_redisplay (MailDisplay *md, gboolean unscroll) mail_html_write (md->html, md->stream, "<body marginwidth=0 marginheight=0>\n"); if (md->current_message) { - MailConfigDisplayStyle style = mail_config_get_message_display_style (); - if (style == MAIL_CONFIG_DISPLAY_SOURCE) + if (md->display_style == MAIL_CONFIG_DISPLAY_SOURCE) mail_format_raw_message (md->current_message, md); - else { - g_datalist_set_data (md->data, "full_headers", GINT_TO_POINTER (style == MAIL_CONFIG_DISPLAY_FULL_HEADERS)); + else mail_format_mime_message (md->current_message, md); - } } mail_html_write (md->html, md->stream, "</body></html>\n"); @@ -1278,6 +1275,8 @@ mail_display_init (GtkObject *object) mail_display->data = NULL; mail_display->invisible = gtk_invisible_new (); + + mail_display->display_style = mail_config_get_message_display_style (); } static void diff --git a/mail/mail-display.h b/mail/mail-display.h index 92797438c9..b08fa12927 100644 --- a/mail/mail-display.h +++ b/mail/mail-display.h @@ -13,6 +13,7 @@ #include <camel/camel-medium.h> #include "mail-types.h" +#include "mail-config.h" /*display_style*/ #define MAIL_DISPLAY_TYPE (mail_display_get_type ()) #define MAIL_DISPLAY(o) (GTK_CHECK_CAST ((o), MAIL_DISPLAY_TYPE, MailDisplay)) @@ -37,6 +38,8 @@ struct _MailDisplay { /* Sigh. This shouldn't be needed. I haven't figured out why it is though. */ GtkWidget *invisible; + + MailConfigDisplayStyle display_style; }; typedef struct { diff --git a/mail/mail-format.c b/mail/mail-format.c index 7bd1a84a8a..cfe68fb559 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -875,7 +875,7 @@ write_headers (CamelMimeMessage *message, MailDisplay *md) { "Date", NULL } }; int i, len, flags; - gboolean full = GPOINTER_TO_INT (g_datalist_get_data (md->data, "full_headers")); + gboolean full = (md->display_style == MAIL_CONFIG_DISPLAY_FULL_HEADERS); mail_html_write (md->html, md->stream, "<table width=\"100%%\" cellpadding=0 cellspacing=0>" |