Commit Graph

1006 Commits

Author SHA1 Message Date
Pavel Grunt
aec2248cf8 virt-viewer: Bring back debug log about nonexistent guest
Although commit 88f6341 allowed to use virt-viewer with a wrong guest name,
the user is informed about the nonexistent guest only by a dialog showing
the list of running machines or informing about the connection error.

Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1201177
2015-03-23 19:32:02 +01:00
Jonathon Jongsma
c586dc8c2b Monitor config at sometimes leaves additional monitors enabled
When using the configuration file to specify which remote monitors should be
enabled when using the --full-screen option, it sometimes left additional
displays enabled, or didn't place the displays on the right monitor, or didn't
fullscreen them.

This was especially true when not enabling the first display on the remote
host. For example:

  monitor-mapping=2:2;3:3

(note that configuration file uses 1-based indexes, rather than 0-based
indexes, so the numbers used below will be 1 less than those above)

Previously, when performing fullscreen auto-conf, we were configuring displays
starting at #0 and ending at ndisplays. So for the previous configuration, we
looped from i = 0 to i < 2 (i.e. display #0 and #1) even though we should have
configured display #1 and #2. After this fix, we configure the exact displays
that were specified in the monitor-mapping configuration.

Resolves: rhbz#1200750
2015-03-23 10:15:03 -05:00
Jonathon Jongsma
b368761ea1 Use 'constructed' vfunc instead of 'constructor'
We don't need the added complexity of 'constructor', since we only want
to do some final initializing after all of the properties have been set,
etc. So just use the simpler 'constructed'.
2015-03-23 10:11:51 -05:00
Jonathon Jongsma
3b8be76459 VirtViewerApp: create main window after constructor
When using the configuration file to specify which remote monitors
should be enabled when using the --full-screen option, it sometimes left
additional displays enabled, or didn't place the displays on the right
monitor, or didn't fullscreen them.

Part of the problem was that we were creating the first display window before
loading the monitor mapping configuration from the settings file. So even if
the first display was disabled in the configuration, the first window will
still be created with an id of 0, and therefore didn't get set to fullscreen.
Moving the main window creation to the 'constructor' vfunc instead of the
object init func ensures that the configuration is all loaded before we attempt
to do any fullscreen autoconf.

Related: rhbz#1200750
2015-03-23 10:10:07 -05:00
Fabiano Fidêncio
4de3379f34 Update geometry when enabling/disabling displays
_update_displays_geometry() must be called every time a display is
enabled/disabled, avoiding gaps (when a display is disabled) or overlaps
(when a display is enabled) between the monitors.

This is what happens when we have 3 displays enabled (each one
represented by: width x height + x position + y position) ...

  Display #0       Display #1         Display #2
 +---------+      +----------+       +---------+
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 |         |      |          |       |         |
 +---------+      +----------+       +---------+
(680x804+0+0)   (504x804+680+0)    (408x804+1184+0)

Whether the Display #1 is disable, a message will be sent down to the
vdagent, representing the new arrangement of the monitors:

  Display #0     Display #2
 +---------+     +---------+
 |         |     |         |
 |         |     |         |
 |         |     |         |
 |         |     |         |
 |         |     |         |
 |         |     |         |
 +---------+     +---------+
(680x804+0+0)  (408x804+1184+0)

However, taking a look on the x position, a gap can be identified as
Display #0 starts at position (0,0) and has 680 pixels of width. But
Display #1 only starts at position (1184, 0), leaving 504 pixels as a
gap. The proper message, however, should represent the following
arrangement ...

  Display #0       Display #2
 +---------+      +---------+
 |         |      |         |
 |         |      |         |
 |         |      |         |
 |         |      |         |
 |         |      |         |
 |         |      |         |
 +---------+      +---------+
(680x804+0+0)   (408x804+680+0)

... avoiding then gaps and overlaps.

Resolves: rhbz#1111425
https://bugzilla.redhat.com/show_bug.cgi?id=1111425
2015-03-16 20:54:05 +01:00
Christophe Fergeau
1e63a40014 Deal with NULL gport in virt_viewer_app_set_connect_info()
virt_viewer_app_set_connect_info() has a debug statement printing
gport/gtlsport. It checks that gtlsport is not NULL before printing it,
but makes no similar check for gport. Since it's possible to get a NULL
gport when using ovirt:// after the previous commit, it's better to check
it too.
2015-03-13 15:51:58 +01:00
Christophe Fergeau
1eafd0407e ovirt: Don't try to use invalid port numbers
If a remote oVirt VM don't specify a port/secure port number, we'd still
try to pass it down to spice-gtk, which would then complain that 0 (the
default value) isn't a valid port number.
This commit make sure we filter out the default port/secure-port value
and pass NULL to spice-gtk instead when we get these values.
2015-03-13 15:51:58 +01:00
Christophe Fergeau
32d0ae09b8 foreign-menu: Don't show empty foreign menu on secondary displays
When using ovirt://, the foreign menu will only be shown in the primary
window after getting notified about OvirtForeignMenu::files (ie when
it managed to fetch some ISO files to show in the foreign menu).

However, for secondary windows, the foreign menu will be added to the
window even if there are no files to show. This commit makes sure we
destroy the window foreign menu whenever it would be empty.
2015-03-13 15:51:58 +01:00
Fabiano Fidêncio
f2967d0d88 POTFILES: Add virt-viewer-preferences.xml
The file was introduced in commit
73b80ba99f
2015-03-12 18:09:28 +01:00
Fabiano Fidêncio
d366f20180 spec: Add virt-viewer-preferences.xml
The file was introduced in commit
73b80ba99f
2015-03-12 18:09:28 +01:00
Christophe Fergeau
ccafa32fe0 ovirt: Fail gracefully when hostname is missing
When parsing info returned by oVirt REST API, the hostname should be
present. However, I recently run remote-viewer against a buggy oVirt
instance where the hostname was missing. This commit handles better this
situation by displaying an error message and exiting.
2015-03-12 17:48:36 +01:00
Christophe Fergeau
f9577b9197 ovirt: Take into account SPICE proxy
VMs managed by oVirt can be hidden behind a proxy. This commit allows
remote-viewer to make use of this information when it's available
A recent oVirt instance is needed so that it's available through the
REST API, as well as libgovirt 0.3.3 or newer.
With older oVirt/libgovirt versions, the worst that can happen is a
runtime warning in the console, and an impossibility to connect to VMs
behind a proxy, so this commit is not raising the minimum libgovirt
requirement.
2015-03-12 17:48:22 +01:00
Fabiano Fidêncio
21306d13f9 Take --direct into consideration when checking if a guest is reachable
When connecting to a remote host (using qemu+ssh://...) that has a
virtual machine listening to "127.0.0.1", virt_viewer_is_reachable() must
take --direct into account, otherwise it can end up connecting to a local
virtual machine listening to "0.0.0.0" instead of returning that the
guest is not reachable.

Resolves: rhbz#1085216
2015-03-12 01:54:30 +01:00
Fabiano Fidêncio
3d5a295354 Add G_SOURCE_REMOVE to vir-glib-compat
G_SOURCE_REMOVE was introduced in GLib 2.32 and has its value defined as
FALSE.
2015-03-11 11:52:43 +01:00
Fabiano Fidêncio
fa952ad9b2 Avoid 'Dereference of a null pointer'
Caught by Covscan.
2015-03-11 11:52:43 +01:00
Marc-André Lureau
618e22d71a Enable share folder widgets if supported by session 2015-03-05 21:31:31 +01:00
Marc-André Lureau
526757b01f Add virt_viewer_session_can_share_folder()
Functions name says it all, it is only implement for Spice, checking
for webdav channel presence.
2015-03-05 21:31:31 +01:00
Marc-André Lureau
7254b0256a Sync preferences widgets with session properties 2015-03-05 21:31:31 +01:00
Marc-André Lureau
31b23e7f0a Show preferences dialog
Add a menu item Preferences under File and show the preferences dialog
2015-03-05 21:31:31 +01:00
Marc-André Lureau
73b80ba99f Add preferences dialog UI file 2015-03-05 21:31:30 +01:00
Marc-André Lureau
e426599d86 spice: enable/disable share folder
Connect/disconnect webdav channel to enable or disable sharing folder
2015-03-05 21:31:26 +01:00
Marc-André Lureau
73f70899e4 spice: sync share folder preferences with session 2015-03-04 16:39:14 +01:00
Marc-André Lureau
77ac0d8892 Bump spice-gtk to 0.28
The following patches will only work with spice-gtk >= 0.28.
2015-03-04 16:39:14 +01:00
Marc-André Lureau
6f057f24dd Add a few session properties for share folder
See properties comments for details.
2015-03-04 16:39:14 +01:00
Marc-André Lureau
5d0771f704 misc: add a missing "static" for function 2015-03-04 16:39:14 +01:00
Daniel P. Berrange
f627630086 Switch over to use zanata for managing translations
Push new pot with

  cd po
  make virt-viewer.pot
  zanata push

Pull new translations with

  cd po
  zanata pull

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2015-02-23 13:21:12 +00:00
Pavel Grunt
45c6fc9b06 Do not add "https://" and "/api" to oVirt URI
It is deprecated since govirt 0.3.1 (and virt-viewer already depends on
govirt 0.3.2).

Silences:
(remote-viewer:19420): libgovirt-WARNING **: Passing a full http:// or https:// URI to ovirt_proxy_new() is deprecated
(remote-viewer:19420): libgovirt-WARNING **: Passing an URI ending in /api to ovirt_proxy_new() is deprecated
2015-02-18 14:07:50 +01:00
Daniel P. Berrange
a7d62c285a Bump release to 3.0 for next dev cycle 2015-01-12 18:01:35 +00:00
Daniel P. Berrange
ddd9bba0b5 Update NEWS for 2.0 release 2015-01-12 17:39:20 +00:00
Marc-André Lureau
668c52775f wixl: use a versionized installation directory
It turned out that not only the current MSI broke the "component rule",
but also that our files are not versionized correctly. Windows Installer
applies some file versioning rules before replacing a file
http://msdn.microsoft.com/en-us/library/aa368599%28v=vs.85%29.aspx

Since msitools doesn't extract version from files and populate the Version
field of the File table, it "usually" keep the current file installed.

It's practically impossible to rely on version information from
files (from a quick look, only 5% of the files are versionized and even
less correctly, libgcrypt seems to do non-monotonic buildid for example)

So the rule that applies when files are not versionized is to check the
file hash, and the modified date. File hash was added recently in
msitools, but doesn't apply when the installed file itself has a
version.

In order to solve the above problems, it's simpler to just have a
different installation prefix. Windows Installer will see files with
different component guid, and won't be checking any file update rule.  I
have verified the upgrade is working, not leaving any file behind and
updating registry correctly with this solution. Until the files are
correctly versionized, it looks like the only sensible thing to
do. Furthermore, this make it simpler to have several versions installed
in parallel later on (when we change productid)
2015-01-12 17:04:46 +00:00
Daniel P. Berrange
29f2d8a8e8 Update LINGUAS file from translation refresh 2015-01-12 11:29:33 +00:00
Daniel P. Berrange
625677c589 Tweak autobuild.sh to facilitate release builds 2015-01-12 11:27:56 +00:00
Daniel P. Berrange
675e47f0b4 Refresh translations from transifex 2015-01-12 11:25:52 +00:00
Daniel P. Berrange
a2a38b2721 Add deps on mingw glib-networking RPMs needed by libsoup 2015-01-09 11:13:30 +00:00
Daniel P. Berrange
d7e524fa75 Update mingw RPM deps to refer to gstreamer1 2015-01-09 10:51:45 +00:00
Daniel P. Berrange
83d0ea485e Fix typo s/SPICE_GTK3_REQUIRED/SPICE_GTK_REQUIRED/
There is no separate version constant for SPICE GTK2 vs GTK3
2015-01-08 18:05:53 +00:00
Fabiano Fidêncio
a51c70771a virt-viewer: set transient parent for connection's error dialog
Commit c3d24f8b sets transient parent for the most part of the
GtkDialogs, but seems like this one was forgotten.
2015-01-08 16:13:35 +01:00
Christophe Fergeau
5a07c59e8f virt-viewer: Don't connect to localhost displays with qemu+tcp://
When connecting to a remote libvirt instance, a VM may only be listening
on localhost for SPICE/VNC connections. In such a situation, virt-viewer
then tries to connect to localhost, which is not correct as this
'localhost' referred to the remote libvirt host it connected to.
This commit adds a couple of tests on the libvirt URI used and the
<graphics> listen address to error out in this situation.

Resolves: rhbz#1108523
2015-01-06 15:38:09 -06:00
Jonathon Jongsma
c2eb85c712 Remove 'map' handler for VirtViewerDisplay
In order to solve several problems with sizing and resizing displays, a
'map' handler was added to VirtViewerDisplay. The first time the map
handler runs, its queues a resize to attempt to ensure that the window
gets created at its desired size. Subsequent map events generate a call
to _make_resizable(), which was an attempt to ensure that the window was
always 'shrinkable' on the Microsoft Windows platform. Recent testing
suggests that this _make_resizable() is not actually necessary on
Windows anymore, since it is possible to shrink the display even when
this call is removed.

In addition, the call to _queue_resize() is a bit of an indirect
solution to the problem of ensuring the proper size at startup. What we
really want is to guarantee that the very first size request negotiation
returns the desired size rather than the minimum size. In order to do
this, we've added a flag to determine whether we've ever received a size
request, and if not, we return our desired size, even if 'dirty' is not
set.
2015-01-06 09:13:50 -06:00
Fabiano Fidêncio
f05f30d7de spec: Update mingw in order to use gstreamer1 2015-01-05 23:28:26 +01:00
Victor Toso
3bbf1ded1c nsis: use gstreamer-1.0 instead of gstreamer-0.10
Spice-gtk now is able to use gstreamer-1.0 for playback and record
audio. This patch updates the installer to use the latest version.
2015-01-05 23:28:26 +01:00
Christophe Fergeau
719352e608 win: Use correct format string for intptr_t
Using %d as a format-specifier for intptr_t causes a warning with
mingw64:
virt-viewer-events.c: In function 'virt_viewer_events_add_handle':
virt-viewer-events.c:103:5: warning: format '%d' expects argument of
type 'int', but argument 5 has type 'intptr_t' [-Wformat=]
     g_debug("Converted fd %d to handle %d", fd, _get_osfhandle(fd));
2015-01-02 13:49:05 +01:00
Fabiano Fidêncio
ca1dac5ba9 spec: Update mingw in order to use ovirt 2014-12-23 00:57:44 +01:00
Fabiano Fidêncio
25a236473a spec: Update mingw in order to use gtk3 2014-12-23 00:55:58 +01:00
Fabiano Fidêncio
2cbfd08b09 nsis: use gtk-vnc conditionally
Only include gtk-vnc as dep when it's explicitly done in the configure.
2014-12-23 00:42:05 +01:00
Fabiano Fidêncio
c7cbf57efc nsis: use spice-gtk conditionally
Only include spice-gtk as dep when it's explicitly done in the configure.
2014-12-23 00:42:05 +01:00
Fabiano Fidêncio
979eab69f2 nsis: use libgovirt conditionally
Only include libgovirt as dep when it's explicitly done in the configure.
2014-12-23 00:42:02 +01:00
Fabiano Fidêncio
6baccb2b78 nsis: add missing file needed to use virsh.exe 2014-12-23 00:40:37 +01:00
Fabiano Fidêncio
5159956305 nsis: use libvirt conditionally
Only include libvirt as dep when it's explicitly done in the configure.
2014-12-23 00:40:05 +01:00
Fabiano Fidêncio
de700d09ef msi: use gtk-vnc conditionally
Only include gtk-vnc as dep when it's explicitly done in the configure.
2014-12-21 22:52:49 +01:00