The attached patch adds a global preference to the 'Preferences' dialog for the default VNC scaling value. The new default for all VMs is 'Fullscreen Only': since scaling isn't required for day to day use, and there is a performance penalty, it should be opt in by default. All VMs abide this global pref, but can override it in their details window. However this overwritten value will be forgotten once the virt-manager is restarted (still working on adding per-vm preferences). Screenshot here: http://fedorapeople.org/~crobinso/virt-manager/vmm-prefs-scaling.png Thanks, Cole
# HG changeset patch # User Cole Robinson <crobinso@xxxxxxxxxx> # Date 1234469170 18000 # Node ID 9310a1be19cd57f5d99d662785c92fc3855b6469 # Parent 0a04541cc1d36cf0da809f8927505a45359e1a34 Add global option for VNC scaling: vm details defaults to that. diff -r 0a04541cc1d3 -r 9310a1be19cd src/virt-manager.schemas.in --- a/src/virt-manager.schemas.in Thu Feb 12 13:32:55 2009 -0500 +++ b/src/virt-manager.schemas.in Thu Feb 12 15:06:10 2009 -0500 @@ -222,6 +222,19 @@ </schema> <schema> + <key>/schemas/apps/::PACKAGE::/console/scaling</key> + <applyto>/apps/::PACKAGE::/console/scaling</applyto> + <owner>::PACKAGE::</owner> + <type>int</type> + <default>1</default> + + <locale name="C"> + <short>When to scale the VM graphical console</short> + <long>When to scale the VM graphical console. 0 = never, 1 = only when in full screen mode, 2 = Always</long> + </locale> + </schema> + + <schema> <key>/schemas/apps/::PACKAGE::/details/show-toolbar</key> <applyto>/apps/::PACKAGE::/details/show-toolbar</applyto> <owner>::PACKAGE::</owner> diff -r 0a04541cc1d3 -r 9310a1be19cd src/virtManager/config.py --- a/src/virtManager/config.py Thu Feb 12 13:32:55 2009 -0500 +++ b/src/virtManager/config.py Thu Feb 12 15:06:10 2009 -0500 @@ -42,7 +42,13 @@ DEFAULT_VIRT_SAVE_DIR = "/var/lib/libvirt" class vmmConfig: - def __init__(self, appname, appversion, gconf_dir, glade_dir, icon_dir, data_dir): + + CONSOLE_SCALE_NEVER = 0 + CONSOLE_SCALE_FULLSCREEN = 1 + CONSOLE_SCALE_ALWAYS = 2 + + def __init__(self, appname, appversion, gconf_dir, glade_dir, icon_dir, + data_dir): self.appname = appname self.appversion = appversion self.conf_dir = gconf_dir @@ -226,31 +232,36 @@ # VM Console preferences def on_console_popup_changed(self, callback): self.conf.notify_add(self.conf_dir + "/console/popup", callback) - def get_console_popup(self): console_pref = self.conf.get_int(self.conf_dir + "/console/popup") if console_pref == None: console_pref = 0 return console_pref - def set_console_popup(self, pref): self.conf.set_int(self.conf_dir + "/console/popup", pref) def on_console_keygrab_changed(self, callback): self.conf.notify_add(self.conf_dir + "/console/keygrab", callback) - def get_console_keygrab(self): console_pref = self.conf.get_int(self.conf_dir + "/console/keygrab") if console_pref == None: console_pref = 0 return console_pref - def set_console_keygrab(self, pref): self.conf.set_int(self.conf_dir + "/console/keygrab", pref) + def on_console_scaling_changed(self, callback): + self.conf.notify_add(self.conf_dir + "/console/scaling", callback) + def get_console_scaling(self): + console_pref = self.conf.get_int(self.conf_dir + "/console/scaling") + if console_pref == None: + console_pref = 0 + return console_pref + def set_console_scaling(self, pref): + self.conf.set_int(self.conf_dir + "/console/scaling", pref) + def show_console_grab_notify(self): return self.conf.get_bool(self.conf_dir + "/console/grab-notify") - def set_console_grab_notify(self, state): self.conf.set_bool(self.conf_dir + "/console/grab-notify", state) diff -r 0a04541cc1d3 -r 9310a1be19cd src/virtManager/details.py --- a/src/virtManager/details.py Thu Feb 12 13:32:55 2009 -0500 +++ b/src/virtManager/details.py Thu Feb 12 15:06:10 2009 -0500 @@ -40,11 +40,6 @@ import virtinst -# Different scaling values -SCALE_ALWAYS = 0 -SCALE_FULLSCREEN = 1 -SCALE_NEVER = 2 - # Columns in hw list model HW_LIST_COL_LABEL = 0 HW_LIST_COL_STOCK_ID = 1 @@ -228,15 +223,12 @@ else: self.vncViewer.set_keyboard_grab(False) self.vncViewer.set_pointer_grab(True) - if not topwin.is_composited(): - # XXX: When we have per VM prefs, this will need to be smarter - self.scale_type = SCALE_ALWAYS - else: - self.scale_type = SCALE_NEVER - self.window.get_widget("details-menu-view-scale-always").set_active(self.scale_type == SCALE_ALWAYS) - self.window.get_widget("details-menu-view-scale-never").set_active(self.scale_type == SCALE_NEVER) - self.window.get_widget("details-menu-view-scale-fullscreen").set_active(self.scale_type == SCALE_FULLSCREEN) + self.scale_type = self.config.get_console_scaling() + + self.window.get_widget("details-menu-view-scale-always").set_active(self.scale_type == self.config.CONSOLE_SCALE_ALWAYS) + self.window.get_widget("details-menu-view-scale-never").set_active(self.scale_type == self.config.CONSOLE_SCALE_NEVER) + self.window.get_widget("details-menu-view-scale-fullscreen").set_active(self.scale_type == self.config.CONSOLE_SCALE_FULLSCREEN) self.update_scaling() self.vncViewer.connect("vnc-pointer-grab", self.notify_grabbed) @@ -444,11 +436,11 @@ return if src == self.window.get_widget("details-menu-view-scale-always"): - self.scale_type = SCALE_ALWAYS + self.scale_type = self.config.CONSOLE_SCALE_ALWAYS elif src == self.window.get_widget("details-menu-view-scale-fullscreen"): - self.scale_type = SCALE_FULLSCREEN + self.scale_type = self.config.CONSOLE_SCALE_FULLSCREEN elif src == self.window.get_widget("details-menu-view-scale-never"): - self.scale_type = SCALE_NEVER + self.scale_type = self.config.CONSOLE_SCALE_NEVER self.update_scaling() @@ -456,11 +448,14 @@ curscale = self.vncViewer.get_scaling() fs = self.window.get_widget("control-fullscreen").get_active() - if self.scale_type == SCALE_NEVER and curscale == True: + if (self.scale_type == self.config.CONSOLE_SCALE_NEVER + and curscale == True): self.vncViewer.set_scaling(False) - elif self.scale_type == SCALE_ALWAYS and curscale == False: + elif (self.scale_type == self.config.CONSOLE_SCALE_ALWAYS + and curscale == False): self.vncViewer.set_scaling(True) - elif self.scale_type == SCALE_FULLSCREEN and curscale != fs: + elif (self.scale_type == self.config.CONSOLE_SCALE_FULLSCREEN + and curscale != fs): self.vncViewer.set_scaling(fs) def control_fullscreen(self, src): diff -r 0a04541cc1d3 -r 9310a1be19cd src/virtManager/preferences.py --- a/src/virtManager/preferences.py Thu Feb 12 13:32:55 2009 -0500 +++ b/src/virtManager/preferences.py Thu Feb 12 15:06:10 2009 -0500 @@ -39,6 +39,7 @@ self.config.on_console_popup_changed(self.refresh_console_popup) self.config.on_console_keygrab_changed(self.refresh_console_keygrab) + self.config.on_console_scaling_changed(self.refresh_console_scaling) self.config.on_stats_update_interval_changed(self.refresh_update_interval) self.config.on_stats_history_length_changed(self.refresh_history_length) self.config.on_sound_local_changed(self.refresh_sound_local) @@ -52,6 +53,7 @@ self.refresh_history_length() self.refresh_console_popup() self.refresh_console_keygrab() + self.refresh_console_scaling() self.refresh_sound_local() self.refresh_sound_remote() self.refresh_disk_poll() @@ -64,6 +66,7 @@ "on_prefs_stats_history_length_changed": self.change_history_length, "on_prefs_console_popup_changed": self.change_console_popup, "on_prefs_console_keygrab_changed": self.change_console_keygrab, + "on_prefs_console_scaling_changed": self.change_console_scaling, "on_prefs_close_clicked": self.close, "on_vmm_preferences_delete_event": self.close, "on_prefs_help_clicked": self.show_help, @@ -92,10 +95,15 @@ def refresh_history_length(self, ignore1=None,ignore2=None,ignore3=None,ignore4=None): self.window.get_widget("prefs-stats-history-len").set_value(self.config.get_stats_history_length()) - def refresh_console_popup(self,ignore1=None,ignore2=None,ignore3=None,ignore4=None): + def refresh_console_popup(self,ignore1=None,ignore2=None,ignore3=None, + ignore4=None): self.window.get_widget("prefs-console-popup").set_active(self.config.get_console_popup()) - def refresh_console_keygrab(self,ignore1=None,ignore2=None,ignore3=None,ignore4=None): + def refresh_console_keygrab(self,ignore1=None,ignore2=None,ignore3=None, + ignore4=None): self.window.get_widget("prefs-console-keygrab").set_active(self.config.get_console_keygrab()) + def refresh_console_scaling(self,ignore1=None,ignore2=None,ignore3=None, + ignore4=None): + self.window.get_widget("prefs-console-scaling").set_active(self.config.get_console_scaling()) def refresh_sound_local(self, ignore1=None, ignore2=None, ignore=None, ignore4=None): @@ -126,6 +134,8 @@ self.config.set_console_popup(box.get_active()) def change_console_keygrab(self, box): self.config.set_console_keygrab(box.get_active()) + def change_console_scaling(self, box): + self.config.set_console_scaling(box.get_active()) def change_local_sound(self, src): self.config.set_local_sound(src.get_active()) diff -r 0a04541cc1d3 -r 9310a1be19cd src/vmm-preferences.glade --- a/src/vmm-preferences.glade Thu Feb 12 13:32:55 2009 -0500 +++ b/src/vmm-preferences.glade Thu Feb 12 15:06:10 2009 -0500 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd"> -<!--Generated with glade3 3.4.5 on Thu Feb 12 11:56:15 2009 --> +<!--Generated with glade3 3.4.5 on Thu Feb 12 14:51:35 2009 --> <glade-interface> <widget class="GtkWindow" id="vmm-preferences"> <property name="title" translatable="yes">Preferences</property> @@ -37,34 +37,27 @@ <property name="column_spacing">3</property> <property name="row_spacing">3</property> <child> - <widget class="GtkLabel" id="label6"> + <widget class="GtkLabel" id="label9"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Update status every</property> - </widget> - </child> - <child> - <widget class="GtkLabel" id="label7"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Maintain history of</property> + <property name="label" translatable="yes">samples</property> </widget> <packing> + <property name="left_attach">2</property> + <property name="right_attach">3</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> </packing> </child> <child> - <widget class="GtkSpinButton" id="prefs-stats-update-interval"> + <widget class="GtkLabel" id="label8"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="adjustment">0 0 60 1 5 0</property> - <signal name="value_changed" handler="on_prefs_stats_update_interval_changed"/> + <property name="xalign">0</property> + <property name="label" translatable="yes">seconds</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="x_options">GTK_FILL</property> + <property name="left_attach">2</property> + <property name="right_attach">3</property> </packing> </child> <child> @@ -84,29 +77,36 @@ </packing> </child> <child> - <widget class="GtkLabel" id="label8"> + <widget class="GtkSpinButton" id="prefs-stats-update-interval"> <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">seconds</property> + <property name="can_focus">True</property> + <property name="adjustment">0 0 60 1 5 0</property> + <signal name="value_changed" handler="on_prefs_stats_update_interval_changed"/> </widget> <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="x_options">GTK_FILL</property> </packing> </child> <child> - <widget class="GtkLabel" id="label9"> + <widget class="GtkLabel" id="label7"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">samples</property> + <property name="label" translatable="yes">Maintain history of</property> </widget> <packing> - <property name="left_attach">2</property> - <property name="right_attach">3</property> <property name="top_attach">1</property> <property name="bottom_attach">2</property> </packing> </child> + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Update status every</property> + </widget> + </child> </widget> </child> </widget> @@ -143,63 +143,34 @@ <property name="column_spacing">3</property> <property name="row_spacing">3</property> <child> - <widget class="GtkLabel" id="label11"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">CPU Usage</property> - <property name="ellipsize">PANGO_ELLIPSIZE_END</property> - </widget> - <packing> - <property name="x_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label12"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Memory Usage</property> - </widget> - <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label13"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Disk I/O</property> - </widget> - <packing> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkLabel" id="label14"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Network I/O</property> - </widget> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - <property name="x_options">GTK_FILL</property> - </packing> - </child> - <child> - <widget class="GtkCheckButton" id="prefs-stats-enable-cpu"> + <widget class="GtkCheckButton" id="prefs-stats-enable-net"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_prefs_stats_enable_cpu_toggled"/> + <signal name="toggled" handler="on_prefs_stats_enable_net_toggled"/> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">GTK_EXPAND</property> + </packing> + </child> + <child> + <widget class="GtkCheckButton" id="prefs-stats-enable-disk"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="response_id">0</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_prefs_stats_enable_disk_toggled"/> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> <property name="x_options">GTK_EXPAND</property> </packing> </child> @@ -220,35 +191,64 @@ </packing> </child> <child> - <widget class="GtkCheckButton" id="prefs-stats-enable-disk"> + <widget class="GtkCheckButton" id="prefs-stats-enable-cpu"> <property name="visible">True</property> <property name="can_focus">True</property> <property name="response_id">0</property> <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_prefs_stats_enable_disk_toggled"/> + <signal name="toggled" handler="on_prefs_stats_enable_cpu_toggled"/> </widget> <packing> <property name="left_attach">1</property> <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> <property name="x_options">GTK_EXPAND</property> </packing> </child> <child> - <widget class="GtkCheckButton" id="prefs-stats-enable-net"> + <widget class="GtkLabel" id="label14"> <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="response_id">0</property> - <property name="draw_indicator">True</property> - <signal name="toggled" handler="on_prefs_stats_enable_net_toggled"/> + <property name="xalign">0</property> + <property name="label" translatable="yes">Network I/O</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> <property name="top_attach">3</property> <property name="bottom_attach">4</property> - <property name="x_options">GTK_EXPAND</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label13"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Disk I/O</property> + </widget> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Memory Usage</property> + </widget> + <packing> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">GTK_FILL</property> + </packing> + </child> + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">CPU Usage</property> + <property name="ellipsize">PANGO_ELLIPSIZE_END</property> + </widget> + <packing> + <property name="x_options">GTK_FILL</property> </packing> </child> </widget> @@ -300,29 +300,47 @@ <child> <widget class="GtkTable" id="table3"> <property name="visible">True</property> - <property name="n_rows">4</property> + <property name="n_rows">6</property> <property name="n_columns">1</property> - <property name="row_spacing">2</property> + <property name="row_spacing">3</property> <child> - <widget class="GtkComboBox" id="prefs-console-popup"> + <widget class="GtkComboBox" id="prefs-console-scaling"> <property name="visible">True</property> <property name="items" translatable="yes">Never -For all new domains -For all domains</property> - <signal name="changed" handler="on_prefs_console_popup_changed"/> +Fullscreen only +Always</property> + <signal name="changed" handler="on_prefs_console_scaling_changed"/> </widget> <packing> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> + <property name="top_attach">5</property> + <property name="bottom_attach">6</property> <property name="x_padding">5</property> </packing> </child> <child> - <widget class="GtkLabel" id="label5"> + <widget class="GtkLabel" id="label17"> <property name="visible">True</property> <property name="xalign">0</property> - <property name="label" translatable="yes">Automatically open consoles:</property> + <property name="label" translatable="yes">Graphical Console Scaling:</property> </widget> + <packing> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + </packing> + </child> + <child> + <widget class="GtkComboBox" id="prefs-console-keygrab"> + <property name="visible">True</property> + <property name="items" translatable="yes">Never +When fullscreen +On mouse over</property> + <signal name="changed" handler="on_prefs_console_keygrab_changed"/> + </widget> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_padding">5</property> + </packing> </child> <child> <widget class="GtkLabel" id="label15"> @@ -336,16 +354,23 @@ </packing> </child> <child> - <widget class="GtkComboBox" id="prefs-console-keygrab"> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Automatically open consoles:</property> + </widget> + </child> + <child> + <widget class="GtkComboBox" id="prefs-console-popup"> <property name="visible">True</property> <property name="items" translatable="yes">Never -When fullscreen -On mouse over</property> - <signal name="changed" handler="on_prefs_console_keygrab_changed"/> +For all new domains +For all domains</property> + <signal name="changed" handler="on_prefs_console_popup_changed"/> </widget> <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> <property name="x_padding">5</property> </packing> </child> @@ -384,13 +409,6 @@ <property name="n_columns">1</property> <property name="column_spacing">8</property> <child> - <widget class="GtkLabel" id="label16"> - <property name="visible">True</property> - <property name="xalign">0</property> - <property name="label" translatable="yes">Install Audio Device:</property> - </widget> - </child> - <child> <widget class="GtkAlignment" id="alignment6"> <property name="visible">True</property> <property name="left_padding">12</property> @@ -428,6 +446,13 @@ <property name="bottom_attach">2</property> </packing> </child> + <child> + <widget class="GtkLabel" id="label16"> + <property name="visible">True</property> + <property name="xalign">0</property> + <property name="label" translatable="yes">Install Audio Device:</property> + </widget> + </child> </widget> </child> </widget>
_______________________________________________ et-mgmt-tools mailing list et-mgmt-tools@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/et-mgmt-tools