diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.c | 20 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.h | 2 |
2 files changed, 17 insertions, 5 deletions
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index da8b0d729c..b521dc3712 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -833,18 +833,30 @@ static void action_mail_tools_subscriptions_cb (GtkAction *action, EMailShellView *mail_shell_view) { + EMailShellSidebar *mail_shell_sidebar; EShellWindow *shell_window; EShellView *shell_view; + EMFolderTree *folder_tree; + EAccount *account = NULL; GtkWidget *dialog; + gchar *uri; shell_view = E_SHELL_VIEW (mail_shell_view); shell_window = e_shell_view_get_shell_window (shell_view); - dialog = em_subscribe_editor_new (); - gtk_window_set_transient_for ( - GTK_WINDOW (dialog), GTK_WINDOW (shell_window)); + mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar; + folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); + + uri = em_folder_tree_get_selected_uri (folder_tree); + if (uri != NULL) { + account = mail_config_get_account_by_source_url (uri); + g_free (uri); + } + + dialog = em_subscription_editor_new ( + GTK_WINDOW (shell_window), session, account); gtk_dialog_run (GTK_DIALOG (dialog)); - /* XXX Dialog destroys itself. */ + gtk_widget_destroy (dialog); } static void diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h index 9fbfadde31..816fcef02d 100644 --- a/modules/mail/e-mail-shell-view-private.h +++ b/modules/mail/e-mail-shell-view-private.h @@ -50,7 +50,7 @@ #include "em-folder-selector.h" #include "em-folder-utils.h" #include "em-search-context.h" -#include "em-subscribe-editor.h" +#include "em-subscription-editor.h" #include "em-utils.h" #include "mail-autofilter.h" #include "mail-config.h" |