From 6f27ad1ba0949fe0d9aa364e3d26047b98f7ebf9 Mon Sep 17 00:00:00 2001
From: Robert Fewell <14uBobIT@gmail.com>
Date: Sun, 2 Jul 2017 09:47:21 +0100
Subject: [PATCH] Add new preference to show tree view grid lines
---
src/gnome-utils/dialog-utils.c | 35 ++++++
src/gnome-utils/dialog-utils.h | 17 ++-
.../gtkbuilder/dialog-preferences.glade | 108 +++++++++++++-----
.../gschemas/org.gnucash.gschema.xml.in.in | 15 +++
4 files changed, 147 insertions(+), 28 deletions(-)
diff --git a/src/gnome-utils/dialog-utils.c b/src/gnome-utils/dialog-utils.c
index c1263b2dd4..4f24a5fa42 100644
--- a/src/gnome-utils/dialog-utils.c
+++ b/src/gnome-utils/dialog-utils.c
@@ -224,6 +224,14 @@ gnc_window_adjust_for_screen(GtkWindow * window)
gtk_widget_queue_resize(GTK_WIDGET(window));
}
+/********************************************************************\
+ * Sets the alignament of a Label Widget, GTK3 version specific. *
+ * *
+ * Args: widget - the label widget to set alignment on *
+ * xalign - x alignment *
+ * yalign - y alignment *
+ * Returns: nothing *
+\********************************************************************/
void
gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign)
{
@@ -235,6 +243,33 @@ gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign)
#endif
}
+/********************************************************************\
+ * Get the preference for showing tree view grid lines *
+ * *
+ * Args: none *
+ * Returns: GtkTreeViewGridLines setting *
+\********************************************************************/
+GtkTreeViewGridLines
+gnc_tree_view_get_grid_lines_pref (void)
+{
+ GtkTreeViewGridLines grid_lines;
+ gboolean h_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, "grid-lines-horizontal");
+ gboolean v_lines = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, "grid-lines-vertical");
+
+ if (h_lines)
+ {
+ if (v_lines)
+ grid_lines = GTK_TREE_VIEW_GRID_LINES_BOTH;
+ else
+ grid_lines = GTK_TREE_VIEW_GRID_LINES_HORIZONTAL;
+ }
+ else if (v_lines)
+ grid_lines = GTK_TREE_VIEW_GRID_LINES_VERTICAL;
+ else
+ grid_lines = GTK_TREE_VIEW_GRID_LINES_NONE;
+ return grid_lines;
+}
+
gboolean
gnc_handle_date_accelerator (GdkEventKey *event,
struct tm *tm,
diff --git a/src/gnome-utils/dialog-utils.h b/src/gnome-utils/dialog-utils.h
index a30befaa65..9347711b3e 100644
--- a/src/gnome-utils/dialog-utils.h
+++ b/src/gnome-utils/dialog-utils.h
@@ -61,9 +61,24 @@ void gnc_save_window_size (const char *section, GtkWindow *window);
\********************************************************************/
void gnc_window_adjust_for_screen (GtkWindow * window);
-
+/********************************************************************\
+ * Sets the alignament of a Label Widget, GTK3 version specific. *
+ * *
+ * Args: widget - the label widget to set alignment on *
+ * xalign - x alignment *
+ * yalign - y alignment *
+ * Returns: nothing *
+\********************************************************************/
void gnc_label_set_alignment (GtkWidget *widget, gfloat xalign, gfloat yalign);
+/********************************************************************\
+ * Get the preference for showing tree view grid lines *
+ * *
+ * Args: none *
+ * Returns: GtkTreeViewGridLines setting *
+\********************************************************************/
+GtkTreeViewGridLines gnc_tree_view_get_grid_lines_pref (void);
+
gboolean gnc_handle_date_accelerator (GdkEventKey *event,
struct tm *tm,
const char *date_str);
diff --git a/src/gnome-utils/gtkbuilder/dialog-preferences.glade b/src/gnome-utils/gtkbuilder/dialog-preferences.glade
index 7079e1270c..2d71d01a44 100644
--- a/src/gnome-utils/gtkbuilder/dialog-preferences.glade
+++ b/src/gnome-utils/gtkbuilder/dialog-preferences.glade
@@ -1225,7 +1225,7 @@ many months before the current month:
1
- 20
+ 23
@@ -1240,7 +1240,7 @@ many months before the current month:
0
- 18
+ 21
@@ -1259,7 +1259,7 @@ many months before the current month:
0
- 12
+ 15
@@ -1272,7 +1272,7 @@ many months before the current month:
0
- 11
+ 14
@@ -1282,7 +1282,7 @@ many months before the current month:
0
- 10
+ 13
@@ -1297,7 +1297,7 @@ many months before the current month:
0
- 9
+ 12
@@ -1315,7 +1315,7 @@ many months before the current month:
1
- 9
+ 12
@@ -1334,7 +1334,7 @@ many months before the current month:
0
- 8
+ 11
@@ -1353,7 +1353,7 @@ many months before the current month:
0
- 7
+ 10
@@ -1366,7 +1366,7 @@ many months before the current month:
0
- 6
+ 9
@@ -1376,7 +1376,7 @@ many months before the current month:
0
- 5
+ 8
@@ -1389,7 +1389,7 @@ many months before the current month:
0
- 25
+ 28
@@ -1404,7 +1404,7 @@ many months before the current month:
0
- 26
+ 29
@@ -1422,7 +1422,7 @@ many months before the current month:
1
- 26
+ 29
@@ -1456,7 +1456,7 @@ many months before the current month:
0
- 14
+ 17
@@ -1498,7 +1498,7 @@ many months before the current month:
1
- 14
+ 17
@@ -1517,7 +1517,7 @@ many months before the current month:
0
- 13
+ 16
@@ -1527,7 +1527,7 @@ many months before the current month:
0
- 17
+ 20
@@ -1546,7 +1546,7 @@ many months before the current month:
0
- 19
+ 22
@@ -1565,7 +1565,7 @@ many months before the current month:
0
- 20
+ 23
@@ -1584,7 +1584,7 @@ many months before the current month:
0
- 21
+ 24
@@ -1601,7 +1601,7 @@ many months before the current month:
0
- 15
+ 18
@@ -1616,7 +1616,7 @@ many months before the current month:
0
- 16
+ 19
@@ -1656,7 +1656,7 @@ many months before the current month:
1
- 16
+ 19
@@ -1666,7 +1666,7 @@ many months before the current month:
0
- 22
+ 25
@@ -1680,7 +1680,7 @@ many months before the current month:
1
- 23
+ 26
@@ -1716,7 +1716,61 @@ many months before the current month:
0
- 23
+ 26
+
+
+
+
+
+ 0
+ 5
+ 2
+
+
+
+
+
+ 0
+ 6
+ 2
+
+
+
+
+
+ 0
+ 7
+ 2
diff --git a/src/gnome/gschemas/org.gnucash.gschema.xml.in.in b/src/gnome/gschemas/org.gnucash.gschema.xml.in.in
index a57a341ce4..8a22b4742d 100644
--- a/src/gnome/gschemas/org.gnucash.gschema.xml.in.in
+++ b/src/gnome/gschemas/org.gnucash.gschema.xml.in.in
@@ -125,6 +125,11 @@
Width of notebook tabsThis key specifies the maximum width of notebook tabs. If the text in the tab is longer than this value (the test is approximate) then the tab label will have the middle cut and replaced with an ellipsis.
+
+ true
+ Show Button Icons and Labels
+ If active, buttons that have been configured to show icons and labels will show both. Otherwise only labels will be used.
+ trueUse the system locale currency for all newly created accounts.
@@ -165,6 +170,16 @@
Maximum number of months to go back.Dates will be completed so that they are close to the current date. Enter the maximum number of months to go backwards in time when completing dates.
+
+ false
+ Show Horizontal Grid Lines
+ If active, horzontal grid lines will be shown on table displays. Otherwise no horizontal grid lines will be shown.
+
+
+ false
+ Show Vertical Grid Lines
+ If active, vertical grid lines will be shown on table displays. Otherwise no vertical grid lines will be shown.
+ trueShow splash screen