mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-26 10:03:54 +03:00
Lookup status icons based on libvirt constant, not the translatable(!) string
This commit is contained in:
parent
cf68b91069
commit
0c8c6f9d7a
@ -19,6 +19,7 @@
|
||||
import gconf
|
||||
|
||||
import gtk.gdk
|
||||
import libvirt
|
||||
|
||||
from virtManager.keyring import *
|
||||
|
||||
@ -39,16 +40,15 @@ class vmmConfig:
|
||||
self.keyring = None
|
||||
|
||||
self.status_icons = {
|
||||
"blocked": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_blocked.png", 18, 18),
|
||||
"crashed": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_crashed.png", 18, 18),
|
||||
"paused": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_paused.png", 18, 18),
|
||||
"running": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_running.png", 18, 18),
|
||||
"shutdown": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_shutdown.png", 18, 18),
|
||||
"shutoff": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_shutoff.png", 18, 18),
|
||||
"idle": gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_idle.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_BLOCKED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_blocked.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_CRASHED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_crashed.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_PAUSED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_paused.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_RUNNING: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_running.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_SHUTDOWN: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_shutdown.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_SHUTOFF: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_shutoff.png", 18, 18),
|
||||
libvirt.VIR_DOMAIN_NOSTATE: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_idle.png", 18, 18),
|
||||
}
|
||||
|
||||
|
||||
def get_vm_status_icon(self, state):
|
||||
return self.status_icons[state]
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
import gobject
|
||||
import libvirt
|
||||
|
||||
|
||||
class vmmDomain(gobject.GObject):
|
||||
__gsignals__ = {
|
||||
"status-changed": (gobject.SIGNAL_RUN_FIRST,
|
||||
@ -261,8 +262,7 @@ class vmmDomain(gobject.GObject):
|
||||
raise _("Unknown status code")
|
||||
|
||||
def run_status_icon(self):
|
||||
status = self.run_status()
|
||||
return self.config.get_vm_status_icon(status.lower())
|
||||
return self.config.get_vm_status_icon(self.status())
|
||||
|
||||
def get_console_info(self):
|
||||
# XXX don't hardcode me! need to really extract info from
|
||||
|
Loading…
x
Reference in New Issue
Block a user