diff --git a/src/gnome-utils/gnc-icons.c b/src/gnome-utils/gnc-icons.c index b939fb8149..9792b4fcd6 100644 --- a/src/gnome-utils/gnc-icons.c +++ b/src/gnome-utils/gnc-icons.c @@ -32,34 +32,34 @@ #include "gnc-icons.h" #include "gnc-filepath-utils.h" #include "gnc-gnome-utils.h" +#include "gnc-path.h" typedef struct _item_file { const gchar *icon_name; - const gchar *filename_lg; - const gchar *filename_sm; + const gchar *filename; } item_file; static item_file item_files[] = { - { GNC_ICON_ACCOUNT, "gnc-account.png", "gnc-account-16.png"}, - { GNC_ICON_ACCOUNT_REPORT, "gnc-account-report.png", "gnc-account-report-16.png"}, - { GNC_ICON_DELETE_ACCOUNT, "gnc-account-delete.png", "gnc-account-delete-16.png"}, - { GNC_ICON_EDIT_ACCOUNT, "gnc-account-edit.png", "gnc-account-edit-16.png"}, - { GNC_ICON_NEW_ACCOUNT, "gnc-account-new.png", "gnc-account-new-16.png"}, - { GNC_ICON_OPEN_ACCOUNT, "gnc-account-open.png", "gnc-account-open-16.png"}, - { GNC_ICON_TRANSFER, "gnc-transfer.png", "gnc-transfer-16.png"}, - { GNC_ICON_SCHEDULE, "gnc-sx-new.png", "gnc-sx-new-16.png"}, - { GNC_ICON_SPLIT_TRANS, "gnc-split-trans.png", "gnc-split-trans-16.png"}, - { GNC_ICON_JUMP_TO, "gnc-jumpto.png", "gnc-jumpto-16.png"}, - { GNC_ICON_INVOICE, "gnc-invoice.png", "gnc-invoice-16.png"}, - { GNC_ICON_INVOICE_PAY, "gnc-invoice-pay.png", "gnc-invoice-pay-16.png"}, - { GNC_ICON_INVOICE_POST, "gnc-invoice-post.png", "gnc-invoice-post-16.png"}, - { GNC_ICON_INVOICE_UNPOST, "gnc-invoice-unpost.png", "gnc-invoice-unpost-16.png"}, - { GNC_ICON_INVOICE_NEW, "gnc-invoice-new.png", "gnc-invoice-new-16.png"}, - { GNC_ICON_INVOICE_EDIT, "gnc-invoice-edit.png", "gnc-invoice-edit-16.png"}, - { GNC_ICON_INVOICE_DUPLICATE, "gnc-invoice-duplicate.png", "gnc-invoice-duplicate-16.png"}, - { GNC_ICON_PDF_EXPORT, "gnc-gnome-pdf-24.png", "gnc-gnome-pdf-16.png"}, + { GNC_ICON_ACCOUNT, "gnc-account.png"}, + { GNC_ICON_ACCOUNT_REPORT, "gnc-account-report.png"}, + { GNC_ICON_DELETE_ACCOUNT, "gnc-account-delete.png"}, + { GNC_ICON_EDIT_ACCOUNT, "gnc-account-edit.png"}, + { GNC_ICON_NEW_ACCOUNT, "gnc-account-new.png"}, + { GNC_ICON_OPEN_ACCOUNT, "gnc-account-open.png"}, + { GNC_ICON_TRANSFER, "gnc-transfer.png"}, + { GNC_ICON_SCHEDULE, "gnc-sx-new.png"}, + { GNC_ICON_SPLIT_TRANS, "gnc-split-trans.png"}, + { GNC_ICON_JUMP_TO, "gnc-jumpto.png"}, + { GNC_ICON_INVOICE, "gnc-invoice.png"}, + { GNC_ICON_INVOICE_PAY, "gnc-invoice-pay.png"}, + { GNC_ICON_INVOICE_POST, "gnc-invoice-post.png"}, + { GNC_ICON_INVOICE_UNPOST, "gnc-invoice-unpost.png"}, + { GNC_ICON_INVOICE_NEW, "gnc-invoice-new.png"}, + { GNC_ICON_INVOICE_EDIT, "gnc-invoice-edit.png"}, + { GNC_ICON_INVOICE_DUPLICATE, "gnc-invoice-duplicate.png"}, + { GNC_ICON_PDF_EXPORT, "gnc-gnome-pdf.png"}, { 0 }, }; @@ -67,14 +67,18 @@ void gnc_load_app_icons (void) { item_file *file; + const gchar *default_path; + gchar* pkgdatadir = gnc_path_get_pkgdatadir (); + default_path = g_build_filename (pkgdatadir, "icons", NULL); + g_free(pkgdatadir); for (file = item_files; file->icon_name; file++) { GdkPixbuf *pixbuf_sm, *pixbuf_lg; - char *fullname_sm = NULL, *fullname_lg = NULL; + char *fullname_sm, *fullname_lg; + fullname_sm = g_strconcat (default_path, "/hicolor/16x16/actions/", file->filename, NULL); + fullname_lg = g_strconcat (default_path, "/hicolor/24x24/actions/", file->filename, NULL); - fullname_sm = gnc_filepath_locate_pixmap (file->filename_sm); - fullname_lg = gnc_filepath_locate_pixmap (file->filename_lg); g_assert (fullname_sm && fullname_lg); pixbuf_sm = gnc_gnome_get_gdkpixbuf (fullname_sm); @@ -86,5 +90,8 @@ gnc_load_app_icons (void) g_object_unref(pixbuf_sm); g_object_unref(pixbuf_lg); + + g_free (fullname_sm); + g_free (fullname_lg); } } diff --git a/src/pixmaps/CMakeLists.txt b/src/pixmaps/CMakeLists.txt index 2f0fb2712f..c05254f64f 100644 --- a/src/pixmaps/CMakeLists.txt +++ b/src/pixmaps/CMakeLists.txt @@ -2,6 +2,10 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION share/gnucash PATTERN Makefile.* EXCLUDE PATTERN CMakeLists.txt EXCLUDE + PATTERN hicolor EXCLUDE +) + +INSTALL(DIRECTORY ${DATADIR_BUILD}/gnucash/icons DESTINATION share/gnucash ) IF (GNC_BUILD_AS_INSTALL) @@ -9,6 +13,13 @@ IF (GNC_BUILD_AS_INSTALL) DESTINATION ${DATADIR_BUILD}/gnucash/pixmaps PATTERN Makefile.* EXCLUDE PATTERN CMakeLists.txt EXCLUDE + PATTERN hicolor EXCLUDE + ) +ENDIF() + +IF (GNC_BUILD_AS_INSTALL) + FILE(COPY hicolor + DESTINATION ${DATADIR_BUILD}/gnucash/icons ) ENDIF() @@ -116,4 +127,4 @@ IF (GNC_BUILD_AS_INSTALL) ${DATADIR_BUILD}/gnucash/pixmaps/gnucash-icon-32x32.png ) -ENDIF() \ No newline at end of file +ENDIF() diff --git a/src/pixmaps/gnc-account-delete-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-account-delete.png similarity index 100% rename from src/pixmaps/gnc-account-delete-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-account-delete.png diff --git a/src/pixmaps/gnc-account-edit-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-account-edit.png similarity index 100% rename from src/pixmaps/gnc-account-edit-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-account-edit.png diff --git a/src/pixmaps/gnc-account-new-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-account-new.png similarity index 100% rename from src/pixmaps/gnc-account-new-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-account-new.png diff --git a/src/pixmaps/gnc-account-open-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-account-open.png similarity index 100% rename from src/pixmaps/gnc-account-open-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-account-open.png diff --git a/src/pixmaps/gnc-account-report-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-account-report.png similarity index 100% rename from src/pixmaps/gnc-account-report-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-account-report.png diff --git a/src/pixmaps/gnc-account-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-account.png similarity index 100% rename from src/pixmaps/gnc-account-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-account.png diff --git a/src/pixmaps/gnc-gnome-pdf-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-gnome-pdf.png similarity index 100% rename from src/pixmaps/gnc-gnome-pdf-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-gnome-pdf.png diff --git a/src/pixmaps/gnc-invoice-duplicate-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice-duplicate.png similarity index 100% rename from src/pixmaps/gnc-invoice-duplicate-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice-duplicate.png diff --git a/src/pixmaps/gnc-invoice-edit-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice-edit.png similarity index 100% rename from src/pixmaps/gnc-invoice-edit-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice-edit.png diff --git a/src/pixmaps/gnc-invoice-new-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice-new.png similarity index 100% rename from src/pixmaps/gnc-invoice-new-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice-new.png diff --git a/src/pixmaps/gnc-invoice-pay-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice-pay.png similarity index 100% rename from src/pixmaps/gnc-invoice-pay-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice-pay.png diff --git a/src/pixmaps/gnc-invoice-post-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice-post.png similarity index 100% rename from src/pixmaps/gnc-invoice-post-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice-post.png diff --git a/src/pixmaps/gnc-invoice-unpost-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice-unpost.png similarity index 100% rename from src/pixmaps/gnc-invoice-unpost-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice-unpost.png diff --git a/src/pixmaps/gnc-invoice-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-invoice.png similarity index 100% rename from src/pixmaps/gnc-invoice-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-invoice.png diff --git a/src/pixmaps/gnc-jumpto-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-jumpto.png similarity index 100% rename from src/pixmaps/gnc-jumpto-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-jumpto.png diff --git a/src/pixmaps/gnc-split-trans-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-split-trans.png similarity index 100% rename from src/pixmaps/gnc-split-trans-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-split-trans.png diff --git a/src/pixmaps/gnc-sx-new-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-sx-new.png similarity index 100% rename from src/pixmaps/gnc-sx-new-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-sx-new.png diff --git a/src/pixmaps/gnc-transfer-16.png b/src/pixmaps/hicolor/16x16/actions/gnc-transfer.png similarity index 100% rename from src/pixmaps/gnc-transfer-16.png rename to src/pixmaps/hicolor/16x16/actions/gnc-transfer.png diff --git a/src/pixmaps/gnc-account-delete.png b/src/pixmaps/hicolor/24x24/actions/gnc-account-delete.png similarity index 100% rename from src/pixmaps/gnc-account-delete.png rename to src/pixmaps/hicolor/24x24/actions/gnc-account-delete.png diff --git a/src/pixmaps/gnc-account-edit.png b/src/pixmaps/hicolor/24x24/actions/gnc-account-edit.png similarity index 100% rename from src/pixmaps/gnc-account-edit.png rename to src/pixmaps/hicolor/24x24/actions/gnc-account-edit.png diff --git a/src/pixmaps/gnc-account-new.png b/src/pixmaps/hicolor/24x24/actions/gnc-account-new.png similarity index 100% rename from src/pixmaps/gnc-account-new.png rename to src/pixmaps/hicolor/24x24/actions/gnc-account-new.png diff --git a/src/pixmaps/gnc-account-open.png b/src/pixmaps/hicolor/24x24/actions/gnc-account-open.png similarity index 100% rename from src/pixmaps/gnc-account-open.png rename to src/pixmaps/hicolor/24x24/actions/gnc-account-open.png diff --git a/src/pixmaps/gnc-account-report.png b/src/pixmaps/hicolor/24x24/actions/gnc-account-report.png similarity index 100% rename from src/pixmaps/gnc-account-report.png rename to src/pixmaps/hicolor/24x24/actions/gnc-account-report.png diff --git a/src/pixmaps/gnc-account.png b/src/pixmaps/hicolor/24x24/actions/gnc-account.png similarity index 100% rename from src/pixmaps/gnc-account.png rename to src/pixmaps/hicolor/24x24/actions/gnc-account.png diff --git a/src/pixmaps/gnc-gnome-pdf-24.png b/src/pixmaps/hicolor/24x24/actions/gnc-gnome-pdf.png similarity index 100% rename from src/pixmaps/gnc-gnome-pdf-24.png rename to src/pixmaps/hicolor/24x24/actions/gnc-gnome-pdf.png diff --git a/src/pixmaps/gnc-invoice-duplicate.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice-duplicate.png similarity index 100% rename from src/pixmaps/gnc-invoice-duplicate.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice-duplicate.png diff --git a/src/pixmaps/gnc-invoice-edit.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice-edit.png similarity index 100% rename from src/pixmaps/gnc-invoice-edit.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice-edit.png diff --git a/src/pixmaps/gnc-invoice-new.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice-new.png similarity index 100% rename from src/pixmaps/gnc-invoice-new.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice-new.png diff --git a/src/pixmaps/gnc-invoice-pay.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice-pay.png similarity index 100% rename from src/pixmaps/gnc-invoice-pay.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice-pay.png diff --git a/src/pixmaps/gnc-invoice-post.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice-post.png similarity index 100% rename from src/pixmaps/gnc-invoice-post.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice-post.png diff --git a/src/pixmaps/gnc-invoice-unpost.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice-unpost.png similarity index 100% rename from src/pixmaps/gnc-invoice-unpost.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice-unpost.png diff --git a/src/pixmaps/gnc-invoice.png b/src/pixmaps/hicolor/24x24/actions/gnc-invoice.png similarity index 100% rename from src/pixmaps/gnc-invoice.png rename to src/pixmaps/hicolor/24x24/actions/gnc-invoice.png diff --git a/src/pixmaps/gnc-jumpto.png b/src/pixmaps/hicolor/24x24/actions/gnc-jumpto.png similarity index 100% rename from src/pixmaps/gnc-jumpto.png rename to src/pixmaps/hicolor/24x24/actions/gnc-jumpto.png diff --git a/src/pixmaps/gnc-split-trans.png b/src/pixmaps/hicolor/24x24/actions/gnc-split-trans.png similarity index 100% rename from src/pixmaps/gnc-split-trans.png rename to src/pixmaps/hicolor/24x24/actions/gnc-split-trans.png diff --git a/src/pixmaps/gnc-sx-new.png b/src/pixmaps/hicolor/24x24/actions/gnc-sx-new.png similarity index 100% rename from src/pixmaps/gnc-sx-new.png rename to src/pixmaps/hicolor/24x24/actions/gnc-sx-new.png diff --git a/src/pixmaps/gnc-transfer.png b/src/pixmaps/hicolor/24x24/actions/gnc-transfer.png similarity index 100% rename from src/pixmaps/gnc-transfer.png rename to src/pixmaps/hicolor/24x24/actions/gnc-transfer.png