aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2011-05-24 10:42:49 +0800
committerMatthew Barnes <mbarnes@redhat.com>2011-05-24 12:17:34 +0800
commitc6d8a030399f9e3d9f38798e99cdeecaf2d5fbbb (patch)
treed92b5f0f9623e194c9f79b73ff57ba31e00fd257 /mail/em-composer-utils.c
parente5bb31aae65efd3dbc1804570849e5495a71daf9 (diff)
downloadgsoc2013-evolution-c6d8a030399f9e3d9f38798e99cdeecaf2d5fbbb.tar.gz
gsoc2013-evolution-c6d8a030399f9e3d9f38798e99cdeecaf2d5fbbb.tar.zst
gsoc2013-evolution-c6d8a030399f9e3d9f38798e99cdeecaf2d5fbbb.zip
Let EMFolderSelector create its own EMFolderTree.
Also, minimize the EMFolderSelector API by removing frivolous wrapper functions and unused functions.
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c33
1 files changed, 16 insertions, 17 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index f58e8955dd..e8441b7ab9 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -2790,7 +2790,8 @@ post_header_clicked_cb (EComposerPostHeader *header,
EShell *shell;
EShellBackend *shell_backend;
GtkTreeSelection *selection;
- GtkWidget *folder_tree;
+ EMFolderSelector *selector;
+ EMFolderTree *folder_tree;
GtkWidget *dialog;
GList *list;
@@ -2798,29 +2799,28 @@ post_header_clicked_cb (EComposerPostHeader *header,
shell = e_msg_composer_get_shell (composer);
shell_backend = e_shell_get_backend_by_name (shell, "mail");
- folder_tree = em_folder_tree_new (E_MAIL_BACKEND (shell_backend));
- emu_restore_folder_tree_state (EM_FOLDER_TREE (folder_tree));
+ dialog = em_folder_selector_new (
+ GTK_WINDOW (composer),
+ E_MAIL_BACKEND (shell_backend),
+ EM_FOLDER_SELECTOR_CAN_CREATE,
+ _("Posting destination"),
+ _("Choose folders to post the message to."),
+ NULL);
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_tree));
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
+ selector = EM_FOLDER_SELECTOR (dialog);
+ folder_tree = em_folder_selector_get_folder_tree (selector);
em_folder_tree_set_excluded (
- EM_FOLDER_TREE (folder_tree),
+ folder_tree,
EMFT_EXCLUDE_NOSELECT |
EMFT_EXCLUDE_VIRTUAL |
EMFT_EXCLUDE_VTRASH);
- dialog = em_folder_selector_new (
- GTK_WINDOW (composer),
- EM_FOLDER_TREE (folder_tree),
- EM_FOLDER_SELECTOR_CAN_CREATE,
- _("Posting destination"),
- _("Choose folders to post the message to."),
- NULL);
+ selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (folder_tree));
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
list = e_composer_post_header_get_folders (header);
- em_folder_selector_set_selected_list (
- EM_FOLDER_SELECTOR (dialog), list);
+ em_folder_tree_set_selected_list (folder_tree, list, FALSE);
g_list_foreach (list, (GFunc) g_free, NULL);
g_list_free (list);
@@ -2831,8 +2831,7 @@ post_header_clicked_cb (EComposerPostHeader *header,
goto exit;
}
- list = em_folder_selector_get_selected_uris (
- EM_FOLDER_SELECTOR (dialog));
+ list = em_folder_tree_get_selected_uris (folder_tree);
e_composer_post_header_set_folders (header, list);
g_list_foreach (list, (GFunc) g_free, NULL);
g_list_free (list);