Don't use --nodeps for developer builds

Only use --nodeps when running under the autobuild engine

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix virt-viewer.exe on win32

Libvirt uses gnulib for making winsock look like POSIX
sockets. This means that in the libvirt event handle
callbacks the application will be given a file descriptor
rather than a winsock HANDLE object. The g_io_channel_unix_new
method will detect that it is an FD and delegate to the
g_io_channel_win32_new_fd method. Unfortunately the glib Win32
event loop impl is not very good at dealing with FD objects,
simulating poll() by doing a read() on the FD :-(

The API docs for g_io_channel_win32_new_fd say

 "All reads from the file descriptor should be done by
  this internal GLib thread. Your code should call only
  g_io_channel_read()."

This isn't going to fly for libvirt, since it has zero
knowledge of glib at all, so is just doing normal read().

Fortunately we can work around this problem by turning
the FD we get from libvirt back into a HANDLE using the
_get_osfhandle() method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Refresh translations

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Update for 0.6.0 release

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Display warning if UI file fails

When trying to load ui files, we try to find the file in several directories.
If a file is not found in one directory, try to load it from the next directory.
However, if a file is found in a directory but we are not able to load it (e.g.
due to unsupported versions of glade used to generate it, etc), we should print
a warning to the terminal to help the developer debug the issue.

This is an unexpected failure (whereas not finding the file in that directory at
all is an 'expected' failure).
Improve window title when connected to newer spice-server

Recent spice servers send the guest vm name and uuid to the client.  We can use
these values to display the proper vm name in the window title if a title is not
specified on the commandline. We can also be smarter about the title in
virt-viewer as well.

If a title is specified on the comamndline (-t/--title=foo), we use that.  If not,
we fall back to the vm name.  If that is empty, we fall back to the uri of the
connection.

Comparison between old behavior and new behavior

Using new spice-server
Command                                     Old title                   New title
-------                                     ---------                   ---------
remote-viewer -t xyz spice://host:port      xyz                         xyz
remote-viewer spice://host:port             spice://host:port           <vmname>
virt-viewer <vmname>                        <vmname>                    <vmname>
virt-viewer <uuid>                          <uuid>                      <vmname>

Using old spice-server
Command                                     Old title                   New title
-------                                     ---------                   ---------
remote-viewer -t xyz spice://host:port      xyz                         xyz
remote-viewer spice://host:port             spice://host:port           spice://host:port
virt-viewer <vmname>                        <vmname>                    <vmname>
virt-viewer <uuid>                          <uuid>                      <vmname>
Move vnc-specific auth logic to VirtViewerSessionVnc
Don't hide the main window when disconnecting

The main window (display #1) is treated a bit differently from other windows,
since it is opened at app start and displays status messages while we attempt to
connect to the remote guest.  As such, it should really stay open as long as the
app is running.

The impetus for this change is the following:
- user attempts to connect to a remote VNC display with a password
- user types the wrong password
- A dialog pops up indicating that authentication failed and asking if the user
  would like to try to re-connect.
- User clicks 'Yes'
- Because the connection was disconnected, all windows are closed
- remote-viewer tries to reconnect again, at which point a new display window is
  opened, and the window gets placed by the window manager (possibly on another
  monitor altogether).

As a user, I expect the program to simply re-use the existing window when trying
to re-authenticate, instead of having the window disappear and then re-appear at
a different location.  This patch accomplishes that.
Don't set VNC display to ready until vnc is initialized

We were setting the show_hint to READY as soon as we got the vnc-connected
signal.  But there may be an authentication step between vnc-connected and
vnc-initialized.  In this case, we switch to an empty black display during the
authentication step instead of showing the 'waiting for display N' status.
rhbz#1007306 - Don't free session if we're re-trying auth

deactivate() is called in response to a failed authentication attempt. If the
session is cleared here, when a user attempts to re-authenticate, it will issue
a warning and will not actually work. So only clear the session here if we're
not going to re-try authentication.
Improve docs for --attach flag in virt-viewer

People seem to have a hard time understanding the --attach flag.
Rewrite the docs in the hope that people figure it out this time.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix german translation of send key

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Fix a gcc warning when compiling with mingw32
spice: ask credentials for proxy

If Spice proxy requires authentication, ask credentials and try
connecting again.
spice: do not open in fullscreen with CONTROLLER_AUTO_DISPLAY_RES

This flag is always set when using the rhevm user portal. Best is
probably to ignore it, now that fullscreen has simplified unique
behaviour.
Don't resize guest display on zoom change

When the zoom level is changed, the virt-viewer window gets resized. But we
don't want this to trigger a resize of the guest display. But occasionally
rounding errors cause the guest display to be reconfigured when zooming out.  To
fix this, we first check whether the current size is the preferred size.  If it
is, we don't send down a resize command to the guest.

In addition to preventing guest resizes in response to zooming, it also improves
the behavior when the guest display resolution is changed from within the guest.
Before this change, we'd have the following behavior:
    A. guest changes display to WxH
    B. client gets notified of change and resizes the window to WxH
    C. client responds to window resize by sending a new monitor config command to the guest

With this change, the extra step C will be avoided because we're already at the
preferred size.

Resolves: rhbz#1004051
spec: Don't disable spice support on some archs

Nowadays spice-gtk no longer has an ExclusiveArch: x86 x86_64 %{arm}
virt-viewer can be built with spice-gtk support on all arches.
Revert "Don't resize guest display on zoom change"

This reverts commit 895ef8029e794e7b74a45f27c7c741d1332bc02b.