[gnome-boxes] Drop usage of deprecated Gtk.Stock.* API



commit 4d026d6811558af80ca6663d52fee9673e7461e1
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Mon Sep 2 19:33:54 2013 +0300

    Drop usage of deprecated Gtk.Stock.* API

 src/app.vala                        |    2 +-
 src/libvirt-machine-properties.vala |   14 +++++++-------
 src/notificationbar.vala            |    2 +-
 src/wizard-source.vala              |    4 ++--
 src/wizard.vala                     |    2 +-
 5 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/src/app.vala b/src/app.vala
index 3b0ca8e..87cba6d 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -863,7 +863,7 @@ private class Boxes.App: Boxes.UI {
             }
         };
 
-        notificationbar.display_for_action (message, Gtk.Stock.UNDO, (owned) undo, (owned) really_remove);
+        notificationbar.display_for_action (message, "_Undo", (owned) undo, (owned) really_remove);
     }
 
     private bool on_key_pressed (Widget widget, Gdk.EventKey event) {
diff --git a/src/libvirt-machine-properties.vala b/src/libvirt-machine-properties.vala
index cc5645f..22a9610 100644
--- a/src/libvirt-machine-properties.vala
+++ b/src/libvirt-machine-properties.vala
@@ -136,9 +136,9 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                 var dialog = new Gtk.Dialog.with_buttons (_("Troubleshooting log"),
                                                           App.app.window,
                                                           DialogFlags.DESTROY_WITH_PARENT,
-                                                          Stock.SAVE, 100,
+                                                          _("_Save"), 100,
                                                           _("Copy to clipboard"), 101,
-                                                          Stock.CLOSE, ResponseType.OK);
+                                                          _("_Close"), ResponseType.OK);
                 dialog.set_default_size (640, 480);
                 var text = new Gtk.TextView ();
                 text.editable = false;
@@ -154,7 +154,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                     if (response_id == 100) {
                         var chooser = new Gtk.FileChooserDialog (_("Save log"), App.app.window,
                                                                  Gtk.FileChooserAction.SAVE,
-                                                                 Stock.SAVE, ResponseType.OK);
+                                                                 _("_Save"), ResponseType.OK);
                         chooser.local_only = false;
                         chooser.do_overwrite_confirmation = true;
                         chooser.response.connect ((response_id) => {
@@ -307,8 +307,8 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
                 var dialog = new Gtk.FileChooserDialog (_("Select a device or ISO file"),
                                                         App.app.window,
                                                         Gtk.FileChooserAction.OPEN,
-                                                        Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL,
-                                                        Gtk.Stock.OPEN, Gtk.ResponseType.ACCEPT);
+                                                        _("_Cancel"), Gtk.ResponseType.CANCEL,
+                                                        _("_Open"), Gtk.ResponseType.ACCEPT);
                 dialog.modal = true;
                 dialog.show_hidden = false;
                 dialog.local_only = true;
@@ -457,7 +457,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
             return;
 
         var message = _("Changes require restart of '%s'. Attempt restart?").printf (machine.name);
-        App.app.notificationbar.display_for_action (message, Gtk.Stock.YES, reboot);
+        App.app.notificationbar.display_for_action (message, _("_Yes"), reboot);
     }
 
     private void reboot () {
@@ -513,7 +513,7 @@ private class Boxes.LibvirtMachineProperties: GLib.Object, Boxes.IPropertiesProv
 
             var message = _("Restart of '%s' is taking too long. Force it to shutdown?").printf 
(machine.name);
             notification = App.app.notificationbar.display_for_action (message,
-                                                                       Gtk.Stock.YES,
+                                                                       _("_Yes"),
                                                                        (owned) really_force_shutdown,
                                                                        null,
                                                                        -1);
diff --git a/src/notificationbar.vala b/src/notificationbar.vala
index c330ab3..dcbfca9 100644
--- a/src/notificationbar.vala
+++ b/src/notificationbar.vala
@@ -193,7 +193,7 @@ private class Boxes.Notificationbar: GLib.Object {
         grid.add (message_label);
 
         if (ok_label != null) {
-            var ok_button = new Button.from_stock (ok_label);
+            var ok_button = new Button.with_mnemonic (ok_label);
             ok_button.halign = Gtk.Align.END;
             grid.add (ok_button);
 
diff --git a/src/wizard-source.vala b/src/wizard-source.vala
index cf3a25a..98f7466 100644
--- a/src/wizard-source.vala
+++ b/src/wizard-source.vala
@@ -303,8 +303,8 @@ private class Boxes.WizardSource: GLib.Object {
         var dialog = new Gtk.FileChooserDialog (_("Select a device or ISO file"),
                                                 App.app.window,
                                                 Gtk.FileChooserAction.OPEN,
-                                                Gtk.Stock.CANCEL, Gtk.ResponseType.CANCEL,
-                                                Gtk.Stock.OPEN, Gtk.ResponseType.ACCEPT);
+                                                _("_Cancel"), Gtk.ResponseType.CANCEL,
+                                                _("_Open"), Gtk.ResponseType.ACCEPT);
         dialog.show_hidden = false;
         dialog.filter = new Gtk.FileFilter ();
         dialog.filter.add_mime_type ("application/x-cd-image");
diff --git a/src/wizard.vala b/src/wizard.vala
index c7bbdde..87628a6 100644
--- a/src/wizard.vala
+++ b/src/wizard.vala
@@ -633,7 +633,7 @@ private class Boxes.Wizard: Boxes.UI {
         nokvm_infobar.halign = Gtk.Align.FILL;
         nokvm_infobar.spacing = 10;
         var container = nokvm_infobar.get_content_area () as Gtk.Container;
-        var image = new Gtk.Image.from_stock (Gtk.Stock.DIALOG_WARNING, Gtk.IconSize.LARGE_TOOLBAR);
+        var image = new Gtk.Image.from_icon_name ("dialog-warning", Gtk.IconSize.LARGE_TOOLBAR);
         container.add (image);
         label = new Gtk.Label (_("Virtualization extensions are unavailable on your system. If your system 
is recent (post 2008), check your BIOS settings to enable them."));
         label.wrap = true;


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