Hooked up menus in console window
This commit is contained in:
parent
57a5b6645f
commit
a2590ff060
|
@ -2291,7 +2291,7 @@ Inactive virtual machines</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Run</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu-vm-run_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_run_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
|
@ -2301,7 +2301,7 @@ Inactive virtual machines</property>
|
|||
<property name="label" translatable="yes">_Pause</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="active">False</property>
|
||||
<signal name="activate" handler="on_menu-vm-pause_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_pause_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
|
@ -2310,7 +2310,7 @@ Inactive virtual machines</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Shutdown</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu-vm-shutdown_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_shutdown_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
|
@ -2325,7 +2325,7 @@ Inactive virtual machines</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">_Details</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu-vm-details_activate" last_modification_time="Mon, 03 Apr 2006 10:12:18 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_details_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
|
@ -2334,7 +2334,7 @@ Inactive virtual machines</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Take _Snapshot</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu-vm-snapshot_activate" last_modification_time="Mon, 03 Apr 2006 10:15:07 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_snapshot_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
|
@ -2343,7 +2343,7 @@ Inactive virtual machines</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Launch _Terminal</property>
|
||||
<property name="use_underline">True</property>
|
||||
<signal name="activate" handler="on_menu-vm-terminal_activate" last_modification_time="Mon, 03 Apr 2006 10:15:07 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_terminal_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
|
@ -2358,7 +2358,7 @@ Inactive virtual machines</property>
|
|||
<property name="visible">True</property>
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="activate" handler="on_menu-vm-close_activate" last_modification_time="Mon, 03 Apr 2006 10:15:07 GMT"/>
|
||||
<signal name="activate" handler="on_menu_vm_close_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
@ -2376,11 +2376,11 @@ Inactive virtual machines</property>
|
|||
<widget class="GtkMenu" id="menuitem9_menu">
|
||||
|
||||
<child>
|
||||
<widget class="GtkImageMenuItem" id="about2">
|
||||
<widget class="GtkImageMenuItem" id="menu-help-about">
|
||||
<property name="visible">True</property>
|
||||
<property name="label">gtk-about</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="activate" handler="on_about2_activate" last_modification_time="Mon, 03 Apr 2006 10:15:47 GMT"/>
|
||||
<signal name="activate" handler="on_menu_help_about_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
|
|
|
@ -82,10 +82,20 @@ class vmmConsole(gobject.GObject):
|
|||
"on_control_shutdown_clicked": self.control_vm_shutdown,
|
||||
"on_control_pause_toggled": self.control_vm_pause,
|
||||
|
||||
"on_menu_vm_run_activate": self.control_vm_run,
|
||||
"on_menu_vm_shutdown_activate": self.control_vm_shutdown,
|
||||
"on_menu_vm_pause_activate": self.control_vm_pause,
|
||||
|
||||
"on_control_terminal_clicked": self.control_vm_terminal,
|
||||
"on_control_snapshot_clicked": self.control_vm_snapshot,
|
||||
"on_control_details_clicked": self.control_vm_details,
|
||||
|
||||
"on_menu_vm_terminal_activate": self.control_vm_terminal,
|
||||
"on_menu_vm_snapshot_activate": self.control_vm_snapshot,
|
||||
"on_menu_vm_details_activate": self.control_vm_details,
|
||||
|
||||
"on_menu_vm_close_activate": self.close,
|
||||
|
||||
"on_console_auth_login_clicked": self.try_login,
|
||||
})
|
||||
|
||||
|
@ -178,23 +188,35 @@ class vmmConsole(gobject.GObject):
|
|||
try:
|
||||
if status in [ libvirt.VIR_DOMAIN_SHUTOFF, libvirt.VIR_DOMAIN_CRASHED ]:
|
||||
self.window.get_widget("control-run").set_sensitive(True)
|
||||
self.window.get_widget("menu-vm-run").set_sensitive(True)
|
||||
else:
|
||||
self.window.get_widget("control-run").set_sensitive(False)
|
||||
self.window.get_widget("menu-vm-run").set_sensitive(False)
|
||||
|
||||
if status in [ libvirt.VIR_DOMAIN_SHUTDOWN, libvirt.VIR_DOMAIN_SHUTOFF ,libvirt.VIR_DOMAIN_CRASHED ] or vm.is_read_only():
|
||||
self.window.get_widget("control-pause").set_sensitive(False)
|
||||
self.window.get_widget("control-shutdown").set_sensitive(False)
|
||||
self.window.get_widget("control-terminal").set_sensitive(False)
|
||||
self.window.get_widget("control-snapshot").set_sensitive(False)
|
||||
self.window.get_widget("menu-vm-pause").set_sensitive(False)
|
||||
self.window.get_widget("menu-vm-shutdown").set_sensitive(False)
|
||||
self.window.get_widget("menu-vm-terminal").set_sensitive(False)
|
||||
self.window.get_widget("menu-vm-snapshot").set_sensitive(False)
|
||||
else:
|
||||
self.window.get_widget("control-pause").set_sensitive(True)
|
||||
self.window.get_widget("control-shutdown").set_sensitive(True)
|
||||
self.window.get_widget("control-terminal").set_sensitive(True)
|
||||
self.window.get_widget("control-snapshot").set_sensitive(True)
|
||||
self.window.get_widget("menu-vm-pause").set_sensitive(True)
|
||||
self.window.get_widget("menu-vm-shutdown").set_sensitive(True)
|
||||
self.window.get_widget("menu-vm-terminal").set_sensitive(True)
|
||||
self.window.get_widget("menu-vm-snapshot").set_sensitive(True)
|
||||
if status == libvirt.VIR_DOMAIN_PAUSED:
|
||||
self.window.get_widget("control-pause").set_active(True)
|
||||
self.window.get_widget("menu-vm-pause").set_active(True)
|
||||
else:
|
||||
self.window.get_widget("control-pause").set_active(False)
|
||||
self.window.get_widget("menu-vm-pause").set_active(False)
|
||||
|
||||
if status in [ libvirt.VIR_DOMAIN_SHUTOFF ,libvirt.VIR_DOMAIN_CRASHED ] or vm.is_management_domain():
|
||||
self.window.get_widget("console-pages").set_current_page(0)
|
||||
|
|
Loading…
Reference in New Issue