[evolution] EMFolderSelector: Remove 'title' argument when creating.



commit a0015666b9e36abfb3270159d28f5ef584b77b33
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Mar 19 10:56:07 2014 -0400

    EMFolderSelector: Remove 'title' argument when creating.
    
    Just call gtk_window_set_title() after creating the dialog.
    
    This makes EMFolderSelector a little more "subclassable".

 mail/e-mail-reader.c              |   10 ++++++----
 mail/em-composer-utils.c          |    5 +++--
 mail/em-folder-selection-button.c |    4 +++-
 mail/em-folder-selector.c         |    8 ++------
 mail/em-folder-selector.h         |    6 ++----
 mail/em-folder-utils.c            |    9 ++++++---
 mail/em-vfolder-editor-rule.c     |    4 +++-
 modules/mail/em-composer-prefs.c  |    6 ++++--
 8 files changed, 29 insertions(+), 23 deletions(-)
---
diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c
index 7ffda86..a35da4d 100644
--- a/mail/e-mail-reader.c
+++ b/mail/e-mail-reader.c
@@ -342,8 +342,9 @@ action_mail_copy_cb (GtkAction *action,
 
        model = em_folder_tree_model_get_default ();
 
-       dialog = em_folder_selector_new (
-               window, model, _("Copy to Folder"));
+       dialog = em_folder_selector_new (window, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), _("Copy to Folder"));
 
        selector = EM_FOLDER_SELECTOR (dialog);
        em_folder_selector_set_can_create (selector, TRUE);
@@ -843,8 +844,9 @@ action_mail_move_cb (GtkAction *action,
 
        model = em_folder_tree_model_get_default ();
 
-       dialog = em_folder_selector_new (
-               window, model, _("Move to Folder"));
+       dialog = em_folder_selector_new (window, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), _("Move to Folder"));
 
        selector = EM_FOLDER_SELECTOR (dialog);
        em_folder_selector_set_can_create (selector, TRUE);
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index c8f57f0..44fd49c 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -3036,8 +3036,9 @@ post_header_clicked_cb (EComposerPostHeader *header,
        model = em_folder_tree_model_get_default ();
 
        dialog = em_folder_selector_new (
-               /* FIXME GTK_WINDOW (composer) */ NULL,
-               model, _("Posting destination"));
+               /* FIXME GTK_WINDOW (composer) */ NULL, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), _("Posting destination"));
 
        selector = EM_FOLDER_SELECTOR (dialog);
        em_folder_selector_set_can_create (selector, TRUE);
diff --git a/mail/em-folder-selection-button.c b/mail/em-folder-selection-button.c
index 7ba1a1d..b43eb3e 100644
--- a/mail/em-folder-selection-button.c
+++ b/mail/em-folder-selection-button.c
@@ -269,7 +269,9 @@ folder_selection_button_clicked (GtkButton *button)
        if (model == NULL)
                model = g_object_ref (em_folder_tree_model_get_default ());
 
-       dialog = em_folder_selector_new (parent, model, priv->title);
+       dialog = em_folder_selector_new (parent, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), priv->title);
 
        g_object_unref (model);
 
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index 7f1274c..76b5cc5 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -483,8 +483,7 @@ folder_selector_construct (EMFolderSelector *selector)
 
 GtkWidget *
 em_folder_selector_new (GtkWindow *parent,
-                        EMFolderTreeModel *model,
-                        const gchar *title)
+                        EMFolderTreeModel *model)
 {
        EMFolderSelector *selector;
 
@@ -493,7 +492,6 @@ em_folder_selector_new (GtkWindow *parent,
        selector = g_object_new (
                EM_TYPE_FOLDER_SELECTOR,
                "transient-for", parent,
-               "title", title,
                "model", model, NULL);
        folder_selector_construct (selector);
 
@@ -531,8 +529,7 @@ folder_selector_create_name_activate (GtkEntry *entry,
 
 GtkWidget *
 em_folder_selector_create_new (GtkWindow *parent,
-                               EMFolderTreeModel *model,
-                               const gchar *title)
+                               EMFolderTreeModel *model)
 {
        EMFolderSelector *selector;
        EMFolderTree *folder_tree;
@@ -545,7 +542,6 @@ em_folder_selector_create_new (GtkWindow *parent,
        selector = g_object_new (
                EM_TYPE_FOLDER_SELECTOR,
                "transient-for", parent,
-               "title", title,
                "model", model,
                "default-button-label", _("C_reate"), NULL);
 
diff --git a/mail/em-folder-selector.h b/mail/em-folder-selector.h
index a6e78de..6037b2b 100644
--- a/mail/em-folder-selector.h
+++ b/mail/em-folder-selector.h
@@ -62,11 +62,9 @@ struct _EMFolderSelectorClass {
 
 GType          em_folder_selector_get_type     (void);
 GtkWidget *    em_folder_selector_new          (GtkWindow *parent,
-                                                EMFolderTreeModel *model,
-                                                const gchar *title);
+                                                EMFolderTreeModel *model);
 GtkWidget *    em_folder_selector_create_new   (GtkWindow *parent,
-                                                EMFolderTreeModel *model,
-                                                const gchar *title);
+                                                EMFolderTreeModel *model);
 gboolean       em_folder_selector_get_can_create
                                                (EMFolderSelector *selector);
 void           em_folder_selector_set_can_create
diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c
index 15f6919..b3d7543 100644
--- a/mail/em-folder-utils.c
+++ b/mail/em-folder-utils.c
@@ -507,7 +507,9 @@ em_folder_utils_copy_folder (GtkWindow *parent,
 
        model = em_folder_tree_model_get_default ();
 
-       dialog = em_folder_selector_new (parent, model, title);
+       dialog = em_folder_selector_new (parent, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), title);
 
        selector = EM_FOLDER_SELECTOR (dialog);
        em_folder_selector_set_can_create (selector, TRUE);
@@ -600,8 +602,9 @@ em_folder_utils_create_folder (GtkWindow *parent,
                em_folder_tree_model_add_store (model, CAMEL_STORE (service));
        }
 
-       dialog = em_folder_selector_create_new (
-               parent, model, _("Create Folder"));
+       dialog = em_folder_selector_create_new (parent, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), _("Create Folder"));
 
        g_object_unref (model);
 
diff --git a/mail/em-vfolder-editor-rule.c b/mail/em-vfolder-editor-rule.c
index 7296d36..541ec34 100644
--- a/mail/em-vfolder-editor-rule.c
+++ b/mail/em-vfolder-editor-rule.c
@@ -387,7 +387,9 @@ source_add (GtkWidget *widget,
 
        model = em_folder_tree_model_get_default ();
 
-       dialog = em_folder_selector_new (parent, model, _("Add Folder"));
+       dialog = em_folder_selector_new (parent, model);
+
+       gtk_window_set_title (GTK_WINDOW (dialog), _("Add Folder"));
 
        selector = EM_FOLDER_SELECTOR (dialog);
        em_folder_selector_set_can_create (selector, TRUE);
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index efc740b..d7ddf2a 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -439,8 +439,10 @@ sao_folders_add_button_clicked_cb (GtkButton *button,
        window = GTK_WINDOW (gtk_widget_get_toplevel (widget));
 
        dialog = em_folder_selector_new (
-               window, em_folder_tree_model_get_default (),
-               _("Select Folder to Add"));
+               window, em_folder_tree_model_get_default ());
+
+       gtk_window_set_title (
+               GTK_WINDOW (dialog), _("Select Folder to Add"));
 
        selector = EM_FOLDER_SELECTOR (dialog);
        em_folder_selector_set_default_button_label (selector, _("_Add"));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]