[virt-tools-list] [PATCH 05/22] window: move default sensitivity in .ui

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


On Tue, Jul 31, 2018 at 03:41:08PM +0200, marcandre.lureau at redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
> 
> Instead of modifying it in object initialization.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> ---
>  src/resources/ui/virt-viewer.ui | 4 ++++
>  src/virt-viewer-window.c        | 5 -----
>  2 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/src/resources/ui/virt-viewer.ui b/src/resources/ui/virt-viewer.ui
> index e9609ec..9da1403 100644
> --- a/src/resources/ui/virt-viewer.ui
> +++ b/src/resources/ui/virt-viewer.ui
> @@ -34,6 +34,7 @@
>                          <property name="accel_group">accelgroup</property>
>                          <child>
>                            <object class="GtkMenuItem" id="menu-file-screenshot">
> +                            <property name="sensitive">False</property>
>                              <property name="visible">True</property>
>                              <property name="can_focus">False</property>
>                              <property name="use_action_appearance">False</property>
> @@ -83,6 +84,7 @@
>                          </child>
>                          <child>
>                            <object class="GtkMenuItem" id="menu-preferences">
> +                            <property name="sensitive">False</property>
>                              <property name="visible">True</property>
>                              <property name="can_focus">False</property>
>                              <property name="label" translatable="yes">_Preferences</property>
> @@ -136,6 +138,7 @@
>                          </child>
>                          <child>
>                            <object class="GtkMenuItem" id="menu-view-zoom">
> +                            <property name="sensitive">False</property>
>                              <property name="visible">True</property>
>                              <property name="can_focus">False</property>
>                              <property name="use_action_appearance">False</property>
> @@ -214,6 +217,7 @@
>                  </child>
>                  <child>
>                    <object class="GtkMenuItem" id="menu-send">
> +                    <property name="sensitive">False</property>
>                      <property name="visible">True</property>
>                      <property name="can_focus">False</property>
>                      <property name="use_action_appearance">False</property>
> diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
> index 4b48e31..301a3bf 100644
> --- a/src/virt-viewer-window.c
> +++ b/src/virt-viewer-window.c
> @@ -313,11 +313,6 @@ virt_viewer_window_init (VirtViewerWindow *self)
>  
>      priv->builder = virt_viewer_util_load_ui("virt-viewer.ui");
>  
> -    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-send")), FALSE);
> -    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-view-zoom")), FALSE);
> -    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-file-screenshot")), FALSE);
> -    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-preferences")), FALSE);
> -

Tested by destroying and starting vm again, looks fine.
Acked-by: Victor Toso <victortoso at redhat.com>

>      gtk_builder_connect_signals(priv->builder, self);
>  
>      priv->accel_group = GTK_ACCEL_GROUP(gtk_builder_get_object(priv->builder, "accelgroup"));
> -- 
> 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/4936ff86/attachment.sig>


More information about the virt-tools-list mailing list