diff options
author | Pavel Grunt <pgrunt@redhat.com> | 2015-03-18 17:49:38 +0100 |
---|---|---|
committer | Fabiano FidĂȘncio <fidencio@redhat.com> | 2015-03-23 19:32:02 +0100 |
commit | 1bcd8d0fe6df553f087d11b539a59e128a2a350b (patch) | |
tree | 6198cf3b2846ce059fd6a0e5a6434894e8d7a544 /src/virt-viewer-main.c | |
parent | aec2248cf86cacfc8950f48ccf0fc8fcaa261908 (diff) | |
download | virt-viewer-1bcd8d0fe6df553f087d11b539a59e128a2a350b.tar.gz virt-viewer-1bcd8d0fe6df553f087d11b539a59e128a2a350b.tar.xz virt-viewer-1bcd8d0fe6df553f087d11b539a59e128a2a350b.zip |
Exit normally when canceling dialog
This applies for:
libvirt authentication dialog (e.g. virt-viewer --attach guest)
'recent connection' dialog (e.g. remote-viewer)
'vm choose' dialog when connecting without specifying the vm name
This is done by using a new GError VIRT_VIEWER_ERROR_CANCELLED.
Diffstat (limited to 'src/virt-viewer-main.c')
-rw-r--r-- | src/virt-viewer-main.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c index 3fae955..ae880ab 100644 --- a/src/virt-viewer-main.c +++ b/src/virt-viewer-main.c @@ -113,8 +113,12 @@ int main(int argc, char **argv) if (viewer == NULL) goto cleanup; - if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer))) + if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer), &error)) { + if (g_error_matches(error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_CANCELLED)) + ret = 0; + g_clear_error(&error); goto cleanup; + } gtk_main(); |