[virt-tools-list] [PATCH virt-viewer] Improve USB redirection error dialogs

Hans de Goede hdegoede at redhat.com
Sat Jul 28 09:23:08 UTC 2012


The USB errors passed into the error signal handlers are somewhat lowlevel
and quite detailed. Also they usually already contain a colon. so instead of
prefixing them with "USB redirection error", use USB Redirection Error as the
primary dialog text, and make the detailed message the secondary dialog text.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/virt-viewer-app.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index def52c5..47949d9 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -1153,7 +1153,18 @@ static void virt_viewer_app_usb_failed(VirtViewerSession *session G_GNUC_UNUSED,
                                        const gchar *msg,
                                        VirtViewerApp *self)
 {
-    virt_viewer_app_simple_message_dialog(self, _("USB redirection error: %s"), msg);
+    GtkWindow *window = GTK_WINDOW(virt_viewer_window_get_window(self->priv->main_window));
+    GtkWidget *dialog = gtk_message_dialog_new(window,
+                                    GTK_DIALOG_MODAL |
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_ERROR,
+                                    GTK_BUTTONS_OK,
+                                    _("USB Redirection Error"));
+
+    gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
+                                             "%s", msg);
+    gtk_dialog_run(GTK_DIALOG(dialog));
+    gtk_widget_destroy(dialog);
 }
 
 static void
-- 
1.7.10.4




More information about the virt-tools-list mailing list