[virt-tools-list] [PATCH 2/2] Make hotkey configuration functionality available from the cmdline

Daniel P. Berrange berrange at redhat.com
Wed Dec 19 15:01:21 UTC 2012


On Wed, Dec 19, 2012 at 03:59:28PM +0100, Hans de Goede wrote:
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  src/remote-viewer-main.c | 4 ++++
>  src/virt-viewer-main.c   | 4 ++++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/src/remote-viewer-main.c b/src/remote-viewer-main.c
> index 540d9de..048f6b4 100644
> --- a/src/remote-viewer-main.c
> +++ b/src/remote-viewer-main.c
> @@ -197,6 +197,7 @@ main(int argc, char **argv)
>      gchar **args = NULL;
>      gchar *uri = NULL;
>      char *title = NULL;
> +    char *hotkeys = NULL;
>      gboolean verbose = FALSE;
>      gboolean debug = FALSE;
>      gboolean direct = FALSE;
> @@ -224,6 +225,8 @@ main(int argc, char **argv)
>          { "spice-controller", '\0', 0, G_OPTION_ARG_NONE, &controller,
>            N_("Open connection using Spice controller communication"), NULL },
>  #endif
> +        { "hotkeys", 'h', 0, G_OPTION_ARG_STRING, &hotkeys,
> +          N_("Customise hotkeys"), NULL },
>          { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
>            NULL, "URI" },
>          { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
> @@ -302,6 +305,7 @@ main(int argc, char **argv)
>                   NULL);
>      virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom);
>      virt_viewer_app_set_direct(app, direct);
> +    virt_viewer_app_set_hotkeys(app, hotkeys);
>  
>      if (!virt_viewer_app_start(app))
>          goto cleanup;
> diff --git a/src/virt-viewer-main.c b/src/virt-viewer-main.c
> index 8dca48b..8ac061a 100644
> --- a/src/virt-viewer-main.c
> +++ b/src/virt-viewer-main.c
> @@ -49,6 +49,7 @@ int main(int argc, char **argv)
>      char *uri = NULL;
>      int zoom = 100;
>      gchar **args = NULL;
> +    gchar *hotkeys = NULL;
>      gboolean verbose = FALSE;
>      gboolean debug = FALSE;
>      gboolean direct = FALSE;
> @@ -80,6 +81,8 @@ int main(int argc, char **argv)
>            N_("Display debugging information"), NULL },
>          { "full-screen", 'f', 0, G_OPTION_ARG_NONE, &fullscreen,
>            N_("Open in full screen mode"), NULL },
> +        { "hotkeys", 'h', 0, G_OPTION_ARG_STRING, &hotkeys,
> +          N_("Customise hotkeys"), NULL },
>          { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &args,
>            NULL, "DOMAIN-NAME|ID|UUID" },
>          { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL }
> @@ -131,6 +134,7 @@ int main(int argc, char **argv)
>          goto cleanup;
>  
>      g_object_set(viewer, "fullscreen", fullscreen, NULL);
> +    virt_viewer_app_set_hotkeys(VIRT_VIEWER_APP(viewer), hotkeys);
>      if (!virt_viewer_app_start(VIRT_VIEWER_APP(viewer)))
>          goto cleanup;

Looks reasonable, but I'm not really sure what syntax the --hotkeys
argument expects. Can you update the man pages to illustrate the
usage of this parameter too

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list