mirror of
https://github.com/virt-manager/virt-manager.git
synced 2024-10-27 10:25:25 +03:00
prefs: Remove console popup option
This was originally requested when the console window didn't have option to start/stop a VM (see https://bugzilla.redhat.com/show_bug.cgi?id=211385). That hasn't been valid for a long time. The option was pretty unclear in the prefs dialog anyways, and had weird behavior like 'open the domain for all running vms when we start virt-manager' Just always use the current default of opening the console for VMs that we create with New VM.
This commit is contained in:
parent
46e28f0b1d
commit
6590233b7e
@ -104,19 +104,6 @@
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/::PACKAGE::/console/popup</key>
|
||||
<applyto>/apps/::PACKAGE::/console/popup</applyto>
|
||||
<owner>::PACKAGE::</owner>
|
||||
<type>int</type>
|
||||
<default>1</default>
|
||||
|
||||
<locale name="C">
|
||||
<short>When to pop up a console for a guest</short>
|
||||
<long>Whether to pop up a console for a guest. 0 = never, 1 = only on creation of a new guest, 2 = On creation of any guest</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/::PACKAGE::/console/enable-accels</key>
|
||||
<applyto>/apps/::PACKAGE::/console/enable-accels</applyto>
|
||||
|
@ -36,10 +36,6 @@ except Exception, _spice_error:
|
||||
from virtManager.keyring import vmmKeyring
|
||||
from virtManager.secret import vmmSecret
|
||||
|
||||
CONSOLE_POPUP_NEVER = 0
|
||||
CONSOLE_POPUP_NEW_ONLY = 1
|
||||
CONSOLE_POPUP_ALWAYS = 2
|
||||
|
||||
CONSOLE_KEYGRAB_NEVER = 0
|
||||
CONSOLE_KEYGRAB_FULLSCREEN = 1
|
||||
CONSOLE_KEYGRAB_MOUSEOVER = 2
|
||||
@ -464,16 +460,6 @@ class vmmConfig(object):
|
||||
cb, userdata)
|
||||
|
||||
# VM Console preferences
|
||||
def on_console_popup_changed(self, callback):
|
||||
return 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_accels_changed(self, callback):
|
||||
return self.conf.notify_add(self.conf_dir + "/console/enable-accels", callback)
|
||||
def get_console_accels(self):
|
||||
|
@ -1649,19 +1649,19 @@ class vmmCreate(vmmGObjectUI):
|
||||
self.failed_guest = self.guest
|
||||
return
|
||||
|
||||
vm = self.conn.get_vm(guest.uuid)
|
||||
|
||||
if self.config.get_console_popup() == 1:
|
||||
# user has requested console on new created vms only
|
||||
gtype = vm.get_graphics_console()[0]
|
||||
if gtype in self.config.embeddable_graphics():
|
||||
self.emit("action-show-console", self.conn.get_uri(),
|
||||
guest.uuid)
|
||||
else:
|
||||
self.emit("action-show-terminal", self.conn.get_uri(),
|
||||
guest.uuid)
|
||||
self.close()
|
||||
|
||||
# Launch details dialog for new VM
|
||||
vm = self.conn.get_vm(guest.uuid)
|
||||
gtype = vm.get_graphics_console()[0]
|
||||
if gtype in self.config.embeddable_graphics():
|
||||
self.emit("action-show-console", self.conn.get_uri(),
|
||||
guest.uuid)
|
||||
elif vm.get_connection().is_remote():
|
||||
self.emit("action-show-terminal", self.conn.get_uri(),
|
||||
guest.uuid)
|
||||
|
||||
|
||||
|
||||
def do_install(self, asyncjob, guest):
|
||||
meter = vmmCreateMeter(asyncjob)
|
||||
|
@ -23,8 +23,6 @@ import gtk
|
||||
|
||||
import logging
|
||||
|
||||
import libvirt
|
||||
|
||||
import virtManager.config as cfg
|
||||
import virtManager.uihelpers as uihelpers
|
||||
from virtManager.connection import vmmConnection
|
||||
@ -904,33 +902,13 @@ class vmmManager(vmmGObjectUI):
|
||||
# State/UI updating methods #
|
||||
#############################
|
||||
|
||||
def _vm_started(self, vm):
|
||||
connection = vm.get_connection()
|
||||
uri = connection.get_uri()
|
||||
vmuuid = vm.get_uuid()
|
||||
|
||||
logging.debug("VM %s started" % vm.get_name())
|
||||
|
||||
if (self.config.get_console_popup() != 2 or
|
||||
vm.is_management_domain()):
|
||||
return
|
||||
|
||||
# user has requested consoles on all vms
|
||||
gtype = vm.get_graphics_console()[0]
|
||||
if gtype in self.config.embeddable_graphics():
|
||||
self.emit("action-show-console", uri, vmuuid)
|
||||
elif not connection.is_remote():
|
||||
self.emit("action-show-terminal", uri, vmuuid)
|
||||
|
||||
def vm_status_changed(self, vm, oldstatus, newstatus):
|
||||
ignore = newstatus
|
||||
ignore = oldstatus
|
||||
parent = self.rows[vm.get_connection().get_uri()].iter
|
||||
vmlist = self.window.get_widget("vm-list")
|
||||
model = vmlist.get_model()
|
||||
|
||||
if vm.is_active() and oldstatus is libvirt.VIR_DOMAIN_SHUTOFF:
|
||||
self._vm_started(vm)
|
||||
|
||||
missing = True
|
||||
for row in range(model.iter_n_children(parent)):
|
||||
_iter = model.iter_nth_child(parent, row)
|
||||
|
@ -36,7 +36,6 @@ class vmmPreferences(vmmGObjectUI):
|
||||
vmmGObjectUI.__init__(self, "vmm-preferences.glade", "vmm-preferences")
|
||||
|
||||
self.add_gconf_handle(self.config.on_view_system_tray_changed(self.refresh_view_system_tray))
|
||||
self.add_gconf_handle(self.config.on_console_popup_changed(self.refresh_console_popup))
|
||||
self.add_gconf_handle(self.config.on_console_accels_changed(self.refresh_console_accels))
|
||||
self.add_gconf_handle(self.config.on_console_scaling_changed(self.refresh_console_scaling))
|
||||
self.add_gconf_handle(self.config.on_stats_update_interval_changed(self.refresh_update_interval))
|
||||
@ -56,7 +55,6 @@ class vmmPreferences(vmmGObjectUI):
|
||||
self.refresh_view_system_tray()
|
||||
self.refresh_update_interval()
|
||||
self.refresh_history_length()
|
||||
self.refresh_console_popup()
|
||||
self.refresh_console_accels()
|
||||
self.refresh_console_scaling()
|
||||
self.refresh_sound_local()
|
||||
@ -75,7 +73,6 @@ class vmmPreferences(vmmGObjectUI):
|
||||
"on_prefs_system_tray_toggled" : self.change_view_system_tray,
|
||||
"on_prefs_stats_update_interval_changed": self.change_update_interval,
|
||||
"on_prefs_stats_history_length_changed": self.change_history_length,
|
||||
"on_prefs_console_popup_changed": self.change_console_popup,
|
||||
"on_prefs_console_accels_toggled": self.change_console_accels,
|
||||
"on_prefs_console_scaling_changed": self.change_console_scaling,
|
||||
"on_prefs_close_clicked": self.close,
|
||||
@ -124,10 +121,6 @@ class vmmPreferences(vmmGObjectUI):
|
||||
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):
|
||||
self.window.get_widget("prefs-console-popup").set_active(
|
||||
self.config.get_console_popup())
|
||||
def refresh_console_accels(self, ignore1=None, ignore2=None,
|
||||
ignore3=None, ignore4=None):
|
||||
self.window.get_widget("prefs-console-accels").set_active(
|
||||
@ -268,8 +261,6 @@ class vmmPreferences(vmmGObjectUI):
|
||||
def change_history_length(self, src):
|
||||
self.config.set_stats_history_length(src.get_value_as_int())
|
||||
|
||||
def change_console_popup(self, box):
|
||||
self.config.set_console_popup(box.get_active())
|
||||
def change_console_accels(self, src):
|
||||
self.config.set_console_accels(src.get_active())
|
||||
def change_console_scaling(self, box):
|
||||
|
@ -322,7 +322,7 @@
|
||||
<child>
|
||||
<widget class="GtkTable" id="table3">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">6</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="row_spacing">3</property>
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="prefs-console-scaling">
|
||||
@ -333,8 +333,8 @@ Always</property>
|
||||
<signal name="changed" handler="on_prefs_console_scaling_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>
|
||||
@ -346,33 +346,6 @@ Always</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">prefs-console-scaling</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="prefs-console-popup">
|
||||
<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"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_padding">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label5">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Automatically _open consoles:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">prefs-console-popup</property>
|
||||
</widget>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox2">
|
||||
@ -414,8 +387,8 @@ For all domains</property>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">4</property>
|
||||
<property name="bottom_attach">5</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
@ -448,8 +421,8 @@ For all domains</property>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">5</property>
|
||||
<property name="bottom_attach">6</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
@ -536,48 +509,31 @@ For all domains</property>
|
||||
<property name="label" translatable="yes">Install Audio Device:</property>
|
||||
</widget>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label162">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Install Graphics:</property>
|
||||
<property name="use_underline">False</property>
|
||||
<property name="use_markup">False</property>
|
||||
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||
<property name="wrap">False</property>
|
||||
<property name="selectable">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xpad">0</property>
|
||||
<property name="ypad">0</property>
|
||||
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
|
||||
<property name="width_chars">-1</property>
|
||||
<property name="single_line_mode">False</property>
|
||||
<property name="angle">0</property>
|
||||
<property name="label" translatable="yes">Install Graphics:</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">fill</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="prefs-graphics-type">
|
||||
<property name="visible">True</property>
|
||||
<property name="items" translatable="no">VNC
|
||||
<property name="items">VNC
|
||||
Spice</property>
|
||||
<signal name="changed" handler="on_prefs_graphics_type_changed"/>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="right_attach">1</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="x_padding">5</property>
|
||||
<property name="x_options">fill</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
|
Loading…
Reference in New Issue
Block a user