mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
Added button to launch console from details window. Cleanup debug output
This commit is contained in:
parent
de407853b1
commit
6529609d4b
@ -48,7 +48,7 @@
|
||||
<signal name="activate" handler="on_menu_file_new_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image15">
|
||||
<widget class="GtkImage" id="image24">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-new</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"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image16">
|
||||
<widget class="GtkImage" id="image25">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-connect</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -94,6 +94,15 @@
|
||||
</widget>
|
||||
</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>
|
||||
<widget class="GtkImageMenuItem" id="menu_file_quit">
|
||||
<property name="visible">True</property>
|
||||
@ -119,12 +128,12 @@
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="menu_edit_details">
|
||||
<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>
|
||||
<signal name="activate" handler="on_menu_edit_details_activate" last_modification_time="Tue, 28 Mar 2006 17:06:34 GMT"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image17">
|
||||
<widget class="GtkImage" id="image26">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-properties</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"/>
|
||||
|
||||
<child internal-child="image">
|
||||
<widget class="GtkImage" id="image18">
|
||||
<widget class="GtkImage" id="image27">
|
||||
<property name="visible">True</property>
|
||||
<property name="stock">gtk-delete</property>
|
||||
<property name="icon_size">1</property>
|
||||
@ -691,6 +700,22 @@ Inactive virtual machines</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</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>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
@ -1368,7 +1393,7 @@ Inactive virtual machines</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label64">
|
||||
<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_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
@ -1647,7 +1672,7 @@ Inactive virtual machines</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label65">
|
||||
<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_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
@ -1694,7 +1719,7 @@ Inactive virtual machines</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label66">
|
||||
<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_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
@ -1741,7 +1766,7 @@ Inactive virtual machines</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label67">
|
||||
<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_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
|
@ -59,7 +59,7 @@ class vmmConnection(gobject.GObject):
|
||||
|
||||
def connect(self, name, callback):
|
||||
gobject.GObject.connect(self, name, callback)
|
||||
print "Cnnect " + name + " to " + str(callback)
|
||||
|
||||
if name == "vm-added":
|
||||
for uuid in self.vms.keys():
|
||||
self.emit("vm-added", self.uri, uuid)
|
||||
|
@ -104,8 +104,6 @@ class vmmConsole(gobject.GObject):
|
||||
def update_widget_states(self, vm, status):
|
||||
self.ignorePause = True
|
||||
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 ]:
|
||||
self.window.get_widget("control-run").set_sensitive(True)
|
||||
else:
|
||||
|
@ -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").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)
|
||||
|
||||
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_snapshot_clicked": self.control_vm_snapshot,
|
||||
"on_control_console_clicked": self.control_vm_console,
|
||||
})
|
||||
|
||||
self.change_graph_ranges()
|
||||
@ -174,6 +178,9 @@ class vmmDetails(gobject.GObject):
|
||||
def control_vm_terminal(self, src):
|
||||
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):
|
||||
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):
|
||||
self.ignorePause = True
|
||||
try:
|
||||
print "Update statu" + vm.run_status()
|
||||
if status in [ libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED ]:
|
||||
self.window.get_widget("control-run").set_sensitive(True)
|
||||
else:
|
||||
@ -227,7 +233,6 @@ class vmmDetails(gobject.GObject):
|
||||
self.window.get_widget("overview-status-icon").set_from_pixbuf(self.vm.run_status_icon())
|
||||
|
||||
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-memory-usage-text").set_text("%d MB of %d MB" % (self.vm.current_memory()/1024, self.vm.get_connection().host_memory_size()/1024))
|
||||
|
||||
|
@ -42,7 +42,7 @@ class vmmDomain(gobject.GObject):
|
||||
info = self.vm.info()
|
||||
status = info[0]
|
||||
status = self._normalize_status(status)
|
||||
print "Update status check " + str(status) + " old " + str(self.lastStatus)
|
||||
|
||||
if status != self.lastStatus:
|
||||
self.lastStatus = status
|
||||
self.emit("status-changed", status)
|
||||
@ -81,7 +81,7 @@ class vmmDomain(gobject.GObject):
|
||||
"maxMem": info[1],
|
||||
"maxMemPercent": pcentMaxMem,
|
||||
}
|
||||
print "Update " + str(newStats)
|
||||
|
||||
self.record.insert(0, newStats)
|
||||
|
||||
nSamples = 5
|
||||
@ -190,17 +190,14 @@ class vmmDomain(gobject.GObject):
|
||||
return vector
|
||||
|
||||
def shutdown(self):
|
||||
print "Do shutdown"
|
||||
self.vm.shutdown()
|
||||
self._update_status()
|
||||
|
||||
def suspend(self):
|
||||
print "Do suspend"
|
||||
self.vm.suspend()
|
||||
self._update_status()
|
||||
|
||||
def resume(self):
|
||||
print "Do resume"
|
||||
self.vm.resume()
|
||||
self._update_status()
|
||||
|
||||
|
@ -75,6 +75,7 @@ class vmmManager(gobject.GObject):
|
||||
"on_vm_manager_delete_event": self.close,
|
||||
"on_menu_file_open_connection_activate": self.open_connection,
|
||||
"on_menu_file_quit_activate": self.exit_app,
|
||||
"on_menu_file_close_activate": self.close,
|
||||
"on_vmm_close_clicked": self.close,
|
||||
"on_vm_details_clicked": self.show_vm_details,
|
||||
"on_vm_open_clicked": self.open_vm_console,
|
||||
@ -139,11 +140,9 @@ class vmmManager(gobject.GObject):
|
||||
break
|
||||
|
||||
def vm_status_changed(self, domain, status):
|
||||
print "Status changed"
|
||||
self.vm_updated(domain.get_uuid())
|
||||
|
||||
def vm_resources_sampled(self, domain):
|
||||
print "Resource sampled"
|
||||
self.vm_updated(domain.get_uuid())
|
||||
|
||||
def vm_updated(self, vmuuid):
|
||||
|
Loading…
Reference in New Issue
Block a user