Commit Graph

1044 Commits

Author SHA1 Message Date
Haochen Tong
03f8a8ff5a virt-viewer-display: fix guest display size on HiDPI host
Signed-off-by: Haochen Tong <i@hexchain.org>
2020-08-19 20:11:13 +00:00
Pino Toscano
7f3317e578 VM selection: sort items
Even if the view has search capabilities built-in, show the VM names
sorted so it is easier to visually search for them.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
4b7f2ac0ec Use VM descriptions if available
When listing the running VMs in a libvirt connection, use the
descriptions as tooltips if available.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
e2abe953ed VM selection: expand models for tooltip column
Add a new column in the list models for the VM selection dialog, and use
this new column to hold the tooltip of the items in the list.

At the moment nothing is set in the new column, so there is no behavior
change.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
2e46ffc08d Use VM titles if available
When listing the running VMs in a libvirt connection, use the titles if
available.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
74d25742ea VM selection: expand models for UI/key columns
Add a new column in the list models for the VM selection dialog, and use
this new column to hold the key of the VM. This way, the first column
represents the UI representation of the VM without affecting the key.

At the moment the VM name is set for both, so there is no behavior
change.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 13:01:57 +00:00
Pino Toscano
c28374d8a8 Unconditionally use virDomainOpenGraphicsFD
libvirt 1.2.8 is required now.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-24 11:38:16 +02:00
Pino Toscano
35443daed4 Remove unused i18n translation
All the g_printerr does is printing the message of the GError with a
newline at the end. Hence, use a simple format string without the need
to translate it.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
0325901984 Create single strings for the window title
Currently there is a strings with four placeholders that represents
optional bits: the "press to release", a whitespace (!), the subtitle,
and the application title. This is suboptimal, because it hides the way
the title is composed, and makes it hard to properly translate.

Instead of this string puzzle, create separate strings for each case
(there are only four of them, and one is only the application title).
Each of the string has all the static text availale, with a proper
comment explaining the layout.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
debedd40d1 Disambiguate "unknown" messages
Give them a context to explain what is the "unknown thing", so it is
possible to provide proper translations.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
8db413e689 Fix few spellings
"ID", "oVirt", "SSH", "UNIX", "URI", "UUID"

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:52 +02:00
Pino Toscano
b2a2a02b5b Show localized accelerators in Send key menu
Turn the menu labels into GTK accelerator strings, so we can parse them
to convert them into a proper user representation.

There is a small behaviour change: the menu items do not have mnemonics
anymore by default.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-23 12:01:38 +02:00
Pino Toscano
671f79bd7d ui: improve homepage in about dialog
Switch the homepage URL to https, and synchronize the label with the
URL. Also, do not make the label translatable, as it is pointless (it is
only a URL).

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-22 12:08:25 +02:00
Pino Toscano
44c03148f1 ui: use the standard about dialog license type
Use the standard gpl-2-0 license type of GtkAboutDialog, instead of the
custom license text: this way, the dialog will show a translated text
with the license type, and a link to the full license text.

As side change due to the editing of this file in glade 3.36: set the
logo icon name to "virt-viewer", even if at runtime a logo/image will be
loaded. glade needs a logo set, either as icon name or as pixmap.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-07-22 12:04:33 +02:00
Frediano Ziglio
522cca5ac1 virt-viewer-file-transfer-dialog: Reports detailed errors
Instead of showing just a generic error with a list of files group
files by error and show them.

This solves https://bugzilla.redhat.com/show_bug.cgi?id=1753563

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-15 10:52:24 +01:00
Frediano Ziglio
ae25f6ca6b More specific key accelerator description
The default key accelerator to release mouse if left control and
left alt but the current description is "Ctrl+Alt", change to
"Ctrl_L+Alt_L" to avoid misunderstanding.

This solves https://bugzilla.redhat.com/show_bug.cgi?id=1548371

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-15 08:13:45 +01:00
Frediano Ziglio
2f0d080179 iso-dialog: Fix leak and quoting
Do not leak memory in case of task cancelled.
Quote "msg" in case it contains some no-xml character that could
came from translated strings.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-10 09:11:52 +01:00
Frediano Ziglio
8297a178c4 Minor updates to accel_key_to_keys
Make "modifiers" static, potentially avoids a copy to stack.
Use G_N_ELEMENTS also to allocate keys, as in the next loop
allowing to easily change "modifiers" size.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-10 09:11:52 +01:00
Frediano Ziglio
ff11d5937e iso-dialog: Give less scary error if there are no ISOs
Instead of a fail simply reply that there are no ISO files.

Message text was suggested by Radek Duda who reported the issue.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-07-10 09:11:19 +01:00
Eduardo Lima (Etrunko)
53dcc7fe52 foreign-menu: Avoid leaking 'name' variable in error path
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-07-01 11:14:38 -03:00
Daniel P. Berrangé
3e1d619529 src: remove trailing whitespace
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Daniel P. Berrangé
e587274b76 src: remove tab characters from indent
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-06-26 15:50:50 +01:00
Eduardo Lima (Etrunko)
bb3d020cb9 ovirt-foreign-menu: Take into account StorageDomains of type DATA
Now that we support both ISO and DATA storage domain types, we need to
make sure that the files are listed correctly. In this case we give the
domains of ISO type the precedence over DATA ones.

This change extends previous commit bbda3aa which made it possible for
storage domains of type DATA to be considered valid.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-06-25 23:02:03 -03:00
Eduardo Lima (Etrunko)
42f408902e ovirt-foreign-menu: Use proper function in the case of DATA StorageDomains
Unlike the StorageDomain objects of ISO type, the DATA ones require a
specific API recently added to libgovirt to support them. This commit
makes use of those new functions under #ifdef guards and adds proper a
check to configure.ac.

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

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-06-25 23:02:01 -03:00
Julien Ropé
c6afc28cc9 Rather than adding a default extension to screenshots, display an error message to make the user add it.
This prevents the silent overwriting of the file, and still makes sure the user knows why we don't proceed.

Fix BZ#1752514

Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-06-09 15:50:02 +02:00
Stephen Thom
fedaa5f89a Added -K --keymap commandline option that allows user to block certain keypresses or to remap keypresses being sent to the underlying spice or vnc widget
Signed-off-by: Stephen Thom <sthom@williamhill.co.uk>
2020-06-05 14:12:19 +00:00
Daniel P. Berrangé
c12131ef30 fix handling of enter/leave events in full screen revealer
The current code is using a single event handler for leave/enter and
looking at the mouse coordinates to decide whether it entered or left
the widget. This logic is completely broken when the window is
mimimized, because the mouse coordinates of the leave event are still
within the window boundary.

Switch to just have a separate handler for enter/leave events and stop
looking at mouse coordinates entirely.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-05-19 17:48:28 +01:00
Eduardo Lima (Etrunko)
bbda3aa71a ovirt: Do not filter out DATA storage domains
Since ovirt 4.2 it is acceptable to have ISO images in storage domains
of DATA type, while the usage of ISO type is about to be deprecated. The
code now allow both types of storage domains when looking up for ISO
images.

https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.2/html/release_notes/deprecated_features_rhv
https://access.redhat.com/documentation/en-us/red_hat_virtualization/4.4-beta/html/release_notes/deprecated_features_rhv

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1835640

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-05-19 10:30:21 -03:00
James Le Cuirot
ee173fc254
Add minimize button to toolbar
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
2020-05-07 09:21:04 +01:00
Daniel P. Berrangé
beeff760ac docs: update to point users to gitlab.com project
The project primary git repo has moved from pagure.io to
gitlab.com/virt-viewer/virt-viewer.  We want users to submit
code contributions, bug reports and support questions to the
gitlab project, not the mailing list, nor bugzilla, nor the
virt-manager.org site.

We're still using virt-manager.org for hosting downloads of
source and pagure.io for MSIs, but we'll aim to change that
too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-04-03 14:08:10 +01:00
Julien Ropé
d84149a92c Fix potential file descriptor leaks found by Coverity.
The error code returned by virt_viewer_session_open_fd() and
virt_viewer_session_channel_open_fd() were not checked. The file
descriptor passed to them could then be left opened even if the function
failed, causing a leak of resources.

This was reported by a Coverity scan, logged under
https://bugzilla.redhat.com/show_bug.cgi?id=1655792

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-04-03 14:08:00 +01:00
Julien ROPE
e4bacb8fde remote-viewer: add a default extension to screenshot filenames
When doing a screenshot, if the user provides a filename without a file
extension, an error occurs because the image format could not be determined.
This patch adds a .png extension to such filenames, so that there is a default
file format for screenshots.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1752514

Reviewed-by: Victor Toso <victortoso@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-02-19 09:47:21 +01:00
Julien Ropé
e279712281 Remember monitor mapping on close.
When the application is stopped, if the windows are in fullscreen, their
position on the client will be remembered.

This change uses the existing option 'monitor-mapping' in the settings
file to save the position and reuse it on next launch.

This implements part of the requirement from
https://bugzilla.redhat.com/show_bug.cgi?id=1179070

NOTE: this feature is effective only with GTK >= 3.22

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-02-07 13:57:56 +00:00
Francesco Giudici
a724dff8a3 remote-viewer: add handler for SIGINT signal
When remote-viewer is started from terminal, CTRL-C sends a SIGINT
signal to the program causing immediate termination. On linux clients
usb redirected devices are left without any kernel driver attached,
causing them to appear as no more available to the host.
Add a SIGINT handler to allow a clean exit, in particular to allow
the kernel to attach back the host driver.
The issue is present on linux only.

To perform usb device redirection, virt-viewer leverages spice-gtk
library, which in turn relies on usbredir library, which uses libusb.
In order to take control of the usb device the auto-loaded kernel
driver must be detached. This is achieved (in the very end) with
libusb_detach_kernel_driver(). Then the device interfaces can be claimed
with libusb_claim_interface() and get in control to the application.
During normal application termination, the usb channel is teared down,
performing a reset of the usb device and giving back the control of the
device to the kernel (libusb_attach_kernel_driver()).
If the application quits without doing this, the device interfaces will
end up with no driver attached, making them not usable in the host
system.

Note that enabling libusb_set_auto_detach_kernel_driver() does not solve
the issue, as this is just a convenient API from libusb: libusb will
take care of detaching/attaching the driver to the interfaces of the usb
device each time a call to libusb_release_interface() and
libusb_claim_interface() is performed. An unexpected quit of the
application will skip the libusb_release_interface() call too, leaving
the interfaces without any driver attached.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1713311

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Francesco Giudici <fgiudici@redhat.com>
2020-01-17 16:37:52 +00:00
Eduardo Lima (Etrunko)
b63e90f1f9 remote-viewer: Prefer ca-cert from display instead of proxy
Since oVirt engine version 4.3.2.1, the API returns certificate data for
display connection in the VM XML, so users do not need to specify it
from the command line anymore. The certificate obtained from the XML
gets precedence over the one from the command line, which is still kept
to keep compatibility of older versions of oVirt.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1402909

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-11 10:55:00 -03:00
Victor Toso
a13173ae64 remote-viewer: fix free on dangling pointer
On remote_viewer_session_connected() we are passing a dup of URI of
connection and freeing it afterwards. Problem is, we don't disconnect
from listening "session-connected" and on an eventual second emission
of this signal, remote-viewer crashes as seen in the backtrace below.

This can happen over switch-host migration message from
SpiceMainChannel.

A fix trying to use VirtViewerApp URI avoid the crash but introduces
regression while running remote-viewer with ovirt so, keeping the
changes to a minimum to avoid it, just use g_intern_string() for now.

Found it while improving migrate.py from spice/tests (server):
 | Invalid free() / delete / delete[] / realloc()
 |    at 0x4839A0C: free (vg_replace_malloc.c:540)
 |    by 0x56EBD8C: g_free (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x11DED0: remote_viewer_session_connected (remote-viewer.c:658)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566AF68: g_signal_emit_by_name (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x135E5D: virt_viewer_session_spice_main_channel_event (virt-viewer-session-spice.c:699)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x53149E3: emit_main_context (gio-coroutine.c:198)
 |  Address 0x18f1ecc0 is 0 bytes inside a block of size 23 free'd
 |    at 0x4839A0C: free (vg_replace_malloc.c:540)
 |    by 0x56EBD8C: g_free (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x11DED0: remote_viewer_session_connected (remote-viewer.c:658)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566AF68: g_signal_emit_by_name (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x135E5D: virt_viewer_session_spice_main_channel_event (virt-viewer-session-spice.c:699)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x56614F3: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x53149E3: emit_main_context (gio-coroutine.c:198)
 |  Block was alloc'd at
 |    at 0x483880B: malloc (vg_replace_malloc.c:309)
 |    by 0x56EBC98: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x5705C43: g_strdup (in /usr/lib64/libglib-2.0.so.0.6000.6)
 |    by 0x11EB80: remote_viewer_initial_connect (remote-viewer.c:696)
 |    by 0x11EB80: remote_viewer_start (remote-viewer.c:790)
 |    by 0x1250D3: virt_viewer_app_start (virt-viewer-app.c:1727)
 |    by 0x127108: virt_viewer_app_on_application_startup (virt-viewer-app.c:1870)
 |    by 0x564D741: g_closure_invoke (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x5661638: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A34D: g_signal_emit_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x566A972: g_signal_emit (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 |    by 0x553ECA1: g_application_register (in /usr/lib64/libgio-2.0.so.0.6000.6)
 |    by 0x553F41D: g_application_run (in /usr/lib64/libgio-2.0.so.0.6000.6)

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-04 10:02:42 +02:00
Eduardo Lima (Etrunko)
c1998594b1 ovirt-foreign-menu: Plug memory leak
Error caught by valgrind, the OvirtCollection object created in function
ovirt_foreign_menu_fetch_vm_async() was never freed.

433 (40 direct, 393 indirect) bytes in 1 blocks are definitely lost in loss record 16,708 of 17,677
   at 0x5868FDF: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x584B42C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x584D347: g_object_new_valist (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x584D69C: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
   by 0x558E823: ovirt_collection_new (ovirt-collection.c:304)
   by 0x558E98C: ovirt_sub_collection_new_from_resource_search (ovirt-collection.c:375)
   by 0x42D510: ovirt_foreign_menu_fetch_vm_async (ovirt-foreign-menu.c:994)
   by 0x42D510: ovirt_foreign_menu_next_async_step (ovirt-foreign-menu.c:316)
   by 0x42D70D: api_fetched_cb (ovirt-foreign-menu.c:1025)
   by 0x570BC19: ??? (in /usr/lib64/libgio-2.0.so.0.6000.6)
   by 0x570C7EC: ??? (in /usr/lib64/libgio-2.0.so.0.6000.6)
   by 0x559005D: call_async_cb (ovirt-proxy.c:279)
   by 0x55B5A07: ??? (in /usr/lib64/librest-0.7.so.0.0.0)

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-30 11:05:42 -03:00
Eduardo Lima (Etrunko)
22bd91cba0 ovirt-foreign-menu: Factor out code to set file collection
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-26 10:18:52 -03:00
Eduardo Lima (Etrunko)
ff0bfe3494 ovirt-foreign-menu: Only set domain_valid once
In the case of having a valid storage domain without any ISO files, this
variable can be reset to FALSE again in the next iteration of the loop,
resulting in a misleading error message presented to the user.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-21 10:37:47 -03:00
Fabiano Fidêncio
b79bb39420 ovirt-foreign-menu: Fix warnings on Rawhide
gmaovirt-foreign-menu.c: In function 'storage_domains_fetched_cb':
ovirt-foreign-menu.c:721:9: error: format not a string literal and no format arguments [-Werror=format-security]
  721 |         g_debug(msg);
      |         ^~~~~~~
ovirt-foreign-menu.c:722:9: error: format not a string literal and no format arguments [-Werror=format-security]
  722 |         g_task_return_new_error(task, OVIRT_ERROR, OVIRT_ERROR_FAILED, msg);
      |         ^~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
gmake[3]: *** [Makefile:963: libvirt_viewer_la-ovirt-foreign-menu.lo] Error 1
gmake[2]: *** [Makefile:647: all] Error 2
gmake[1]: *** [Makefile:482: all-recursive] Error 1
make: *** [Makefile:410: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.f14Lmj (%build)

Errors have been caught by https://ci.centos.org/job/virt-viewer-rpm/systems=libvirt-fedora-rawhide/589/

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-08-15 22:26:26 +02:00
Eduardo Lima (Etrunko)
1c9a9c1205 ovirt-foreign-menu: Fix endpoint for storage domains query
Instead of fetching toplevel REST API query, we use the one relative
from the data center, which returns more detailed information,
especially the status of the storage domain.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1427467

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-12 10:55:54 -03:00
Kevin Pouget
a2a372ac2d virt-viewer-file-transfer-dialog: improve error message
This patch improves the error shown to the user when a file transfer
fails.

The previous behavior was to create a simple message dialog box, with
the error description and the full list of the files that failed to be
transferred. When the list of files was long, the dialog box would
grow bigger than the screen.

Now, the file list is inserted inside a scrollable widget, whose
height is limited to 170px.

NB: these two calls would be more adapted, but they require GTK >=
3.22:

> gtk_scrolled_window_set_max_content_height(GTK_SCROLLED_WINDOW(scrolled_window), 170);
> gtk_scrolled_window_set_propagate_natural_height(GTK_SCROLLED_WINDOW(scrolled_window), TRUE);

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1496356

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-08 15:54:46 +02:00
Pavel Moseev
3627da2432 virt-viewer add translatable string
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-05-28 11:08:02 -03:00
Jonathon Jongsma
c2dabf0730 Fix a regression when initial connection fails
Due to changes in commit 65ef66e4, when the initial connection fails,
virt-viewer just sat quietly and didn't indicate what was wrong. It also
did not exit as it did before.  This is because we were using
virt_viewer_session_spice_channel_destroy() incorrectly. This function
was intended to be a callback that is called to clean up the VV session
when the SpiceSession tells us that a channel has been destroyed. It
does not actually destroy the channel, it only cleans up references to
that channel within virt-viewer. After calling this function, the
channel is not affected in any way. If the channel object was valid
before calling the function, it will be valid and unchanged after
calling the function as well.

The problem is that before commit 65ef66e4, this function
(_channel_destroy()) also had a side-effect of emitting a signal that
made us think that the SpiceSession was disconnected when it was not.
The application responded to this signal by exiting even though the
session was not properly disconnected and cleaned up.

We now no longer exit the application until the SpiceSession is properly
disconnected and cleaned up. So we need to make sure that this happens
when our initial connection fails. Therefore, when the main channel
receives an error channel-event, we should not call
virt_viewer_session_spice_channel_destroy(). This function should only
be called when a channel has actually been destroyed, and the channel is
not destroyed at this point.  We should instead explicitly disconnect
the session, which will result in the channels being destroyed properly.
After the session destroys all of the channels, the 'channel-destroy' signal
will be emitted by SpiceSession, so the _channel_destroy() function will
eventually get called by the signal handler.

To make the proper use of the function more obvious, I also changed the
function name from _channel_destroy() to _channel_destroyed() and added
a comment.

Fixes: rhbz#1666869
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-04-16 15:19:51 -05:00
Christophe Fergeau
da336ab4b3 Mark PrintScreen as translatable
It's for example ImprÉcran on French keyboards.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>

https://bugzilla.redhat.com/show_bug.cgi?id=1510411
Fabiano Fidêncio <fidencio@redhat.com>
2019-03-15 14:38:53 +00:00
Aleksei Nikiforov
ceb21d7894 remote-viewer: Allow toggling shared clipboard
Signed-off-by: Aleksei Nikiforov <darktemplar@basealt.ru>
Message-Id: <20190304143712.27989-1-darktemplar@basealt.ru>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-03-07 19:52:00 +01:00
Eduardo Lima (Etrunko)
099d86286b iso-dialog: Move type definitions from header to source file
There is no reason for this object to define a private structure, so it
is fine to make everything private to the dialog itself.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-02-22 09:19:27 -03:00
Eduardo Lima (Etrunko)
ed4768d589 Update usage of GObject private structures
New functions and macros have been added in glib 2.38 to better handle
this case.

c8de2b11bb/NEWS

The old method is being deprecated as of version 2.58.

https://gitlab.gnome.org/GNOME/glib/merge_requests/7/commits

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-02-22 09:19:27 -03:00
Daniel P. Berrangé
5daeea567c Declare VirtViewerFile variable at start of method
virt_viewer_session_vnc_auth_credential uses gotos which jump over the
declaration of 'file', meaning its contents are uninitialized in the
jump target.

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-19 14:52:59 +00:00
Daniel P. Berrangé
9e4cc377a5 Fix prototype of function with no arguments
Modern C standard requires the function to be "void"

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2019-02-19 14:52:59 +00:00