mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-29 00:15:15 +00:00
Report error in dialog
Use a UI dialog to inform of connection error.
This commit is contained in:
parent
6100d08dd3
commit
1eaaf8c3ab
@ -848,9 +848,17 @@ virt_viewer_connect(VirtViewerApp *app)
|
||||
}
|
||||
|
||||
if (!virt_viewer_app_initial_connect(app, &error)) {
|
||||
if (error != NULL)
|
||||
g_warning("%s", error->message);
|
||||
g_clear_error(&error);
|
||||
if (error != NULL) {
|
||||
GtkWidget *dialog = gtk_message_dialog_new(NULL,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_CLOSE,
|
||||
"Failed to connect: %s",
|
||||
error->message);
|
||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||
gtk_widget_destroy(GTK_WIDGET(dialog));
|
||||
g_clear_error(&error);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user