[gedit] Remove some deprecated calls



commit 31eb25277fe585ff6131ce0d9911fbd977d92d79
Author: Paolo Borelli <pborelli gnome org>
Date:   Wed Feb 5 16:23:27 2014 +0100

    Remove some deprecated calls

 docs/reference/gedit-sections.txt |    2 +-
 gedit/gedit-io-error-info-bar.c   |    5 -----
 gedit/gedit-progress-info-bar.c   |   29 +++++++++++------------------
 gedit/gedit-progress-info-bar.h   |    6 +++---
 gedit/gedit-tab.c                 |   33 +++++++++++++--------------------
 5 files changed, 28 insertions(+), 47 deletions(-)
---
diff --git a/docs/reference/gedit-sections.txt b/docs/reference/gedit-sections.txt
index 8938fa5..3cf2abe 100644
--- a/docs/reference/gedit-sections.txt
+++ b/docs/reference/gedit-sections.txt
@@ -251,7 +251,7 @@ GeditProgressInfoBarPrivate
 <TITLE>GeditProgressInfoBar</TITLE>
 GeditProgressInfoBar
 gedit_progress_info_bar_new
-gedit_progress_info_bar_set_stock_image
+gedit_progress_info_bar_set_icon_name
 gedit_progress_info_bar_set_markup
 gedit_progress_info_bar_set_text
 gedit_progress_info_bar_set_fraction
diff --git a/gedit/gedit-io-error-info-bar.c b/gedit/gedit-io-error-info-bar.c
index 54a641f..541ca91 100644
--- a/gedit/gedit-io-error-info-bar.c
+++ b/gedit/gedit-io-error-info-bar.c
@@ -455,7 +455,6 @@ gedit_network_unavailable_info_bar_new (GFile *location)
 {
        GtkWidget *info_bar;
        GtkWidget *hbox_content;
-       GtkWidget *image;
        GtkWidget *vbox;
        gchar *primary_markup;
        gchar *secondary_markup;
@@ -483,10 +482,6 @@ gedit_network_unavailable_info_bar_new (GFile *location)
                                       GTK_MESSAGE_WARNING);
        hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
 
-       image = gtk_image_new_from_stock ("gtk-dialog-warning", GTK_ICON_SIZE_DIALOG);
-       gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
-       gtk_widget_set_halign (image, GTK_ALIGN_START);
-
        vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
        gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
 
diff --git a/gedit/gedit-progress-info-bar.c b/gedit/gedit-progress-info-bar.c
index 9d0d0d7..91abc7e 100644
--- a/gedit/gedit-progress-info-bar.c
+++ b/gedit/gedit-progress-info-bar.c
@@ -109,40 +109,35 @@ gedit_progress_info_bar_init (GeditProgressInfoBar *bar)
 }
 
 GtkWidget *
-gedit_progress_info_bar_new (const gchar *stock_id,
+gedit_progress_info_bar_new (const gchar *icon_name,
                             const gchar *markup,
                             gboolean     has_cancel)
 {
        GeditProgressInfoBar *bar;
 
-       g_return_val_if_fail (stock_id != NULL, NULL);
+       g_return_val_if_fail (icon_name != NULL, NULL);
        g_return_val_if_fail (markup != NULL, NULL);
 
        bar = GEDIT_PROGRESS_INFO_BAR (g_object_new (GEDIT_TYPE_PROGRESS_INFO_BAR,
                                                     "has-cancel-button", has_cancel,
                                                     NULL));
 
-       G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-       gedit_progress_info_bar_set_stock_image (bar, stock_id);
-       G_GNUC_END_IGNORE_DEPRECATIONS;
-
+       gedit_progress_info_bar_set_icon_name (bar, icon_name);
        gedit_progress_info_bar_set_markup (bar, markup);
 
        return GTK_WIDGET (bar);
 }
 
 void
-gedit_progress_info_bar_set_stock_image (GeditProgressInfoBar *bar,
-                                        const gchar          *stock_id)
+gedit_progress_info_bar_set_icon_name (GeditProgressInfoBar *bar,
+                                      const gchar          *icon_name)
 {
        g_return_if_fail (GEDIT_IS_PROGRESS_INFO_BAR (bar));
-       g_return_if_fail (stock_id != NULL);
+       g_return_if_fail (icon_name != NULL);
 
-       G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
-       gtk_image_set_from_stock (GTK_IMAGE (bar->priv->image),
-                                 stock_id,
-                                 GTK_ICON_SIZE_SMALL_TOOLBAR);
-       G_GNUC_END_IGNORE_DEPRECATIONS;
+       gtk_image_set_from_icon_name (GTK_IMAGE (bar->priv->image),
+                                     icon_name,
+                                     GTK_ICON_SIZE_SMALL_TOOLBAR);
 }
 
 void
@@ -152,8 +147,7 @@ gedit_progress_info_bar_set_markup (GeditProgressInfoBar *bar,
        g_return_if_fail (GEDIT_IS_PROGRESS_INFO_BAR (bar));
        g_return_if_fail (markup != NULL);
 
-       gtk_label_set_markup (GTK_LABEL (bar->priv->label),
-                             markup);
+       gtk_label_set_markup (GTK_LABEL (bar->priv->label), markup);
 }
 
 void
@@ -163,8 +157,7 @@ gedit_progress_info_bar_set_text (GeditProgressInfoBar *bar,
        g_return_if_fail (GEDIT_IS_PROGRESS_INFO_BAR (bar));
        g_return_if_fail (text != NULL);
 
-       gtk_label_set_text (GTK_LABEL (bar->priv->label),
-                           text);
+       gtk_label_set_text (GTK_LABEL (bar->priv->label), text);
 }
 
 void
diff --git a/gedit/gedit-progress-info-bar.h b/gedit/gedit-progress-info-bar.h
index e40473d..e775c46 100644
--- a/gedit/gedit-progress-info-bar.h
+++ b/gedit/gedit-progress-info-bar.h
@@ -74,12 +74,12 @@ struct _GeditProgressInfoBarClass
  */
 GType           gedit_progress_info_bar_get_type               (void) G_GNUC_CONST;
 
-GtkWidget      *gedit_progress_info_bar_new                    (const gchar          *stock_id,
+GtkWidget      *gedit_progress_info_bar_new                    (const gchar          *icon_name,
                                                                 const gchar          *markup,
                                                                 gboolean              has_cancel);
 
-void            gedit_progress_info_bar_set_stock_image        (GeditProgressInfoBar *bar,
-                                                                const gchar          *stock_id);
+void            gedit_progress_info_bar_set_icon_name          (GeditProgressInfoBar *bar,
+                                                                const gchar          *icon_name);
 
 void            gedit_progress_info_bar_set_markup             (GeditProgressInfoBar *bar,
                                                                 const gchar          *markup);
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index bd68ebb..f26ede7 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -776,7 +776,7 @@ show_loading_info_bar (GeditTab *tab)
                                               name_markup);
                }
 
-               bar = gedit_progress_info_bar_new (GTK_STOCK_REVERT_TO_SAVED,
+               bar = gedit_progress_info_bar_new ("document-revert",
                                                   msg,
                                                   TRUE);
        }
@@ -799,7 +799,7 @@ show_loading_info_bar (GeditTab *tab)
                                               name_markup);
                }
 
-               bar = gedit_progress_info_bar_new (GTK_STOCK_OPEN,
+               bar = gedit_progress_info_bar_new ("document-open",
                                                   msg,
                                                   TRUE);
        }
@@ -884,7 +884,7 @@ show_saving_info_bar (GeditTab *tab)
                msg = g_strdup_printf (_("Saving %s"), from_markup);
        }
 
-       bar = gedit_progress_info_bar_new (GTK_STOCK_SAVE,
+       bar = gedit_progress_info_bar_new ("document-save",
                                           msg,
                                           FALSE);
 
@@ -2634,22 +2634,13 @@ print_cancelled (GtkWidget        *bar,
 }
 
 static void
-show_printing_info_bar (GeditTab *tab, gboolean preview)
+show_printing_info_bar (GeditTab *tab)
 {
        GtkWidget *bar;
 
-       if (preview)
-       {
-               bar = gedit_progress_info_bar_new (GTK_STOCK_PRINT_PREVIEW,
-                                                       "",
-                                                       TRUE);
-       }
-       else
-       {
-               bar = gedit_progress_info_bar_new (GTK_STOCK_PRINT,
-                                                       "",
-                                                       TRUE);
-       }
+       bar = gedit_progress_info_bar_new ("document-print",
+                                          "",
+                                          TRUE);
 
        g_signal_connect (bar,
                          "response",
@@ -2664,7 +2655,6 @@ gedit_tab_print_or_print_preview (GeditTab                *tab,
                                  GtkPrintOperationAction  print_action)
 {
        GeditView *view;
-       gboolean is_preview;
        GtkPageSetup *setup;
        GtkPrintSettings *settings;
        GtkPrintOperationResult res;
@@ -2675,13 +2665,12 @@ gedit_tab_print_or_print_preview (GeditTab                *tab,
 
        view = gedit_tab_get_view (tab);
 
-       is_preview = (print_action == GTK_PRINT_OPERATION_ACTION_PREVIEW);
 
        tab->priv->print_job = gedit_print_job_new (view);
        g_object_add_weak_pointer (G_OBJECT (tab->priv->print_job),
                                   (gpointer *) &tab->priv->print_job);
 
-       show_printing_info_bar (tab, is_preview);
+       show_printing_info_bar (tab);
 
        g_signal_connect (tab->priv->print_job,
                          "printing",
@@ -2696,10 +2685,14 @@ gedit_tab_print_or_print_preview (GeditTab                *tab,
                          G_CALLBACK (done_printing_cb),
                          tab);
 
-       if (is_preview)
+       if (print_action == GTK_PRINT_OPERATION_ACTION_PREVIEW)
+       {
                gedit_tab_set_state (tab, GEDIT_TAB_STATE_PRINT_PREVIEWING);
+       }
        else
+       {
                gedit_tab_set_state (tab, GEDIT_TAB_STATE_PRINTING);
+       }
 
        setup = get_page_setup (tab);
        settings = get_print_settings (tab);


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