summaryrefslogtreecommitdiffstats
path: root/src/remote-viewer-main.c
Commit message (Collapse)AuthorAgeFilesLines
* Port to GtkApplication API'sEduardo Lima (Etrunko)2016-02-181-165/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Show osid in remote-viewer --versionChristophe Fergeau2015-06-091-1/+5
|
* 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.
* 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.
* remote-viewer: mention vv-file in help outputJonathon Jongsma2014-07-011-1/+1
| | | | | | | The man page already has a description of the vv-file format, but the --help output didn't mention it how to use it. References: rhbz#970825
* Improve window title when connected to newer spice-serverJonathon Jongsma2014-02-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* ovirt: Honour oVirt command line optionsChristophe Fergeau2013-10-301-0/+6
| | | | | | libgovirt 0.3.0 and newer can be passed from the commandline a CA certificate to use during SSL communications. This commit adds support for this option to remote-viewer.
* Try to share more GOption code between r-v and v-vMarc-André Lureau2013-08-201-51/+3
|
* remote-viewer: remove -d direct optionMarc-André Lureau2013-08-141-4/+0
| | | | | | | | remote-viewer currently doesn't provide automatic ssh tunnels, and even if it would, that would be explicit in the url given to remote-viewer (such as spice+ssh://...) https://bugzilla.redhat.com/show_bug.cgi?id=991261
* 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
* Fix trivial criticalMarc-André Lureau2013-05-211-5/+7
| | | | | | GLib-CRITICAL **: g_strv_length: assertion `str_array != NULL' Committed without review under trivial rule.
* Move connect dialog to remote-viewer.cMarc-André Lureau2013-05-171-93/+2
|
* Rename variable, fix gcc warningMarc-André Lureau2013-05-161-4/+4
| | | | virt-viewer-main.c:61: warning: declaration of 'basename' shadows a global declaration
* 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
* remote-viewer: set auto-conf before fullscreenMarc-André Lureau2013-05-031-4/+2
| | | | | | | | | | | | If a monitor is already in fullscreen, setting auto-conf to true will not move it until it is re-fullscreen This was unnoticed, because usually, the first client window is opened on the first monitor. Also we may argue than relying on g_object_set() property order is lame and fragile, we better split it in two seperate calls as this might break upstream. https://bugzilla.redhat.com/show_bug.cgi?id=872288
* Be more consistent in #if/#ifdef useChristophe Fergeau2013-04-121-5/+5
| | | | | | | Some of the code is checking for spice-gtk/oVirt availability by using #ifdef HAVE_XXX, and some of the code is using #if HAVE_XXX. As configure.ac only AC_DEFINE() HAVE_XXX when XXX could be found, let's use the #ifdef HAVE_XXX form everywhere
* 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>
* Add VirtViewerSession:file propertyMarc-André Lureau2012-11-271-0/+1
| | | | | | | | | | If VirtViewerSession:file is set, it should be used to define the connection parameters. Also correct the mime type used in this case. The mime type is needed to identify the kind of resources we are adding to the recent list. The recent list can then be filtered and various application handling that type may attempt to access that resource.
* recent: get mime type from sessionMarc-André Lureau2012-11-271-5/+4
| | | | | Do not use spice mime type for all kind of sessions, but depending on what is actually being used.
* Use a common early init() functionMarc-André Lureau2012-10-231-21/+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.
* win32: there is no CONERR$, only CONOUT$Marc-André Lureau2012-10-231-1/+1
|
* Allow user to set a window title for remote-viewerDaniel P. Berrange2012-10-091-1/+4
| | | | | | | | | 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>
* Document -f=auto-conf in remote-viewer --helpChristophe Fergeau2012-08-131-1/+1
| | | | | | virt-viewer does not support -f=auto-conf so this does not change the option there. Fixes rhbz#718001
* Use real binary name in help messageChristophe Fergeau2012-08-101-4/+5
| | | | | | | | | | | | 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 various memory leaksChristophe Fergeau2012-06-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ==25063== 59 bytes in 1 blocks are definitely lost in loss record 5,163 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356) ==25063== by 0x41F40A: connected (remote-viewer-main.c:186) ==25063== by 0x3DE400F663: g_closure_invoke (gclosure.c:777) ==25063== by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547) ==25063== by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296) ==25063== by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389) ==25063== by 0x41AA53: reemit_signal_VOID (virt-viewer-session-ovirt.c:211) ==25063== by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840) ==25063== by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207) ==25063== by 0x3DE4028CCF: g_signal_emit_by_name (gsignal.c:3389) ==25063== 14 bytes in 1 blocks are definitely lost in loss record 623 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82) ==25063== by 0x3DE3882F1A: g_vasprintf (stdio2.h:199) ==25063== by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509) ==25063== by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535) ==25063== by 0x40CBAE: virt_viewer_app_update_pretty_address (virt-viewer-app.c:1538) ==25063== by 0x40FB55: virt_viewer_app_free_connect_info (virt-viewer-app.c:1707) ==25063== by 0x40FBE9: virt_viewer_app_dispose (virt-viewer-app.c:1291) ==25063== by 0x3DE40144F7: g_object_unref (gobject.c:2981) ==25063== by 0x40C31A: main (remote-viewer-main.c:336) ==25063== 10 bytes in 1 blocks are definitely lost in loss record 491 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x34561092F7: __vasprintf_chk (vasprintf_chk.c:82) ==25063== by 0x3DE3882F1A: g_vasprintf (stdio2.h:199) ==25063== by 0x3DE3862EDC: g_strdup_vprintf (gstrfuncs.c:509) ==25063== by 0x3DE3862F7B: g_strdup_printf (gstrfuncs.c:535) ==25063== by 0x40DE36: window_update_menu_displays_cb (virt-viewer-app.c:1640) ==25063== by 0x3DE383833F: g_hash_table_foreach (ghash.c:1524) ==25063== by 0x3DE400F663: g_closure_invoke (gclosure.c:777) ==25063== by 0x3DE40206D7: signal_emit_unlocked_R (gsignal.c:3547) ==25063== by 0x3DE402866C: g_signal_emit_valist (gsignal.c:3296) ==25063== by 0x3DE40287C1: g_signal_emit (gsignal.c:3352) ==25063== by 0x5772F95: gtk_widget_show (gtkwidget.c:3225) ==25063== 8,431 (72 direct, 8,359 indirect) bytes in 1 blocks are definitely lost in loss record 9,468 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE38616B1: g_slice_alloc (gslice.c:1003) ==25063== by 0x3DE3861C05: g_slice_alloc0 (gslice.c:1029) ==25063== by 0x3DE402F96F: g_type_create_instance (gtype.c:1872) ==25063== by 0x3DE40147A7: g_object_constructor (gobject.c:1849) ==25063== by 0x3DE4016260: g_object_newv (gobject.c:1632) ==25063== by 0x3DE40168AB: g_object_new (gobject.c:1542) ==25063== by 0x40C4BD: virt_viewer_util_load_ui (virt-viewer-util.c:41) ==25063== by 0x40C7EB: virt_viewer_auth_collect_credentials (virt-viewer-auth.c:43) ==25063== by 0x41B391: authenticate_cb (virt-viewer-session-ovirt.c:430) ==25063== by 0x3458C05E8F: ffi_call_unix64 (unix64.S:75) ==25063== 32 (16 direct, 16 indirect) bytes in 1 blocks are definitely lost in loss record 3,962 of 9,502 ==25063== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==25063== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==25063== by 0x3DE38616B1: g_slice_alloc (gslice.c:1003) ==25063== by 0x3DE38629F2: g_slist_append (gslist.c:222) ==25063== by 0x41483C: virt_viewer_window_init (virt-viewer-window.c:323) ==25063== by 0x3DE402FA05: g_type_create_instance (gtype.c:1892) ==25063== by 0x3DE40147A7: g_object_constructor (gobject.c:1849) ==25063== by 0x3DE4015D70: g_object_newv (gobject.c:1713) ==25063== by 0x3DE401655F: g_object_new_valist (gobject.c:1830) ==25063== by 0x3DE4016893: g_object_new (gobject.c:1545) ==25063== by 0x40DA34: virt_viewer_app_window_new (virt-viewer-app.c:590) ==25063== by 0x40E300: virt_viewer_app_constructor (virt-viewer-app.c:1336) ==30355== 4 bytes in 1 blocks are definitely lost in loss record 53 of 9,267 ==30355== at 0x4A0884D: malloc (vg_replace_malloc.c:263) ==30355== by 0x3DE384D2BE: g_malloc (gmem.c:159) ==30355== by 0x3DE3862D0B: g_strdup (gstrfuncs.c:356) ==30355== by 0x3DE40360FC: value_copy_string (gvaluetypes.c:276) ==30355== by 0x3DE40340CA: g_value_transform (gvalue.c:535) ==30355== by 0x3FDAE621DD: gdk_screen_get_setting (gdkevents-x11.c:3022) ==30355== by 0x3FDB3C7415: gtk_settings_get_property (gtksettings.c:1152) ==30355== by 0x3DE4017A74: g_object_get_property (gobject.c:1289) ==30355== by 0x414991: virt_viewer_window_disable_modifiers (virt-viewer-window.c:616) ==30355== by 0x415922: virt_viewer_window_keyboard_grab (virt-viewer-window.c:931) ==30355== by 0x3DE400F942: _g_closure_invoke_va (gclosure.c:840) ==30355== by 0x3DE4027D87: g_signal_emit_valist (gsignal.c:3207)
* Set the remote-viewer binary application nameDaniel P. Berrange2012-04-231-0/+2
| | | | | | | Currently the window titles for remote-view have 'remote-viewer' appended them. This is based off the argv[0] name. We should be setting the GLib application name though, so we can get a localized 'Remote Viewer' string in the titlebar
* remote-viewer: make it a GUI/windows application with hybrid consoleMarc-André Lureau2012-04-021-0/+15
| | | | | If the application can attach to its parent console, redirect input/output. So that will work nicely with the command line wrapper.
* Fix recent --spice-controller regression, add error messageMarc-André Lureau2012-03-301-3/+10
| | | | | | | | | The current code will attempt to dereference args if --spice-controller, even if args is NULL. Let's not accept any extra argument/uri on the command line if using the controller. Beside, the conditionnal block looks better outside of the if condition.
* remote-viewer: press Enter to connect in dialogMarc-André Lureau2012-03-291-0/+1
|
* Remove unused variable iMarc-André Lureau2012-03-291-3/+3
|
* remote-viewer: add a simple connection dialogMarc-André Lureau2012-03-291-4/+127
| | | | | | If the user doesn't provide URI, let's show a simple dialog to enter it. Also save & list recently used URLs in that dialog.
* 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.
* spice: implement --fullscreen=auto-confMarc-André Lureau2012-03-211-4/+28
| | | | | | | - auto-conf is an optionnal argument to --fullscreen: it will set the guest display configuration to match the client display configuration, by sending the client monitors size and position to capable guests.
* Make sure we call g_thread_init()Marc-André Lureau2012-03-091-0/+2
| | | | GThread is needed by spice-gtk
* Set pretty icon for remote-viewer windows tooDaniel P. Berrange2012-02-141-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-94/+93
|
* Adapt remote-viewer so that it builds without SPICEDaniel P. Berrange2012-01-311-3/+13
|
* Add spice_get_option_group()Marc-André Lureau2012-01-311-0/+3
|
* Add spice controller support in remote-viewerMarc-André Lureau2012-01-311-6/+14
| | | | Usage is simply "remote-viewer --spice-controller"
* Add remote-viewer programMarc-André Lureau2012-01-311-0/+148
This program is meant for direct URI connections. ex: remote-viewer vnc://uri