diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-11-29 23:11:15 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-12-02 14:09:32 +0100 |
commit | 72490b407c93898248fa1c56c9b30437f4dc3a62 (patch) | |
tree | efff03fe6a6f64275a4a2eeec343656c63be3fcb /gtk | |
parent | 63c8526c699692b6fdca15db8209730fca7eb817 (diff) | |
download | spice-gtk-72490b407c93898248fa1c56c9b30437f4dc3a62.tar.gz spice-gtk-72490b407c93898248fa1c56c9b30437f4dc3a62.tar.xz spice-gtk-72490b407c93898248fa1c56c9b30437f4dc3a62.zip |
spicy: Don't show an error dialog on a cancelled device open
If for example the user plugs in a new device, then gets the policykit agent
authentication dialog and then unplugs the device, spice-gtk will cancel
the acl-helper request, which in turn will dismiss the policykit agent
authentication dialog. Which is all a nice and smooth user experience,
except that when this happens spicy throws a dialog with an error
that the open was cancelled. Since a cancel usually is done deliberately
(such as on the user unpluging the device) no error dialog should be thrown
for it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/spicy.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gtk/spicy.c b/gtk/spicy.c index 427b8d1..c662983 100644 --- a/gtk/spicy.c +++ b/gtk/spicy.c @@ -1618,6 +1618,9 @@ static void auto_connect_failed(SpiceUsbDeviceManager *manager, { GtkWidget *dialog; + if (error->domain == G_IO_ERROR && error->code == G_IO_ERROR_CANCELLED) + return; + dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "USB redirection error"); |