aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-folder-view.c22
-rw-r--r--mail/em-folder-view.h15
-rw-r--r--mail/em-format-html-display.c2
-rw-r--r--mail/em-message-browser.c4
5 files changed, 41 insertions, 15 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index a43675bfa7..d742368388 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,18 @@
2004-02-26 Jeffrey Stedfast <fejj@ximian.com>
+ Fix for bug #54352
+
+ * em-message-browser.c (emmb_class_init): Set update_message_style
+ to FALSE.
+
+ * em-folder-view.c (emfv_setting_notify): Only update message
+ display style if our subclass wants us to.
+ (emfv_class_init): Set update_message_style to TRUE.
+ (emfv_view_mode): Don't save the gconf key unless our class allows
+ us to.
+
+2004-02-26 Jeffrey Stedfast <fejj@ximian.com>
+
* em-utils.c (em_utils_folder_name_from_uri): Make sure url->path
is non-NULL before setting folder_name to url->path + 1. Could
possibly fix bug #54853.
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c
index c42787b440..a6d45dec63 100644
--- a/mail/em-folder-view.c
+++ b/mail/em-folder-view.c
@@ -240,13 +240,15 @@ emfv_class_init(GObjectClass *klass)
((GtkObjectClass *) klass)->destroy = emfv_destroy;
+ ((EMFolderViewClass *) klass)->update_message_style = TRUE;
+
((EMFolderViewClass *)klass)->set_folder = emfv_set_folder;
((EMFolderViewClass *)klass)->set_folder_uri = emfv_set_folder_uri;
((EMFolderViewClass *)klass)->set_message = emfv_set_message;
((EMFolderViewClass *)klass)->activate = emfv_activate;
((EMFolderViewClass *)klass)->on_url = emfv_on_url;
-
+
signals[EMFV_ON_URL] = g_signal_new ("on-url",
G_OBJECT_CLASS_TYPE (klass),
G_SIGNAL_RUN_LAST,
@@ -1546,7 +1548,7 @@ emfv_view_mode(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_Even
if (strcmp(emfv_display_styles[i]+strlen("/commands/"), path) == 0) {
em_format_set_mode((EMFormat *)emfv->preview, i);
- if (TRUE /* set preferences but not for EMMessageBrowser? */) {
+ if (EM_FOLDER_VIEW_GET_CLASS (emfv)->update_message_style) {
GConfClient *gconf = mail_config_get_gconf_client ();
gconf_client_set_int (gconf, "/apps/evolution/mail/display/message_style", i, NULL);
@@ -2046,13 +2048,15 @@ emfv_setting_notify(GConfClient *gconf, guint cnxn_id, GConfEntry *entry, EMFold
case EMFV_CARET_MODE:
em_format_html_display_set_caret_mode(emfv->preview, gconf_value_get_bool(gconf_entry_get_value(entry)));
break;
- case EMFV_MESSAGE_STYLE: {
- int style = gconf_value_get_int(gconf_entry_get_value(entry));
-
- if (style < EM_FORMAT_NORMAL || style > EM_FORMAT_SOURCE)
- style = EM_FORMAT_NORMAL;
- em_format_set_mode((EMFormat *)emfv->preview, style);
- break; }
+ case EMFV_MESSAGE_STYLE:
+ if (EM_FOLDER_VIEW_GET_CLASS (emfv)->update_message_style) {
+ int style = gconf_value_get_int(gconf_entry_get_value(entry));
+
+ if (style < EM_FORMAT_NORMAL || style > EM_FORMAT_SOURCE)
+ style = EM_FORMAT_NORMAL;
+ em_format_set_mode((EMFormat *)emfv->preview, style);
+ }
+ break;
case EMFV_MARK_SEEN:
emfv->mark_seen = gconf_value_get_bool(gconf_entry_get_value(entry));
break;
diff --git a/mail/em-folder-view.h b/mail/em-folder-view.h
index 4d7f3057a2..31dd8a13dd 100644
--- a/mail/em-folder-view.h
+++ b/mail/em-folder-view.h
@@ -37,6 +37,8 @@ struct _EMFormatHTMLDisplay;
struct _CamelFolder;
struct _CamelMedium;
+#define EM_FOLDER_VIEW_GET_CLASS(emfv) ((EMFolderViewClass *) G_OBJECT_GET_CLASS (emfv))
+
typedef struct _EMFolderView EMFolderView;
typedef struct _EMFolderViewClass EMFolderViewClass;
@@ -86,7 +88,10 @@ struct _EMFolderView {
struct _EMFolderViewClass {
GtkVBoxClass parent_class;
-
+
+ /* behaviour definition */
+ int update_message_style:1;
+
/* if used as a control, used to activate/deactivate custom menu's */
void (*activate)(EMFolderView *, struct _BonoboUIComponent *uic, int state);
@@ -102,10 +107,10 @@ GType em_folder_view_get_type(void);
GtkWidget *em_folder_view_new(void);
-#define em_folder_view_activate(emfv, uic, state) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->activate((emfv), (uic), (state))
-#define em_folder_view_set_folder(emfv, folder, uri) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->set_folder((emfv), (folder), (uri))
-#define em_folder_view_set_folder_uri(emfv, uri) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->set_folder_uri((emfv), (uri))
-#define em_folder_view_set_message(emfv, uid) ((EMFolderViewClass *)G_OBJECT_GET_CLASS(emfv))->set_message((emfv), (uid))
+#define em_folder_view_activate(emfv, uic, state) EM_FOLDER_VIEW_GET_CLASS (emfv)->activate((emfv), (uic), (state))
+#define em_folder_view_set_folder(emfv, folder, uri) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_folder((emfv), (folder), (uri))
+#define em_folder_view_set_folder_uri(emfv, uri) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_folder_uri((emfv), (uri))
+#define em_folder_view_set_message(emfv, uid) EM_FOLDER_VIEW_GET_CLASS (emfv)->set_message((emfv), (uid))
struct _EMPopupTarget *em_folder_view_get_popup_target(EMFolderView *emfv);
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index f6e2ccefe3..a241518b05 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -1347,7 +1347,7 @@ efhd_bonobo_object(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *
*/
const CamelInternetAddress *from;
char *from_address;
-
+
from = camel_mime_message_get_from((CamelMimeMessage *)((EMFormat *)efh)->message);
from_address = camel_address_encode((CamelAddress *)from);
bonobo_property_bag_client_set_value_string(prop_bag, "from_address", from_address, &ev);
diff --git a/mail/em-message-browser.c b/mail/em-message-browser.c
index 4050f0b9ea..9ddbae1327 100644
--- a/mail/em-message-browser.c
+++ b/mail/em-message-browser.c
@@ -111,7 +111,11 @@ static void
emmb_class_init(GObjectClass *klass)
{
klass->finalize = emmb_finalise;
+
((GtkObjectClass *)klass)->destroy = emmb_destroy;
+
+ ((EMFolderViewClass *) klass)->update_message_style = FALSE;
+
((EMFolderViewClass *)klass)->set_message = emmb_set_message;
((EMFolderViewClass *)klass)->activate = emmb_activate;
}