From 3de927d10965d65b9c43308b692ce6616947b20a Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Sun, 13 Jan 2013 14:41:25 -0500 Subject: [PATCH] Remove rhel compat get_system_shutdown_icon --- src/virtManager/config.py | 8 +------- src/virtManager/details.py | 4 ++-- src/virtManager/manager.py | 12 +++++------- src/virtManager/systray.py | 14 ++++++++------ src/virtManager/uihelpers.py | 15 +++++++++------ 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/virtManager/config.py b/src/virtManager/config.py index f503dd72e..2c543e48a 100644 --- a/src/virtManager/config.py +++ b/src/virtManager/config.py @@ -169,14 +169,8 @@ class vmmConfig(object): return False - # General app wide helpers (gconf agnostic) - def get_shutdown_icon_name(self): - theme = Gtk.IconTheme.get_default() - iconname = "system-shutdown" - if theme.has_icon(iconname): - return iconname - return "media-playback-stop" + # General app wide helpers (gconf agnostic) def get_appname(self): return self.appname diff --git a/src/virtManager/details.py b/src/virtManager/details.py index cf2402e3f..954e7521c 100644 --- a/src/virtManager/details.py +++ b/src/virtManager/details.py @@ -612,13 +612,13 @@ class vmmDetails(vmmGObjectUI): self.control_vm_destroy, self.control_vm_save) - icon_name = self.config.get_shutdown_icon_name() for name in ["details-menu-shutdown", "details-menu-reboot", "details-menu-reset", "details-menu-poweroff", "details-menu-destroy"]: - image = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU) + image = Gtk.Image.new_from_icon_name("system-shutdown", + Gtk.IconSize.MENU) self.widget(name).set_image(image) # Add HW popup menu diff --git a/src/virtManager/manager.py b/src/virtManager/manager.py index 7f1f9b483..c345bcc94 100644 --- a/src/virtManager/manager.py +++ b/src/virtManager/manager.py @@ -306,13 +306,11 @@ class vmmManager(vmmGObjectUI): def build_stock(name): return Gtk.Image.new_from_stock(name, Gtk.IconSize.MENU) - icon_name = self.config.get_shutdown_icon_name() - shutdownmenu_icon = build_icon(icon_name) - reboot_icon = build_icon(icon_name) - shutdown_icon = build_icon(icon_name) - destroy_icon = build_icon(icon_name) - reset_icon = build_icon(icon_name) - reset_icon = build_stock(icon_name) + shutdownmenu_icon = build_icon("system-shutdown") + reboot_icon = build_icon("system-shutdown") + shutdown_icon = build_icon("system-shutdown") + destroy_icon = build_icon("system-shutdown") + reset_icon = build_icon("system-shutdown") run_icon = build_stock(Gtk.STOCK_MEDIA_PLAY) pause_icon = build_stock(Gtk.STOCK_MEDIA_PAUSE) save_icon = build_stock(Gtk.STOCK_SAVE) diff --git a/src/virtManager/systray.py b/src/virtManager/systray.py index a2506ec50..1c0b02bd7 100644 --- a/src/virtManager/systray.py +++ b/src/virtManager/systray.py @@ -167,7 +167,6 @@ class vmmSystray(vmmGObject): def build_vm_menu(self, vm): icon_size = Gtk.IconSize.MENU - stop_icon = self.config.get_shutdown_icon_name() pause_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Pause")) pause_img = Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_PAUSE, icon_size) @@ -190,28 +189,30 @@ class vmmSystray(vmmGObject): # Shutdown menu reboot_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Reboot")) - reboot_img = Gtk.Image.new_from_icon_name(stop_icon, icon_size) + reboot_img = Gtk.Image.new_from_icon_name("system-shutdown", icon_size) reboot_item.set_image(reboot_img) reboot_item.connect("activate", self.run_vm_action, "action-reboot-domain", vm.get_uuid()) reboot_item.show() shutdown_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Shut Down")) - shutdown_img = Gtk.Image.new_from_icon_name(stop_icon, icon_size) + shutdown_img = Gtk.Image.new_from_icon_name("system-shutdown", + icon_size) shutdown_item.set_image(shutdown_img) shutdown_item.connect("activate", self.run_vm_action, "action-shutdown-domain", vm.get_uuid()) shutdown_item.show() reset_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Force Reset")) - reset_img = Gtk.Image.new_from_icon_name(stop_icon, icon_size) + reset_img = Gtk.Image.new_from_icon_name("system-shutdown", icon_size) reset_item.set_image(reset_img) reset_item.show() reset_item.connect("activate", self.run_vm_action, "action-reset-domain", vm.get_uuid()) destroy_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Force Off")) - destroy_img = Gtk.Image.new_from_icon_name(stop_icon, icon_size) + destroy_img = Gtk.Image.new_from_icon_name("system-shutdown", + icon_size) destroy_item.set_image(destroy_img) destroy_item.show() destroy_item.connect("activate", self.run_vm_action, @@ -223,7 +224,8 @@ class vmmSystray(vmmGObject): shutdown_menu.add(reset_item) shutdown_menu.add(destroy_item) shutdown_menu_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Shut Down")) - shutdown_menu_img = Gtk.Image.new_from_icon_name(stop_icon, icon_size) + shutdown_menu_img = Gtk.Image.new_from_icon_name("system-shutdown", + icon_size) shutdown_menu_item.set_image(shutdown_menu_img) shutdown_menu_item.set_submenu(shutdown_menu) diff --git a/src/virtManager/uihelpers.py b/src/virtManager/uihelpers.py index 9fbfe08a0..b1d651bac 100644 --- a/src/virtManager/uihelpers.py +++ b/src/virtManager/uihelpers.py @@ -842,15 +842,18 @@ def mediadev_set_default_selection(widget): def build_shutdown_button_menu(widget, shutdown_cb, reboot_cb, reset_cb, destroy_cb, save_cb): - icon_name = util.running_config.get_shutdown_icon_name() - widget.set_icon_name(icon_name) + widget.set_icon_name("system-shutdown") menu = Gtk.Menu() widget.set_menu(menu) - rebootimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU) - shutdownimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU) - resetimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU) - destroyimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU) + rebootimg = Gtk.Image.new_from_icon_name("system-shutdown", + Gtk.IconSize.MENU) + shutdownimg = Gtk.Image.new_from_icon_name("system-shutdown", + Gtk.IconSize.MENU) + destroyimg = Gtk.Image.new_from_icon_name("system-shutdown", + Gtk.IconSize.MENU) + resetimg = Gtk.Image.new_from_icon_name("system-shutdown", + Gtk.IconSize.MENU) saveimg = Gtk.Image.new_from_icon_name(Gtk.STOCK_SAVE, Gtk.IconSize.MENU) reboot = Gtk.ImageMenuItem.new_with_mnemonic(_("_Reboot"))