gnucash unstable: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Mon Feb 19 14:32:28 EST 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/62fd179f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/27256357 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b2ed250d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/22921c9f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3bc741e1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/7c9ac17c (commit)
	from  https://github.com/Gnucash/gnucash/commit/5929bb3b (commit)



commit 62fd179f8754702c2e77fb10eb79a53e07ad008d
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Feb 19 20:30:36 2018 +0100

    Adjust gnc_userconfig_dir and get_userconfig_home to the former returns a subdirectory of the latter
    
    Also add a few comments to make the distinction more clear.

diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp
index a8857d4..21e3f69 100644
--- a/libgnucash/core-utils/gnc-filepath-utils.cpp
+++ b/libgnucash/core-utils/gnc-filepath-utils.cpp
@@ -492,6 +492,12 @@ quarz_get_userdata_home(void)
 }
 #endif
 
+/* Returns an absolute path to the user's data directory.
+ * Note the default path depends on the platform.
+ *  - Windows: CSIDL_APPDATA
+ *  - OS X: $HOME/Application Support
+ *  - Linux: $XDG_DATA_HOME (or the default $HOME/.local/share)
+ */
 static bfs::path
 get_userdata_home(void)
 {
@@ -543,6 +549,12 @@ get_userdata_home(void)
     return userdata_home;
 }
 
+/* Returns an absolute path to the user's config directory.
+ * Note the default path depends on the platform.
+ *  - Windows: CSIDL_APPDATA
+ *  - OS X: $HOME/Application Support
+ *  - Linux: $XDG_CONFIG_HOME (or the default $HOME/.config)
+ */
 static bfs::path
 get_userconfig_home(void)
 {
@@ -565,8 +577,6 @@ get_userconfig_home(void)
     else
         userconfig_home = g_get_user_config_dir();
 
-    userconfig_home = userconfig_home / PACKAGE;
-
     return userconfig_home;
 }
 
@@ -670,12 +680,12 @@ gnc_filepath_init (void)
  *  Note that the default path depends on the platform.
  *  - Windows: CSIDL_APPDATA/Gnucash
  *  - OS X: $HOME/Application Support/Gnucash
- *  - Linux: $XDG_DATA_HOME/Gnucash (or the default $HOME/.local/share/Gnucash)
+ *  - Linux: $XDG_DATA_HOME/gnucash (or the default $HOME/.local/share/gnucash)
  *
- *  If any of these paths doesn't exist and can't be created the function will
+ *  If any of these paths don't exist and can't be created the function will
  *  fall back to
  *  - $HOME/.gnucash
- *  - <TMP_DIR>/Gnucash
+ *  - <TMP_DIR>/gnucash
  *  (in that order)
  *
  *  @return An absolute path to the configuration directory. This string is
@@ -712,12 +722,14 @@ gnc_userdata_dir (void)
 }
 
 /** @fn const gchar * gnc_userconfig_dir ()
- *  @brief Return the config directory
+ *  @brief Return the user's config directory for gnucash
  *
- *  Note that the default path depends on the platform.
+ *  @note the default path depends on the platform.
  *  - Windows: CSIDL_APPDATA/Gnucash
  *  - OS X: $HOME/Application Support/Gnucash
- *  - Linux: $XDG_CONFIG_HOME/Gnucash (or the default $HOME/.config/Gnucash)
+ *  - Linux: $XDG_CONFIG_HOME/gnucash (or the default $HOME/.config/gnucash)
+ *
+ *  @note gnucash will not create this directory if it doesn't exist
  *
  *  @return An absolute path to the configuration directory. This string is
  *  owned by the gnc_filepath_utils code and should not be freed by the user.
@@ -725,7 +737,7 @@ gnc_userdata_dir (void)
 const gchar *
 gnc_userconfig_dir (void)
 {
-    auto path_string = get_userconfig_home();
+    auto path_string = get_userconfig_home() / PACKAGE;
     return g_strdup(path_string.string().c_str());
 }
 

commit 27256357f519efe9ca9d5cf6cec1cb91917b97ce
Merge: 5929bb3 b2ed250
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Mon Feb 19 20:31:33 2018 +0100

    Merge branch 'BUG792809' of https://github.com/Bob-IT/gnucash into unstable


commit b2ed250db10b27a8dae48dd4ab279ca66a3d3cb8
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Feb 3 22:33:53 2018 +0000

    Change gsettings upgrade test so old_maj_min is < 207
    
    With the original value of 208, the use-gnucash-color-theme kept on
    being reset to what ever the use-theme-colors was, by default false.

diff --git a/libgnucash/app-utils/gnc-gsettings.c b/libgnucash/app-utils/gnc-gsettings.c
index 92a6edd..6e174ee 100644
--- a/libgnucash/app-utils/gnc-gsettings.c
+++ b/libgnucash/app-utils/gnc-gsettings.c
@@ -837,8 +837,8 @@ void gnc_gsettings_version_upgrade (void)
     if (!gnc_gsettings_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_MIGRATE_PREFS_DONE))
         gnc_gsettings_migrate_from_gconf ();
 
-    /* Convert settings to 2.8 compatibility level */
-    if (old_maj_min < 208)
+    /* Convert settings to 3.0 compatibility level */
+    if (old_maj_min < 207)
     {
         /* 'use-theme-colors' has been replaced with 'use-gnucash-color-theme'
          * which inverts the meaning of the setting */

commit 22921c9f290666266d6b0c20834720f889a631a6
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Feb 3 20:36:18 2018 +0000

    On first load, cell height is wrong which affects highlighting
    
    Move the get text height function which is the basis of the cell height
    to the start of the draw procedure so highlight area can be computed
    correctly.

diff --git a/gnucash/gnome-utils/gnc-dense-cal.c b/gnucash/gnome-utils/gnc-dense-cal.c
index 8b57330..b6d31ba 100644
--- a/gnucash/gnome-utils/gnc-dense-cal.c
+++ b/gnucash/gnome-utils/gnc-dense-cal.c
@@ -947,6 +947,9 @@ gnc_dense_cal_draw_to_buffer(GncDenseCal *dcal)
           marker_color_class = g_strconcat ("markers", class_extension, NULL);
     }
 
+    /* lets confirm text height size */
+    pango_layout_set_text(layout, "S", -1);
+    pango_layout_get_pixel_size(layout, NULL, &dcal->dayLabelHeight);
 
     /* Fill in alternating month colors. */
     {
@@ -1037,9 +1040,6 @@ gnc_dense_cal_draw_to_buffer(GncDenseCal *dcal)
         gint j;
 
         cairo_save (cr);
-        pango_layout_set_text(layout, "S", -1);
-        pango_layout_get_pixel_size(layout, NULL, &dcal->dayLabelHeight);
-
         gdk_rgba_parse (&color, "black");
 
         x = dcal->leftPadding

commit 3bc741e193fe68dda20b07b5adff8ff0042afef0
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sat Feb 3 18:59:40 2018 +0000

    Remove doc gtk2 rc file and replace with gtk3 css one

diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 109db6e..56296e8 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -14,10 +14,11 @@ SET(doc_DATA
   README.win32-bin.txt
   guile-hackers.txt
   projects.html
+  gtk-3.0.css
 )
 
 SET(doc_noinst_DATA
-        build-aix.txt build-solaris.txt CMakeLists.txt gnc-fq-dump.1 gnc-fq-helper.1 gnucash.1.in gtkrc-2.0.gnucash
+        build-aix.txt build-solaris.txt CMakeLists.txt gnc-fq-dump.1 gnc-fq-helper.1 gnucash.1.in
         misc-notes.txt README.HBCI README.OFX README.translator.txt tip_of_the_day.list.in
         TRANSLATION_HOWTO)
 
diff --git a/doc/gtk-3.0.css b/doc/gtk-3.0.css
new file mode 100755
index 0000000..4b56b89
--- /dev/null
+++ b/doc/gtk-3.0.css
@@ -0,0 +1,96 @@
+/* This is an example GTK CSS file that can be used with Gnucash.
+   Simply copy this file to the loaction specified below according
+   to your platform and then restart gnucash.
+
+  - Windows: CSIDL_APPDATA/GnuCash
+    (or the default is users\%USERNAME%\AppData\Roaming\GnuCash)
+
+  - OS X: $HOME/Application Support/GnuCash
+
+  - Linux: $XDG_CONFIG_HOME/gnucash
+    (or the default is $HOME/.config/gnucash)
+
+  These settings are mainly to do with register colors and can be seen
+  when the preference setting 'Register\Use GnuCash built-in color theme'
+  is unset.
+
+  Note: Widgets obtained from Glade files will not be addressable
+  directly by name as these are not brought in when loaded, only
+  the widget type can be configured unless they are named in code.
+*/
+
+/* Register sheet font setting */
+sheet {
+  font: 18px arial, sans-serif;
+}
+
+sheet calendar {
+  font: 12px arial, sans-serif;
+}
+
+
+/* Register User Colors */
+.header-color {
+  background-color: seagreen;
+  color: white;
+}
+
+.primary-color {
+  background-color: pink;
+}
+
+.primary-color:disabled {
+  background-color: plum;
+}
+
+.secondary-color {
+  background-color: lightgreen;
+}
+
+.secondary-color:disabled {
+  background-color: plum;
+}
+
+.split-color {
+  background-color: lightblue;
+}
+
+.split-color:disabled {
+  background-color: plum;
+}
+
+.cursor-color {
+  background-color: #00BFFF;
+  color: white;
+}
+
+cursor entry {
+  background-color: #00BFFF;
+  color: white;
+}
+
+
+/* Dense Calendar Settings */
+.calendar {
+  border-color: white;
+}
+
+.calendar.header {
+ background-color: lightgreen;
+}
+
+.calendar.primary {
+  background-color: darksalmon;
+}
+
+.calendar.secondary {
+  background-color: darkseagreen;
+}
+
+.calendar.markers {
+  background-color: indianred;
+}
+
+#dense-cal-popup treeview {
+  background-color: lightcoral;
+}
diff --git a/doc/gtkrc-2.0.gnucash b/doc/gtkrc-2.0.gnucash
deleted file mode 100644
index c1cb6d4..0000000
--- a/doc/gtkrc-2.0.gnucash
+++ /dev/null
@@ -1,197 +0,0 @@
-#
-# This is an example GTK RC file that can be used with Gnucash.
-# Simply copy this file to ~/.gtkrc-2.0.gnucash and then restart
-# gnucash.  Yes the colors are hideous, but then this is a (bad)
-# example that you should customize to your liking.
-#
-# On an FC3 system, the RC files (if they exist) are loaded for in
-# this order:
-#
-#       /usr/share/gtkrc-2.0
-#       /etc/gtk-2.0/gtkrc
-#       ~/.gtkrc-2.0
-#  **   ~/.gtkrc-2.0.gnucash   **
-#       ~/.gnome2/gtkrc-2.0
-#       ~/.themes/Bluecurve/gtk-2.0/gtkrc
-#       /usr/share/themes/Bluecurve/gtk-2.0/gtkrc
-#       ~/.themes/Default/gtk-2.0-key/gtkrc
-#       /usr/share/themes/Default/gtk-2.0-key/gtkrc
-#
-
-##########
-#
-# Define the various styles here
-#
-##########
-
-style "gnc-button"
-{
-  # This shows all the possible states for a button.  The only one that
-  # doesn't apply is the SELECTED state.
-  
-  bg[NORMAL]   = "LightBlue"
-  fg[NORMAL]   = "IndianRed"
-
-  # Mouse over
-  bg[PRELIGHT] = "SkyBlue"
-  fg[PRELIGHT] = "white"
-
-  # Mouse down
-  bg[ACTIVE]   = "SteelBlue"
-  fg[ACTIVE]   = "white"
-
-  bg[INSENSITIVE] = { 1.0, 1.0, 1.0 }
-  fg[INSENSITIVE] = { 1.0, 0, 1.0 }
-}
-
-style "gnc-button2" = "gnc-button"
-{
-  bg[NORMAL]   = "PeachPuff"
-  fg[NORMAL]   = "firebrick"
-}
-
-style "gnc-button3" = "gnc-button"
-{
-  bg[NORMAL]   = "LightGoldenrod1"
-  fg[NORMAL]   = "firebrick"
-}
-
-
-
-style "gnc-entry"
-{
-  base[NORMAL]   = "LightBlue"
-  text[NORMAL]   = "firebrick"
-}
-
-style "gnc-entry2"
-{
-  base[NORMAL]   = "RoyalBlue"
-  text[NORMAL]   = "WhiteSmoke"
-}
-
-
-
-style "gnc-treeview"
-{
-	GtkTreeView::even-row-color = "IndianRed"
-	GtkTreeView::odd-row-color  = "LightBlue"
-}
-
-
-
-##########
-#
-# Program wide changes should go here.
-#
-##########
-class "GtkEntry" style "gnc-entry"
-class "GtkButton" style "gnc-button"
-
-
-##########
-#
-# Individual window changes should go here.
-#
-##########
-
-#
-# Price Selection Dialog
-#
-# widget "Prices Dialog.*.close_button" style "gnc-button"
-# widget "Prices Dialog.*.get_quotes_button" style "gnc-button2"
-# widget "Prices Dialog.*.edit_button" style "gnc-button2"
-# widget "Prices Dialog.*.add_button" style "gnc-button2"
-# widget "Prices Dialog.*.remove_button" style "gnc-button2"
-# widget "Prices Dialog.*.remove_old_button" style "gnc-button2"
-widget "Prices Dialog.*.price_tree" style "gnc-treeview"
-widget "Prices Dialog.*.price_tree.GtkButton" style "gnc-button3"
-
-#
-# Dialog to edit one price
-#
-# widget "Price Dialog.*.cancel_button" style "gnc-button2"
-# widget "Price Dialog.*.ok_button" style "gnc-button2"
-# widget "Price Dialog.*.GNCGeneralSelect" style "gnc-entry"
-# widget "Price Dialog.*.GNCCurrencyEdit" style "gnc-entry"
-# widget "Price Dialog.*.GNCDateEdit.GtkEntry" style "gnc-entry"
-# widget "Price Dialog.*.source_entry" style "gnc-entry"
-# widget "Price Dialog.*.type_option" style "foo"
-widget "Price Dialog.*.GNCAmountEdit" style "gnc-entry2"
-
-#
-# Commodity Dialog
-#
-widget "Commodities Dialog.*.commodity_tree" style "gnc-treeview"
-
-
-#
-# Register - Font
-#
-style "gnc-register"
-{
-  font_name    = "Sans 10"
-}
-widget "*.GnucashSheet" style "gnc-register"
-
-
-#
-# Register Window - Colors
-#
-
-# The header lines at the top of a register.
-style "gnc-register-header"
-{
-  base[NORMAL]      = "#B18396"
-}
-
-# The color of the first line/transaction in a register.
-style "gnc-register-primary"
-{
-  base[NORMAL]      = "#DEB9BF"
-  base[SELECTED]    = "#EF98FF"
-}
-
-# The color of the second line/transaction in a register.
-style "gnc-register-secondary"
-{
-  base[NORMAL]      = "#FFDAF6"
-  base[SELECTED]    = "#EF98FF"
-}
-
-# The color of any "split" lines in a register.
-style "gnc-register-split"
-{
-  base[NORMAL]      = "#E7D3ED"
-  base[SELECTED]    = "#EF98FF"
-}
-widget "GncMainWindow.*.header_color"    style : highest "gnc-register-header"
-widget "GncMainWindow.*.primary_color"   style : highest "gnc-register-primary"
-widget "GncMainWindow.*.secondary_color" style : highest "gnc-register-secondary"
-widget "GncMainWindow.*.split_color"     style : highest "gnc-register-split"
-
-
-
-#
-# From: calmar <mac at calmar.ws>
-# Allow changing notebook tabs with vim next/prev keys.
-#
-binding "book" {
-    bind "<Control>k" {
-    "change-current-page" (1)
-   }
-    bind "<Control>j" {
-    "change-current-page" (-1)
-   }
-}
-class "GtkNotebook" binding "book"
-
-#
-# From: calmar <mac at calmar.ws>
-# Use larger disclosure tiangles in all tree views.
-#
-style "wide-tree"
-{
-          GtkTreeView::expander_size = 20
-}
-class "GtkTreeView" style "wide-tree"

commit 7c9ac17cb6b269e93b70c5030b39727827321137
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Feb 1 15:43:10 2018 +0000

    Move the user CSS settings file
    
    Move the CSS settings file to a location based on XDG_CONFIG_HOME which
    is OS dependant but with slight changes for Windows and OS X.
    
    - Windows: CSIDL_APPDATA/Gnucash
    - OS X: $HOME/Application Support/Gnucash
    - Linux: $XDG_CONFIG_HOME/gnucash (or the default $HOME/.config/gnucash)

diff --git a/gnucash/gnome-utils/gnc-gnome-utils.c b/gnucash/gnome-utils/gnc-gnome-utils.c
index efd6573..1ed551f 100644
--- a/gnucash/gnome-utils/gnc-gnome-utils.c
+++ b/gnucash/gnome-utils/gnc-gnome-utils.c
@@ -219,11 +219,11 @@ gnc_add_css_file (void)
 #endif
     gtk_css_provider_load_from_resource (provider_fallback,  "/org/gnucash/gnucash-fallback-310.css");
 
-    var = g_get_home_dir ();
+    var = gnc_userconfig_dir ();
     if (var)
     {
         gchar *str;
-        str = g_build_filename (var, ".gtk-3.0-gnucash.css", (char *)NULL);
+        str = g_build_filename (var, "gtk-3.0.css", (char *)NULL);
         gtk_css_provider_load_from_path (provider_user, str, &error);
         g_free (str);
     }
diff --git a/libgnucash/core-utils/gnc-filepath-utils.cpp b/libgnucash/core-utils/gnc-filepath-utils.cpp
index 8b45780..a8857d4 100644
--- a/libgnucash/core-utils/gnc-filepath-utils.cpp
+++ b/libgnucash/core-utils/gnc-filepath-utils.cpp
@@ -543,6 +543,33 @@ get_userdata_home(void)
     return userdata_home;
 }
 
+static bfs::path
+get_userconfig_home(void)
+{
+    gchar *config_dir = NULL;
+    auto userconfig_home = bfs::path();
+
+#ifdef G_OS_WIN32
+    config_dir = win32_get_userdata_home ();
+#elif defined MAC_INTEGRATION
+    config_dir = quarz_get_userdata_home ();
+#endif
+
+    /* On Windows and Macs the data directory is used, for Linux
+       $HOME/.config is used */
+    if (config_dir)
+    {
+        userconfig_home = config_dir;
+        g_free(config_dir);
+    }
+    else
+        userconfig_home = g_get_user_config_dir();
+
+    userconfig_home = userconfig_home / PACKAGE;
+
+    return userconfig_home;
+}
+
 gboolean
 gnc_filepath_init (void)
 {
@@ -684,6 +711,24 @@ gnc_userdata_dir (void)
     return gnc_userdata_home.string().c_str();
 }
 
+/** @fn const gchar * gnc_userconfig_dir ()
+ *  @brief Return the config directory
+ *
+ *  Note that the default path depends on the platform.
+ *  - Windows: CSIDL_APPDATA/Gnucash
+ *  - OS X: $HOME/Application Support/Gnucash
+ *  - Linux: $XDG_CONFIG_HOME/Gnucash (or the default $HOME/.config/Gnucash)
+ *
+ *  @return An absolute path to the configuration directory. This string is
+ *  owned by the gnc_filepath_utils code and should not be freed by the user.
+ */
+const gchar *
+gnc_userconfig_dir (void)
+{
+    auto path_string = get_userconfig_home();
+    return g_strdup(path_string.string().c_str());
+}
+
 static const bfs::path&
 gnc_userdata_dir_as_path (void)
 {
diff --git a/libgnucash/core-utils/gnc-filepath-utils.h b/libgnucash/core-utils/gnc-filepath-utils.h
index 465d404..f327446 100644
--- a/libgnucash/core-utils/gnc-filepath-utils.h
+++ b/libgnucash/core-utils/gnc-filepath-utils.h
@@ -103,6 +103,8 @@ gchar *gnc_build_data_path (const gchar *filename);
 gchar *gnc_build_report_path (const gchar *filename);
 gchar *gnc_build_stdreports_path (const gchar *filename);
 
+const gchar *gnc_userconfig_dir (void);
+
 /** Given a pixmap/pixbuf file name, find the file in the pixmap
  *  directory associated with this application.  This routine will
  *  display an error message if it can't find the file.



Summary of changes:
 doc/CMakeLists.txt                           |   3 +-
 doc/gtk-3.0.css                              |  96 +++++++++++++
 doc/gtkrc-2.0.gnucash                        | 197 ---------------------------
 gnucash/gnome-utils/gnc-dense-cal.c          |   6 +-
 gnucash/gnome-utils/gnc-gnome-utils.c        |   4 +-
 libgnucash/app-utils/gnc-gsettings.c         |   4 +-
 libgnucash/core-utils/gnc-filepath-utils.cpp |  63 ++++++++-
 libgnucash/core-utils/gnc-filepath-utils.h   |   2 +
 8 files changed, 167 insertions(+), 208 deletions(-)
 create mode 100755 doc/gtk-3.0.css
 delete mode 100644 doc/gtkrc-2.0.gnucash



More information about the gnucash-changes mailing list