Commit Graph

867 Commits

Author SHA1 Message Date
Fabiano Fidêncio
276ca0f753 Add support to view the password entry content
Allow users to check if the entered password is right and/org modify
the password easily in case it's wrong.
2014-09-17 13:45:46 +02:00
Fabiano Fidêncio
e825e183a1 Mark all strings for translation in the auth dialog
A few strings weren't marked for translation in the authentication
dialog.
2014-09-15 14:54:02 +02:00
Fabiano Fidêncio
55cdb9867d Do not show duplicated menu items
When the support to use numpad accelerators for zoom-{in,out,reset}
was added (3a168815), by mistake, we have added duplicated buttons
in View -> Zoom.
2014-09-15 14:53:53 +02:00
Christophe Fergeau
69eccb59f9 Fix --without-spice-gtk --with-ovirt build
The oVirt foreign menu support reused some existing bits from the older
SPICE controller foreign menu code. However, this controller code is
only built when spice-gtk support is built, while the oVirt foreign menu
code could be used with VNC as well. Trying to build the ovirt foreign
menu code without spice-gtk causes build issues due to missing
functions, or missing declarations, ...

The libgovirt/spice-gtk code which is entangled is the code to update
the foreign menu when its content changes, or when a new window is
opened. Making the oVirt-specific code independant from the
spice-gtk-specific code is not too complicated, but this comes at the
expense of a bit of code duplication, but this is only simple code
iterating over the GHashTable storing the opened windows.

Resolves: rhbz#1127156
2014-09-12 17:08:42 +02:00
Christophe Fergeau
fe7927733c Add translatable file to POTFILES.in 2014-09-12 17:08:42 +02:00
Jonathon Jongsma
8f16b38f9e Remove extra ref on SpiceDisplay
There's no need to ref the SpiceDisplay widget when adding it to a
container. The container will take its own ref.
2014-09-11 09:30:23 -05:00
Jonathon Jongsma
401906afd7 VirtViewer: Fix memory leaks
Don't leak priv->uri or priv->domkey from VirtViewer class
2014-09-11 09:30:17 -05:00
Jonathon Jongsma
75b7ff0fa2 Don't print warning for missing comment in config file
Change g_warning to g_debug as suggested by Marc-Andre
2014-09-05 11:15:52 -05:00
Jonathon Jongsma
2561c171e7 Change collect_credentials() to return a boolean
Instead of returning 0 for success and -1 for failure, change to a
boolean success value to be more consistent with the rest of the
virt-viewer code.
2014-08-26 16:54:01 -05:00
Jonathon Jongsma
b7c8049460 Auth: fix leak of username
When collect_credentials() returns a failure status, 'username' was
potentially leaked.
2014-08-26 16:54:01 -05:00
Jonathon Jongsma
ad8966ccf9 remote-viewer: oVirt username review fixes
Minor fixes from patch review

rhbz#1061826
2014-08-19 14:15:53 -05:00
Fabiano Fidêncio
e85ae4c27c Force displays to update geometry when agent connects
We have to force displays to update geometry when the agent connects to
ensure the client will have the guest with the right resolution when the
guest has rebooted or the agent has crashed.

https://bugzilla.redhat.com/sho_bug.cgi?id=1021841
2014-08-19 18:11:48 +02:00
Fabiano Fidêncio
4767491532 Fix gcc warning (unused-parameter) 2014-08-19 18:10:04 +02:00
Fabiano Fidêncio
729ce99023 Fix gcc warning (missing-prototypes) 2014-08-19 18:10:04 +02:00
Fabiano Fidêncio
3a168815b7 Add support to use numpad accelarators for zoom-{in.out,reset}
As virt-viewer uses GtkAccelMap for shortcuts and that GTK only can have
one key binding per accelerator (in accel_map_add_entry), let's also add
support specificly for the numpad keys in the virt-viewer code

https://bugzilla.redhat.com/show_bug.cgi?id=883433
2014-08-19 18:10:04 +02:00
Fabiano Fidêncio
dc3db6302e Don't check for NULL when it never can happen 2014-08-19 18:10:03 +02:00
Christophe Fergeau
6ab5444c81 Create foreign menu from .vv file information
When the .vv file has an [ovirt] section, we should try to create a foreign
menu out of it. This will allow remote-viewer to offer a menu to change the
currenty inserted cdrom.

Contrary to the ovirt:// case when we already have fetched an OvirtAPI
and OvirtVm instance in order to get the SPICE/VNC connection details,
when working from a .vv file, we'll need to get them from the REST API.
Authentication should happen through the JSESSIONID cookie, if that
fails we want to give up on using the foreign menu, so we don't need to
set up authentication callbacks.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
eb4a7e4a84 Add ovirt-specific properties to VirtViewerFile
They will be useful to implement foreign menu support through
oVirt REST API
2014-08-18 13:20:42 +02:00
Christophe Fergeau
c7a8bcdb63 Add 'group' argument to VirtViewerFile helpers
For foreign menu support, we'll need a way to pass oVirt-specific
information in the .vv file. This will be done through an additional
[ovirt] section, this commit is in preparation for that.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
3df1e5a17a ovirt: Use OvirtForeignMenu class
After the previous commit which introduced the OvirtForeignMenu
class, we can now make use of it in the remote-viewer UI code.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
894396d6b5 ovirt: Add OvirtForeignMenu class
This class is used to implement the so-called oVirt 'foreign menu'
which is a menu populated with ISO images available on the
oVirt instance that the user can dynamically insert into the
virtual machine he is currently viewing.
2014-08-18 13:20:42 +02:00
Christophe Fergeau
914f75ee8d ovirt: Remove extra '/' from oVirt URI
The 'path' part of the URI will always start with a '/' when present as
this is what separates it from the hostname. When rebuilding the final
URI, the current code inserts a '/' by itself between the hostname and
the path, which results in URIs with an extra '/':
https://ovirt.example.com//some/path/api

This is not only cosmetic as this can cause issues with cookie handling
if libgovirt accesses //some/path/api while the cookie is set for
/some/path/api.
2014-08-18 13:20:42 +02:00
Jonathon Jongsma
49abd71dae remote-viewer: allow username in ovirt URIs
When the user launches remote-viewer with an ovirt URI of the form

        ovirt://user@host/vmname

Pre-populate the authentication dialog with the specified username. We
don't support specifying the password on the commandline, since that is
a potential security risk.

rhbz#1061826
2014-08-18 13:20:42 +02:00
Jonathon Jongsma
8b7f5db573 Don't use fallback ca-file when launching vv-file
When launching from a vv-file, we want to use the ca specified in the vv
file and not load additional certs from the fallback ca-file. This
ensures that the ca-file property of the spice session is unset when
loading a ca from a vv-file.

Resolves: rhbz#1127762
2014-08-15 11:22:59 -05:00
Jonathon Jongsma
0ca9959f00 Write vm name to config file as comment 2014-08-07 08:51:15 -05:00
Jonathon Jongsma
539e672437 Change per-guest fullscreen config format
use <display>:<monitor>;<display>:<monitor> instead of simply implying the
display from the array index (e.g. <monitor>;<monitor>). This allows you to set
up sparse guest displays (e.g. display 1 + 3).

For example, to configure display 1 to be fullscreen on monitor 2 and display 2
to be fullscreen on monitor 3:

    monitor-mapping=1:2;2:3
2014-08-07 08:51:15 -05:00
Jonathon Jongsma
b684a76fa4 Add a dialog showing details of the current guest
This allows the user to obtain the GUID and vm name of the currently-connected
guest.  Obviously, this only works with spice. In the future, it will allow them
to set guest-specific configuration options (using a GUID as a key)
2014-08-07 08:51:15 -05:00
Christophe Fergeau
7d8abf3957 Fix warning when going in/out of fullscreen
Going to fullscreen, and then exiting causes these messages to show up
on the console:
(remote-viewer:14481): GLib-CRITICAL **: Source ID 784 was not found
when attempting to remove it
2014-08-04 17:41:50 +02:00
Christophe Fergeau
5dcd46c0b1 Remove unused RemoteViewerPrivate members 2014-08-04 17:41:50 +02:00
Christophe Fergeau
4eaeab65a3 Remove incorrect G_GNUC_UNUSED from remote_viewer_window_added
The 'app' parameter is used in the function.
2014-08-04 17:41:50 +02:00
Christophe Fergeau
7d2dc19717 Remove unused VirtViewerNotebook::dispose
The vfunc implementation is only chaining to its parent, removing it
will achieve the same result.
2014-08-04 17:41:50 +02:00
Christophe Fergeau
e7418992ea Chain up to parent's dispose at the end of VirtViewerWindow::dispose
glib documentation says this should be the last thing done in the
dispose() call, which makes sense as this could invalidate still-needed
data in the parent object.
2014-08-04 17:41:50 +02:00
Marc-André Lureau
808715491b virt-viewer.xml: remove zoom-{in,out} accelerators
The XML menu accelerators conflict with accelerator set in the code and
prevent using them. This is a regression from d29fc63d.
2014-07-22 13:22:12 +02:00
Marc-André Lureau
6b997e5696 Only filter virt-viewer debug messages
Filter only our own debug messages.

https://bugzilla.redhat.com/show_bug.cgi?id=1118365
2014-07-21 18:47:36 +02:00
Marc-André Lureau
2262d4b5b4 Always set ask-quit setting
Avoid creating empty settings files, always set the ask-quit key.

https://bugzilla.redhat.com/show_bug.cgi?id=1006737
2014-07-21 18:46:58 +02:00
Marc-André Lureau
4c65848526 spice: avoid crash if connection failed without error
spice_channel_get_error() is not guarantee to return a GError.
2014-07-21 18:46:58 +02:00
Daniel P. Berrange
507f426a7f Bump version to 2.0 for next dev cycle 2014-07-21 15:34:13 +01:00
Daniel P. Berrange
50536e7b58 Update NEWS for 1.0 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-07-21 11:07:31 +01:00
Daniel P. Berrange
2575ab49f2 Refresh translations from transifex
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-07-21 11:06:33 +01:00
Marc-André Lureau
d29fc63dc2 Make ctrl-[+-] zoom in/out in fullscreen
Make ctrl-[+-] zoom in/out in fullscreen
with mouse over the control bar.

https://bugzilla.redhat.com/show_bug.cgi?id=987549
2014-07-08 16:36:52 +02:00
Marc-André Lureau
225dff3cb0 app: report disconnection error details
It may be useful to provide more detailed reason for disconnection.

https://bugzilla.redhat.com/show_bug.cgi?id=1115986
2014-07-08 16:36:52 +02:00
Marc-André Lureau
df28177c67 app: add virt_viewer_app_make_dialog()
Add a function to create an application dialog. In the following
commit, we will add more details for connection failures.
2014-07-08 16:36:52 +02:00
Jonathon Jongsma
abb888bce7 Use GOptionGroup for VirtViewerApp options
Encapsulate things a bit better by adding
virt_viewer_app_get_option_group() which provides a GOptionGroup rather
than exposing an array of options.  This option is then set as the main
option group, and additional options can be added by subclasses, so the
effect to the user should be equivalent.
2014-07-02 15:59:39 -05:00
Jonathon Jongsma
de3e27b333 Set help output summary correctly
Use g_option_context_set_summary() to provide a brief description of the
executable instead of tacking the summary onto the end of the
commandline.
2014-07-01 15:14:38 -05:00
Jonathon Jongsma
657d490e93 remote-viewer: mention vv-file in help output
The man page already has a description of the vv-file format, but the
--help output didn't mention it how to use it.

References: rhbz#970825
2014-07-01 15:14:08 -05:00
Christophe Fergeau
4cf0a83781 build-sys: Use automake 'subdir-objects' option
This silences an automake 1.14 warning:

src/Makefile.am:35: warning: source file 'view/autoDrawer.c' is in a
subdirectory,
src/Makefile.am:35: but option 'subdir-objects' is disabled
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the
'subdir-objects'
automake: automake option hasn't been enabled.  For now, the
corresponding output
automake: object file(s) will be placed in the top-level directory.
However,
automake: this behaviour will change in future Automake versions: they
will
automake: unconditionally cause object files to be placed in the same
subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option
throughout your
automake: project, to avoid future incompatibilities.
2014-06-26 21:22:27 +02:00
Christophe Fergeau
14f3041930 Don't use C99 for loops
Declaring a local variable as part as a for loop
such as 'for (unsigned int i; i < N; i++)' is a C99 specific feature.
Running configure with --enable-compile-warnings=minimal does not add
-std=c99 to the compile flags, so it's better if the codebase does not
require C99 support from the compiler.
2014-06-26 21:22:18 +02:00
Jonathon Jongsma
eaaa4f5106 rhbz#1111514: Fix un-shrinkable displays on windows guests
Commit 6edde5786 introduced a regression wrt shrinking windows on windows
guests. This seems to be because resizing a display often causes the notebook
widget to switch to the status page temporarily (often so quickly that it's not
noticeable to the eye). This causes a quick 'unmap' and 'map' event sequence on
the display widget. Apparently the timing of these events varies enough between
linux and windows guests that it is only noticeable on windows gueststhe timing
of these events varies enough between linux and windows guests that it is only
noticeable on windows guests. The exact sequence that causes the bug appears to
be as follows:

1 user resizes window smaller
2 display widget gets a new allocation, which causes it to send a display
  reconfiguration to the guest
3 client receives a new show-hint for the display which causes it to switch
  temporarily to the 'status' notebook page
4 display widget gets unmapped
5 Client receives another new show-hint, which causes the display widget to get
  re- mapped, which causes client to send a display reconfiguration to the guest
  (using the old size)
6 client receives new (smaller, from step 2) display size and temporarily
  changes to the new size
7 client receives new (larger, from step 5) display size and changes back to
  original size.

To fix the issue, we only explicitly request a resize in response to the very
first map event, and for any subsequent map events, we simply call
_make_resizable() as before.
2014-06-23 13:26:53 -05:00
Daniel P. Berrange
28a6bd6cf4 Bump version 1.0 to simplify Windows MSI versioning
The Windows MSI product version is restricted to a 3 component
version number, whose fields are a max value of 255.255.65536

Since the main virt-viewer version takes up 3 components already,
we have the munge the micro version together with the first
component of the release version. eg we have

   $VERSION[0].$VERSION[1].($VERSION[2] << 8 + $RELEASE[0])

This causes problems for RHEL which needs to have 2-component
release versions to deal with z-stream builds.  eg a RHEL
version might be virt-viewer-0.5.6-2.el6_4.3 and we've
no easy way of adding the final '.3' to the Windows product
version.

If we reduce the primary virt-viewer version to just 2 components,
then we can leave the 3rd component for exclusive use by the RPM
release number. eg so we'd make product version up using

   $VERSION[0].$VERSION[1].($RELEASE[0] << 8 + $RELEASE[1])

In course of normal development, we'd increase the $VERSION[0]
for each release. ie next release is 1.0, then 2.0, then 3.0.
This means we retain the ability to put out "stable" branch
releases for any historical version by doing 1.1, 1.2 instead
of having to re-add a 3rd component.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2014-06-23 16:16:01 +01:00
Marc-André Lureau
687b9e0bfa man: fix zoom level range
https://bugzilla.redhat.com/show_bug.cgi?id=1111428
2014-06-20 13:36:04 +02:00