Commit Graph

25 Commits

Author SHA1 Message Date
Jonathon Jongsma
b917969f75 Add some missing mnemonics to menu items
Fixes: rhbz#1332545
2016-05-03 15:49:05 -05: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
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
Marc-André Lureau
31b23e7f0a Show preferences dialog
Add a menu item Preferences under File and show the preferences dialog
2015-03-05 21:31:31 +01:00
Jonathon Jongsma
a15bbac320 Make default window size a bit more useful
Currently, windows have a default size of 400x400 pixels. This is a
strange aspect ratio for a display, and it is also too small to be
useful for much. Since the default window size determines the initial
size of newly-enabled displays, it would be nice if we used a slightly
better size.
2014-09-24 10:21:22 -05:00
Fabiano Fidêncio
e86e885380 Revert changes related to numpad accelerators
Due to a GTK+ limitation and bad testing from my side, I've pushed
two patches trying to add support to use Ctrl + {+, -, 0} from numpad
to control zoom-in, zoom-out and zoom-reset.
Unfortunately, with the first patch (3a168815) I've duplicated the menu
items related to the zoom functions. With the second one (55cdb986),
provided to not show the duplicated menu items, we came back to the
initial state, where the numpad accelerators don't work.

So, in resume, multiple accelerators in a GTK+ widget are only supported
on applications using GApplication, what is not our case and won't be
till we drop the GTK+2 support.

Revert "Do not show duplicated menu items" and
Revert "Add support to use numpad accelarators for zoom-{in.out,reset}"

This reverts commits 55cdb9867d and
3a168815b7.
2014-09-23 15:00:19 +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
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
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
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
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
c3cbdef888 Remove "Automatically resize" menu
Remove "Automatically resize" menu item (always enabled for Spice
display now)

https://bugzilla.redhat.com/show_bug.cgi?id=1007649
2014-03-13 12:57:14 +01:00
Marc-André Lureau
679bb4468e Rename internal toggle-fullscreen menu accel name
This avoid confusion with other fullscreen state property
2013-11-07 19:43:39 +01:00
Marc-André Lureau
e044fe2544 window: use dynamically generated menu
Remove the static Glade menu in favour of the one generated dynamically
already used for the toolbar.
2013-07-30 21:11:28 +02:00
Marc-André Lureau
e2dce44aa2 Make zoom-reset a global key binding 2013-07-30 21:09:30 +02:00
Marc-André Lureau
51ca18beee Use the accelgroup to define key bindings
With accelgroups, we can redefine the keybindings
2012-02-22 16:45:00 +01:00
Marc-André Lureau
e6dfd324c4 Add hidden menu smartcard remove/insert and release-cursor 2012-02-22 16:44:27 +01:00
Marc-André Lureau
2601ba1150 Require an accel group for full-screen menu
Bump Gtk depedency to 2.18, since we already use symbols from it.
2012-02-22 16:12:10 +01:00
Hans de Goede
c67a8cfdbe Only make the USB device selection sensitive when the vm is USB capable 2012-02-06 12:30:27 +00:00
Hans de Goede
b272e08541 Add a menu entry for USB device selection 2012-02-06 12:30:08 +00:00
Marc-André Lureau
0584170300 Add a "Displays" submenu, and warn when closing last display 2011-07-26 12:00:29 +01:00
Marc-André Lureau
c7ad98333d Split VirtViewerApp window into VirtViewerWindow 2011-07-26 11:16:34 +01:00
Marc-André Lureau
e2c09a876b Turn VirtViewer into a VirtViewerApp object 2011-07-22 16:11:02 +01:00
Daniel P. Berrange
cff795065a Replace use of GtkAlignment with a custom align widget
To use the GtkAlignment we have to play evil tricks overriding
its size request, to make it reallocate the child to the preferred
size we desire based on the virtual desktop size + zoom level.

By replacing the GtkAlignment with a custom widget we can
directly implement the layout/sizing semantics we want without
playing stupid games
2011-07-01 18:07:25 +01:00
Daniel P. Berrange
f3fa999769 Introduce standard naming convention to files & methods
All source files must be named

  virt-viewer-XXXX

All methods named

  virt_viewer_XXX
2011-07-01 16:12:20 +01:00