various UI tweaks for the graphical console to match the HIG as well as

to be a little cleaner looking
This commit is contained in:
Jeremy Katz 2006-09-01 10:49:46 -04:00
parent 53a13dc622
commit ecb202e391
3 changed files with 74 additions and 161 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 814 B

After

Width:  |  Height:  |  Size: 792 B

View File

@ -599,7 +599,7 @@ Inactive virtual machines</property>
<widget class="GtkAboutDialog" id="vmm-about">
<property name="visible">True</property>
<property name="destroy_with_parent">False</property>
<property name="destroy_with_parent">True</property>
<property name="name" translatable="yes">Virtual Machine Manager</property>
<property name="copyright" translatable="yes">Copyright (C) 2006 Red Hat Inc.</property>
<property name="comments" translatable="yes"></property>
@ -3090,21 +3090,6 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-details">
<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="Fri, 14 Jul 2006 14:26:39 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-save">
<property name="visible">True</property>
@ -3115,16 +3100,22 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
</child>
<child>
<widget class="GtkMenuItem" id="menu-vm-terminal">
<widget class="GtkSeparatorMenuItem" id="separatormenuitem2">
<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="Fri, 14 Jul 2006 14:26:39 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator3">
<widget class="GtkMenuItem" id="menu-vm-screenshot">
<property name="visible">True</property>
<property name="label" translatable="yes">_Take Screenshot</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu_vm_screenshot_activate" last_modification_time="Fri, 01 Sep 2006 14:48:05 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator6">
<property name="visible">True</property>
</widget>
</child>
@ -3143,20 +3134,55 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
</child>
<child>
<widget class="GtkMenuItem" id="menuitem9">
<widget class="GtkMenuItem" id="view1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
<property name="label" translatable="yes">View</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menuitem9_menu">
<widget class="GtkMenu" id="view1_menu">
<child>
<widget class="GtkImageMenuItem" id="menu-help-about">
<widget class="GtkMenuItem" id="menu-view-details">
<property name="visible">True</property>
<property name="label">gtk-about</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_menu_help_about_activate" last_modification_time="Fri, 14 Jul 2006 14:26:39 GMT"/>
<property name="label" translatable="yes">_Details</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu_view_details_activate" last_modification_time="Fri, 01 Sep 2006 14:33:18 GMT"/>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="menu-view-fullscreen">
<property name="visible">True</property>
<property name="label" translatable="yes">_FullScreen</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="on_menu_view_fullscreen_activate" last_modification_time="Fri, 01 Sep 2006 14:33:18 GMT"/>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu-view-serial">
<property name="visible">True</property>
<property name="label" translatable="yes">_Serial Console</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu_view_serial_activate" last_modification_time="Fri, 01 Sep 2006 14:31:44 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="separator5">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkCheckMenuItem" id="menu-view-toolbar">
<property name="visible">True</property>
<property name="label" translatable="yes">Toolbar</property>
<property name="use_underline">True</property>
<property name="active">True</property>
<signal name="activate" handler="on_menu_view_toolbar_activate" last_modification_time="Fri, 01 Sep 2006 14:31:44 GMT"/>
</widget>
</child>
</widget>
@ -3172,7 +3198,7 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
</child>
<child>
<widget class="GtkToolbar" id="toolbar3">
<widget class="GtkToolbar" id="console-toolbar">
<property name="visible">True</property>
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
<property name="toolbar_style">GTK_TOOLBAR_BOTH</property>
@ -3184,6 +3210,7 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
<property name="visible">True</property>
<property name="label" translatable="yes">Run</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-media-play</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
@ -3200,6 +3227,7 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
<property name="visible">True</property>
<property name="label" translatable="yes">Pause</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-media-pause</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
@ -3227,102 +3255,6 @@ Máirín Duffy &lt;duffy@redhat.com&gt;
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem2">
<property name="visible">True</property>
<property name="draw">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="control-terminal">
<property name="visible">True</property>
<property name="label" translatable="yes">Open terminal</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_terminal_clicked" last_modification_time="Mon, 03 Apr 2006 09:54:01 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="control-save">
<property name="visible">True</property>
<property name="label" translatable="yes">Save domain</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_save_clicked" last_modification_time="Thu, 20 Jul 2006 17:25:06 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="control-details">
<property name="visible">True</property>
<property name="label" translatable="yes">Machine details</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-properties</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_details_clicked" last_modification_time="Mon, 03 Apr 2006 13:41:26 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="control-screenshot">
<property name="visible">True</property>
<property name="label" translatable="yes">Take screenshot</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_screenshot_clicked" last_modification_time="Tue, 15 Aug 2006 20:47:57 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToggleToolButton" id="control-fullscreen">
<property name="visible">True</property>
<property name="label" translatable="yes">Full screen</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-zoom-fit</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<property name="active">False</property>
<signal name="toggled" handler="on_control_fullscreen_toggled" last_modification_time="Tue, 29 Aug 2006 20:00:28 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>

View File

@ -44,24 +44,9 @@ class vmmConsole(gobject.GObject):
topwin.hide()
topwin.set_title(vm.get_name() + " " + topwin.get_title())
self.window.get_widget("control-run").set_icon_widget(gtk.Image())
self.window.get_widget("control-run").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_run.png")
self.window.get_widget("control-pause").set_icon_widget(gtk.Image())
self.window.get_widget("control-pause").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_pause.png")
self.window.get_widget("control-shutdown").set_icon_widget(gtk.Image())
self.window.get_widget("control-shutdown").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_shutdown.png")
self.window.get_widget("control-terminal").set_icon_widget(gtk.Image())
self.window.get_widget("control-terminal").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_launch_term.png")
self.window.get_widget("control-screenshot").set_icon_widget(gtk.Image())
self.window.get_widget("control-screenshot").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_screenshot.png")
self.window.get_widget("control-save").set_icon_widget(gtk.Image())
self.window.get_widget("control-save").get_icon_widget().set_from_file(config.get_icon_dir() + "/icon_save.png")
self.vncViewer = GRFBViewer()
scrolledWin = gtk.ScrolledWindow()
scrolledWin.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
@ -87,20 +72,16 @@ class vmmConsole(gobject.GObject):
"on_control_shutdown_clicked": self.control_vm_shutdown,
"on_control_pause_toggled": self.control_vm_pause,
"on_control_fullscreen_toggled": self.toggle_fullscreen,
"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_screenshot_clicked": self.control_vm_screenshot,
"on_control_save_clicked": self.control_vm_save_domain,
"on_control_details_clicked": self.control_vm_details,
"on_menu_vm_terminal_activate": self.control_vm_terminal,
"on_menu_vm_save_activate": self.control_vm_save_domain,
"on_menu_vm_details_activate": self.control_vm_details,
"on_menu_vm_screenshot_activate": self.control_vm_screenshot,
"on_menu_view_serial_activate": self.control_vm_terminal,
"on_menu_view_details_activate": self.control_vm_details,
"on_menu_view_fullscreen_activate": self.toggle_fullscreen,
"on_menu_view_toolbar_activate": self.toggle_toolbar,
"on_menu_vm_close_activate": self.close,
@ -136,6 +117,11 @@ class vmmConsole(gobject.GObject):
self.window.get_widget("vmm-console").unfullscreen()
#gtk.gdk.keyboard_ungrab()
def toggle_toolbar(self, src):
if src.get_active():
self.window.get_widget("console-toolbar").show()
else:
self.window.get_widget("console-toolbar").hide()
def show(self):
dialog = self.window.get_widget("vmm-console")
@ -201,15 +187,14 @@ class vmmConsole(gobject.GObject):
def activate_unavailable_page(self):
self.window.get_widget("console-pages").set_current_page(0)
self.window.get_widget("control-screenshot").set_sensitive(False)
self.window.get_widget("menu-vm-screenshot").set_sensitive(False)
def activate_screenshot_page(self):
self.window.get_widget("console-pages").set_current_page(1)
self.window.get_widget("control-screenshot").set_sensitive(True)
self.window.get_widget("menu-vm-screenshot").set_sensitive(True)
def activate_auth_page(self):
pw = self.config.get_console_password(self.vm)
self.window.get_widget("control-screenshot").set_sensitive(False)
self.window.get_widget("menu-vm-screenshot").set_sensitive(False)
self.window.get_widget("console-auth-password").set_text(pw)
if self.config.has_keyring():
self.window.get_widget("console-auth-remember").set_sensitive(True)
@ -223,7 +208,7 @@ class vmmConsole(gobject.GObject):
def activate_viewer_page(self):
self.window.get_widget("console-pages").set_current_page(3)
self.window.get_widget("control-screenshot").set_sensitive(True)
self.window.get_widget("menu-vm-screenshot").set_sensitive(True)
self.vncViewer.grab_focus()
def control_vm_screenshot(self, src):
@ -315,23 +300,19 @@ class vmmConsole(gobject.GObject):
self.window.get_widget("menu-vm-run").set_sensitive(False)
if vm.is_serial_console_tty_accessible():
self.window.get_widget("control-terminal").set_sensitive(True)
self.window.get_widget("menu-vm-terminal").set_sensitive(True)
self.window.get_widget("menu-view-serial").set_sensitive(True)
else:
self.window.get_widget("control-terminal").set_sensitive(False)
self.window.get_widget("menu-vm-terminal").set_sensitive(False)
self.window.get_widget("menu-view-serial").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-save").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-save").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-save").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-save").set_sensitive(True)