diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-16 13:18:25 +0100 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2013-01-18 12:28:58 +0100 |
commit | b6af879d1982b563503d4bfa10b665c0897e34ce (patch) | |
tree | 0305952038a1b683432e412dc87d1512679b3f6c /src/virt-viewer-auth.c | |
parent | c0a2f9dfd5db36ca3f15ffcda6edc174353edea1 (diff) | |
download | virt-viewer-b6af879d1982b563503d4bfa10b665c0897e34ce.tar.gz virt-viewer-b6af879d1982b563503d4bfa10b665c0897e34ce.tar.xz virt-viewer-b6af879d1982b563503d4bfa10b665c0897e34ce.zip |
vnc: add connection by file
Learn to connect to a VNC server with the connection details file, ex:
[virt-viewer]
type=vnc
host=localhost
port=2356
password=foobar
v2:
- add username/password support
https://bugzilla.redhat.com/show_bug.cgi?id=843410
Diffstat (limited to 'src/virt-viewer-auth.c')
-rw-r--r-- | src/virt-viewer-auth.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/virt-viewer-auth.c b/src/virt-viewer-auth.c index 487e67c..9751ac8 100644 --- a/src/virt-viewer-auth.c +++ b/src/virt-viewer-auth.c @@ -96,7 +96,8 @@ virt_viewer_auth_collect_credentials(GtkWindow *window, #ifdef HAVE_GTK_VNC void -virt_viewer_auth_vnc_credentials(GtkWindow *window, +virt_viewer_auth_vnc_credentials(VirtViewerSession *session, + GtkWindow *window, GtkWidget *vnc, GValueArray *credList, char *vncAddress) @@ -125,6 +126,19 @@ virt_viewer_auth_vnc_credentials(GtkWindow *window, } } + VirtViewerFile *file = virt_viewer_session_get_file(session); + if (file != NULL) { + if (wantUsername && virt_viewer_file_is_set(file, "username")) { + username = virt_viewer_file_get_username(file); + wantUsername = FALSE; + } + if (wantPassword && virt_viewer_file_is_set(file, "password")) { + password = virt_viewer_file_get_password(file); + g_message (password); + wantPassword = FALSE; + } + } + if (wantUsername || wantPassword) { int ret = virt_viewer_auth_collect_credentials(window, "VNC", vncAddress, |