gnucash master: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Sun Jan 1 11:28:03 EST 2023
Updated via https://github.com/Gnucash/gnucash/commit/37d009bd (commit)
via https://github.com/Gnucash/gnucash/commit/470afc91 (commit)
via https://github.com/Gnucash/gnucash/commit/b3fa876d (commit)
from https://github.com/Gnucash/gnucash/commit/a5431436 (commit)
commit 37d009bd08f8d2cdc847246acdbf2792a3fed7db
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sun Jan 1 17:24:48 2023 +0100
Remove debug output
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index aa73ddd33..cc4dac0f8 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -3795,9 +3795,6 @@ gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
gnc_main_window_update_toolbar (window, page, menu_qualifier);
- PERR("Display Item Hash size %d", g_hash_table_size (priv->display_item_hash)); //FIXMEb temp added
- PERR("Display Item Q %d", priv->num_item_q); //FIXMEb temp added
-
// reset hash table and remove added menu items
g_hash_table_remove_all (priv->display_item_hash);
gnc_menubar_model_remove_items_with_attrib (priv->menubar_model,
commit 470afc918fb1620d02ec0d7c61152b5b1856d7da
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sun Jan 1 17:23:12 2023 +0100
Relocate resource to /org/gnucash/GnuCash prefix
This is done to be consistent with the GSettings
prefix (which is also a GLib subsystem).
In the process replace the magic string with
a single, globally defined macro.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7b209da5..1b6e8f94f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,8 @@ set(GNUCASH_BUILD_ID "" CACHE STRING "Overrides the GnuCash build identification
# gnucash/gnome/gnucash.releases.xml with (package) release details to be included
# in the appdata file. It should follow appdata <release> node conventions.
+# Common prefix to use for GLib resources related to GnuCash
+set (GNUCASH_RESOURCE_PREFIX "/org/${PROJECT_NAME}/${PACKAGE_NAME}")
# Check that all of the absolute install paths are inside
# ${CMAKE_INSTALL_PREFIX}. If they're not, disable binreloc as it
diff --git a/common/cmake_modules/GncGenerateGResources.cmake b/common/cmake_modules/GncGenerateGResources.cmake
index 536e5b06b..84eb4cc85 100644
--- a/common/cmake_modules/GncGenerateGResources.cmake
+++ b/common/cmake_modules/GncGenerateGResources.cmake
@@ -35,7 +35,7 @@ function(gnc_generate_gresources)
file(WRITE ${TMP_FILE} "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
file(APPEND ${TMP_FILE} "<gresources>\n")
- file(APPEND ${TMP_FILE} " <gresource prefix=\"/org/gnucash\">\n")
+ file(APPEND ${TMP_FILE} " <gresource prefix=\"${GNUCASH_RESOURCE_PREFIX}\">\n")
foreach(res_file ${GR_RESOURCE_FILES})
get_filename_component(res_file_short ${res_file} NAME)
diff --git a/common/config.h.cmake.in b/common/config.h.cmake.in
index 6188080eb..3e357b2e1 100644
--- a/common/config.h.cmake.in
+++ b/common/config.h.cmake.in
@@ -60,6 +60,9 @@
/* GnuCash earliest compatible databaseversion number */
#define GNUCASH_RESAVE_VERSION @GNUCASH_RESAVE_VERSION@
+/* GnuCash prefix to use for GLib resources */
+#define GNUCASH_RESOURCE_PREFIX "@GNUCASH_RESOURCE_PREFIX@"
+
/* Don't use deprecated gtk functions */
#cmakedefine GTK_DISABLE_DEPRECATED 1
diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index 57278c60b..631a52691 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -343,7 +343,7 @@ gnc_embedded_window_new (const gchar *action_group_name,
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
- ui_fullname = g_strconcat ("/org/gnucash/", ui_filename, NULL);
+ ui_fullname = g_strconcat (GNUCASH_RESOURCE_PREFIX "/", ui_filename, NULL);
gtk_builder_add_from_resource (builder, ui_fullname, &error);
diff --git a/gnucash/gnome-utils/gnc-gnome-utils.c b/gnucash/gnome-utils/gnc-gnome-utils.c
index 4b2ed35c3..2cf7829cb 100644
--- a/gnucash/gnome-utils/gnc-gnome-utils.c
+++ b/gnucash/gnome-utils/gnc-gnome-utils.c
@@ -153,8 +153,8 @@ gnc_add_css_file (void)
gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_app), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
gtk_style_context_add_provider_for_screen (screen, GTK_STYLE_PROVIDER (provider_user), GTK_STYLE_PROVIDER_PRIORITY_USER);
- gtk_css_provider_load_from_resource (provider_app, "/org/gnucash/gnucash.css");
- gtk_css_provider_load_from_resource (provider_fallback, "/org/gnucash/gnucash-fallback.css");
+ gtk_css_provider_load_from_resource (provider_app, GNUCASH_RESOURCE_PREFIX "/gnucash.css");
+ gtk_css_provider_load_from_resource (provider_fallback, GNUCASH_RESOURCE_PREFIX "/gnucash-fallback.css");
var = gnc_userconfig_dir ();
if (var)
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 3bce64fb8..aa73ddd33 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -3414,7 +3414,7 @@ update_menu_model (GncMainWindow *window, const gchar *ui_filename,
{
GncMainWindowPrivate *priv;
GError *error = nullptr;
- const gchar *resource = "/org/gnucash/";
+ const gchar *resource = GNUCASH_RESOURCE_PREFIX "/";
gchar *res_name;
GtkBuilder *builder = gtk_builder_new ();
GMenuModel *menu_model_part;
@@ -3427,7 +3427,7 @@ update_menu_model (GncMainWindow *window, const gchar *ui_filename,
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
- res_name = g_strconcat ("/org/gnucash/", ui_filename, NULL);
+ res_name = g_strconcat (GNUCASH_RESOURCE_PREFIX "/", ui_filename, NULL);
gtk_builder_add_from_resource (builder, res_name, &error);
g_free (res_name);
@@ -4127,7 +4127,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
- gtk_builder_add_from_resource (builder, "/org/gnucash/gnc-main-window.ui", &error);
+ gtk_builder_add_from_resource (builder, GNUCASH_RESOURCE_PREFIX "/gnc-main-window.ui", &error);
if (error)
{
diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c
index e65090782..291324c17 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.c
+++ b/gnucash/gnome-utils/gnc-plugin-page.c
@@ -265,7 +265,7 @@ gnc_plugin_page_merge_actions (GncPluginPage *page)
if (!priv->builder)
priv->builder = gtk_builder_new ();
- resource = g_strconcat ("/org/gnucash/", priv->ui_description, NULL);
+ resource = g_strconcat (GNUCASH_RESOURCE_PREFIX "/", priv->ui_description, NULL);
gtk_builder_set_translation_domain (priv->builder, PROJECT_NAME);
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 26e3177a4..42bbec13c 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1847,7 +1847,7 @@ recnWindowWithBalance (GtkWidget *parent, Account *account, gnc_numeric new_endi
GMenuModel *menu_model;
GtkWidget *menu_bar;
GtkAccelGroup *accel_group = gtk_accel_group_new ();
- const gchar *ui = "/org/gnucash/gnc-reconcile-window.ui";
+ const gchar *ui = GNUCASH_RESOURCE_PREFIX "/gnc-reconcile-window.ui";
GError *error = NULL;
#ifdef MAC_INTEGRATION
GtkosxApplication *theApp = g_object_new (GTKOSX_TYPE_APPLICATION,
commit b3fa876da3b985a2c22e4c966dd2522ea3cdc3a7
Author: Geert Janssens <geert at kobaltwit.be>
Date: Sun Jan 1 16:31:10 2023 +0100
Drop ui path specifier from resources paths
They were only there due to how the source directories
are organized and not really adding useful detail.
Removing it from the resource paths gives more freeedom
wrt to the organization of source files.
diff --git a/common/cmake_modules/GncGenerateGResources.cmake b/common/cmake_modules/GncGenerateGResources.cmake
index 600201dcf..536e5b06b 100644
--- a/common/cmake_modules/GncGenerateGResources.cmake
+++ b/common/cmake_modules/GncGenerateGResources.cmake
@@ -38,7 +38,8 @@ function(gnc_generate_gresources)
file(APPEND ${TMP_FILE} " <gresource prefix=\"/org/gnucash\">\n")
foreach(res_file ${GR_RESOURCE_FILES})
- file(APPEND ${TMP_FILE} " <file>${res_file}</file>\n")
+ get_filename_component(res_file_short ${res_file} NAME)
+ file(APPEND ${TMP_FILE} " <file alias=\"${res_file_short}\">${res_file}</file>\n")
endforeach()
file(APPEND ${TMP_FILE} " </gresource>\n")
file(APPEND ${TMP_FILE} "</gresources>\n")
diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index 7ff112bb4..57278c60b 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -343,7 +343,7 @@ gnc_embedded_window_new (const gchar *action_group_name,
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
- ui_fullname = g_strconcat ("/org/gnucash/ui/", ui_filename, NULL);
+ ui_fullname = g_strconcat ("/org/gnucash/", ui_filename, NULL);
gtk_builder_add_from_resource (builder, ui_fullname, &error);
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 33873f241..3bce64fb8 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -3427,7 +3427,7 @@ update_menu_model (GncMainWindow *window, const gchar *ui_filename,
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
- res_name = g_strconcat ("/org/gnucash/ui/", ui_filename, NULL);
+ res_name = g_strconcat ("/org/gnucash/", ui_filename, NULL);
gtk_builder_add_from_resource (builder, res_name, &error);
g_free (res_name);
@@ -4127,7 +4127,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
builder = gtk_builder_new ();
gtk_builder_set_translation_domain (builder, PROJECT_NAME);
- gtk_builder_add_from_resource (builder, "/org/gnucash/ui/gnc-main-window.ui", &error);
+ gtk_builder_add_from_resource (builder, "/org/gnucash/gnc-main-window.ui", &error);
if (error)
{
diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c
index ee570f4b1..e65090782 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.c
+++ b/gnucash/gnome-utils/gnc-plugin-page.c
@@ -265,7 +265,7 @@ gnc_plugin_page_merge_actions (GncPluginPage *page)
if (!priv->builder)
priv->builder = gtk_builder_new ();
- resource = g_strconcat ("/org/gnucash/ui/", priv->ui_description, NULL);
+ resource = g_strconcat ("/org/gnucash/", priv->ui_description, NULL);
gtk_builder_set_translation_domain (priv->builder, PROJECT_NAME);
diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index f419316e9..26e3177a4 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -1847,7 +1847,7 @@ recnWindowWithBalance (GtkWidget *parent, Account *account, gnc_numeric new_endi
GMenuModel *menu_model;
GtkWidget *menu_bar;
GtkAccelGroup *accel_group = gtk_accel_group_new ();
- const gchar *ui = "/org/gnucash/ui/gnc-reconcile-window.ui";
+ const gchar *ui = "/org/gnucash/gnc-reconcile-window.ui";
GError *error = NULL;
#ifdef MAC_INTEGRATION
GtkosxApplication *theApp = g_object_new (GTKOSX_TYPE_APPLICATION,
diff --git a/gnucash/import-export/aqb/CMakeLists.txt b/gnucash/import-export/aqb/CMakeLists.txt
index 181f793f4..264ee7fdd 100644
--- a/gnucash/import-export/aqb/CMakeLists.txt
+++ b/gnucash/import-export/aqb/CMakeLists.txt
@@ -41,7 +41,7 @@ set (aqbanking_noinst_HEADERS
set(aqbanking_GLADE assistant-ab-initial.glade dialog-ab.glade dialog-ab-pref.glade)
-set(aqbanking_UI ui/gnc-plugin-aqbanking.ui)
+set(aqbanking_UI gnc-plugin-aqbanking.ui)
if(WITH_AQBANKING)
diff --git a/gnucash/import-export/aqb/ui/gnc-plugin-aqbanking.ui b/gnucash/import-export/aqb/gnc-plugin-aqbanking.ui
similarity index 100%
rename from gnucash/import-export/aqb/ui/gnc-plugin-aqbanking.ui
rename to gnucash/import-export/aqb/gnc-plugin-aqbanking.ui
diff --git a/gnucash/import-export/ofx/CMakeLists.txt b/gnucash/import-export/ofx/CMakeLists.txt
index 695f4fe34..e998b6b44 100644
--- a/gnucash/import-export/ofx/CMakeLists.txt
+++ b/gnucash/import-export/ofx/CMakeLists.txt
@@ -15,7 +15,7 @@ set(ofx_noinst_HEADERS
gnc-plugin-ofx.h
)
-set(ofx_UI ui/gnc-plugin-ofx.ui)
+set(ofx_UI gnc-plugin-ofx.ui)
if (WITH_OFX)
diff --git a/gnucash/import-export/ofx/ui/gnc-plugin-ofx.ui b/gnucash/import-export/ofx/gnc-plugin-ofx.ui
similarity index 100%
rename from gnucash/import-export/ofx/ui/gnc-plugin-ofx.ui
rename to gnucash/import-export/ofx/gnc-plugin-ofx.ui
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 16b574a68..e5293495c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -315,9 +315,9 @@ gnucash/import-export/aqb/gnc-flicker-gui.c
gnucash/import-export/aqb/gnc-gwen-gui.c
gnucash/import-export/aqb/gncmod-aqbanking.c
gnucash/import-export/aqb/gnc-plugin-aqbanking.c
+gnucash/import-export/aqb/gnc-plugin-aqbanking.ui
gnucash/import-export/aqb/gschemas/org.gnucash.GnuCash.dialogs.flicker.gschema.xml.in
gnucash/import-export/aqb/gschemas/org.gnucash.GnuCash.dialogs.import.hbci.gschema.xml.in
-gnucash/import-export/aqb/ui/gnc-plugin-aqbanking.ui
gnucash/import-export/bi-import/dialog-bi-import.c
gnucash/import-export/bi-import/dialog-bi-import-gui.c
gnucash/import-export/bi-import/dialog-bi-import-helper.c
@@ -362,8 +362,8 @@ gnucash/import-export/log-replay/gnc-plugin-log-replay.c
gnucash/import-export/ofx/gncmod-ofx-import.c
gnucash/import-export/ofx/gnc-ofx-import.c
gnucash/import-export/ofx/gnc-plugin-ofx.c
+gnucash/import-export/ofx/gnc-plugin-ofx.ui
gnucash/import-export/ofx/gschemas/org.gnucash.GnuCash.dialogs.import.ofx.gschema.xml.in
-gnucash/import-export/ofx/ui/gnc-plugin-ofx.ui
gnucash/import-export/qif-imp/assistant-qif-import.c
gnucash/import-export/qif-imp/dialog-account-picker.c
gnucash/import-export/qif-imp/gnc-plugin-qif-import.c
Summary of changes:
CMakeLists.txt | 2 ++
common/cmake_modules/GncGenerateGResources.cmake | 5 +++--
common/config.h.cmake.in | 3 +++
gnucash/gnome-utils/gnc-embedded-window.c | 2 +-
gnucash/gnome-utils/gnc-gnome-utils.c | 4 ++--
gnucash/gnome-utils/gnc-main-window.cpp | 9 +++------
gnucash/gnome-utils/gnc-plugin-page.c | 2 +-
gnucash/gnome/window-reconcile.c | 2 +-
gnucash/import-export/aqb/CMakeLists.txt | 2 +-
gnucash/import-export/aqb/{ui => }/gnc-plugin-aqbanking.ui | 0
gnucash/import-export/ofx/CMakeLists.txt | 2 +-
gnucash/import-export/ofx/{ui => }/gnc-plugin-ofx.ui | 0
po/POTFILES.in | 4 ++--
13 files changed, 20 insertions(+), 17 deletions(-)
rename gnucash/import-export/aqb/{ui => }/gnc-plugin-aqbanking.ui (100%)
rename gnucash/import-export/ofx/{ui => }/gnc-plugin-ofx.ui (100%)
More information about the gnucash-changes
mailing list