From e2abe953ed09288daf45684efc28f305b8c9df59 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 24 Jul 2020 10:54:08 +0200 Subject: [PATCH] VM selection: expand models for tooltip column Add a new column in the list models for the VM selection dialog, and use this new column to hold the tooltip of the items in the list. At the moment nothing is set in the new column, so there is no behavior change. Signed-off-by: Pino Toscano --- src/remote-viewer.c | 4 ++-- src/resources/ui/virt-viewer-vm-connection.ui | 13 +++++++++---- src/virt-viewer-vm-connection.c | 2 +- src/virt-viewer.c | 4 ++-- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/remote-viewer.c b/src/remote-viewer.c index 717a57e..09e3f98 100644 --- a/src/remote-viewer.c +++ b/src/remote-viewer.c @@ -608,8 +608,8 @@ choose_vm(GtkWindow *main_window, g_return_val_if_fail(vm_name != NULL, NULL); free(*vm_name); - /* UI name , key */ - model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + /* UI name , key , tooltip */ + model = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); vms = ovirt_collection_get_resources(vms_collection); g_hash_table_iter_init(&vms_iter, vms); diff --git a/src/resources/ui/virt-viewer-vm-connection.ui b/src/resources/ui/virt-viewer-vm-connection.ui index f190c92..cff1797 100644 --- a/src/resources/ui/virt-viewer-vm-connection.ui +++ b/src/resources/ui/virt-viewer-vm-connection.ui @@ -1,6 +1,7 @@ - + + False 5 @@ -21,7 +22,7 @@ end - _Cancel + _Cancel True True True @@ -64,6 +65,7 @@ False 0 horizontal + 2 @@ -90,12 +92,12 @@ True False - 0 - 0 4 Available virtual machines end 26 + 0 + 0 @@ -113,5 +115,8 @@ button-cancel button-connect + + + diff --git a/src/virt-viewer-vm-connection.c b/src/virt-viewer-vm-connection.c index f253a69..6cc04ed 100644 --- a/src/virt-viewer-vm-connection.c +++ b/src/virt-viewer-vm-connection.c @@ -65,7 +65,7 @@ virt_viewer_vm_connection_choose_name_dialog(GtkWindow *main_window, return NULL; } - g_assert(gtk_tree_model_get_n_columns(model) == 2); + g_assert(gtk_tree_model_get_n_columns(model) == 3); vm_connection = virt_viewer_util_load_ui("virt-viewer-vm-connection.ui"); g_return_val_if_fail(vm_connection != NULL, NULL); diff --git a/src/virt-viewer.c b/src/virt-viewer.c index 79c867a..871ef25 100644 --- a/src/virt-viewer.c +++ b/src/virt-viewer.c @@ -823,8 +823,8 @@ choose_vm(GtkWindow *main_window, g_return_val_if_fail(vm_name != NULL, NULL); free(*vm_name); - /* UI name , key */ - model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING); + /* UI name , key , tooltip */ + model = gtk_list_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); vms_running = virConnectListAllDomains(conn, &domains, flags); for (i = 0; i < vms_running; i++) {