mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Remove rhel compat get_system_shutdown_icon
This commit is contained in:
parent
cb512f61e7
commit
3de927d109
@ -169,14 +169,8 @@ class vmmConfig(object):
|
|||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# General app wide helpers (gconf agnostic)
|
|
||||||
|
|
||||||
def get_shutdown_icon_name(self):
|
# General app wide helpers (gconf agnostic)
|
||||||
theme = Gtk.IconTheme.get_default()
|
|
||||||
iconname = "system-shutdown"
|
|
||||||
if theme.has_icon(iconname):
|
|
||||||
return iconname
|
|
||||||
return "media-playback-stop"
|
|
||||||
|
|
||||||
def get_appname(self):
|
def get_appname(self):
|
||||||
return self.appname
|
return self.appname
|
||||||
|
@ -612,13 +612,13 @@ class vmmDetails(vmmGObjectUI):
|
|||||||
self.control_vm_destroy,
|
self.control_vm_destroy,
|
||||||
self.control_vm_save)
|
self.control_vm_save)
|
||||||
|
|
||||||
icon_name = self.config.get_shutdown_icon_name()
|
|
||||||
for name in ["details-menu-shutdown",
|
for name in ["details-menu-shutdown",
|
||||||
"details-menu-reboot",
|
"details-menu-reboot",
|
||||||
"details-menu-reset",
|
"details-menu-reset",
|
||||||
"details-menu-poweroff",
|
"details-menu-poweroff",
|
||||||
"details-menu-destroy"]:
|
"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)
|
self.widget(name).set_image(image)
|
||||||
|
|
||||||
# Add HW popup menu
|
# Add HW popup menu
|
||||||
|
@ -306,13 +306,11 @@ class vmmManager(vmmGObjectUI):
|
|||||||
def build_stock(name):
|
def build_stock(name):
|
||||||
return Gtk.Image.new_from_stock(name, Gtk.IconSize.MENU)
|
return Gtk.Image.new_from_stock(name, Gtk.IconSize.MENU)
|
||||||
|
|
||||||
icon_name = self.config.get_shutdown_icon_name()
|
shutdownmenu_icon = build_icon("system-shutdown")
|
||||||
shutdownmenu_icon = build_icon(icon_name)
|
reboot_icon = build_icon("system-shutdown")
|
||||||
reboot_icon = build_icon(icon_name)
|
shutdown_icon = build_icon("system-shutdown")
|
||||||
shutdown_icon = build_icon(icon_name)
|
destroy_icon = build_icon("system-shutdown")
|
||||||
destroy_icon = build_icon(icon_name)
|
reset_icon = build_icon("system-shutdown")
|
||||||
reset_icon = build_icon(icon_name)
|
|
||||||
reset_icon = build_stock(icon_name)
|
|
||||||
run_icon = build_stock(Gtk.STOCK_MEDIA_PLAY)
|
run_icon = build_stock(Gtk.STOCK_MEDIA_PLAY)
|
||||||
pause_icon = build_stock(Gtk.STOCK_MEDIA_PAUSE)
|
pause_icon = build_stock(Gtk.STOCK_MEDIA_PAUSE)
|
||||||
save_icon = build_stock(Gtk.STOCK_SAVE)
|
save_icon = build_stock(Gtk.STOCK_SAVE)
|
||||||
|
@ -167,7 +167,6 @@ class vmmSystray(vmmGObject):
|
|||||||
|
|
||||||
def build_vm_menu(self, vm):
|
def build_vm_menu(self, vm):
|
||||||
icon_size = Gtk.IconSize.MENU
|
icon_size = Gtk.IconSize.MENU
|
||||||
stop_icon = self.config.get_shutdown_icon_name()
|
|
||||||
|
|
||||||
pause_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Pause"))
|
pause_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Pause"))
|
||||||
pause_img = Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_PAUSE, icon_size)
|
pause_img = Gtk.Image.new_from_stock(Gtk.STOCK_MEDIA_PAUSE, icon_size)
|
||||||
@ -190,28 +189,30 @@ class vmmSystray(vmmGObject):
|
|||||||
|
|
||||||
# Shutdown menu
|
# Shutdown menu
|
||||||
reboot_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Reboot"))
|
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.set_image(reboot_img)
|
||||||
reboot_item.connect("activate", self.run_vm_action,
|
reboot_item.connect("activate", self.run_vm_action,
|
||||||
"action-reboot-domain", vm.get_uuid())
|
"action-reboot-domain", vm.get_uuid())
|
||||||
reboot_item.show()
|
reboot_item.show()
|
||||||
|
|
||||||
shutdown_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Shut Down"))
|
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.set_image(shutdown_img)
|
||||||
shutdown_item.connect("activate", self.run_vm_action,
|
shutdown_item.connect("activate", self.run_vm_action,
|
||||||
"action-shutdown-domain", vm.get_uuid())
|
"action-shutdown-domain", vm.get_uuid())
|
||||||
shutdown_item.show()
|
shutdown_item.show()
|
||||||
|
|
||||||
reset_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Force Reset"))
|
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.set_image(reset_img)
|
||||||
reset_item.show()
|
reset_item.show()
|
||||||
reset_item.connect("activate", self.run_vm_action,
|
reset_item.connect("activate", self.run_vm_action,
|
||||||
"action-reset-domain", vm.get_uuid())
|
"action-reset-domain", vm.get_uuid())
|
||||||
|
|
||||||
destroy_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Force Off"))
|
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.set_image(destroy_img)
|
||||||
destroy_item.show()
|
destroy_item.show()
|
||||||
destroy_item.connect("activate", self.run_vm_action,
|
destroy_item.connect("activate", self.run_vm_action,
|
||||||
@ -223,7 +224,8 @@ class vmmSystray(vmmGObject):
|
|||||||
shutdown_menu.add(reset_item)
|
shutdown_menu.add(reset_item)
|
||||||
shutdown_menu.add(destroy_item)
|
shutdown_menu.add(destroy_item)
|
||||||
shutdown_menu_item = Gtk.ImageMenuItem.new_with_mnemonic(_("_Shut Down"))
|
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_image(shutdown_menu_img)
|
||||||
shutdown_menu_item.set_submenu(shutdown_menu)
|
shutdown_menu_item.set_submenu(shutdown_menu)
|
||||||
|
|
||||||
|
@ -842,15 +842,18 @@ def mediadev_set_default_selection(widget):
|
|||||||
|
|
||||||
def build_shutdown_button_menu(widget, shutdown_cb, reboot_cb, reset_cb,
|
def build_shutdown_button_menu(widget, shutdown_cb, reboot_cb, reset_cb,
|
||||||
destroy_cb, save_cb):
|
destroy_cb, save_cb):
|
||||||
icon_name = util.running_config.get_shutdown_icon_name()
|
widget.set_icon_name("system-shutdown")
|
||||||
widget.set_icon_name(icon_name)
|
|
||||||
menu = Gtk.Menu()
|
menu = Gtk.Menu()
|
||||||
widget.set_menu(menu)
|
widget.set_menu(menu)
|
||||||
|
|
||||||
rebootimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
rebootimg = Gtk.Image.new_from_icon_name("system-shutdown",
|
||||||
shutdownimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
Gtk.IconSize.MENU)
|
||||||
resetimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
shutdownimg = Gtk.Image.new_from_icon_name("system-shutdown",
|
||||||
destroyimg = Gtk.Image.new_from_icon_name(icon_name, Gtk.IconSize.MENU)
|
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)
|
saveimg = Gtk.Image.new_from_icon_name(Gtk.STOCK_SAVE, Gtk.IconSize.MENU)
|
||||||
|
|
||||||
reboot = Gtk.ImageMenuItem.new_with_mnemonic(_("_Reboot"))
|
reboot = Gtk.ImageMenuItem.new_with_mnemonic(_("_Reboot"))
|
||||||
|
Loading…
Reference in New Issue
Block a user