From 1906d3027dc3ad8b9b5533712299d48e265c852c Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Mon, 12 Mar 2018 09:14:01 -0700 Subject: Do not use hardcoded path for icon Use just the symbolic name "hardinfo", allowing for icon packs to provide alternative icons. Fixes #227 --- CMakeLists.txt | 4 ++++ hardinfo.desktop.cmake | 2 +- modules/benchmark/guibench.c | 2 +- pixmaps/hardinfo.png | Bin 0 -> 1904 bytes pixmaps/logo.png | Bin 1904 -> 0 bytes shell/callbacks.c | 2 +- shell/shell.c | 2 +- 7 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 pixmaps/hardinfo.png delete mode 100644 pixmaps/logo.png diff --git a/CMakeLists.txt b/CMakeLists.txt index ab62cad6..8038aead 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -299,3 +299,7 @@ install(FILES ${HARDINFO_MANPAGES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/man/man1 PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) +install(FILES pixmaps/hardinfo.png + DESTINATION share/icons/hicolor/48x48/apps + PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ +) diff --git a/hardinfo.desktop.cmake b/hardinfo.desktop.cmake index 53dbee55..55ccae26 100644 --- a/hardinfo.desktop.cmake +++ b/hardinfo.desktop.cmake @@ -7,7 +7,7 @@ Name[ru]=Информация о системе и тестирование Comment=Displays system information Comment[ru]=Показывает информацию о системе Exec=@CMAKE_INSTALL_FULL_BINDIR@/hardinfo -Icon=@CMAKE_INSTALL_FULL_DATAROOTDIR@/hardinfo/pixmaps/logo.png +Icon=hardinfo Terminal=false Type=Application StartupNotify=true diff --git a/modules/benchmark/guibench.c b/modules/benchmark/guibench.c index b9573278..7d159d7e 100644 --- a/modules/benchmark/guibench.c +++ b/modules/benchmark/guibench.c @@ -108,7 +108,7 @@ static double test_icons(GtkWindow *window) gc = gdk_gc_new(GDK_DRAWABLE(gdk_window)); timer = g_timer_new(); - pixbufs[0] = icon_cache_get_pixbuf("logo.png"); + pixbufs[0] = icon_cache_get_pixbuf("hardinfo.png"); pixbufs[1] = icon_cache_get_pixbuf("syncmanager.png"); pixbufs[2] = icon_cache_get_pixbuf("report-large.png"); diff --git a/pixmaps/hardinfo.png b/pixmaps/hardinfo.png new file mode 100644 index 00000000..9d0484a5 Binary files /dev/null and b/pixmaps/hardinfo.png differ diff --git a/pixmaps/logo.png b/pixmaps/logo.png deleted file mode 100644 index 9d0484a5..00000000 Binary files a/pixmaps/logo.png and /dev/null differ diff --git a/shell/callbacks.c b/shell/callbacks.c index 9bb5c990..e7183185 100644 --- a/shell/callbacks.c +++ b/shell/callbacks.c @@ -199,7 +199,7 @@ void cb_about() gtk_about_dialog_set_comments(GTK_ABOUT_DIALOG(about), _("System information and benchmark tool")); gtk_about_dialog_set_logo(GTK_ABOUT_DIALOG(about), - icon_cache_get_pixbuf("logo.png")); + icon_cache_get_pixbuf("hardinfo.png")); gtk_about_dialog_set_license(GTK_ABOUT_DIALOG(about), _("HardInfo is free software; you can redistribute it and/or modify " diff --git a/shell/shell.c b/shell/shell.c index 8688f9ac..10c74d13 100644 --- a/shell/shell.c +++ b/shell/shell.c @@ -416,7 +416,7 @@ static void create_window(void) shell->window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_icon(GTK_WINDOW(shell->window), - icon_cache_get_pixbuf("logo.png")); + icon_cache_get_pixbuf("hardinfo.org")); shell_set_title(shell, NULL); gtk_window_set_default_size(GTK_WINDOW(shell->window), 800, 600); g_signal_connect(G_OBJECT(shell->window), "destroy", destroy_me, NULL); -- cgit v1.2.3