summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-main.c
Commit message (Collapse)AuthorAgeFilesLines
* Port to GtkApplication API'sEduardo Lima (Etrunko)2016-02-181-104/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* virt-viewer-main: '--wait' should not be used without domain namePavel Grunt2015-04-141-0/+5
| | | | | | | | | | | Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain name to be placed just after the '--wait' option. It broke the command line api, because running 'virt-viewer $vm --wait' was considered as the error. This patch rather checks whether the domain name was specified. Related: rhbz#1209398, rhbz#1211573
* Revert "virt-viewer-main: Require domain name as argument for '--wait'"Pavel Grunt2015-04-141-5/+4
| | | | | | | | | | | This reverts commit a830275344c88aef12166661b68ea2b4429c7212. Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain name to be placed just after the '--wait' option. It broke the command line api, because running 'virt-viewer $vm --wait' was considered as the error. Related: rhbz#1209398, rhbz#1211573
* Revert "virt-viewer-main: exit when domain names doesn't match"Pavel Grunt2015-04-141-5/+0
| | | | | | | | | | | This reverts commit 10264d0d1ecbd67d3e59e3a1a3032936b0635eda. Commit a830275344c88aef12166661b68ea2b4429c7212 required the domain name to be placed just after the '--wait' option. It broke the command line api, because running 'virt-viewer $vm --wait' was considered as the error. Related: rhbz#1209398, rhbz#1211573
* virt-viewer-main: exit when domain names doesn't matchPavel Grunt2015-04-141-0/+5
| | | | | | | | | Since the domain name is required as a parameter for the '--wait' option (commit a830275344c88aef12166661b68ea2b4429c7212 ), it is neccessary to check whether all domains names are the same. Otherwise it wouldn't be clear which name should be used. related: rhbz#1211573
* man: document usage of domain name as optionalPavel Grunt2015-04-141-1/+1
| | | | related: rhbz#1211573
* virt-viewer-main: Require domain name as argument for '--wait'Pavel Grunt2015-04-071-4/+5
| | | | | | | As since 88f634179e56742a21fb4c7efc270e4203322d74 virt-viewer can be used without a domain-name, let's require it when using --wait. Resolves: rhbz#1209398
* Report errors in one placePavel Grunt2015-03-231-0/+3
| | | | | | Since the error is propagated to the main, report the error there. To make it work GError VIRT_VIEWER_ERROR_FAILED is set for all failing states and it is reported using virt_viewer_app_simple_message_dialog().
* Clear GError in cleanup sectionPavel Grunt2015-03-231-2/+1
|
* Exit normally when canceling dialogPavel Grunt2015-03-231-1/+5
| | | | | | | | | 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.
* Show VM chooser dialog when starting virt-viewer with no argPavel Grunt2014-10-101-2/+2
| | | | | | When user starts virt-viewer without specifying VM domain name or with a wrong name a list of running machines is shown and user may choose one of them.
* Use GOptionGroup for VirtViewerApp optionsJonathon Jongsma2014-07-021-2/+4
| | | | | | | | 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.
* Set help output summary correctlyJonathon Jongsma2014-07-011-1/+2
| | | | | | Use g_option_context_set_summary() to provide a brief description of the executable instead of tacking the summary onto the end of the commandline.
* Try to share more GOption code between r-v and v-vMarc-André Lureau2013-08-201-27/+2
|
* Use -H instead of -h for the short --hotkeysChristophe Fergeau2013-07-031-1/+1
| | | | | | -h conflicts with the short version of --help. Fixes rhbz#980846
* Rename variable, fix gcc warningMarc-André Lureau2013-05-161-4/+4
| | | | virt-viewer-main.c:61: warning: declaration of 'basename' shadows a global declaration
* Remove the "container" logic used by legacy browser pluginMarc-André Lureau2013-05-161-1/+1
|
* Add -- to seperate program arguments to server in man / --helpMarc-André Lureau2013-05-131-1/+1
| | | | | | | | Since some of the arguments are expecting following value, make it more explicit in the man and --help that -- can seperate options from server name or location. https://bugzilla.redhat.com/show_bug.cgi?id=843103
* build-sys: add --with-buildid to details build versionMarc-André Lureau2013-02-121-1/+1
| | | | | | Add a configure argument to append build version details, similar to what Daniel Berrange proposed in the "use finer package version in mingw-virt-viewer" thread on the ML.
* Make hotkey configuration functionality available from the cmdline (v2)Hans de Goede2012-12-211-0/+4
| | | | | | | Changes in v2: -Add --hotkeys documentation to the man-pages Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* Use a common early init() functionMarc-André Lureau2012-10-231-11/+1
| | | | | There is a number of things both virt-viewer and remote-viewer need to do early during execution. Do it only in one place.
* Use real binary name in help messageChristophe Fergeau2012-08-101-3/+10
| | | | | | | | | | | | Now that we have 2 distinct binaries, remote-viewer and virt-viewer, 'PACKAGE' can no longer be used in error messages as the name of the binary. This causes a small inconsistency when running 'remote-viewer --foobar' as the error message would be: 'Unknown option --foobar Run 'virt-viewer --help' to see a full list of available command line options' This commit makes sure we use argv[0] for this message. Fixes rhbz#814150
* Fix g_thread_init deprecation warningMarc-André Lureau2012-03-291-0/+2
| | | | | Although the doc says it is only deprecated since >2.32, it's actually >2.31 according to glib git log.
* Make sure we call g_thread_init()Marc-André Lureau2012-03-091-0/+2
| | | | GThread is needed by spice-gtk
* Import a pretty icon for virt-viewer applicationDaniel P. Berrange2012-02-081-0/+2
|
* Use exit() constantsDaniel P. Berrange2012-02-061-1/+1
|
* Update copyright headersDaniel P. Berrange2012-02-061-1/+1
|
* Convert TABS to spaces & reindent everywhereDaniel P. Berrange2012-02-061-92/+91
|
* Support for virDomainOpenGraphics APIDaniel P. Berrange2012-01-311-1/+4
| | | | | | 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.
* Use a first letter capital in helpMarc-André Lureau2012-01-311-7/+7
| | | | | The GLib/GNOME convention seems to have first letter as capital for option description strings.
* Add spice_get_option_group()Marc-André Lureau2012-01-311-2/+6
|
* build: make gtk-vnc optionalMarc-André Lureau2011-11-071-1/+6
|
* Make title more translatable and using application nameMarc-André Lureau2011-08-041-0/+2
|
* Use g_printerr for errors instead of fprintf(stderr,..)Marc-André Lureau2011-08-041-2/+2
|
* Use app fullscreen property instead of app.start() argumentMarc-André Lureau2011-07-261-1/+2
|
* Inherit from VirtViewerApp for VirtViewerMarc-André Lureau2011-07-221-3/+10
| | | | | | Make it a real GObject. The parts specific to virt should go in virt-viewer.c
* Turn VirtViewer into a VirtViewerApp objectMarc-André Lureau2011-07-221-3/+6
|
* Fix leak of command line argumentsDaniel P. Berrange2011-07-121-5/+9
|
* Add support for --fullscreen optionMarc-André Lureau2011-07-111-3/+7
|
* Introduce standard naming convention to files & methodsDaniel P. Berrange2011-07-011-0/+122
All source files must be named virt-viewer-XXXX All methods named virt_viewer_XXX