summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-app.h
Commit message (Collapse)AuthorAgeFilesLines
* Port to GtkApplication API'sEduardo Lima (Etrunko)2016-02-181-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Don't wait for reconnect when user cancels authJonathon Jongsma2015-06-191-0/+1
| | | | | | | | | | | When starting virt-viewer with the --reconnect switch to a guest that has a password, if the user cancels the authentication dialog (e.g. pressing 'Esc'), the window will display "Waiting for guest domain to restart". Obviously, the domain will never restart because it's already running. After this fix, the application will simply exit when the user cancels authentication, even if the --reconnect switch is used.
* virt-viewer: Set toolbar buttons not sensitive when neededLukas Venhoda2015-04-221-0/+1
| | | | | | | | | | | | | | File->Screenshot, File->Preferences, View->Zoom and Send keys are now sensitive only while quest is connected. Changed behaviour of zoom: Previously, zoom could be set while quest wasn't connected. The zoom would then be set on connection. There was no indication of current zoom level while not connected to guest. Now, the menu is not sensitive while not connected to guest. Zoom can now be only modified while connected to guest, or from the command line.
* virt-viewer-app: create_session() should return a booleanFabiano Fidêncio2015-03-271-1/+1
| | | | | | | By convention functions that take GError parameters should return FALSE (or NULL) or error. Related: rhbz#1085216
* virt-viewer-app: Add a GError arg to create_session()Fabiano Fidêncio2015-03-271-1/+1
| | | | | | | | | | | This is part of a small re-factoring that will have all connection errors, when we won't be able to connect regardless of what changes on the remote host, being treated by virt_viewer_app_initial_connect(), avoiding weird behaviors as we have nowadays (like more than one error dialog being shown or having the virt-viewer waiting forever for a guest that will never show up). Related: rhbz#1085216
* Exit normally when canceling dialogPavel Grunt2015-03-231-2/+2
| | | | | | | | | This applies for: libvirt authentication dialog (e.g. virt-viewer --attach guest) 'recent connection' dialog (e.g. remote-viewer) 'vm choose' dialog when connecting without specifying the vm name This is done by using a new GError VIRT_VIEWER_ERROR_CANCELLED.
* Monitor config at sometimes leaves additional monitors enabledJonathon Jongsma2015-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | When using the configuration file to specify which remote monitors should be enabled when using the --full-screen option, it sometimes left additional displays enabled, or didn't place the displays on the right monitor, or didn't fullscreen them. This was especially true when not enabling the first display on the remote host. For example: monitor-mapping=2:2;3:3 (note that configuration file uses 1-based indexes, rather than 0-based indexes, so the numbers used below will be 1 less than those above) Previously, when performing fullscreen auto-conf, we were configuring displays starting at #0 and ending at ndisplays. So for the previous configuration, we looped from i = 0 to i < 2 (i.e. display #0 and #1) even though we should have configured display #1 and #2. After this fix, we configure the exact displays that were specified in the monitor-mapping configuration. Resolves: rhbz#1200750
* Show preferences dialogMarc-André Lureau2015-03-051-0/+1
| | | | Add a menu item Preferences under File and show the preferences dialog
* Move libvirt reconnect polling to VirtViewerMarc-André Lureau2014-11-251-1/+0
| | | | | This is libvirt specific, no need to share it in the VirtViewerApp base class.
* VirtViewerApp: store windows in a listJonathon Jongsma2014-09-241-1/+1
| | | | | Use a list to store the application's windows. This is another step towards separating the window from the guest display ID.
* Add a dialog showing details of the current guestJonathon Jongsma2014-08-071-1/+0
| | | | | | 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)
* Use GOptionGroup for VirtViewerApp optionsJonathon Jongsma2014-07-021-1/+1
| | | | | | | | Encapsulate things a bit better by adding virt_viewer_app_get_option_group() which provides a GOptionGroup rather than exposing an array of options. This option is then set as the main option group, and additional options can be added by subclasses, so the effect to the user should be equivalent.
* Don't connect to localhost when using --directChristophe Fergeau2014-06-101-0/+1
| | | | | | | | | | | | | | | | | | Trying to connect to a remote virtual machine using virt-viewer -c qemu+ssh://example.com/system --direct $vm_name will currently fail with an error message saying it's not possible to localhost. This happens with VMs which listen on a wildcard address (eg '0.0.0.0'). This was introduced by commit 74b1b62 which changes the host to connect to to 'localhost' when trying to connect through ssh to a VM listening on a wildcard address. This is only valid when using a ssh tunnel, and should not be done with --direct. The fallback code which uses the hostname from the libvirt URI is what makes the most sense in this situation (wildcard listen address + --direct). This commit introduces a virt_viewer_app_get_direct() so that this can be implemented. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1079211
* Improve window title when connected to newer spice-serverJonathon Jongsma2014-02-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent spice servers send the guest vm name and uuid to the client. We can use these values to display the proper vm name in the window title if a title is not specified on the commandline. We can also be smarter about the title in virt-viewer as well. If a title is specified on the comamndline (-t/--title=foo), we use that. If not, we fall back to the vm name. If that is empty, we fall back to the uri of the connection. Comparison between old behavior and new behavior Using new spice-server Command Old title New title ------- --------- --------- remote-viewer -t xyz spice://host:port xyz xyz remote-viewer spice://host:port spice://host:port <vmname> virt-viewer <vmname> <vmname> <vmname> virt-viewer <uuid> <uuid> <vmname> Using old spice-server Command Old title New title ------- --------- --------- remote-viewer -t xyz spice://host:port xyz xyz remote-viewer spice://host:port spice://host:port spice://host:port virt-viewer <vmname> <vmname> <vmname> virt-viewer <uuid> <uuid> <vmname>
* Fix rebuild of accelerators menu when loading from fileMarc-André Lureau2014-01-071-0/+1
| | | | | | | | | It's not enough to set the property to notify of its change. Add a virt_viewer_app_set_enable_accel() helper, and call it after the changes to accelerators are made when loading from file. I verified the menu is correctly built when connection from controller or command line too.
* Remove obsolete function declarationJonathon Jongsma2013-12-101-1/+0
| | | | | This function was removed in bd914bdea2e85d62d5f67eb567ce200f526c6bab, but the declaration was missed.
* Add ability to define custom display->monitor mapping per vmJonathon Jongsma2013-11-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fullscreen mode generally just assigns display 1 to monitor 1, display 2 to monitor 2, etc. For custom setups, you can define a monitor mapping in the settings keyfile per-vm. This requires a vm uuid (so only works in virt-viewer or on versions of spice-server that send the uuid over the wire). The format is pretty basic: [6485b20f-e9da-614c-72b0-60a7857e7886] monitor-mapping=2;3 The group name ("6485b20f-e9da-614c-72b0-60a7857e7886") is the uuid id of the vm. This group has a single key: monitor-mapping. This key is an array of integers describing the order in which to assign the monitors to a guest display. Any monitors that are not listed in this array will not be configured at startup. For instance: monitor-mapping=2;1 will attempt to configure 2 displays on the guest and assign the first display to monitor 2 and the second display to monitor 1. monitor-mapping=2 will only configure a single display on the guest and place it on the second monitor. Any monitor numbers listed in the keyfile are greater than the number of monitors that are physically present, they will be ignored.
* Unify configured hotkey behaviourMarc-André Lureau2013-11-071-0/+1
| | | | | | | | | | | Whether the hotkeys are set through command line, controller or file, we should get the same keybinding result (clear unspecified, and enable global bindings) However, when started from command line arguments, without --hotkey argument, it will have basic non-global default bindings. https://bugzilla.redhat.com/show_bug.cgi?id=1023447
* Try to share more GOption code between r-v and v-vMarc-André Lureau2013-08-201-0/+1
|
* app: always use maybe_quit()Marc-André Lureau2013-07-081-1/+0
| | | | | | | Now that closing a window is like quiting, there is no reason to ask or skip the confirm dialog depending on how you quit (menu/toolbar/window). https://bugzilla.redhat.com/show_bug.cgi?id=905684
* Show connect dialog again if connection from dialog failedMarc-André Lureau2013-05-171-1/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=864026
* Exit virt-viewer when trying to close any windowChristophe Fergeau2013-04-251-0/+1
| | | | | | | | Currently, in multi-screen scenarios, when closing one remote-viewer window, the corresponding screen gets disabled in the guest OS. This can be confusing as this behaves very differently from File/Quit. This commit will exit the whole application when the user tries to close one of virt-viewer window.
* app: add get_fullscreen_auto_conf()Marc-André Lureau2013-03-251-0/+1
|
* Allow app_initial_connect() to raise an errorMarc-André Lureau2013-03-081-4/+4
|
* Add a virt_viewer_app_set_hotkeys() helper functionHans de Goede2012-12-211-0/+1
| | | | Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* spice: only autoresize once with screen size in fullscreenMarc-André Lureau2012-10-181-0/+1
| | | | | | | | | | | | It's currently not possible to configure guest with higher resolution than native, as it will switch back to native, since the gtk widget allocation will always end up being the size of the screen. We special-case fullscreen mode, and only resize when entering fullscreen. Furthermore, it avoids sending extra unnecessary resize events to the guest whenever gtk+ call size allocate in various stages, with different values. https://bugzilla.redhat.com/show_bug.cgi?id=864929
* Allow user to set a window title for remote-viewerDaniel P. Berrange2012-10-091-0/+2
| | | | | | | | | Currently the remote viewer windows get the URI as their title. Provide a --title STRING arg to remote-viewer to let the user override the title with something more meaningful to them. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
* Small code simplificationMarc-André Lureau2012-02-221-3/+0
|
* Add virt_viewer_app_get_session()Marc-André Lureau2012-02-221-0/+1
|
* Add VirtViewerApp:enable-accel propertyMarc-André Lureau2012-02-221-0/+1
|
* Extract tlsPort for SPICE and use it to enable secure connectionsDaniel P. Berrange2012-02-141-0/+1
|
* Update copyright headersDaniel P. Berrange2012-02-061-1/+1
|
* Convert TABS to spaces & reindent everywhereDaniel P. Berrange2012-02-061-13/+20
|
* Add a menu entry for USB device selectionHans de Goede2012-02-061-0/+3
|
* Support for virDomainOpenGraphics APIDaniel P. Berrange2012-01-311-0/+3
| | | | | | Add a new flag --attach, which instructs virt-viewer to attach to the target display using virDomainOpenGraphics, instead of initiating a VNC/SPICE connection directly.
* Add a few property getters, used by controllerMarc-André Lureau2012-01-301-0/+1
| | | | | | - virt_viewer_app_get_windows() - virt_viewer_window_get_builder() - "VirtViewerSessionSpice:spice-session" property
* Make virt_viewer_activate() a vfuncMarc-André Lureau2012-01-301-0/+1
| | | | since other equivalent methods are already overridable.
* Add window-added & window-removed signalsMarc-André Lureau2012-01-301-0/+5
|
* Use graphical URI for connectionMarc-André Lureau2012-01-301-1/+2
| | | | If specified, use URI for connection details
* Add virt_viewer_app_show_display()Marc-André Lureau2011-08-041-0/+1
| | | | | Similar to previous virt_viewer_app_show_status(). Used later on by Spice controller to switch between display and status.
* Show status on all open windowsMarc-André Lureau2011-07-261-1/+1
| | | | | | The split virt_viewer_notebook_show_status() to virt_viewer_notebook_show_status_va() is unnecessary in the end, but it's more future-proof.
* Add a "Displays" submenu, and warn when closing last displayMarc-André Lureau2011-07-261-0/+1
|
* Use app fullscreen property instead of app.start() argumentMarc-André Lureau2011-07-261-3/+3
|
* Split VirtViewerApp window into VirtViewerWindowMarc-André Lureau2011-07-261-0/+3
|
* Inherit from VirtViewerApp for VirtViewerMarc-André Lureau2011-07-221-0/+80
Make it a real GObject. The parts specific to virt should go in virt-viewer.c