Commit Graph

1662 Commits

Author SHA1 Message Date
Victor Toso
81129f8eb1 build: fix build without gtk-vnc
Without gtk-vnc we get implicit function declaration for
VIRT_VIEWER_IS_SESSION_VNC. Introduced at 8bc91ac "session: remove
"session-error" signal" in 2021-02-18

As we are already using #ifdef here, I've also changed the ternary to
an if for clarity.

Signed-off-by: Victor Toso <victortoso@redhat.com>
2021-03-08 17:05:42 +01:00
Daniel P. Berrangé
04c2c4a035 build-aux: set MANUFACTURER env when building MSI
This needs to be set via an env variable so that it can be overridden by
vendors building their own MSIs downstream.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08 12:53:55 +00:00
Daniel P. Berrangé
df4f0a8d4f data: fix URLs in wxs file
The download site is on virt-manager.org, not virt-tools.org, so lets
use that site, with TLS too.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08 12:53:55 +00:00
Daniel P. Berrangé
7040dded11 icons: remove obsolete usb icon
We are now using a standard symbolic icon so don't need the custom USB
icon.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-08 12:33:06 +00:00
Hela Basa
d71c56dacd Added translation using Weblate (Sinhala)
Signed-off-by: Hela Basa <r45xveza@pm.me>
2021-03-03 22:00:42 +01:00
Daniel P. Berrangé
0c94c1f844 man: document the default cursor ungrab sequence in man pages
While the window titlebar already displays the ungrab sequence when a
grab is active, it doesn't hurt to also document it upfront for people.

Fixes https://gitlab.com/virt-viewer/virt-viewer/-/issues/10
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-03 14:45:03 +00:00
Daniel P. Berrangé
044534899b rpm: include buildid components in MSI filename
The MSI file can contain different content with each change in build ID,
but the filename never changes. This creates confusion as to whether the
MSI is actually up to date or not. It requires the looking inside the
MSI to see the encoded version.

The RPM uses 2 components from the %release field as input for the build
ID value. Use these as two parts of the filename, separated from the
version with a "-" similar to how RPM version/release are separated.

IOW, an RPM

   mingw32-virt-viewer-msi-9.0-1.fc33.noarch.rpm

will result in

   virt-viewer-x64-9.0-1.0.msi

while

   mingw32-virt-viewer-msi-9.0-1.fc33.1.noarch.rpm

will result in

   virt-viewer-x64-9.0-1.1.msi

Essentially we've just stripped the %dist part (".fc33") out of
the release, and default the second component to "0" if omitted.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-03-01 22:25:54 +00:00
Geert Warrink
c34984c41e Translated using Weblate (Dutch)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/nl/

Signed-off-by: Geert Warrink <geert.warrink@onsnet.nu>
2021-03-01 23:07:34 +01:00
Daniel P. Berrangé
febf72fe26 src: switch to preferring gtk dark theme
This enables the app to use the dark theme when running in environments
where a dark theme is available.

This is not done in Windows because the dark theme looks quite odd when
run on older versions of Windows where GTK can't replace the titlebars
by default.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
0f1c12dc38 src: add help window showing keyboard shortcuts
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
49a67971af src: make use of header bar subtitle for ungrab hint
The header bar includes space for both a title and subtitle. By using
the latter for the ungrab hint, we avoid having such a long title.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
c43eb057bd src: convert full screen toolbar to GtkHeaderBar
The user interface for the fullscreen toolbar is now identical to that
seen when non-fullscreen. All that differs is that the toolbar autohides
in fullscreen mode and doesn't expand to fill the window width.

There is a complication with the timed revealer and menus. With
traditional GtkMenus, it appears a grab is held as long as the menu is
open, so the revealer won't hide the toolbar. With modern GtkPopover
based menus, however, the revealer hides the toolbar despite the menu
being open, and thus in turn hides the menu.

This hacks around the problem by setting the header buttons to force use
of a traditional GtkMenu instead of a GtkPopover. It is not quite as
visually pretty, but at least it works.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
bb9664de38 src: switch main window to use GtkHeaderBar
This removes the main menu bar in favour of using the GtkHeaderBar with
integrated bars. This reduces the amount of vertical screen real estate
consumed by the application, leaving more for the guest display. The new
buttons are laid out to make the more common actions available with a
single click.

The buttons are grouped into two sets. On the left hand side of the
header are buttons that are interacting with the server

 - Send key
 - USB device selection
 - Monitor selection and VM pause/shutdown

whle on the right hand side are buttons interacting with the local user
interface

 - Fullscreen
 - Preferences / About / Guest detail / zoom level

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
2f11e0a407 src: convert accelerator handling over to actions
This better decouples the accelerator handling from the current user
interface design.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
407836ecee src: convert displays menu to use actions
This better decouples the user interface from the implementation.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
4ae25cdf46 src: switch most menu and toolbar buttons to use actions
This decouples the user interface from the functional implementation
more cleanly.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
1ffee18864 src: convert smartcard and machine menus to use actions
This better decouples the user interface from the implementation.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
d35ca0b099 src: introduce more window level actions
All the menu / toolbar callbacks are given equivalent action
implementations.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
71a583bae6 src: introduce some application level actions
The machine pause/reset/powerdown and smartcard insert/remove operations
can implemented directly by the application class as they require no UI.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
5a0bf52d73 src: introduce public helpers for changing cd and screenshot dialogs
This decouples the functional implementation from the UI controls that
trigger it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
049f93d90a src: introduce public helpers for about and guest details dialogs
This decouples the functional implementation from the UI controls that
trigger it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
825975d2e7 src: introduce public helpers for changing zoom levels
This decouples the functional implementation from the UI controls that
trigger it.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
29d0c7cecd src: decouple accelerators array from actions array
We will be adding many more actions shortly, so cannot keep the two
arrays' sizes in sync.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Daniel P. Berrangé
ef6485c63e src: remove conditional test when setting USB reset accelerator
The first time this method is called we know that
usb_device_reset_accel_valid will be FALSE.

The other times this method is called all pass override=TRUE.

Thus the conditional test in virt_viewer_set_usb_device_reset_accel
always evaluates to TRUE and thus can be removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-19 12:36:07 +00:00
Eduard Lucena
bb51ddb72f Translated using Weblate (Spanish)
Currently translated at 83.7% (150 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/es/

Signed-off-by: Eduard Lucena <eduardlucena@gmail.com>
2021-02-19 00:06:53 +01:00
Igor Gorbounov
8199a74091 Translated using Weblate (Russian)
Currently translated at 100.0% (179 of 179 strings)

Translation: virt-viewer/virt-viewer
Translate-URL: https://translate.fedoraproject.org/projects/virt-viewer/virt-viewer/ru/

Signed-off-by: Igor Gorbounov <igor.gorbounov@gmail.com>
2021-02-19 00:06:53 +01:00
Daniel P. Berrangé
efbc5f9c91 src: build as a GUI app
This hides the console window when running on Windows platforms

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 22:41:00 +00:00
Daniel P. Berrangé
e71c72490d src: replace deprecated GtkVBox with GtkBox
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
71d146f3d0 src: recreate .ui files with latest glade
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
eb9dffbbd9 src: set min gtk to 3.18 to match glib 2.48 vintage
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
6c6af77fdd src: remove setting of resize grip property
This API is deprecated since GTK 3.14 as the concept has been removed.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Daniel P. Berrangé
496f99f5da src: remove deprecations squash for g_strv_contains
We rely on new enough glib version, so don't need to squash warnings.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-18 14:21:36 +00:00
Jakub Janků
5a55d43796 vnc-session: use g_signal_connect_object
If the VncDisplay emits a signal and the VirtViewerSessionVnc
instance is no longer valid, using the pointer inside one of the
callbacks can lead to segfault.

To prevent that, use g_signal_connect_object instead of
g_signal_connect.

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

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:20:25 +01:00
Jakub Janků
8bc91ac80f session: remove "session-error" signal
This partially reverts commit de5cd71.

Problem with that commit is, that it practically renders
the "session-auth-*" signals from vnc session useless.
That's because gtk-vnc currently emits "vnc-error" before each
"vnc-auth-*" signal and the error callback in virt-viewer-app.c
calls virt_viewer_app_disconnected(), which in turn closes
the session.
As a consequence, virt-viewer never retries authentication
with vnc, it simply exits.

Since the last commit, vnc, similarly to spice, emits
"session-disconnected" with the appropriate error message. Thus
there's no need to maintain separate "session-error" signal
for now.

With vnc, this error message is shown to the user in a dialog,
if the disconnect happened during the init phase.
"session-auth-*" callbacks create their own dialogs, so
initialized must be set to TRUE to avoid having a dialog
displayed twice.

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

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:20:22 +01:00
Jakub Janků
11ec065ce2 vnc-session: save message from "vnc-error" for "vnc-disconnected"
"vnc-error" is always followed by "vnc-disconnected".
So save the error message and use it in "vnc-disconnected" callback.

"session-disconnected" already allows us to set a string
with details on why the disconnection happened.

This approach is also similar to the one in spice session
(GError is saved in virt_viewer_session_spice_channel_destroyed).

Signed-off-by: Jakub Janků <jjanku@redhat.com>
2021-02-18 11:16:29 +01:00
Daniel P. Berrangé
942fc8c6fb src: remove G_BEGIN_DECLS / G_END_DECLS
None of our header files are installed for public use, so these macros
are not required.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
3ae426e926 src: switch to using "#pragma once" for headers
We can rely on GCC/CLang and thus use this more concise approach

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
25092c2122 src: centralize the editor indentation rules
Instead of repeating an emacs footer in every source file, use config
files in the root of the repository. This fixes the bug that several
source files are missing the indent rules.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
396f31cb4b tests: convert VirtViewerTest to G_DECLARE_FINAL_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
aa8bb67972 src: convert OvirtForeignMenu to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
622d5c2e3e src: convert RemoteViewerISOListDialog to G_DECLARE_FINAL_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
06b57ee1fe src: convert RemoteViewer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
5c8c6db41b src: convert VirtViewer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
080a6fefe2 src: convert VirtViewerFileTransferDialog to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
58a8e71404 src: convert VirtViewerTimedRevealer to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
18322a9551 src: convert VirtViewerNotebook to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
4973411ed8 src: convert VirtViewerSessionVnc to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
1985713f78 src: convert VirtViewerSessionSpice to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
96c24fd9db src: convert VirtViewerSession to G_DECLARE_DERIVABLE_TYPE
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00
Daniel P. Berrangé
025fbb2470 src: convert VirtViewerFile to G_DECLARE_FINAL_TYPE
This removes the use of a private data struct.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-02-17 11:35:32 +00:00