Commit Graph

1359 Commits

Author SHA1 Message Date
Victor Toso
4fc66ec46c Don't define function without oVirt integration
Function is not used without oVirt.

> virt-viewer-window.c:1063:1: warning: 'iso_dialog_response' defined
> but not used [-Wunused-function]

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-03-07 15:06:32 +01:00
Victor Toso
87c63b9f3e Avoid harmless warnings due lack of oVirt on build
> remote-viewer.c: In function 'remote_viewer_get_property':
> remote-viewer.c:227:26: warning: unused variable 'priv' [-Wunused-variable]
>      RemoteViewerPrivate *priv = self->priv;
>                           ^~~~
> remote-viewer.c:224:36: warning: unused parameter 'value' [-Wunused-parameter]
>      GValue *value, GParamSpec *pspec)
>              ^~~~~
> virt-viewer-window.c: In function 'virt_viewer_window_menu_change_cd_activate':
> virt-viewer-window.c:1077:62: warning: unused parameter 'self' [-Wunused-parameter]
>      VirtViewerWindow *self)
>                        ^~~~

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-03-07 15:05:15 +01:00
Victor Toso
2ed3e393b8 Fix build when building without oVirt
As remote_viewer_iso_list_dialog_new() is defined on
remote-viewer-iso-list-dialog.h which is only build with oVirt
integration.

 > undefined reference to `remote_viewer_iso_list_dialog_new'

Note that the callback virt_viewer_window_menu_change_cd_activate() is
only visible if oVirt is built in.

Signed-off-by: Victor Toso <victortoso@redhat.com>
2017-03-07 15:03:52 +01:00
Pavel Grunt
5af0a37b6b file-transfer: Fix label of the dialog
Display correct text and make it translatable

Resolves:
https://bugs.freedesktop.org/show_bug.cgi?id=99980

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-03-03 09:37:38 +01:00
Christophe Fergeau
8d64be24fe spice: Remove unneeded braces
Two statements in virt_viewer_session_spice_main_channel_event() are
wrapped in a { } block, but this is unneeded.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-17 13:36:19 +01:00
Christophe Fergeau
cb2be722cf man: Fix qemu+ssh URL in example
The 'system' path was missing: qemu+ssh://example.org/system

Resolves: rhbz#1377283
2017-02-17 13:31:52 +01:00
Christophe de Dinechin
a4509770d1 Show errors generated by connection dialog
When running 'remote-viewer' without arguments,
and selecting a non-supported protocol, e.g. ssh://foo,
the generated error was silently swallowed by the retry loop.
This was introduced in 06b2c38246.

Signed-off-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-02-14 12:25:27 -02:00
Eduardo Lima (Etrunko)
f207dda59f session-spice: Pass hostname to authentication dialog
With this patch the dialog now shows the host we are connecting to.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-02-09 17:27:11 -02:00
Eduardo Lima (Etrunko)
88a70174fd iso-dialog: Avoid crash when closing dialog early
We must take into account that users can close the dialog at anytime,
even during an operation of fetch or set ISO has not been finished. This
will cause the callbacks for those operations to be invoked with an
invalid object, crashing the application.

To fix this issue we need to pass a GCancellable to the asynchronous
operations, so they can be cancelled if the dialog happens to get closed
before they complete.

NOTE: This patch triggers a deadlock in libgovirt when the dialog is
closed before the operation completes. Bug reported in
https://bugzilla.gnome.org/show_bug.cgi?id=777808. We will need to bump
libgovirt dependency whenever it has a new release.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-02-09 17:27:11 -02:00
Pavel Grunt
b7f8644429 Do not print password in the debug log
Do not show a length since it is sensitive info as well.

Resolves: rhbz#1410030

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-07 17:29:59 +01:00
Pavel Grunt
a37f952109 iso-dialog: Do not use string directly
Fixes -Werror=format-security used when creating the rpm

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-02-07 17:00:45 +01:00
Pavel Grunt
7bc259d193 Update for README.md
It is needed to use the 'foreign' init option otherwise autotools
requires README

Fix make distcheck and spec file generation

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-07 16:58:17 +01:00
Pavel Grunt
7f40049780 README: switch to Markdown syntax
To render nicely on the project git page:
 https://pagure.io/virt-viewer

Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2017-01-27 15:50:47 +01:00
Pavel Grunt
c08f51f5a4 README: Update links
Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2017-01-27 15:50:26 +01:00
Eduardo Lima (Etrunko)
6963650581 Run ISO dialog when 'Change CD' menu is activated
Also moves 'Change CD' menu item from the toplevel menu to a subitem
under 'File' toplevel menu.

In order to avoid object interdependency, it is necessary to make the
ovirt foreign-menu pointer from RemoteViewer, accessible via property,
so it can be passed to the dialog as an opaque GObject.

Finally, with this commit, we clean up ovirt foreign menu code, which
only deals with data, leaving the UI bits to be handled properly in the
new ISO list dialog.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-24 09:51:35 -02:00
Eduardo Lima (Etrunko)
dcbb6929d0 Introduce ISO List dialog
The motivation for this dialog started with rhbz #1310624, where it was
reported that foreign menu was causing too many debug messages to be
printed to the console, because remote viewer had a timeout of 5 seconds
to refresh the ISO list automatically.

As a workaround, the timeout was adjusted for 5 minutes, but it could
cause more problems, such as inconsistencies between what was shown by
remote viewer and what the server had configured.

Another issue caused by displaying the ISO files as a menu item was that
if the list was too long, it would take all the available space on the
screen. In the end, a menu item was not the correct choice of UI
component for this use case.

In order to solve both problems, we now present the ISO list as a
dedicated dialog, where the refresh of ISO list is triggered manually by
the user and the list is contained within the dialog, by displaying de
files in a treeview.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-24 09:48:56 -02:00
Eduardo Lima (Etrunko)
2102e05915 ovirt-foreign-menu: Add accessors for current iso and iso list
Also, to keep consistency around the codebase, changed the return value
of ovirt_foreign_menu_get_current_iso_name() from char * to gchar *.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-19 13:27:34 -02:00
Eduardo Lima (Etrunko)
5f50c1420f ovirt-foreign-menu: Fetch ISO names using GTask API
Similar to the previous commit, the ISO dialog will fetch the result
asynchronously, rather than relying on the "notify::files" signal from
OvirtForeignMenu object. It also enables error to be shown if anything
goes wrong.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-18 17:07:14 -02:00
Eduardo Lima (Etrunko)
c39dcbb045 ovirt-foreign-menu: Set new ISO name using GTask API
This is done with the new ovirt_foreign_menu_set_current_iso_name_async
function.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-18 16:55:43 -02:00
Eduardo Lima (Etrunko)
3dd077b060 remote-viewer: Extend #ifdef HAVE_OVIRT block
The #endif is closing a #ifdef HAVE_OVIRT block, while another one is
opened right next, so there is no need to have those lines. Also, due to
the large amount of source code in between, add a small comment on the
last #endif to identify what it refers to.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2017-01-13 18:07:49 -02:00
Snir Sheriber
d7ef44d44f app: Update warning msg in virt-viewer's window
Information about connection issues during display
activation will appear in virt-viewer's window

Related: rhbz#1386630
2017-01-10 11:23:55 +01:00
Pavel Grunt
965286d699 Set guest name at the same time as uuid
Avoid showing the "Unknown" name in the guest detail dialog when
waiting for the domain to be started.

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-01-05 17:31:05 +01:00
Snir Sheriber
3dba5a1485 spice: Replace g_warning with g_debug
Instead of having a warning message telling the user that they can't
have more displays enabled in fullscreen than the number of physical
displays, let's just have it as a debug message.

Related: rhbz#1368390

Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2017-01-02 11:41:20 +01:00
Snir Sheriber
d08df78030 spice: Fix display id in the warning log
The display id in the warning log is now consistent with the display
id in the "view->displays->display x" menu item

Related: rhbz#1368390

Acked-by: Fabiano Fidêncio <fabiano@fidencio.org>
2016-12-30 01:09:43 +01:00
Christophe Fergeau
276012ea37 man: Mention that ssh-agent can be useful
When using a tunneled SPICE connection, the user will get a dozen
authentication prompts if they are not using ssh-agent.

https://bugzilla.redhat.com/show_bug.cgi?id=1377283
2016-12-05 10:59:24 +01:00
Daniel P. Berrange
679043cfa4 Post release version bump to 6.0
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-24 16:23:53 +00:00
Daniel P. Berrange
8e82f5bc0a Add NEWS for 5.0 release
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-24 14:04:39 +00:00
Daniel P. Berrange
8f32f19690 Refresh PO files from zanata
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-11-24 14:04:39 +00:00
Jonathon Jongsma
dfeaac75b9 Make new file-transfer ui file translatable 2016-11-02 11:36:00 -05:00
Jonathon Jongsma
61d4a95a91 Add necessary header include
Fixes the build broken by the last patch series.
2016-11-02 11:03:45 -05:00
Jonathon Jongsma
657dbfbfed Show failed file transfers
After all ongoing file transfers are finished, save a list of the file
transfer tasks that had errors and display the list of failed files to
the user so that they know that a failure occurred and can potentially
retry the transfer. Previously, we just failed silently so the user
may not have even been aware that the transfer failed.
2016-11-02 09:59:22 -05:00
Jonathon Jongsma
37459d0488 Simplify file transfer dialog UI
When transferring a large number of files, the file transfer dialog was
unusable because the window size would be larger than the client
desktop. To solve this, remove the list of individual files (and the
ability to cancel each file transfer independantly) and only display
a single overall progress bar that shows the status of all ongoing
transfers.

This also allows us to remove the delayed unref of the task since we
don't need to show the task information about each individual transfer
task until the window is closed. Removes TaskFinishedData type.

This patch requires new API from spice-gtk to calculate the overall
progress:
 spice_file_transfer_task_get_total_bytes()
 spice_file_transfer_task_get_transferred_bytes()
2016-11-02 09:59:22 -05:00
Pavel Grunt
a744f9a5ce app: Inform user about connection failure
Use errno to get the reason of the failure

Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1377100
2016-10-05 14:58:43 +02:00
Pavel Grunt
e73947776d build-sys: Check spice-glib version
virt-viewer uses spice-glib api, configure should check
for the required version

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1375429

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-10-05 14:57:55 +02:00
Daniel P. Berrange
8b91f52715 spec: don't distribute both .spec files in dist
rpmbuild -ta only works if the tar.gz contains a single
spec file, so remove the mingw-virt-viewer.spec from
dist.

We should however be including both the spec.in files.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-08-10 15:17:07 +01:00
Victor Toso
813c775cc9 Fix filename leak on transfer dialog
spice_file_transfer_task_get_filename() was wrongly annotated as
transfer none. We can safely free this string after usage.
2016-08-05 10:59:23 +02:00
Eduardo Lima (Etrunko)
dbc8105155 ovirt-foreign-menu: Use g_clear_pointer/g_clear_object
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-07-29 17:53:34 -03:00
Eduardo Lima (Etrunko)
f7b15be770 ovirt-foreign-menu: Rework states logic
Use switch/case instead of lots of conditional blocks

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-07-29 17:53:34 -03:00
Jonathon Jongsma
2d2d7ac2f7 Fix resizing problem with recent gtk versions
When using client-side decorations, as well as in certain other
situations (wayland, and windows in some cases), the window gradually
resizes larger and larger.

This is caused by a change in how gtk interprets the sizes passed to
gtk_window_resize(), particularly when client-side decorations (CSD) are
involved. For example, In the past this size was assumed to include the
size of the CSD, but now it it assumes that the sizes only represent the
size of the window's content, without any decorations. However,
gtk_widget_get_preferred_size() (when called on a GtkWindow*), returns a
size that includes the size of the CSD. So
virt_viewer_window_queue_resize() was essentially growing the window by
the size of the CSD every time it was called.

To work around this issue, we need to calculate the preferred size of
the window's child, not the size of the entire window (including CSD).
Then we add the width of the window's border (just to be safe) and pass
those values to gtk_window_resize().
2016-07-28 11:14:36 -05:00
Daniel P. Berrange
a62827d28c virt-viewer: ensure we close when seeing domain stop event
Normally virt-viewer relies on the VNC/SPICE widget seeing
an EOF on its underlying connection to detect when the
session is closed.

When tunnelling to a remote guest over SSH though, this
EOF can be delayed for a very long time, leaving a dead
session open.

This can be seen with

   virt-viewer -c qemu+ssh://remotehost/system guestname

when on the remote shell run

   virsh destroy guestname

and notice that virt-viewer does not see the shutdown
immediately.

When we get a domain stopped event we know the session
should be dead, so forceably close it, if not already
closed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-12 13:54:15 +01:00
Daniel P. Berrange
35e489d519 virt-viewer: fix display of guest name in title for vnc
The following commit broke the display of the guest name in
the title for VNC displays:

  commit 61a1bc4dcb
  Author: Pavel Grunt <pgrunt@redhat.com>
  Date:   Wed Apr 15 13:50:35 2015 +0200

    session-vnc: Set window for display to avoid gtk-vnc v0.3.8 crash

    The VNC display widget of gtk-vnc v0.3.8 needs a window at the moment

The problem is that this causes the window to be associated
with the display before the guest name is available. Thus
when ensure_window_for_display() runs, the window is already
configured and so it never invokes the logic to set the title.

The fix is to unconditionally update the title in the
ensure_window_for_display() method, even if the window already
exists.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-07-12 10:46:06 +01:00
Fabiano Fidêncio
0bba2d07af app,vnc: Don't retry to authenticate when vvfile authentication fails
When connecting to a RHEVM/oVirt machine through an expired vvfile the
user ends up in an endless loop of getting an error message, pressing
"Okay", re-scheduling a new connection retry. getting an error message
due to the expired vvfile and so on.

In order to avoid the issue, let's not re-schedule the connection retry
when the user tries to connect through a vvfile and it fails.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-07-07 17:11:13 +02:00
Daniel P. Berrange
e204c25799 Post-release version bump to 5.0 2016-06-30 15:18:42 +01:00
Daniel P. Berrange
3b036c061e Update NEWS for 4.0 release 2016-06-30 13:54:00 +01:00
Daniel P. Berrange
48de38bd97 Refresh translations from zanata 2016-06-30 13:53:29 +01:00
Eduardo Lima (Etrunko)
49f4b829ff Adjust timer to refresh ovirt foreign menu
This is a temporary solution, as discussed in the bug. We will adjust
the timer to refresh the ISO list from 15 seconds to 5 minutes (300
seconds), while reworking in the UI to replace the menu with a dialog,
which seems a saner way to display the list.

Resolves: rhbz#1347726

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-30 09:01:01 -03:00
Fabiano Fidêncio
271d33e7d8 ui: Use mnemonics for remote-viewer connection UI
Here we added mnemonics for the buttons "Cancel" and "Connect" and also
for the "Connection Address" entry (as it was before moving this dialog
to a .ui file).

The "Recent connections" widget is left behind as GtkRecentChooserWidget
isn't suitable for mnemonic activation.

Resolves: rhbz#1351487

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-06-30 13:48:43 +02:00
Fabiano Fidêncio
3775e095a5 timed-revealer: listen to the "grab-notify" signal
The "grab-notify" signal lets us know when our widget becomes
shadowed by a Gtk+ grab on another widget, or when it becomes unshadowed
due to a grab being removed.

That's exactly the case we face when dealing with "usb-redirection" and
"close" items of the fullscreen toolbar. And, currently, when these
widgets get closed the timed-revealer stays there forever. From now on
let's take advantage of the "grab-notify" signal and schedule a timeout
for the revealer when these widgets' windows get closed.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-30 11:51:06 +02:00
Eduardo Lima (Etrunko)
8a32e0bfee Get rid of deprecated functions to customize widget colors
Since commit cc455b7f91, the background
color has not been set correctly for Gtk+ 3.18 (Fedora 23), while it was
working fine for more recent version 3.20 (Fedora 24). Tracked down to
some changes in GtkNotebook code which can not be easily backported.

Instead of customizing background and foreground colors, let's just
stick with the default colors provided by theme.

Related https://bugs.freedesktop.org/show_bug.cgi?id=94276

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-06-29 10:30:46 -03:00
Lukáš Venhoda
f212c5a358 package: Add appdata metadata for Gnome Software
Adds metadata to be used with Gnome Software.
Includes name, summary, description and a few screenshots of remote-viewer.

Signed-off-by: Lukáš Venhoda <lvenhoda@redhat.com>
Acked-by: Daniel P. Berrange <berrange@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-06-29 02:01:42 +02:00