Fixes several reference leaks that were preventing the folder view window from being...
[modest] / src / hildon2 / modest-account-view-window.c
index 8d0c6dd..71382f8 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <modest-runtime.h>
 #include "modest-platform.h"
+#include "modest-text-utils.h"
 #include "modest-account-protocol.h"
 #include <modest-account-mgr-helpers.h>
 #include <string.h>
@@ -59,7 +60,6 @@ enum {
 
 typedef struct _ModestAccountViewWindowPrivate ModestAccountViewWindowPrivate;
 struct _ModestAccountViewWindowPrivate {
-       GtkWidget           *new_button;
        GtkWidget           *edit_button;
        ModestAccountView   *account_view;
        guint acc_removed_handler;
@@ -271,6 +271,7 @@ on_account_activated (GtkTreeView *account_view,
                        ModestAccountSettingsDialog *dialog =
                                modest_account_protocol_get_account_settings_dialog (proto, account_name);
                        modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (dialog), GTK_WINDOW (self));
+                       gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE);
                        gtk_widget_show (GTK_WIDGET (dialog));
                }
        }
@@ -278,58 +279,6 @@ on_account_activated (GtkTreeView *account_view,
 }
 
 static void
-on_wizard_response (GtkDialog *dialog, 
-                   gint response, 
-                   gpointer user_data)
-{      
-       /* The response has already been handled by the wizard dialog itself,
-        * creating the new account.
-        */      
-       if (dialog)
-               gtk_widget_destroy (GTK_WIDGET (dialog));
-
-       /* Re-focus the account list view widget */
-       if (MODEST_IS_ACCOUNT_VIEW_WINDOW (user_data)) {
-               ModestAccountViewWindowPrivate *priv;
-               priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE (user_data);
-               gtk_widget_grab_focus (GTK_WIDGET (priv->account_view));
-       }
-}
-
-static void
-on_new_button_clicked (GtkWidget *button, ModestAccountViewWindow *self)
-{
-       GtkDialog *wizard;
-
-       /* there is no such wizard yet */
-       wizard = GTK_DIALOG (modest_easysetup_wizard_dialog_new ());
-       modest_window_mgr_set_modal (modest_runtime_get_window_mgr(), 
-                                    GTK_WINDOW (wizard), GTK_WINDOW (self));
-
-       gtk_window_set_modal (GTK_WINDOW (wizard), TRUE);
-       gtk_window_set_transient_for (GTK_WINDOW (wizard), GTK_WINDOW (self));
-       /* Destroy the dialog when it is closed: */
-       g_signal_connect (G_OBJECT (wizard), "response", G_CALLBACK
-                         (on_wizard_response), self);
-       gtk_widget_show (GTK_WIDGET (wizard));
-}
-
-static void
-setup_button_box (ModestAccountViewWindow *self, GtkButtonBox *box)
-{
-       ModestAccountViewWindowPrivate *priv = MODEST_ACCOUNT_VIEW_WINDOW_GET_PRIVATE(self);
-       
-       priv->new_button     = gtk_button_new_from_stock(_("mcen_bd_new"));
-       
-       g_signal_connect (G_OBJECT(priv->new_button), "clicked",
-                         G_CALLBACK(on_new_button_clicked),
-                         self);
-       gtk_box_pack_start (GTK_BOX(box), priv->new_button, FALSE, FALSE,0);
-
-       gtk_widget_show_all (GTK_WIDGET (box));
-}
-
-static void
 window_vbox_new (ModestAccountViewWindow *self)
 {
 }
@@ -400,8 +349,6 @@ modest_account_view_window_new (void)
        /* Add widgets */
        window_vbox_new (MODEST_ACCOUNT_VIEW_WINDOW (self));
        
-       setup_button_box (MODEST_ACCOUNT_VIEW_WINDOW (self), GTK_BUTTON_BOX (GTK_DIALOG (self)->action_area));
-
        gtk_window_set_title (GTK_WINDOW (self), _("mcen_ti_emailsetup_accounts"));
 
        /* Connect signals */