0c96ca8237
tweaks Generate better errors if disk/net stats polling fails
250 lines
11 KiB
Diff
250 lines
11 KiB
Diff
# HG changeset patch
|
|
# User Cole Robinson <crobinso@redhat.com>
|
|
# Date 1253201058 14400
|
|
# Node ID a6f055361d165bea5fbb3c62ec54a820987a7dde
|
|
# Parent 1c886d1863f72e7ddd5fb99050362296be6a9deb
|
|
Update new VM status icons.
|
|
|
|
Previous round didn't convey state very well, and looked too much like
|
|
buttons.
|
|
|
|
diff -r 1c886d1863f7 -r a6f055361d16 pixmaps/state_paused.png
|
|
Binary file pixmaps/state_paused.png has changed
|
|
diff -r 1c886d1863f7 -r a6f055361d16 pixmaps/state_running.png
|
|
Binary file pixmaps/state_running.png has changed
|
|
diff -r 1c886d1863f7 -r a6f055361d16 pixmaps/state_shutoff.png
|
|
Binary file pixmaps/state_shutoff.png has changed
|
|
diff -r 1c886d1863f7 -r a6f055361d16 src/virtManager/config.py
|
|
--- a/src/virtManager/config.py Wed Sep 16 16:02:19 2009 -0400
|
|
+++ b/src/virtManager/config.py Thu Sep 17 11:24:18 2009 -0400
|
|
@@ -90,7 +90,16 @@
|
|
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_running.png", 18, 18),
|
|
}
|
|
- #initialize the help stuff
|
|
+ self.status_icons_large = {
|
|
+ libvirt.VIR_DOMAIN_BLOCKED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_running.png", 32, 32),
|
|
+ libvirt.VIR_DOMAIN_CRASHED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_crashed.png", 32, 32),
|
|
+ libvirt.VIR_DOMAIN_PAUSED: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_paused.png", 32, 32),
|
|
+ libvirt.VIR_DOMAIN_RUNNING: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_running.png", 32, 32),
|
|
+ libvirt.VIR_DOMAIN_SHUTDOWN: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_shutoff.png", 32, 32),
|
|
+ libvirt.VIR_DOMAIN_SHUTOFF: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_shutoff.png", 32, 32),
|
|
+ libvirt.VIR_DOMAIN_NOSTATE: gtk.gdk.pixbuf_new_from_file_at_size(self.get_icon_dir() + "/state_running.png", 32, 32),
|
|
+ }
|
|
+
|
|
props = { gnome.PARAM_APP_DATADIR : self.get_data_dir()}
|
|
gnome.program_init(self.get_appname(), self.get_appversion(), \
|
|
properties=props)
|
|
@@ -100,6 +109,9 @@
|
|
def get_vm_status_icon(self, state):
|
|
return self.status_icons[state]
|
|
|
|
+ def get_vm_status_icon_large(self, state):
|
|
+ return self.status_icons_large[state]
|
|
+
|
|
def get_shutdown_icon_name(self):
|
|
theme = gtk.icon_theme_get_default()
|
|
if theme.has_icon("system-shutdown"):
|
|
diff -r 1c886d1863f7 -r a6f055361d16 src/virtManager/domain.py
|
|
--- a/src/virtManager/domain.py Wed Sep 16 16:02:19 2009 -0400
|
|
+++ b/src/virtManager/domain.py Thu Sep 17 11:24:18 2009 -0400
|
|
@@ -728,6 +728,8 @@
|
|
|
|
def run_status_icon(self):
|
|
return self.config.get_vm_status_icon(self.status())
|
|
+ def run_status_icon_large(self):
|
|
+ return self.config.get_vm_status_icon_large(self.status())
|
|
|
|
def _is_serial_console_tty_accessible(self, path):
|
|
# pty serial scheme doesn't work over remote
|
|
diff -r 1c886d1863f7 -r a6f055361d16 src/virtManager/manager.py
|
|
--- a/src/virtManager/manager.py Wed Sep 16 16:02:19 2009 -0400
|
|
+++ b/src/virtManager/manager.py Thu Sep 17 11:24:18 2009 -0400
|
|
@@ -493,7 +493,7 @@
|
|
row.insert(ROW_NAME, vm.get_name())
|
|
row.insert(ROW_MARKUP, row[ROW_NAME])
|
|
row.insert(ROW_STATUS, vm.run_status())
|
|
- row.insert(ROW_STATUS_ICON, vm.run_status_icon())
|
|
+ row.insert(ROW_STATUS_ICON, vm.run_status_icon_large())
|
|
row.insert(ROW_KEY, vm.get_uuid())
|
|
row.insert(ROW_HINT, None)
|
|
row.insert(ROW_IS_CONN, False)
|
|
@@ -575,7 +575,7 @@
|
|
|
|
row = self.rows[self.vm_row_key(vm)]
|
|
row[ROW_STATUS] = vm.run_status()
|
|
- row[ROW_STATUS_ICON] = vm.run_status_icon()
|
|
+ row[ROW_STATUS_ICON] = vm.run_status_icon_large()
|
|
row[ROW_IS_VM_RUNNING] = vm.is_active()
|
|
model.row_changed(row.path, row.iter)
|
|
|
|
@@ -850,7 +850,6 @@
|
|
statusCol.add_attribute(status_icon, 'cell-background', ROW_COLOR)
|
|
statusCol.add_attribute(status_icon, 'pixbuf', ROW_STATUS_ICON)
|
|
statusCol.add_attribute(status_icon, 'visible', ROW_IS_VM)
|
|
- statusCol.add_attribute(status_icon, 'sensitive', ROW_IS_VM_RUNNING)
|
|
|
|
name_txt = gtk.CellRendererText()
|
|
nameCol.pack_start(name_txt, True)
|
|
# HG changeset patch
|
|
# User Cole Robinson <crobinso@redhat.com>
|
|
# Date 1253205341 14400
|
|
# Node ID cdbe1da3ce75a5ad06b8e07e891ac35d1b246685
|
|
# Parent a6f055361d165bea5fbb3c62ec54a820987a7dde
|
|
Change VM name text arrangement in manager view.
|
|
|
|
Shrink text size, add a second row that shows the VM status. Fills the
|
|
display up a bit so it doesn't look so sparse.
|
|
|
|
diff -r a6f055361d16 -r cdbe1da3ce75 src/virtManager/manager.py
|
|
--- a/src/virtManager/manager.py Thu Sep 17 11:24:18 2009 -0400
|
|
+++ b/src/virtManager/manager.py Thu Sep 17 12:35:41 2009 -0400
|
|
@@ -486,12 +486,26 @@
|
|
else:
|
|
self.emit("action-refresh-console", uri, vmuuid)
|
|
|
|
+ def _build_conn_markup(self, conn, row):
|
|
+ if conn.state == conn.STATE_DISCONNECTED:
|
|
+ markup = ("<span font='9' color='#5b5b5b'>%s - "
|
|
+ "Not Connected</span>" % row[ROW_NAME])
|
|
+ else:
|
|
+ markup = ("<span font='9'>%s</span>" % row[ROW_NAME])
|
|
+ return markup
|
|
+
|
|
+ def _build_vm_markup(self, vm, row):
|
|
+ markup = ("<span font='10'>%s</span>\n"
|
|
+ "<span font='9' color='#989898'>%s</span>" %
|
|
+ (row[ROW_NAME], row[ROW_STATUS]))
|
|
+ return markup
|
|
+
|
|
def _append_vm(self, model, vm, conn):
|
|
parent = self.rows[conn.get_uri()].iter
|
|
row = []
|
|
row.insert(ROW_HANDLE, vm)
|
|
row.insert(ROW_NAME, vm.get_name())
|
|
- row.insert(ROW_MARKUP, row[ROW_NAME])
|
|
+ row.insert(ROW_MARKUP, "")
|
|
row.insert(ROW_STATUS, vm.run_status())
|
|
row.insert(ROW_STATUS_ICON, vm.run_status_icon_large())
|
|
row.insert(ROW_KEY, vm.get_uuid())
|
|
@@ -502,6 +516,8 @@
|
|
row.insert(ROW_IS_VM_RUNNING, vm.is_active())
|
|
row.insert(ROW_COLOR, "white")
|
|
|
|
+ row[ROW_MARKUP] = self._build_vm_markup(vm, row)
|
|
+
|
|
_iter = model.append(parent, row)
|
|
path = model.get_path(_iter)
|
|
self.rows[self.vm_row_key(vm)] = model[path]
|
|
@@ -512,12 +528,7 @@
|
|
row = []
|
|
row.insert(ROW_HANDLE, conn)
|
|
row.insert(ROW_NAME, conn.get_pretty_desc_inactive(False))
|
|
- if conn.state == conn.STATE_DISCONNECTED:
|
|
- markup = ("<span font='9.5' color='#5b5b5b'>%s - "
|
|
- "Not Connected</span>" % row[ROW_NAME])
|
|
- else:
|
|
- markup = ("<span font='9.5'>%s</span>" % row[ROW_NAME])
|
|
- row.insert(ROW_MARKUP, markup)
|
|
+ row.insert(ROW_MARKUP, self._build_conn_markup(conn, row))
|
|
row.insert(ROW_STATUS, ("<span font='9'>%s</span>" %
|
|
conn.get_state_text()))
|
|
row.insert(ROW_STATUS_ICON, None)
|
|
@@ -589,12 +600,7 @@
|
|
model = vmlist.get_model()
|
|
row = self.rows[conn.get_uri()]
|
|
|
|
- if conn.state == conn.STATE_DISCONNECTED:
|
|
- markup = ("<span font='9.5' color='#5b5b5b'>%s - "
|
|
- "Not Connected</span>" % row[ROW_NAME])
|
|
- else:
|
|
- markup = ("<span font='9.5'>%s</span>" % row[ROW_NAME])
|
|
- row[ROW_MARKUP] = markup
|
|
+ row[ROW_MARKUP] = self._build_conn_markup(conn, row)
|
|
row[ROW_STATUS] = "<span font='9'>%s</span>" % conn.get_state_text()
|
|
row[ROW_IS_CONN_CONNECTED] = conn.state != conn.STATE_DISCONNECTED
|
|
|
|
# HG changeset patch
|
|
# User Cole Robinson <crobinso@redhat.com>
|
|
# Date 1253201111 14400
|
|
# Node ID 739a6876af4692d6f86d8813f6dd3aa046bf6a8b
|
|
# Parent cdbe1da3ce75a5ad06b8e07e891ac35d1b246685
|
|
Drop row coloring for managed connection rows.
|
|
|
|
Looks kind of funky with lots of dark colored rows for a user with multiple
|
|
connections.
|
|
|
|
diff -r cdbe1da3ce75 -r 739a6876af46 src/virtManager/manager.py
|
|
--- a/src/virtManager/manager.py Thu Sep 17 12:35:41 2009 -0400
|
|
+++ b/src/virtManager/manager.py Thu Sep 17 11:25:11 2009 -0400
|
|
@@ -49,8 +49,6 @@
|
|
ROW_IS_CONN_CONNECTED = 8
|
|
ROW_IS_VM = 9
|
|
ROW_IS_VM_RUNNING = 10
|
|
-ROW_COLOR = 11
|
|
-ROW_HEIGHT = 12
|
|
|
|
# Columns in the tree view
|
|
COL_NAME = 0
|
|
@@ -514,7 +512,6 @@
|
|
row.insert(ROW_IS_CONN_CONNECTED, True)
|
|
row.insert(ROW_IS_VM, True)
|
|
row.insert(ROW_IS_VM_RUNNING, vm.is_active())
|
|
- row.insert(ROW_COLOR, "white")
|
|
|
|
row[ROW_MARKUP] = self._build_vm_markup(vm, row)
|
|
|
|
@@ -539,7 +536,6 @@
|
|
conn.state != conn.STATE_DISCONNECTED)
|
|
row.insert(ROW_IS_VM, False)
|
|
row.insert(ROW_IS_VM_RUNNING, False)
|
|
- row.insert(ROW_COLOR, "#d4d2d2")
|
|
|
|
_iter = model.append(None, row)
|
|
path = model.get_path(_iter)
|
|
@@ -823,9 +819,9 @@
|
|
vmlist = self.window.get_widget("vm-list")
|
|
|
|
# Handle, name, markup, status, status icon, key/uuid, hint, is conn,
|
|
- # is conn connected, is vm, is vm running, color
|
|
+ # is conn connected, is vm, is vm running
|
|
model = gtk.TreeStore(object, str, str, str, gtk.gdk.Pixbuf, str, str,
|
|
- bool, bool, bool, bool, str)
|
|
+ bool, bool, bool, bool)
|
|
vmlist.set_model(model)
|
|
util.tooltip_wrapper(vmlist, ROW_HINT, "set_tooltip_column")
|
|
|
|
@@ -834,7 +830,7 @@
|
|
|
|
nameCol = gtk.TreeViewColumn(_("Name"))
|
|
nameCol.set_expand(True)
|
|
- nameCol.set_spacing(12)
|
|
+ nameCol.set_spacing(6)
|
|
cpuUsageCol = gtk.TreeViewColumn(_("CPU usage"))
|
|
cpuUsageCol.set_min_width(150)
|
|
|
|
@@ -853,13 +849,11 @@
|
|
|
|
status_icon = gtk.CellRendererPixbuf()
|
|
statusCol.pack_start(status_icon, False)
|
|
- statusCol.add_attribute(status_icon, 'cell-background', ROW_COLOR)
|
|
statusCol.add_attribute(status_icon, 'pixbuf', ROW_STATUS_ICON)
|
|
statusCol.add_attribute(status_icon, 'visible', ROW_IS_VM)
|
|
|
|
name_txt = gtk.CellRendererText()
|
|
nameCol.pack_start(name_txt, True)
|
|
- nameCol.add_attribute(name_txt, 'cell-background', ROW_COLOR)
|
|
nameCol.add_attribute(name_txt, 'markup', ROW_MARKUP)
|
|
nameCol.set_sort_column_id(VMLIST_SORT_NAME)
|
|
|
|
@@ -870,9 +864,7 @@
|
|
cpuUsage_img.set_property("reversed", True)
|
|
cpuUsageCol.pack_start(cpuUsage_img, True)
|
|
cpuUsageCol.pack_start(cpuUsage_txt, False)
|
|
- cpuUsageCol.add_attribute(cpuUsage_img, 'cell-background', ROW_COLOR)
|
|
cpuUsageCol.add_attribute(cpuUsage_img, 'visible', ROW_IS_VM)
|
|
- cpuUsageCol.add_attribute(cpuUsage_txt, 'cell-background', ROW_COLOR)
|
|
cpuUsageCol.add_attribute(cpuUsage_txt, 'visible', ROW_IS_CONN)
|
|
cpuUsageCol.set_sort_column_id(VMLIST_SORT_STATS)
|
|
self.stats_sparkline = cpuUsage_img
|