[virt-tools-list] [PATCH 04/22] window: use virt_viewer_window_set_menus_sensitive()

Victor Toso victortoso at redhat.com
Fri Aug 31 06:12:28 UTC 2018


Hi,

On Tue, Jul 31, 2018 at 03:41:07PM +0200, marcandre.lureau at redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
> 
> virt_viewer_window_set_menus_sensitive() is the common function to set
> sensitivity on menu items.
> 
> It was lacking "toolbar_send_key", so add it there too.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>

Acked-by: Victor Toso <victortoso at redhat.com>

> ---
>  src/virt-viewer-window.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index af3441f..4b48e31 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -1352,6 +1352,8 @@ virt_viewer_window_set_menus_sensitive(VirtViewerWindow *self, gboolean sensitiv
>  
>      menu = GTK_WIDGET(gtk_builder_get_object(priv->builder, "menu-send"));
>      gtk_widget_set_sensitive(menu, sensitive);
> +
> +    gtk_widget_set_sensitive(self->priv->toolbar_send_key, sensitive);
>  }
>  
>  static void
> @@ -1432,10 +1434,7 @@ virt_viewer_window_set_display(VirtViewerWindow *self, VirtViewerDisplay *displa
>          if (virt_viewer_display_get_enabled(display))
>              virt_viewer_window_desktop_resize(display, self);
>  
> -        gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-preferences")), TRUE);
> -        gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-view-zoom")), TRUE);
> -        gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-send")), TRUE);
> -        gtk_widget_set_sensitive(self->priv->toolbar_send_key, TRUE);
> +        virt_viewer_window_set_menus_sensitive(self, TRUE);
>      }
>  }
>  
> -- 
> 2.18.0.321.gffc6fa0e39
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20180831/8ae4da33/attachment.sig>


More information about the virt-tools-list mailing list