[virt-tools-list] [PATCH v2 09/16] app: append VTE consoles to display submenu

Victor Toso victortoso at redhat.com
Thu Dec 20 16:43:31 UTC 2018


Hi,

On Wed, Sep 26, 2018 at 07:26:32PM +0400, marcandre.lureau at redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau at redhat.com>
> 
> Get the name of the console, and set the subtitle with it.
> 
> Rename "set_title" to "set_subtitle" while at it, since it is more
> appropriate.

I'm confused, isn't this the previous patch? :)

> Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
> ---
>  src/virt-viewer-app.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
> index 7b750c6..568af47 100644
> --- a/src/virt-viewer-app.c
> +++ b/src/virt-viewer-app.c
> @@ -2294,6 +2294,26 @@ window_update_menu_displays_cb(gpointer value,
>          tmp = tmp->next;
>      }
>  
> +    for (GList *l = self->priv->windows; l; l = l->next) {

It would be the first time using this C feature in virt-viewer
codebase I think. You might use tmp if you don't want to declare
a new var.

> +        VirtViewerWindow *win = VIRT_VIEWER_WINDOW(l->data);
> +        VirtViewerDisplay *display = virt_viewer_window_get_display(win);
> +
> +        if (VIRT_VIEWER_IS_DISPLAY_VTE(display)) {
> +            gchar *name = NULL;
> +            GtkWidget *item;
> +
> +            g_object_get(display, "name", &name, NULL);
> +            item = gtk_check_menu_item_new_with_label(name);
> +            g_free(name);
> +
> +            virt_viewer_signal_connect_object(G_OBJECT(item), "toggled",
> +                G_CALLBACK(menu_display_visible_toggled_cb), display, 0);
> +            gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
> +                gtk_widget_get_visible(GTK_WIDGET(virt_viewer_window_get_window(win))));
> +            gtk_menu_shell_append(submenu, item);
> +        }
> +    
> +

Apart from the rename bit on commit log,
Acked-by: Victor Toso <victortoso at redhat.com>

>      gtk_widget_show_all(GTK_WIDGET(submenu));
>      g_list_free(keys);
>  }
> -- 
> 2.19.0.271.gfe8321ec05
> 
-------------- 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/20181220/5e7accb3/attachment.sig>


More information about the virt-tools-list mailing list