1213 Commits

Author SHA1 Message Date
Christophe Fergeau
82589e74e6 spec: Use pkgconfig() in BuildRequires
This is better than hardcoding the name of the development package as
this will not be impacted by package renames.
2016-04-15 18:03:31 +02:00
Eduardo Lima (Etrunko)
a19659eb76 configure: cleanup {GLIB2, GTK}_CFLAGS
Also, remove unecessary AC_SUBST calls, as {GLIB2,GTK}_LIBS are never
touched.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-24 11:49:51 +01:00
Eduardo Lima (Etrunko)
e5239c7cbb Fix spice includes
Spice release version 0.31 requires that only spice-client.h or
spice-client-gtk.h should be included directly. As a result,
compilation is now throwing warnings like:

warning: #warning "Only <spice-client.h> can be included directly" [-Wcpp]
warning: #warning "Only <spice-client-gtk.h> can be included directly" [-Wcpp]

This patch also bumps spice version requirement to 0.31, to ensure
those files are available.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-24 11:49:39 +01:00
Pavel Grunt
3367285c37 util: Remove unused GHashTable key/value 2016-03-15 07:24:03 +01:00
Pavel Grunt
2736081940 Move tests under /tests directory
Keep tests separated from the code
2016-03-14 16:36:37 +01:00
Pavel Grunt
d81f7c047f Add libvirt-viewer-util library an use it in tests 2016-03-14 16:35:43 +01:00
Christophe Fergeau
8ea6a9d923 Don't include libvirt.h in virt-viewer-auth.h
virt-viewer-auth.h does not use any libvirt types, so the #include is
not needed, and virt-viewer-auth.h is used while building remote-viewer,
which do not use libvirt compilation flags. This caused failures on
a freshly installed box without libvirt headers.
2016-03-09 16:59:59 +01:00
Christophe Fergeau
0ea2a674b8 ovirt: Only use active ISO domains for foreign menu
oVirt storage domains can be in various states (inactive, in
maintainance, ...). We only want to show the ISOs it contains in the
foreign menu when the storage domain is actually active, not in the
other states.

https://bugzilla.redhat.com/show_bug.cgi?id=1310450
2016-03-09 16:59:37 +01:00
Pavel Grunt
3e42ec7c39 test: Add tests for monitor mapping 2016-03-08 19:04:12 +01:00
Pavel Grunt
ab603d8e25 virt_viewer_parse_monitor_mappings: Add parameter for client monitors
Drop dependency on gdk. it allows to write tests not depending
on the client's configuration.
2016-03-08 19:04:04 +01:00
Pavel Grunt
e0c6718c3f Move monitor mapping parsing from app to util
It is not specific to VirtViewerApp.
Following commits will add support for tests thanks to this move.
2016-03-08 19:03:53 +01:00
Fabiano Fidêncio
adf1ee3823 app, cosmetic: remove one unneeded level of identation
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-03-07 16:04:01 +01:00
Fabiano Fidêncio
5f26924535 app: monitor-config - do it all or nothing
Don't keep trying to use a monitor config when it already failed for one
monitor, otherwise virt-viewer can end up in a situation where none of
the displays are enabled but the program is still running.
So, in case of any failure, let's skip the whole monitor config, forcing
virt-viewer to use the "fallback" one instead.

Resolves: rhbz#1315206

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-03-07 16:03:52 +01:00
Fabiano Fidêncio
4aac5ca55b Refresh translations from Zanata
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-03-04 11:30:11 +01:00
Fabiano Fidêncio
82e13442b9 Use GResource for loading ui files
Let's take advantage of GResource for loading ui files in a better and
cleaner way than virt_viewer_util_load_ui() was doing.
It also brings the benefit, at least for developers, of being able to
test ui changes without having to "make install" virt-viewer.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-03 23:08:37 +01:00
Fabiano Fidêncio
ad6924aff1 app: Remove useless libxml includes
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-03 23:08:32 +01:00
Fabiano Fidêncio
b7de994156 about: Fix the program's name in the title
Title currently says "About Glade". It's not a big deal because it's not
actually shown anywhere, but just for correctness let's change it to
"About Virt-Viewer".

Thanks Jonathon Jongsma for pointing this out.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-03-03 23:08:12 +01:00
Eduardo Lima (Etrunko)
d18bbc6f5b Don't open the default display while parsing command line
Since commit a9ce19f it has not been possible to check app version from
a tty without X session running. The issue is that gtk_get_option_group
function opens the default display if passed TRUE as argument.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-26 22:23:07 +01:00
Fabiano Fidêncio
0e0df372cf session-vnc: Avoid depracated warnings on this file
This is a temporary solution for using autobuild.sh, as commit df403f5
introduced the -Wdeprecated-declarations and gtk-vnc provides a callback
for getting authentication credentials which uses GValueArray, forcing
virt-viewer to keep using g_value_array_get_nth(), which is deprecated.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-26 22:21:04 +01:00
Fabiano Fidêncio
45afba8d0b configure: Simplify libvirt/libvirt-glib handling
Merge libvirt and libvirt-glib checking in PKG_CHECK_MODULES, then we
don't nee the LIBVIRT_GLIB_{CFLAGS,LIBS} in Makefile.am

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-25 22:26:59 +01:00
Fabiano Fidêncio
ce0c17b4f5 wxi: virt-viewer depends on libvirt-glib
Since 51ce01d virt-viewer depends again on libvirt-glib.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-02-25 22:18:53 +01:00
Fabiano Fidêncio
151109dbd2 nsis: Add libvirt-glib-1.0-0.dll
Since 51ce01d virt-viewer depends again on libvirt-glib.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-02-25 22:18:13 +01:00
Fabiano Fidêncio
51ce01dfdd Bring back libvirt-glib dependency
libvirt-glib dependency was dropped in commit 296f91c in favor to
maintain the full glib event loop integration into virt-viewer tree.
This decision was taken because libvirt-glib was not mature enough at
that time, which is not the case nowadays.

The libvirt-glib version chosen as dependency (0.1.8) is the first
release that includes the fixes for the glib event loop integration that
were backported to virt-viewer last year.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-02-25 22:17:37 +01:00
Pavel Grunt
c2d85041fb README: update information
Remove info about gtk versions
Fix a typo
Change link for spice-gtk widget
2016-02-25 09:26:57 +01:00
Fabiano Fidêncio
a3e5d0b97a cleanup: Don't use gtk_widget_modify_{fg,bg}()
These function have been deprecated since Gtk 3.0 and is recommended to
use _override_color() and _override_background_color() instead.
As these new functions take a GdkRGBA as parameter, let's use
gdk_rgba_parse() instead of gdk_color_parse().

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:58:01 +01:00
Fabiano Fidêncio
af1e42a101 cleanup: Don't use GtkStock
It has been deprecated since Gtk 3.10.

New strings have been added as the GTK_STOCK_* defines had their
translations done inside Gtk itself, but now the translations of the new
added labels must be done by virt-viewer translators.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:57:37 +01:00
Fabiano Fidêncio
a37127c7cf cleanup: Drop old compatibilty code
A few more pieces of old compatibility code can be dropped, as we
already depend on GLib 2.38.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-02-24 16:57:34 +01:00
Fabiano Fidêncio
4c4a43c61d Use GDK_VERSION_MAX_ALLOWED
In order to avoid using a too new Gtk API.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:57:23 +01:00
Fabiano Fidêncio
96d120903f Use GLIB_VERSION_MAX_ALLOWED
In order to avoid using a too new GLib API.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:57:12 +01:00
Fabiano Fidêncio
df403f5aba m4: Use -Wdeprecated-declarations
Let's enable deprecated-declarations warnings as we want to:
1) Avoid insert/maintain deprecated widgets/methods
2) Avoid adding widgets/methods that are too new, what could cause
problems like virt-viewer not being able to build in a specific distro.

Patches for making these two items possible are coming, introducing
_VERSION_MAX_ALLOWED for both GLIB and GDK and removing (as much as
possible) deprecated widgets/methods/structures.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 16:56:51 +01:00
Fabiano Fidêncio
2c712a0525 mingw: Bump msitools version
Since commit 5d98df3 we depend on msitools 0.95-2.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-02-24 08:27:08 +01:00
Fabiano Fidêncio
80ac4d5774 app: Don't leave a window opened in case of connection error
Since commit ed9b3f3 the main window is not hidden when disconnecting.
But it also is not hidden when a connection error occurs, leaving a
black display with a not so accurate message to the users in case they
try to connect to a non-valid address from the remote-viewer connection
window and in this case the main window (display #1) shuldn't be shown.

The impetus for this chance is the following:
- user runs remote-viewer without any argument
- the remote-viewer connection window shows up
- user attempts to connect to a non-valid address
- a dialog pops up indicating a failure connecting to the graphic server
- the main window shows up saying "Connecting to the graphic server"
- user clicks 'Ok'
- the main window stays there with the same message

As a user, I expect the program to not show the main window in
connecting failure cases. This patch accomplishes that.
2016-02-24 07:21:06 +01:00
Fabiano Fidêncio
5d98df3ef1 nsis: update nettle to 3.2.1
Use version 3.2.1, matching what currently is in f23.
2016-02-24 07:20:10 +01:00
Eduardo Lima (Etrunko)
76d2e483d5 Drop old compatibility code
With glib requirements now being 2.38, these functions do not make sense anymore.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:46:02 +01:00
Eduardo Lima (Etrunko)
3270ce61af remote-viewer: Remove unused properties
The reason for using properties to access those members was to ensure
that they would only be set during the creation of the object. Now that
we removed that restriction, we set private members directly.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:46:02 +01:00
Eduardo Lima (Etrunko)
a9ce19f848 Port to GtkApplication API's
Most of this patch consists in code being shuffled around to fit the
expected flow while using the new APIs. I tried my best to make this
patch the less intrusive as possible. Main changes are:

- Updated build requirements
   * glib version 2.38
   * gtk+ version 3.10
   * gio

- VirtViewerApp is now a subclass of GtkApplication.
  Some mainloop calls were replaced:
   * gtk_main() -> g_application_run()
   * gtk_quit() -> g_application_quit()

- Unified command line option handling.
  The logic has moved from the main functions and split in common
  options, and specific ones for each application. With this, the main
  functions were highly simplified, and now basically responsible for
  instantiating the App object and running the main loop.

- All Window objects must be associated with the Application.
  With this, there is no need to emit our own 'window-added'/'window-
  removed' signals, as those will be emited by GtkApplication whenever
  gtk_application_add_window() and gtk_application_remove_window() are
  called. Also, 'window-removed' was not being used anywhere.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-18 21:45:56 +01:00
Uri Lublin
7a54b96dbe spice: vv-file: do not ignore usb-filter
Fixes rhbz#1309634

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-18 16:23:34 +01:00
Eduardo Lima (Etrunko)
40ebfbadee Minor code cleanups
- Reuse #ifdef HAVE_SPICE_GTK block for include.
- Move declaration of vfunc together with others of the same class.
- Move variable declaration to the top of the function.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-15 21:50:19 +01:00
Fabiano Fidêncio
4235ef3453 Drop support to gtk2
The 3.0 release was the last one that still supports GTK2. For the
Windows builds the support to GTK2 was dropped in the previous release.
Let's do the same for the entire project now.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-15 21:49:57 +01:00
Pavel Grunt
c86a4dfa41 display: Use correct variable name
Fix gtk2 build
2016-02-15 17:59:32 +01:00
Pavel Grunt
fd4c721551 display: Remove zoom property
It is possible to get the same info from the "zoom-level" property.
virt_viewer_display_get_zoom() now returns TRUE if zoom level != 100
2016-02-15 14:01:50 +01:00
Pavel Grunt
ca1ad884bd display: Use common code to get preferred size 2016-02-15 14:01:42 +01:00
Pavel Grunt
724744ca20 app: Compute monitor mapping only in fullscreen 2016-02-15 13:51:13 +01:00
Pavel Grunt
529980e8d3 app: Do not show usbredir button without session
The button is visible in the fullscreen toolbar when waiting for a guest.
Clicking on it causes the runtime warning:
virt-viewer-CRITICAL **: virt_viewer_session_usb_device_selection: assertion 'VIRT_VIEWER_IS_SESSION(self)' failed
2016-02-15 10:05:16 +01:00
Pavel Grunt
8c9a968561 app: Add comment only when config file has VM group
Avoid the debug message on close:
virt-viewer-DEBUG: Unable to get comment from key file: Key file does not have group '39cd210d-5d45-478a-91fe-b3680307f2df'
2016-02-15 10:04:42 +01:00
Pavel Grunt
fcb200e3d4 app: Return early on empty monitor mapping
Resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1304648
2016-02-15 10:04:32 +01:00
Pavel Grunt
422cbb6ea6 display: Set value of desktop width and height property directly
Avoid calling gtk_widget_queue_resize() and emiting
the "display-desktop-resize" signal.
The only user of the properties is virt_viewer_display_spice_set_desktop()
which will call the function and emit the signal after setting both
"desktop-width" and "desktop-height" properties.

Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Pavel Grunt
045174f483 display: Return early and remove a block
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Pavel Grunt
c2f6412e7a display: Remove unnecessary VIRT_VIEWER_DISPLAY cast
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2016-02-03 15:25:09 +01:00
Fabiano Fidêncio
5fd23329c4 Remove GSLice usage
It's being slowly deprecated in glib
https://bugzilla.gnome.org/show_bug.cgi?id=754687
2016-01-18 11:27:07 +01:00