[virt-tools-list] [virt-viewer][PATCH] app/window: Set display menu not sensitive when needed

Pavel Grunt pgrunt at redhat.com
Thu Apr 16 09:55:05 UTC 2015


Hi, it looks good to me. Just one comment below.

> 
> Displays menu must be sensitive only when at least one display is
> enabled.
> ---
>  src/virt-viewer-app.c    |  6 +++++-
>  src/virt-viewer-window.c | 13 +++++++++++++
>  src/virt-viewer-window.h |  1 +
>  3 files changed, 19 insertions(+), 1 deletion(-)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 563117a..7cf0c60 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -2253,17 +2253,21 @@ window_update_menu_displays_cb(gpointer
> value,
>      GtkMenuShell *submenu;
>      GList *keys = g_hash_table_get_keys(self->priv->displays);
>      GList *tmp;
> +    gboolean sensitive;
>  
>      keys = g_list_sort(keys, update_menu_displays_sort);
>      submenu =
>      window_empty_display_submenu(VIRT_VIEWER_WINDOW(value));
>  
> +    sensitive = (keys != NULL) ? TRUE : FALSE;
> +

no need for the ternary operator.

Pavel




More information about the virt-tools-list mailing list