summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer.c
diff options
context:
space:
mode:
authorFabiano FidĂȘncio <fidencio@redhat.com>2015-03-26 15:21:03 +0100
committerFabiano FidĂȘncio <fidencio@redhat.com>2015-03-27 16:48:31 +0100
commitffe19f6ece25e89968e74bccd12c61c1cd749f61 (patch)
tree15a6ec99b6f7aef190c4556b4d9409082d0c43bf /src/virt-viewer.c
parentf1204f0e695d9db2f4bdca433d2a75944673f490 (diff)
downloadvirt-viewer-ffe19f6ece25e89968e74bccd12c61c1cd749f61.tar.gz
virt-viewer-ffe19f6ece25e89968e74bccd12c61c1cd749f61.tar.xz
virt-viewer-ffe19f6ece25e89968e74bccd12c61c1cd749f61.zip
virt-viewer: Avoid simple_message_dialog() when errors can be propagated
Remove all the dialogs used to report errors on extract_connect_info() and just propagate the errors we got from it. The only exception is virt_viewer_domain_event(), that is a callback that doesn't have GError as argument. In this specific case, we show the error dialog instead of propagating it. Related: rhbz#1085216
Diffstat (limited to 'src/virt-viewer.c')
-rw-r--r--src/virt-viewer.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 5cef139..93449a6 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -414,9 +414,6 @@ virt_viewer_extract_connect_info(VirtViewer *self,
VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
_("Cannot determine the graphic type for the guest %s"), priv->domkey);
- virt_viewer_app_simple_message_dialog(app, _("Cannot determine the graphic type for the guest %s"),
- priv->domkey);
-
goto cleanup;
}
@@ -456,9 +453,6 @@ virt_viewer_extract_connect_info(VirtViewer *self,
VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
_("Cannot determine the host for the guest %s"), priv->domkey);
- virt_viewer_app_simple_message_dialog(app, _("Cannot determine the host for the guest %s"),
- priv->domkey);
-
goto cleanup;
}
@@ -490,9 +484,6 @@ virt_viewer_extract_connect_info(VirtViewer *self,
g_debug("graphics listen '%s' is not reachable from this machine",
ghost ? ghost : "");
- virt_viewer_app_simple_message_dialog(app, _("Guest '%s' is not reachable"),
- priv->domkey);
-
goto cleanup;
}
@@ -607,7 +598,12 @@ virt_viewer_domain_event(virConnectPtr conn G_GNUC_UNUSED,
break;
case VIR_DOMAIN_EVENT_STARTED:
- virt_viewer_update_display(self, dom, NULL);
+ virt_viewer_update_display(self, dom, &error);
+ if (error) {
+ virt_viewer_app_simple_message_dialog(app, error->message);
+ g_clear_error(&error);
+ }
+
virt_viewer_app_activate(app, &error);
if (error) {
/* we may want to consolidate error reporting in