[gedit] More stock removal



commit 0cf1ec9a5698c9bc53784caff026e8bb8a4491d5
Author: Paolo Borelli <pborelli gnome org>
Date:   Sat Feb 8 11:14:53 2014 +0100

    More stock removal

 gedit/gedit-commands-file.c                     |    8 ++++----
 gedit/gedit-preferences-dialog.c                |    2 +-
 gedit/gedit-progress-info-bar.c                 |    6 +++---
 plugins/checkupdate/gedit-check-update-plugin.c |    8 --------
 plugins/quickopen/quickopen/popup.py            |    7 -------
 plugins/snippets/snippets/manager.py            |   18 +++++++++---------
 plugins/spell/gedit-automatic-spell-checker.c   |   12 ++++++------
 plugins/spell/gedit-spell-language-dialog.c     |    9 +++------
 8 files changed, 26 insertions(+), 44 deletions(-)
---
diff --git a/gedit/gedit-commands-file.c b/gedit/gedit-commands-file.c
index 4f6c240..0c8c987 100644
--- a/gedit/gedit-commands-file.c
+++ b/gedit/gedit-commands-file.c
@@ -438,8 +438,8 @@ _gedit_cmd_file_open (GSimpleAction *action,
                                                     GTK_WINDOW (window),
                                                     GTK_FILE_CHOOSER_ACTION_OPEN,
                                                     NULL,
-                                                    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                                    GTK_STOCK_OPEN, GTK_RESPONSE_OK,
+                                                    _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                                    _("_Open"), GTK_RESPONSE_OK,
                                                     NULL);
 
        g_object_set_data (G_OBJECT (window),
@@ -830,8 +830,8 @@ _gedit_cmd_file_save_as_tab (GeditTab    *tab,
                                                     GTK_WINDOW (window),
                                                     GTK_FILE_CHOOSER_ACTION_SAVE,
                                                     NULL,
-                                                    GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                                    GTK_STOCK_SAVE, GTK_RESPONSE_OK,
+                                                    _("_Cancel"), GTK_RESPONSE_CANCEL,
+                                                    _("_Save"), GTK_RESPONSE_OK,
                                                     NULL);
 
        gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (save_dialog),
diff --git a/gedit/gedit-preferences-dialog.c b/gedit/gedit-preferences-dialog.c
index f0ffb03..fcccfd5 100644
--- a/gedit/gedit-preferences-dialog.c
+++ b/gedit/gedit-preferences-dialog.c
@@ -850,7 +850,7 @@ install_scheme_clicked (GtkButton              *button,
        chooser = gtk_file_chooser_dialog_new (_("Add Scheme"),
                                               GTK_WINDOW (dlg),
                                               GTK_FILE_CHOOSER_ACTION_OPEN,
-                                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                              _("_Cancel"), GTK_RESPONSE_CANCEL,
                                               _("A_dd Scheme"), GTK_RESPONSE_ACCEPT,
                                               NULL);
 
diff --git a/gedit/gedit-progress-info-bar.c b/gedit/gedit-progress-info-bar.c
index 91abc7e..a7de664 100644
--- a/gedit/gedit-progress-info-bar.c
+++ b/gedit/gedit-progress-info-bar.c
@@ -47,9 +47,9 @@ gedit_progress_info_bar_set_has_cancel_button (GeditProgressInfoBar *bar,
                                               gboolean              has_button)
 {
        if (has_button)
-               gtk_info_bar_add_button (GTK_INFO_BAR (bar),
-                                        GTK_STOCK_CANCEL,
-                                        GTK_RESPONSE_CANCEL);
+       {
+               gtk_info_bar_add_button (GTK_INFO_BAR (bar), _("_Cancel"), GTK_RESPONSE_CANCEL);
+       }
 }
 
 static void
diff --git a/plugins/checkupdate/gedit-check-update-plugin.c b/plugins/checkupdate/gedit-check-update-plugin.c
index d3a77c9..d44ab6e 100644
--- a/plugins/checkupdate/gedit-check-update-plugin.c
+++ b/plugins/checkupdate/gedit-check-update-plugin.c
@@ -174,12 +174,10 @@ set_contents (GtkWidget *infobar,
 
 static void
 set_message_area_text_and_icon (GtkWidget        *message_area,
-                               const gchar      *icon_stock_id,
                                const gchar      *primary_text,
                                const gchar      *secondary_text)
 {
        GtkWidget *hbox_content;
-       GtkWidget *image;
        GtkWidget *vbox;
        gchar *primary_markup;
        gchar *secondary_markup;
@@ -189,11 +187,6 @@ set_message_area_text_and_icon (GtkWidget        *message_area,
        hbox_content = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
        gtk_widget_show (hbox_content);
 
-       image = gtk_image_new_from_stock (icon_stock_id, GTK_ICON_SIZE_DIALOG);
-       gtk_widget_show (image);
-       gtk_box_pack_start (GTK_BOX (hbox_content), image, FALSE, FALSE, 0);
-       gtk_widget_set_valign (image, GTK_ALIGN_START);
-
        vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
        gtk_widget_show (vbox);
        gtk_box_pack_start (GTK_BOX (hbox_content), vbox, TRUE, TRUE, 0);
@@ -299,7 +292,6 @@ create_infobar (GeditWindow *window,
 
        message = g_strdup_printf ("%s (%s)", _("There is a new version of gedit"), version);
        set_message_area_text_and_icon (infobar,
-                                       "gtk-dialog-info",
                                        message,
                                        _("You can download the new version of gedit"
                                          " by clicking on the download button or"
diff --git a/plugins/quickopen/quickopen/popup.py b/plugins/quickopen/quickopen/popup.py
index d0a30fa..45249e1 100644
--- a/plugins/quickopen/quickopen/popup.py
+++ b/plugins/quickopen/quickopen/popup.py
@@ -138,13 +138,6 @@ class Popup(Gtk.Dialog):
             cell.set_property('cell-background-set', False)
             cell.set_property('style-set', False)
 
-    def _icon_from_stock(self, stock):
-        theme = Gtk.icon_theme_get_default()
-        size = Gtk.icon_size_lookup(Gtk.IconSize.MENU)
-        pixbuf = theme.load_icon(stock, size[0], Gtk.IconLookupFlags.USE_BUILTIN)
-
-        return pixbuf
-
     def _is_text(self, entry):
         content_type = entry.get_content_type()
 
diff --git a/plugins/snippets/snippets/manager.py b/plugins/snippets/snippets/manager.py
index 6efbb96..1e3347d 100644
--- a/plugins/snippets/snippets/manager.py
+++ b/plugins/snippets/snippets/manager.py
@@ -163,9 +163,9 @@ class Manager(Gtk.Dialog, Gtk.Buildable):
                 snippet = model.get_value(iter, self.SNIPPET_COLUMN)
 
                 if snippet and not snippet.valid:
-                        cell.set_property('stock-id', Gtk.STOCK_DIALOG_ERROR)
+                        cell.set_property('icon-name', 'dialog-error')
                 else:
-                        cell.set_property('stock-id', None)
+                        cell.set_property('icon-name', None)
 
                 cell.set_property('xalign', 1.0)
 
@@ -664,7 +664,7 @@ class Manager(Gtk.Dialog, Gtk.Buildable):
 
                 if text and not Library().valid_tab_trigger(text):
                         img = self['image_tab_trigger']
-                        img.set_from_stock(Gtk.STOCK_DIALOG_ERROR, Gtk.IconSize.BUTTON)
+                        img.set_from_icon_name('dialog-error', Gtk.IconSize.BUTTON)
                         img.show()
 
                         #self['hbox_tab_trigger'].set_spacing(3)
@@ -787,8 +787,8 @@ class Manager(Gtk.Dialog, Gtk.Buildable):
         def on_import_snippets_button_clicked(self, button):
                 dlg = Gtk.FileChooserDialog(parent=self.get_toplevel(), title=_("Import snippets"),
                                 action=Gtk.FileChooserAction.OPEN,
-                                buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
-                                         Gtk.STOCK_OPEN, Gtk.ResponseType.OK))
+                                buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
+                                         _("_Open"), Gtk.ResponseType.OK))
 
                 dlg.add_filter(self.file_filter(_('All supported archives'), ('*.gz','*.bz2','*.tar', 
'*.xml')))
                 dlg.add_filter(self.file_filter(_('Gzip compressed archive'), ('*.tar.gz',)))
@@ -872,8 +872,8 @@ class Manager(Gtk.Dialog, Gtk.Buildable):
                 if not filename:
                         dlg = Gtk.FileChooserDialog(parent=self.get_toplevel(), title=_('Export snippets'),
                                         action=Gtk.FileChooserAction.SAVE,
-                                        buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
-                                                 Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
+                                        buttons=(_("_Cancel"), Gtk.ResponseType.CANCEL,
+                                                 _("_Save"), Gtk.ResponseType.OK))
 
                         dlg._export_snippets = export_snippets
                         dlg.add_filter(self.file_filter(_('All supported archives'), 
('*.gz','*.bz2','*.tar')))
@@ -910,8 +910,8 @@ class Manager(Gtk.Dialog, Gtk.Buildable):
 
                 dlg = Gtk.FileChooserDialog(parent=self.get_toplevel(), title=_('Export snippets'),
                                 action=Gtk.FileChooserAction.SAVE,
-                                buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
-                                         Gtk.STOCK_SAVE, Gtk.ResponseType.OK))
+                                buttons=(_('_Cancel'), Gtk.ResponseType.CANCEL,
+                                         _('_Save'), Gtk.ResponseType.OK))
 
                 dlg._export_snippets = snippets
 
diff --git a/plugins/spell/gedit-automatic-spell-checker.c b/plugins/spell/gedit-automatic-spell-checker.c
index 47013e8..86b9ec5 100644
--- a/plugins/spell/gedit-automatic-spell-checker.c
+++ b/plugins/spell/gedit-automatic-spell-checker.c
@@ -490,8 +490,8 @@ build_suggestion_menu (GeditAutomaticSpellChecker *spell, const gchar *word)
        /* Ignore all */
        mi = gtk_image_menu_item_new_with_mnemonic (_("_Ignore All"));
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),
-                                      gtk_image_new_from_stock (GTK_STOCK_GOTO_BOTTOM,
-                                                                GTK_ICON_SIZE_MENU));
+                                      gtk_image_new_from_icon_name ("go-bottom",
+                                                                    GTK_ICON_SIZE_MENU));
 
        g_signal_connect (mi,
                          "activate",
@@ -502,11 +502,11 @@ build_suggestion_menu (GeditAutomaticSpellChecker *spell, const gchar *word)
 
        gtk_menu_shell_append (GTK_MENU_SHELL (topmenu), mi);
 
-       /* + Add to Dictionary */
+       /* Add to Dictionary */
        mi = gtk_image_menu_item_new_with_mnemonic (_("_Add"));
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi),
-                                      gtk_image_new_from_stock (GTK_STOCK_ADD,
-                                                                GTK_ICON_SIZE_MENU));
+                                      gtk_image_new_from_icon_name ("list-add",
+                                                                    GTK_ICON_SIZE_MENU));
 
        g_signal_connect (mi,
                          "activate",
@@ -541,7 +541,7 @@ populate_popup (GtkTextView *textview, GtkMenu *menu, GeditAutomaticSpellChecker
        gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), mi);
 
        /* then, on top of it, the suggestions menu. */
-       img = gtk_image_new_from_stock (GTK_STOCK_SPELL_CHECK, GTK_ICON_SIZE_MENU);
+       img = gtk_image_new_from_icon_name ("tools-check-spelling", GTK_ICON_SIZE_MENU);
        mi = gtk_image_menu_item_new_with_mnemonic (_("_Spelling Suggestions..."));
        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (mi), img);
 
diff --git a/plugins/spell/gedit-spell-language-dialog.c b/plugins/spell/gedit-spell-language-dialog.c
index 9b8054b..c04bfc6 100644
--- a/plugins/spell/gedit-spell-language-dialog.c
+++ b/plugins/spell/gedit-spell-language-dialog.c
@@ -121,12 +121,9 @@ create_dialog (GeditSpellLanguageDialog *dlg,
        };
 
        gtk_dialog_add_buttons (GTK_DIALOG (dlg),
-                               GTK_STOCK_CANCEL,
-                               GTK_RESPONSE_CANCEL,
-                               GTK_STOCK_OK,
-                               GTK_RESPONSE_OK,
-                               GTK_STOCK_HELP,
-                               GTK_RESPONSE_HELP,
+                               _("_Cancel"), GTK_RESPONSE_CANCEL,
+                               _("_OK"), GTK_RESPONSE_CANCEL,
+                               _("_Help"), GTK_RESPONSE_HELP,
                                NULL);
 
        gtk_window_set_title (GTK_WINDOW (dlg), _("Set language"));


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