[virt-tools-list] [virt-viewer 1/2] window, util: Fix resource path for icons

Fabiano Fidêncio fidencio at redhat.com
Tue Jun 21 20:04:28 UTC 2016


Since commit 1f6f1a48 the resource path for icons has been broken.
The reason is that when moving the .ui files to $(srcdir)/resources/ui,
the define used for the resources was changed to reflect the new
directory. However, this change wasn't needed by the icons and ended up
with virt-viewer not displaying a few icons.

Let's fix the issue by adding a new define for the icon's resource path.

Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
---
 src/virt-viewer-util.h   | 1 +
 src/virt-viewer-window.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/virt-viewer-util.h b/src/virt-viewer-util.h
index 14a477a..7b90052 100644
--- a/src/virt-viewer-util.h
+++ b/src/virt-viewer-util.h
@@ -35,6 +35,7 @@ enum {
 
 #define VIRT_VIEWER_ERROR virt_viewer_error_quark ()
 #define VIRT_VIEWER_RESOURCE_PREFIX "/org/virt-manager/virt-viewer/ui"
+#define VIRT_VIEWER_RESOURCE_ICONS_PREFIX "/org/virt-manager/virt-viewer"
 
 GQuark virt_viewer_error_quark(void);
 
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 8ec2521..f29cc38 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -1042,7 +1042,7 @@ virt_viewer_window_menu_help_about(GtkWidget *menu G_GNUC_UNUSED,
 
     gtk_about_dialog_set_version(GTK_ABOUT_DIALOG(dialog), VERSION BUILDID);
 
-    icon = gdk_pixbuf_new_from_resource(VIRT_VIEWER_RESOURCE_PREFIX"/icons/48x48/virt-viewer.png", NULL);
+    icon = gdk_pixbuf_new_from_resource(VIRT_VIEWER_RESOURCE_ICONS_PREFIX"/icons/48x48/virt-viewer.png", NULL);
     if (icon != NULL) {
         gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(dialog), icon);
         g_object_unref(icon);
@@ -1081,7 +1081,7 @@ virt_viewer_window_toolbar_setup(VirtViewerWindow *self)
     g_signal_connect(button, "clicked", G_CALLBACK(virt_viewer_window_menu_file_quit), self);
 
     /* USB Device selection */
-    button = gtk_image_new_from_resource(VIRT_VIEWER_RESOURCE_PREFIX"/icons/24x24/virt-viewer-usb.png");
+    button = gtk_image_new_from_resource(VIRT_VIEWER_RESOURCE_ICONS_PREFIX"/icons/24x24/virt-viewer-usb.png");
     button = GTK_WIDGET(gtk_tool_button_new(button, NULL));
     gtk_tool_button_set_label(GTK_TOOL_BUTTON(button), _("USB device selection"));
     gtk_tool_item_set_tooltip_text(GTK_TOOL_ITEM(button), _("USB device selection"));
-- 
2.7.4




More information about the virt-tools-list mailing list