[evolution/wip/webkit2] Bug 263592 - Add "Go to Folder" menu option
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] Bug 263592 - Add "Go to Folder" menu option
- Date: Wed, 24 Feb 2016 13:54:19 +0000 (UTC)
commit 378337c01d1da9e5eba4eba964df4adf3de21b7e
Author: Milan Crha <mcrha redhat com>
Date: Fri Apr 3 14:51:45 2015 +0200
Bug 263592 - Add "Go to Folder" menu option
modules/mail/e-mail-shell-view-actions.c | 65 ++++++++++++++++++++++++++++++
ui/evolution-mail.ui | 2 +
2 files changed, 67 insertions(+), 0 deletions(-)
---
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index 6c6540d..faa2bc2 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -1012,6 +1012,64 @@ action_mail_global_expunge_cb (GtkAction *action,
}
static void
+action_mail_goto_folder_cb (GtkAction *action,
+ EMailShellView *mail_shell_view)
+{
+ CamelFolder *folder;
+ EMailReader *reader;
+ EMailView *mail_view;
+ EMFolderSelector *selector;
+ EMFolderTree *folder_tree;
+ EMFolderTreeModel *model;
+ GtkWidget *dialog;
+ GtkWindow *window;
+ const gchar *uri;
+
+ mail_view = e_mail_shell_content_get_mail_view (mail_shell_view->priv->mail_shell_content);
+ reader = E_MAIL_READER (mail_view);
+
+ folder = e_mail_reader_ref_folder (reader);
+ window = e_mail_reader_get_window (reader);
+
+ model = em_folder_tree_model_get_default ();
+
+ dialog = em_folder_selector_new (window, model);
+
+ gtk_window_set_title (GTK_WINDOW (dialog), _("Go to Folder"));
+
+ selector = EM_FOLDER_SELECTOR (dialog);
+ em_folder_selector_set_can_create (selector, FALSE);
+ em_folder_selector_set_default_button_label (selector, _("_Select"));
+
+ folder_tree = em_folder_selector_get_folder_tree (selector);
+ gtk_tree_view_expand_all (GTK_TREE_VIEW (folder_tree));
+
+ if (folder) {
+ gchar *uri = e_mail_folder_uri_from_folder (folder);
+
+ if (uri) {
+ em_folder_tree_set_selected (folder_tree, uri, FALSE);
+ g_free (uri);
+ }
+
+ g_object_unref (folder);
+ }
+
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) {
+ uri = em_folder_selector_get_selected_uri (selector);
+
+ if (uri != NULL) {
+ folder_tree = e_mail_shell_sidebar_get_folder_tree
(mail_shell_view->priv->mail_shell_sidebar);
+ em_folder_tree_set_selected (folder_tree, uri, FALSE);
+ }
+ }
+
+ gtk_widget_destroy (dialog);
+
+ g_clear_object (&folder);
+}
+
+static void
action_mail_label_cb (GtkToggleAction *action,
EMailShellView *mail_shell_view)
{
@@ -1702,6 +1760,13 @@ static GtkActionEntry mail_entries[] = {
N_("Permanently remove all the deleted messages from all accounts"),
G_CALLBACK (action_mail_global_expunge_cb) },
+ { "mail-goto-folder",
+ NULL,
+ N_("Go to _Folder"),
+ "<Control>g",
+ N_("Opens a dialog to select a folder to go to"),
+ G_CALLBACK (action_mail_goto_folder_cb) },
+
{ "mail-label-new",
NULL,
N_("_New Label"),
diff --git a/ui/evolution-mail.ui b/ui/evolution-mail.ui
index 70fd30d..c7cec4f 100644
--- a/ui/evolution-mail.ui
+++ b/ui/evolution-mail.ui
@@ -26,6 +26,8 @@
</placeholder>
<separator/>
<placeholder name='mail-message-list-actions'>
+ <menuitem action='mail-goto-folder'/>
+ <separator/>
<menuitem action='mail-threads-group-by'/>
<menuitem action='mail-threads-expand-all'/>
<menuitem action='mail-threads-collapse-all'/>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]