aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-08 05:27:06 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-08 05:27:06 +0800
commit19f1e3fe20c29690aaf07d26e81760405cc577df (patch)
tree76d78a49c48debc47b6204412a73470c781875a7 /mail
parent8d8e4ac1c23905892a42b779188c852fdead7f5f (diff)
downloadgsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.tar
gsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.tar.gz
gsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.tar.bz2
gsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.tar.lz
gsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.tar.xz
gsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.tar.zst
gsoc2013-evolution-19f1e3fe20c29690aaf07d26e81760405cc577df.zip
Fix some miscellaneous mailer bugs.
svn path=/branches/kill-bonobo/; revision=37011
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-reader.c62
-rw-r--r--mail/e-mail-reader.h2
-rw-r--r--mail/e-mail-shell-content.c5
-rw-r--r--mail/e-mail-shell-view-actions.c60
-rw-r--r--mail/em-folder-browser.c102
-rw-r--r--mail/evolution-mail.schemas.in19
6 files changed, 129 insertions, 121 deletions
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 93279c2bfe..5a623baa96 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -548,7 +548,6 @@ static void
action_mail_message_open_cb (GtkAction *action,
EMailReader *reader)
{
- /* FIXME This belongs in EMailShellView */
e_mail_reader_open_selected (reader);
}
@@ -1456,15 +1455,29 @@ mail_reader_key_press_cb (EMailReader *reader,
const gchar *action_name;
if ((event->key.state & GDK_CONTROL_MASK) != 0)
- return FALSE;
+ goto ctrl;
+ /* <keyval> alone */
switch (event->key.keyval) {
+ case GDK_Delete:
+ case GDK_KP_Delete:
+ action_name = "mail-delete";
+ break;
+
case GDK_Return:
case GDK_KP_Enter:
case GDK_ISO_Enter:
action_name = "mail-message-open";
break;
+ case GDK_period:
+ action_name = "mail-next-unread";
+ break;
+
+ case GDK_comma:
+ action_name = "mail-previous-unread";
+ break;
+
#ifdef HAVE_XFREE
case XF86XK_Reply:
action_name = "mail-reply-all";
@@ -1483,6 +1496,25 @@ mail_reader_key_press_cb (EMailReader *reader,
return FALSE;
}
+ goto exit;
+
+ctrl:
+
+ /* Ctrl + <keyval> */
+ switch (event->key.keyval) {
+ case GDK_period:
+ action_name = "mail-next-unread";
+ break;
+
+ case GDK_comma:
+ action_name = "mail-previous-unread";
+ break;
+
+ default:
+ return FALSE;
+ }
+
+exit:
e_mail_reader_activate (reader, action_name);
return TRUE;
@@ -1520,7 +1552,6 @@ mail_reader_message_loaded_cb (CamelFolder *folder,
EMEventTargetMessage *target;
gboolean mark_read;
gint timeout_interval;
- gpointer data;
html_display = e_mail_reader_get_html_display (reader);
message_list = e_mail_reader_get_message_list (reader);
@@ -1675,7 +1706,6 @@ mail_reader_set_message (EMailReader *reader,
gboolean mark_read)
{
MessageList *message_list;
- gpointer data;
message_list = e_mail_reader_get_message_list (reader);
message_list_select_uid (message_list, uid);
@@ -1907,6 +1937,30 @@ e_mail_reader_set_folder (EMailReader *reader,
iface->set_folder (reader, folder, folder_uri);
}
+/* Helper for e_mail_reader_set_folder_uri() */
+static void
+mail_reader_got_folder_cb (gchar *folder_uri,
+ CamelFolder *folder,
+ gpointer user_data)
+{
+ EMailReader *reader = user_data;
+
+ e_mail_reader_set_folder (reader, folder, folder_uri);
+}
+
+void
+e_mail_reader_set_folder_uri (EMailReader *reader,
+ const gchar *folder_uri)
+{
+ g_return_if_fail (E_IS_MAIL_READER (reader));
+ g_return_if_fail (folder_uri != NULL);
+
+ /* Fetch the CamelFolder asynchronously. */
+ mail_get_folder (
+ folder_uri, 0, mail_reader_got_folder_cb,
+ reader, mail_msg_fast_ordered_push);
+}
+
void
e_mail_reader_set_message (EMailReader *reader,
const gchar *uid,
diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h
index 4fba37056f..bb9e8d461f 100644
--- a/mail/e-mail-reader.h
+++ b/mail/e-mail-reader.h
@@ -82,6 +82,8 @@ GtkWindow * e_mail_reader_get_window (EMailReader *reader);
void e_mail_reader_set_folder (EMailReader *reader,
CamelFolder *folder,
const gchar *folder_uri);
+void e_mail_reader_set_folder_uri (EMailReader *reader,
+ const gchar *folder_uri);
void e_mail_reader_set_message (EMailReader *reader,
const gchar *uid,
gboolean mark_read);
diff --git a/mail/e-mail-shell-content.c b/mail/e-mail-shell-content.c
index c846a83d5d..e06e68acfc 100644
--- a/mail/e-mail-shell-content.c
+++ b/mail/e-mail-shell-content.c
@@ -663,6 +663,8 @@ e_mail_shell_content_set_vertical_view (EMailShellContent *mail_shell_content,
mail_shell_content->priv->paned_binding_id = binding_id;
mail_shell_content->priv->paned = g_object_ref (new_paned);
+ e_mail_shell_content_update_view_instance (mail_shell_content);
+
g_object_notify (G_OBJECT (mail_shell_content), "vertical-view");
}
@@ -700,12 +702,11 @@ e_mail_shell_content_update_view_instance (EMailShellContent *mail_shell_content
mail_shell_content->priv->view_instance = NULL;
}
- /* TODO: Should this go through the mail-config API? */
view_id = mail_config_folder_to_safe_url (folder_view->folder);
view_instance = e_shell_view_new_view_instance (shell_view, view_id);
mail_shell_content->priv->view_instance = view_instance;
- show_vertical_view = folder_view->list_active &&
+ show_vertical_view =
e_mail_shell_content_get_vertical_view (mail_shell_content);
if (show_vertical_view) {
diff --git a/mail/e-mail-shell-view-actions.c b/mail/e-mail-shell-view-actions.c
index 5b26c8a67d..611ceff204 100644
--- a/mail/e-mail-shell-view-actions.c
+++ b/mail/e-mail-shell-view-actions.c
@@ -455,24 +455,6 @@ static GtkActionEntry mail_entries[] = {
NULL, /* XXX Add a tooltip! */
G_CALLBACK (action_mail_create_search_folder_cb) },
-#if 0
- /* XXX Work around one-accelerator-per-action limit. */
- { "mail-delete-1",
- NULL,
- NULL,
- "Delete",
- NULL,
- G_CALLBACK (action_mail_delete_cb) },
-
- /* XXX Work around one-accelerator-per-action limit. */
- { "mail-delete-2",
- NULL,
- NULL,
- "KP_Delete",
- NULL,
- G_CALLBACK (action_mail_delete_cb) },
-#endif
-
{ "mail-download",
NULL,
N_("_Download Messages for Offline Usage"),
@@ -592,40 +574,6 @@ static GtkActionEntry mail_entries[] = {
N_("Temporarily hide the selected messages"),
G_CALLBACK (action_mail_hide_selected_cb) },
-#if 0
- /* XXX Work around one-accelerator-per-action limit. */
- { "mail-next-unread-1",
- NULL,
- NULL,
- "period",
- NULL,
- G_CALLBACK (action_mail_next_unread_cb) },
-
- /* XXX Work around one-accelerator-per-action limit. */
- { "mail-next-unread-2",
- NULL,
- NULL,
- "<Control>period",
- NULL,
- G_CALLBACK (action_mail_next_unread_cb) },
-
- /* XXX Work around one-accelerator-per-action limit. */
- { "mail-previous-unread-1",
- NULL,
- NULL,
- "comma",
- NULL,
- G_CALLBACK (action_mail_previous_unread_cb) },
-
- /* XXX Work around one-accelerator-per-action limit. */
- { "mail-previous-unread-2",
- NULL,
- NULL,
- "<Control>comma",
- NULL,
- G_CALLBACK (action_mail_previous_unread_cb) },
-#endif
-
{ "mail-show-hidden",
NULL,
N_("Show Hidde_n Messages"),
@@ -1029,11 +977,11 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view)
key = "/apps/evolution/mail/display/show_preview";
gconf_bridge_bind_property (bridge, key, object, "active");
- object = G_OBJECT (ACTION (MAIL_VIEW_VERTICAL));
- key = "/apps/evolution/mail/display/show_wide";
- gconf_bridge_bind_property (bridge, key, object, "active");
-
object = G_OBJECT (ACTION (MAIL_THREADS_GROUP_BY));
key = "/apps/evolution/mail/display/thread_list";
gconf_bridge_bind_property (bridge, key, object, "active");
+
+ object = G_OBJECT (ACTION (MAIL_VIEW_VERTICAL));
+ key = "/apps/evolution/mail/display/layout";
+ gconf_bridge_bind_property (bridge, key, object, "current-value");
}
diff --git a/mail/em-folder-browser.c b/mail/em-folder-browser.c
index 1822d04fcb..7522149c7d 100644
--- a/mail/em-folder-browser.c
+++ b/mail/em-folder-browser.c
@@ -246,36 +246,36 @@ static ESearchBarItem emfb_search_scope_items[] = {
static EMFolderViewClass *emfb_parent;
/* Needed since the paned wont take the position its given otherwise ... */
-static void
-emfb_pane_realised(GtkWidget *w, EMFolderBrowser *emfb)
-{
- GConfClient *gconf;
-
- gconf = mail_config_get_gconf_client ();
-
- if (emfb->priv->show_wide)
- gtk_paned_set_position((GtkPaned *)emfb->vpane, gconf_client_get_int(gconf, "/apps/evolution/mail/display/hpaned_size", NULL));
- else
- gtk_paned_set_position((GtkPaned *)emfb->vpane, gconf_client_get_int(gconf, "/apps/evolution/mail/display/paned_size", NULL));
-}
-
-static gboolean
-emfb_pane_button_release_event(GtkWidget *w, GdkEventButton *e, EMFolderBrowser *emfb)
-{
- GConfClient *gconf = mail_config_get_gconf_client ();
-
- if (GTK_WIDGET_REALIZED (w)) {
- if (emfb->priv->show_wide)
- gconf_client_set_int(gconf, "/apps/evolution/mail/display/hpaned_size",
- gtk_paned_get_position(GTK_PANED(w)), NULL);
- else
- gconf_client_set_int(gconf, "/apps/evolution/mail/display/paned_size",
- gtk_paned_get_position(GTK_PANED(w)), NULL);
-
- }
+//static void
+//emfb_pane_realised(GtkWidget *w, EMFolderBrowser *emfb)
+//{
+// GConfClient *gconf;
+//
+// gconf = mail_config_get_gconf_client ();
+//
+// if (emfb->priv->show_wide)
+// gtk_paned_set_position((GtkPaned *)emfb->vpane, gconf_client_get_int(gconf, "/apps/evolution/mail/display/hpaned_size", NULL));
+// else
+// gtk_paned_set_position((GtkPaned *)emfb->vpane, gconf_client_get_int(gconf, "/apps/evolution/mail/display/paned_size", NULL));
+//}
- return FALSE;
-}
+//static gboolean
+//emfb_pane_button_release_event(GtkWidget *w, GdkEventButton *e, EMFolderBrowser *emfb)
+//{
+// GConfClient *gconf = mail_config_get_gconf_client ();
+//
+// if (GTK_WIDGET_REALIZED (w)) {
+// if (emfb->priv->show_wide)
+// gconf_client_set_int(gconf, "/apps/evolution/mail/display/hpaned_size",
+// gtk_paned_get_position(GTK_PANED(w)), NULL);
+// else
+// gconf_client_set_int(gconf, "/apps/evolution/mail/display/paned_size",
+// gtk_paned_get_position(GTK_PANED(w)), NULL);
+//
+// }
+//
+// return FALSE;
+//}
static void
free_one_ui_file (gpointer data,
@@ -493,21 +493,21 @@ emfb_init(GObject *o)
g_signal_connect_after (((EMFormatHTML *)(emfb->view.preview))->html, "scroll", G_CALLBACK (html_scroll), emfb);
- g_slist_foreach (emfb->view.ui_files, free_one_ui_file, NULL);
- g_slist_free(emfb->view.ui_files);
-
- emfb->view.ui_files = g_slist_append(NULL,
- g_build_filename (EVOLUTION_UIDIR,
- "evolution-mail-global.xml",
- NULL));
- emfb->view.ui_files = g_slist_append(emfb->view.ui_files,
- g_build_filename (EVOLUTION_UIDIR,
- "evolution-mail-list.xml",
- NULL));
- emfb->view.ui_files = g_slist_append(emfb->view.ui_files,
- g_build_filename (EVOLUTION_UIDIR,
- "evolution-mail-message.xml",
- NULL));
+// g_slist_foreach (emfb->view.ui_files, free_one_ui_file, NULL);
+// g_slist_free(emfb->view.ui_files);
+
+// emfb->view.ui_files = g_slist_append(NULL,
+// g_build_filename (EVOLUTION_UIDIR,
+// "evolution-mail-global.xml",
+// NULL));
+// emfb->view.ui_files = g_slist_append(emfb->view.ui_files,
+// g_build_filename (EVOLUTION_UIDIR,
+// "evolution-mail-list.xml",
+// NULL));
+// emfb->view.ui_files = g_slist_append(emfb->view.ui_files,
+// g_build_filename (EVOLUTION_UIDIR,
+// "evolution-mail-message.xml",
+// NULL));
emfb->view.enable_map = g_slist_prepend(emfb->view.enable_map, (void *)emfb_enable_map);
@@ -539,13 +539,13 @@ emfb_init(GObject *o)
emfb->priv->labels_change_notify_id = gconf_client_notify_add (gconf, E_UTIL_LABELS_GCONF_KEY, gconf_labels_changed, emfb, NULL, NULL);
}
- 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();
+// 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);
+// 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_widget_show(emfb->vpane);
gtk_box_pack_start_defaults((GtkBox *)emfb, emfb->vpane);
@@ -766,8 +766,8 @@ void em_folder_browser_show_wide(EMFolderBrowser *emfb, gboolean state)
w = emfb->priv->show_wide?gtk_hpaned_new():gtk_vpaned_new();
g_signal_handler_disconnect(emfb->vpane, emfb->priv->vpane_resize_id);
- g_signal_connect(w, "realize", G_CALLBACK(emfb_pane_realised), emfb);
- emfb->priv->vpane_resize_id = g_signal_connect(w, "button_release_event", G_CALLBACK(emfb_pane_button_release_event), emfb);
+// g_signal_connect(w, "realize", G_CALLBACK(emfb_pane_realised), emfb);
+// emfb->priv->vpane_resize_id = g_signal_connect(w, "button_release_event", G_CALLBACK(emfb_pane_button_release_event), emfb);
gtk_box_pack_start_defaults((GtkBox *)emfb, w);
gtk_widget_reparent((GtkWidget *)emfb->view.list, w);
diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in
index d74295f669..3dca693698 100644
--- a/mail/evolution-mail.schemas.in
+++ b/mail/evolution-mail.schemas.in
@@ -570,16 +570,19 @@
</schema>
<schema>
- <key>/schemas/apps/evolution/mail/display/show_wide</key>
- <applyto>/apps/evolution/mail/display/show_wide</applyto>
+ <key>/schemas/apps/evolution/mail/display/layout</key>
+ <applyto>/apps/evolution/mail/display/layout</applyto>
<owner>evolution-mail</owner>
- <type>bool</type>
- <default>false</default>
+ <type>int</type>
+ <default>0</default>
<locale name="C">
- <short>Use side-by-side or wide layout</short>
- <long>
- If the &quot;Preview&quot; pane is on, then show it side-by-side rather than vertically.
- </long>
+ <short>Layout style</short>
+ <long>
+ The layout style determines where to place the preview pane
+ in relation to the message list. "0" (Classic View) places
+ the preview pane below the message list. "1" (Vertical View)
+ places the preview pane next to the message list.
+ </long>
</locale>
</schema>