496 Commits

Author SHA1 Message Date
Christophe Fergeau
45a791082e Set a default dir/name for screenshots
It makes sense for the screenshots to be saved in ~/Images,
especially as otherwise the filechooser will display
'recent documents' to which we cannot save. This commit also sets
the default screenshot name to 'Screenshot'.
2012-11-15 10:21:03 +01:00
Christophe Fergeau
6d35a443da Fix spice-gtk check in configure.ac
The check that at least one of spice-gtk and gtk-vnc is present
uses a wrong variable name to check for spice-gtk presence, which
causes the check to think it's never present. This would make
gtk-vnc presence mandatory. This commit fixes the name of the
spice-gtk variable ($have_gtk_spice -> $have_spice_gtk).
2012-11-15 10:21:03 +01:00
Michal Privoznik
9983fe74dd Don't SIGSEGV if no transport is used.
One of previous commits (74b1b62510d939) allowed us to connect to
localhost directly if ssh transport was used. However, if there's
not transport, we SIGSEGV'ed as g_str_equal doesn't like NULL as
one of arguments. Change this to g_strcmp0 which does the same
service but is more friendly to NULL arguments.
2012-11-14 15:20:58 +01:00
Michal Privoznik
fa39c5335c Reconnect to libvirtd after connection breaks
Currently, if user wants to reconnect to a domain he can use
'-r' cmd line argument. This makes virt-viewer listen to
domain events. However, if connection to libvirtd breaks
somehow, we will receive no longer any event. Hence we must
reconnect to the libvirt.
2012-11-13 15:23:51 +01:00
Dave Allan
74b1b62510 Connect to localhost for display when transport is ssh
When connecting to a VM that does not have a 'listen' tag in its
graphcs element, we have to guess where to try to connect to the VM's
display.  The current default is the host specified in the connection
URI which is correct for most transports, however, the SSH transport
makes the display connection from the remote end, so in that case,
attempt to connect to localhost.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-11-08 17:44:18 +01:00
Guido Günther
7083a07a92 Fail if neither vnc nor spice is detected
Since the viewer makes little sense otherwise.
2012-10-25 12:14:33 +02:00
Marc-André Lureau
8b06fb7319 Fix jenkins build failure
virt-viewer-util.c: In function 'virt_viewer_util_init':
virt-viewer-util.c:289: warning: implicit declaration of function 'setlocale'
virt-viewer-util.c:289: warning: nested extern declaration of 'setlocale'
virt-viewer-util.c:289: error: 'LC_ALL' undeclared (first use in this function)
virt-viewer-util.c:289: error: (Each undeclared identifier is reported only once
virt-viewer-util.c:289: error: for each function it appears in.)
2012-10-23 15:59:38 +02:00
Marc-André Lureau
93da043657 Use a mutex to check if VirtViewer running
We need to warn user that installer can't proceed if there is already
a running instance of VirtViewer or of the installer.

https://bugzilla.redhat.com/show_bug.cgi?id=864033
2012-10-23 14:49:23 +02:00
Marc-André Lureau
14a1d48745 Use a common early init() function
There is a number of things both virt-viewer and remote-viewer need to
do early during execution. Do it only in one place.
2012-10-23 14:49:23 +02:00
Marc-André Lureau
53c6549fb4 windows: add debug-helper
This is a simple program that will set some debug variable, and run
gdb and wait until it finished. This makes it possible to debug
"remote-viewer --spice-controller" easily, by setting the necessary
variables and keeping the parent process running (the activex whatches
its death)

To use it, replace the HKCU "Software\spice-space.org\spicex\client"
value "$INSTDIR\bin\remote-viewer.exe --spice-controller" with
"$INSTDIR\bin\debug-helper.exe remote-viewer.exe --spice-controller".
2012-10-23 14:49:18 +02:00
Marc-André Lureau
08db836b13 nsis: add deps.txt file in installer
This helps track package version that were used during the
build of Windows installer. It's not ideal, but make up the
lack of package management on windows
2012-10-23 11:17:05 +02:00
Marc-André Lureau
e5895ce49f nsis: update required files and libraries 2012-10-23 11:17:05 +02:00
Marc-André Lureau
dca7397f16 win32: there is no CONERR$, only CONOUT$ 2012-10-23 11:17:04 +02:00
Marc-André Lureau
3bb6f5ec80 spice: only autoresize once with screen size in fullscreen
It's currently not possible to configure guest with higher resolution
than native, as it will switch back to native, since the gtk widget
allocation will always end up being the size of the screen. We
special-case fullscreen mode, and only resize when entering
fullscreen. Furthermore, it avoids sending extra unnecessary resize
events to the guest whenever gtk+ call size allocate in various
stages, with different values.

https://bugzilla.redhat.com/show_bug.cgi?id=864929
2012-10-18 00:44:36 +02:00
Marc-André Lureau
435a542de2 spice: avoid rounding issues when scaling up display
Fix some unwanted guest resize due to rounding issues (at least when
scaling up)

We may want to save the original remote desktop size, instead of
always checking widget requisition. That way zooming shouldn't resize
guest at all, but it seems tricky to handle that special case vs user
window resize that should trigger guest resize.

https://bugzilla.redhat.com/show_bug.cgi?id=856678
2012-10-17 16:50:14 +02:00
Marc-André Lureau
143bc8a33f Do not resize window to minimum when toggling auto-resize
The virt_viewer_display_idle() will queue a resize event that will
result in display size requisition of 50x50. If we later resize the
window to 1x1 in virt_viewer_window_resize() we end up with a tiny
window.

It is legitimate not to force that 1x1 window resize when toggling the
option. After the rest of the logic in virt_viewer_window_resize(), if
the remote desktop ends up being resize, that will trigger another
virt_viewer_set_desktop_size() and finally change the window size
appropriately.

https://bugzilla.redhat.com/show_bug.cgi?id=856610
2012-10-16 20:41:47 +02:00
Daniel P. Berrange
dcbd306051 Add RPM magic to run autoreconf
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-12 19:29:00 +01:00
Daniel P. Berrange
c4bfbe104f Fix check for IPv6 any address
The string '::' is just one of many possible ways to express
the IPv6 "any" address. Others include  '::0', '0:0:0:0:0:0:0:0',
'0::0' and more. Instead of trying to do strcmp, actually try
parsing the address with GInetAddress and then simply use an
accessor to check what type it is

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-10 16:28:38 +01:00
Daniel P. Berrange
fe485f22de Allow user to set a window title for remote-viewer
Currently the remote viewer windows get the URI as their
title. Provide a --title STRING arg to remote-viewer to
let the user override the title with something more
meaningful to them.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-10-09 17:25:19 +01:00
Christophe Fergeau
a4e588e3ea Don't free SPICE ticket twice
Commit 2201a5a was supposed to free a SPICE ticket leak, but it's
actually introducing a double-free as the SPICE ticket is
unconditionally freed at the end of
virt_viewer_session_spice_main_channel_event
2012-10-01 18:41:26 +02:00
Christophe Fergeau
d5bbe725d3 Append \n to message in virt_viewer_app_trace
Callers manually add a trailing \n when they call virt_viewer_app_trace,
but it's sometimes forgotten, leading to rhbz#822794. This commit
removes the \n from all callers (it was missing in a few of them)
and adds it in virt_viewer_app_trace.
2012-09-18 15:55:38 +02:00
Daniel P. Berrange
0f85fca802 Refresh translations
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-09-18 14:28:42 +01:00
Daniel P. Berrange
c36c848904 Update for 0.5.4 releae v0.5.4 2012-09-17 11:53:12 +01:00
Daniel P. Berrange
a732a94df3 Use a more specific regex to fix enum include paths
Simply doing a search replace on $(srcdir) doesn't work very
well in non-VPATH builds. Use a more specific regex that won't
generate false matches
2012-09-14 18:00:27 +01:00
Daniel P. Berrange
f8c6065330 Look in builddir for icons & strip build dir prefix from enum file includs 2012-09-14 17:35:31 +01:00
Daniel P. Berrange
879517fe46 Don't include generated icons in tar.gz and clean them up 2012-09-14 17:35:10 +01:00
Daniel P. Berrange
c8e0550a82 Convert to use Mingw64 toolchain for Windows biulds 2012-09-14 17:34:53 +01:00
Christophe Fergeau
c5d4570c11 Document -f=auto-conf in remote-viewer --help
virt-viewer does not support -f=auto-conf so this does not change the
option there.
Fixes rhbz#718001
2012-08-13 15:51:48 +02:00
Christophe Fergeau
3d43a9f455 Use real binary name in help message
Now that we have 2 distinct binaries, remote-viewer and virt-viewer,
'PACKAGE' can no longer be used in error messages as the name of the
binary. This causes a small inconsistency when running
'remote-viewer --foobar' as the error message would be:
'Unknown option --foobar
Run 'virt-viewer --help' to see a full list of available command line options'

This commit makes sure we use argv[0] for this message.
Fixes rhbz#814150
2012-08-10 15:50:46 +02:00
Marc-André Lureau
e88f5a52cf Show status page by default if display not ready
Switch back to status page if display is not ready.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
98ac529c0a Make status widget visible immediately
GtkNotebook will use the currently visible widget as default page.
If we don't show status widget before we append the display, the
current page will be on display. Quoting Gtk+ documentation:

"Note that due to historical reasons, GtkNotebook refuses to switch to
a page unless the child widget is visible. Therefore, it is
recommended to show child widgets before adding them to a notebook."
2012-07-23 16:27:33 +02:00
Marc-André Lureau
527a7182d6 vnc: when session is disconnected, make the display as non-ready 2012-07-23 16:27:33 +02:00
Marc-André Lureau
5de6af3095 Simplify display flag handling 2012-07-23 16:27:33 +02:00
Marc-André Lureau
85d5658b63 Add VirtViewerSession::session-display-updated
Rebuild menu when agent is connected. Only when the agent is running
may a display be enabled/disabled.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
8006302fef Make the display submenu insensitive if display can't be selected 2012-07-23 16:27:33 +02:00
Marc-André Lureau
57bf1e9090 spice: factor out main channel lookup code 2012-07-23 16:27:33 +02:00
Marc-André Lureau
6f9c7a624e Add VirtViewerDisplay::selectable property
This property will be set when the display can be selected to be
"enabled" and shown (this can involve creating/connecting an
additional guest monitor, and may need guest agent cooperation for
example).
2012-07-23 16:27:33 +02:00
Marc-André Lureau
37c30a4569 Add virt_viewer_window_get_display()
Getter used in following changes.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
0d58d9c729 Hook up handling of Monitors
Rely on spice-gtk display channel monitors property to manage
displays. The same display channel may now provide several monitors,
the SpiceDisplay widget must be told which monitor to display
2012-07-23 16:27:33 +02:00
Marc-André Lureau
c8d20b35bd Bump glib > 2.22, add compat file
We use API from 2.22, and some from further version. Add
virt-glib-compat.h fallback file for those.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
db7c5b20b0 Use SpiceDisplay:ready property instead of channel mark
The display can now check several conditions before the display can be
shown, use that instead of display mark, which was not high-level
enough.
2012-07-23 16:27:33 +02:00
Marc-André Lureau
f3097fcca9 Number display starting from 1 2012-07-23 16:27:32 +02:00
Marc-André Lureau
90b67222d1 Prevent from adding the same display several time in the session
In virt_viewer_session_spice_display_monitors(), we (re)add the
display unconditionnaly every time we receive a new MonitorConfig.
2012-07-23 16:27:32 +02:00
Marc-André Lureau
2a085766f1 Add a DISABLED display hint
This flag will help to track whether the display has been
removed/closed and whether it really has a valid display.

Ready in contrast, is used to "hide" temporarily the display (when
starting or redrawing the display, to avoid artifacts)
2012-07-23 16:27:32 +02:00
Marc-André Lureau
0897382b45 Use virt_viewer_connect_object() for display
When display is released, detach signal automatically.

Fix various crash related to not cleaning up signal handlers properly,
due to no longer 1-1 only relation between display widget and channel.
2012-07-23 16:27:32 +02:00
Marc-André Lureau
cab1ab0e57 Rebuild display menu when a window is added or removed 2012-07-23 16:27:32 +02:00
Marc-André Lureau
9c15005026 Mark a menu string as translatable 2012-07-23 16:27:32 +02:00
Marc-André Lureau
02b326f80b Run-time check values before doing bad computation 2012-07-23 16:27:32 +02:00
Marc-André Lureau
560767b573 Turn display:show-hint into flags type 2012-07-23 16:27:32 +02:00
Marc-André Lureau
3b70561666 Destroy dialog immediately after run
If the parent is already destroyed, it looks like the dialog is
destroyed too. This avoids a crash when calling app_quit().
2012-07-23 16:27:32 +02:00