Remove rhel compat get_system_shutdown_icon

This commit is contained in:
Cole Robinson 2013-01-13 14:41:25 -05:00
parent cb512f61e7
commit 3de927d109
5 changed files with 25 additions and 28 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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)

View File

@ -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"))