Revert "details: Add USB redirection support in console viewer"

This reverts commit 7e1e21a26a.

Was accidentally applied while patch was still in review.
This commit is contained in:
Cole Robinson 2013-06-28 11:12:23 -04:00
parent 555b2d960d
commit 367041a8d7
3 changed files with 0 additions and 64 deletions

View File

@ -331,21 +331,6 @@
<signal name="activate" handler="on_details_menu_screenshot_activate" swapped="no"/>
</object>
</child>
<child>
<object class="GtkSeparatorMenuItem" id="separator13">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
</child>
<child>
<object class="GtkMenuItem" id="details-menu-usb-redirection">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Select USB devices to redirect</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_details_menu_usb_redirection" swapped="no"/>
</object>
</child>
</object>
</child>
</object>

View File

@ -286,7 +286,6 @@ class VNCViewer(Viewer):
Viewer.__init__(self, console)
self.display = GtkVnc.Display.new()
self.sockfd = None
self.type = "vnc"
# Last noticed desktop resolution
self.desktop_resolution = None
@ -447,7 +446,6 @@ class SpiceViewer(Viewer):
self.display = None
self.audio = None
self.display_channel = None
self.type = "spice"
def _init_widget(self):
self.set_grab_keys()
@ -596,22 +594,6 @@ class SpiceViewer(Viewer):
return
self.display.set_property("scaling", scaling)
def get_usb_widget(self):
# The @format positional parameters are the following:
# 1 '%s' manufacturer
# 2 '%s' product
# 3 '%s' descriptor (a [vendor_id:product_id] string)
# 4 '%d' bus
# 5 '%d' address
usb_device_description_fmt = _("%s %s %s at %d-%d")
if self.spice_session:
return SpiceClientGtk.UsbDeviceWidget.new(self.spice_session,
usb_device_description_fmt)
return
class vmmConsolePages(vmmGObjectUI):
def __init__(self, vm, builder, topwin):
@ -973,13 +955,11 @@ class vmmConsolePages(vmmGObjectUI):
self.close_viewer()
self.widget("console-pages").set_current_page(PAGE_UNAVAILABLE)
self.widget("details-menu-vm-screenshot").set_sensitive(False)
self.widget("details-menu-usb-redirection").set_sensitive(False)
self.widget("console-unavailable").set_label("<b>" + msg + "</b>")
def activate_auth_page(self, withPassword=True, withUsername=False):
(pw, username) = self.config.get_console_password(self.vm)
self.widget("details-menu-vm-screenshot").set_sensitive(False)
self.widget("details-menu-usb-redirection").set_sensitive(False)
if withPassword:
self.widget("console-auth-password").show()
@ -1019,9 +999,6 @@ class vmmConsolePages(vmmGObjectUI):
if self.viewer and self.viewer.display:
self.viewer.display.grab_focus()
if self.viewer.type == "spice":
self.widget("details-menu-usb-redirection").set_sensitive(True)
def page_changed(self, ignore1=None, ignore2=None, ignore3=None):
self.set_allow_fullscreen()

View File

@ -418,7 +418,6 @@ class vmmDetails(vmmGObjectUI):
"on_details_menu_migrate_activate": self.control_vm_migrate,
"on_details_menu_delete_activate": self.control_vm_delete,
"on_details_menu_screenshot_activate": self.control_vm_screenshot,
"on_details_menu_usb_redirection": self.control_vm_usb_redirection,
"on_details_menu_view_toolbar_activate": self.toggle_toolbar,
"on_details_menu_view_manager_activate": self.view_manager,
"on_details_menu_view_details_toggled": self.details_console_changed,
@ -1602,31 +1601,6 @@ class vmmDetails(vmmGObjectUI):
except Exception, e:
self.err.show_err(_("Error taking screenshot: %s") % str(e))
def spice_usbdev_rediret_error(self,
spice_usbdev_widget, spice_usb_device,
errstr):
ignore_widget = spice_usbdev_widget
ignore_device = spice_usb_device
self.err.show_err(_("USB redirection error"),
text2=str(errstr),
async=False)
def control_vm_usb_redirection(self, src):
ignore = src
spice_usbdev_dialog = self.err
spice_usbdev_widget = self.console.viewer.get_usb_widget()
if not spice_usbdev_widget:
self.err.show_err(_("Error initialize spice USB device widget"))
return
spice_usbdev_widget.connect("connect-failed",
self.spice_usbdev_rediret_error)
spice_usbdev_widget.show()
spice_usbdev_dialog.show_info_with_widget(_("Select USB devices for redirection"),
widget=spice_usbdev_widget)
def _take_screenshot(self):
image = self.console.viewer.get_pixbuf()