Added button to launch console from details window. Cleanup debug output

This commit is contained in:
Daniel P. Berrange 2006-06-14 18:51:58 -04:00
parent de407853b1
commit 6529609d4b
6 changed files with 45 additions and 21 deletions

View File

@ -48,7 +48,7 @@
<signal name="activate" handler="on_menu_file_new_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/> <signal name="activate" handler="on_menu_file_new_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image15"> <widget class="GtkImage" id="image24">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-new</property> <property name="stock">gtk-new</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -75,7 +75,7 @@
<signal name="activate" handler="on_menu_file_open_connection_activate" last_modification_time="Mon, 12 Jun 2006 20:34:47 GMT"/> <signal name="activate" handler="on_menu_file_open_connection_activate" last_modification_time="Mon, 12 Jun 2006 20:34:47 GMT"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image16"> <widget class="GtkImage" id="image25">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-connect</property> <property name="stock">gtk-connect</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -94,6 +94,15 @@
</widget> </widget>
</child> </child>
<child>
<widget class="GtkImageMenuItem" id="menu_file_close">
<property name="visible">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_menu_file_close_activate" last_modification_time="Wed, 14 Jun 2006 22:45:26 GMT"/>
</widget>
</child>
<child> <child>
<widget class="GtkImageMenuItem" id="menu_file_quit"> <widget class="GtkImageMenuItem" id="menu_file_quit">
<property name="visible">True</property> <property name="visible">True</property>
@ -119,12 +128,12 @@
<child> <child>
<widget class="GtkImageMenuItem" id="menu_edit_details"> <widget class="GtkImageMenuItem" id="menu_edit_details">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">Machine details</property> <property name="label" translatable="yes">Machine details...</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
<signal name="activate" handler="on_menu_edit_details_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/> <signal name="activate" handler="on_menu_edit_details_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image17"> <widget class="GtkImage" id="image26">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-properties</property> <property name="stock">gtk-properties</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -145,7 +154,7 @@
<signal name="activate" handler="on_menu_edit_delete_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/> <signal name="activate" handler="on_menu_edit_delete_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/>
<child internal-child="image"> <child internal-child="image">
<widget class="GtkImage" id="image18"> <widget class="GtkImage" id="image27">
<property name="visible">True</property> <property name="visible">True</property>
<property name="stock">gtk-delete</property> <property name="stock">gtk-delete</property>
<property name="icon_size">1</property> <property name="icon_size">1</property>
@ -691,6 +700,22 @@ Inactive virtual machines</property>
<property name="homogeneous">True</property> <property name="homogeneous">True</property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkToolButton" id="control-console">
<property name="visible">True</property>
<property name="label" translatable="yes">Machine console</property>
<property name="use_underline">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<signal name="clicked" handler="on_control_console_clicked" last_modification_time="Wed, 14 Jun 2006 22:46:31 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
@ -1368,7 +1393,7 @@ Inactive virtual machines</property>
<child> <child>
<widget class="GtkLabel" id="label64"> <widget class="GtkLabel" id="label64">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label64</property> <property name="label" translatable="yes">Processor configuration not available</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
@ -1647,7 +1672,7 @@ Inactive virtual machines</property>
<child> <child>
<widget class="GtkLabel" id="label65"> <widget class="GtkLabel" id="label65">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label65</property> <property name="label" translatable="yes">Disk configuration not available</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
@ -1694,7 +1719,7 @@ Inactive virtual machines</property>
<child> <child>
<widget class="GtkLabel" id="label66"> <widget class="GtkLabel" id="label66">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label66</property> <property name="label" translatable="yes">Network configuration not available</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
@ -1741,7 +1766,7 @@ Inactive virtual machines</property>
<child> <child>
<widget class="GtkLabel" id="label67"> <widget class="GtkLabel" id="label67">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">label67</property> <property name="label" translatable="yes">New hardware configuration not available</property>
<property name="use_underline">False</property> <property name="use_underline">False</property>
<property name="use_markup">False</property> <property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property> <property name="justify">GTK_JUSTIFY_LEFT</property>

View File

@ -59,7 +59,7 @@ class vmmConnection(gobject.GObject):
def connect(self, name, callback): def connect(self, name, callback):
gobject.GObject.connect(self, name, callback) gobject.GObject.connect(self, name, callback)
print "Cnnect " + name + " to " + str(callback)
if name == "vm-added": if name == "vm-added":
for uuid in self.vms.keys(): for uuid in self.vms.keys():
self.emit("vm-added", self.uri, uuid) self.emit("vm-added", self.uri, uuid)

View File

@ -104,8 +104,6 @@ class vmmConsole(gobject.GObject):
def update_widget_states(self, vm, status): def update_widget_states(self, vm, status):
self.ignorePause = True self.ignorePause = True
try: try:
print "Hell " + str(self) + " " + str(self.vm)
print "Update statu" + vm.run_status()
if status in [ libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED ]: if status in [ libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED ]:
self.window.get_widget("control-run").set_sensitive(True) self.window.get_widget("control-run").set_sensitive(True)
else: else:

View File

@ -50,6 +50,9 @@ class vmmDetails(gobject.GObject):
self.window.get_widget("control-snapshot").set_icon_widget(gtk.Image()) self.window.get_widget("control-snapshot").set_icon_widget(gtk.Image())
self.window.get_widget("control-snapshot").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_snapshot.png") self.window.get_widget("control-snapshot").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_snapshot.png")
self.window.get_widget("control-console").set_icon_widget(gtk.Image())
#self.window.get_widget("control-console").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_snapshot.png")
self.window.get_widget("hw-panel").set_show_tabs(False) self.window.get_widget("hw-panel").set_show_tabs(False)
hwListModel = gtk.ListStore(int, str, gtk.gdk.Pixbuf) hwListModel = gtk.ListStore(int, str, gtk.gdk.Pixbuf)
@ -113,6 +116,7 @@ class vmmDetails(gobject.GObject):
"on_control_terminal_clicked": self.control_vm_terminal, "on_control_terminal_clicked": self.control_vm_terminal,
"on_control_snapshot_clicked": self.control_vm_snapshot, "on_control_snapshot_clicked": self.control_vm_snapshot,
"on_control_console_clicked": self.control_vm_console,
}) })
self.change_graph_ranges() self.change_graph_ranges()
@ -174,6 +178,9 @@ class vmmDetails(gobject.GObject):
def control_vm_terminal(self, src): def control_vm_terminal(self, src):
self.emit("action-launch-terminal", self.vm.get_connection().get_uri(), self.vm.get_uuid()) self.emit("action-launch-terminal", self.vm.get_connection().get_uri(), self.vm.get_uuid())
def control_vm_console(self, src):
self.emit("action-show-console", self.vm.get_connection().get_uri(), self.vm.get_uuid())
def control_vm_snapshot(self, src): def control_vm_snapshot(self, src):
self.emit("action-take-snapshot", self.vm.get_connection().get_uri(), self.vm.get_uuid()) self.emit("action-take-snapshot", self.vm.get_connection().get_uri(), self.vm.get_uuid())
@ -199,7 +206,6 @@ class vmmDetails(gobject.GObject):
def update_widget_states(self, vm, status): def update_widget_states(self, vm, status):
self.ignorePause = True self.ignorePause = True
try: try:
print "Update statu" + vm.run_status()
if status in [ libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED ]: if status in [ libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED ]:
self.window.get_widget("control-run").set_sensitive(True) self.window.get_widget("control-run").set_sensitive(True)
else: else:
@ -227,7 +233,6 @@ class vmmDetails(gobject.GObject):
self.window.get_widget("overview-status-icon").set_from_pixbuf(self.vm.run_status_icon()) self.window.get_widget("overview-status-icon").set_from_pixbuf(self.vm.run_status_icon())
def refresh_resources(self, vm): def refresh_resources(self, vm):
print "In details refresh"
self.window.get_widget("overview-cpu-usage-text").set_text("%d %%" % self.vm.cpu_time_percentage()) self.window.get_widget("overview-cpu-usage-text").set_text("%d %%" % self.vm.cpu_time_percentage())
self.window.get_widget("overview-memory-usage-text").set_text("%d MB of %d MB" % (self.vm.current_memory()/1024, self.vm.get_connection().host_memory_size()/1024)) self.window.get_widget("overview-memory-usage-text").set_text("%d MB of %d MB" % (self.vm.current_memory()/1024, self.vm.get_connection().host_memory_size()/1024))

View File

@ -42,7 +42,7 @@ class vmmDomain(gobject.GObject):
info = self.vm.info() info = self.vm.info()
status = info[0] status = info[0]
status = self._normalize_status(status) status = self._normalize_status(status)
print "Update status check " + str(status) + " old " + str(self.lastStatus)
if status != self.lastStatus: if status != self.lastStatus:
self.lastStatus = status self.lastStatus = status
self.emit("status-changed", status) self.emit("status-changed", status)
@ -81,7 +81,7 @@ class vmmDomain(gobject.GObject):
"maxMem": info[1], "maxMem": info[1],
"maxMemPercent": pcentMaxMem, "maxMemPercent": pcentMaxMem,
} }
print "Update " + str(newStats)
self.record.insert(0, newStats) self.record.insert(0, newStats)
nSamples = 5 nSamples = 5
@ -190,17 +190,14 @@ class vmmDomain(gobject.GObject):
return vector return vector
def shutdown(self): def shutdown(self):
print "Do shutdown"
self.vm.shutdown() self.vm.shutdown()
self._update_status() self._update_status()
def suspend(self): def suspend(self):
print "Do suspend"
self.vm.suspend() self.vm.suspend()
self._update_status() self._update_status()
def resume(self): def resume(self):
print "Do resume"
self.vm.resume() self.vm.resume()
self._update_status() self._update_status()

View File

@ -75,6 +75,7 @@ class vmmManager(gobject.GObject):
"on_vm_manager_delete_event": self.close, "on_vm_manager_delete_event": self.close,
"on_menu_file_open_connection_activate": self.open_connection, "on_menu_file_open_connection_activate": self.open_connection,
"on_menu_file_quit_activate": self.exit_app, "on_menu_file_quit_activate": self.exit_app,
"on_menu_file_close_activate": self.close,
"on_vmm_close_clicked": self.close, "on_vmm_close_clicked": self.close,
"on_vm_details_clicked": self.show_vm_details, "on_vm_details_clicked": self.show_vm_details,
"on_vm_open_clicked": self.open_vm_console, "on_vm_open_clicked": self.open_vm_console,
@ -139,11 +140,9 @@ class vmmManager(gobject.GObject):
break break
def vm_status_changed(self, domain, status): def vm_status_changed(self, domain, status):
print "Status changed"
self.vm_updated(domain.get_uuid()) self.vm_updated(domain.get_uuid())
def vm_resources_sampled(self, domain): def vm_resources_sampled(self, domain):
print "Resource sampled"
self.vm_updated(domain.get_uuid()) self.vm_updated(domain.get_uuid())
def vm_updated(self, vmuuid): def vm_updated(self, vmuuid):