gnucash maint: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Tue Jul 31 11:39:22 EDT 2018


Updated	 via  https://github.com/Gnucash/gnucash/commit/69fef827 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/fe371534 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/2203118d (commit)
	from  https://github.com/Gnucash/gnucash/commit/accd154e (commit)



commit 69fef8277fde56e7d2df700b21c63c19c115852a
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Jul 31 17:30:07 2018 +0200

    Revert "Add preference to control toolbar appearance"
    
    This reverts commit 3b0931310730a4ae5d028a1e2120d2a619ae975a.

diff --git a/gnucash/gnome-utils/dialog-preferences.c b/gnucash/gnome-utils/dialog-preferences.c
index f17b2d9..815587e 100644
--- a/gnucash/gnome-utils/dialog-preferences.c
+++ b/gnucash/gnome-utils/dialog-preferences.c
@@ -1229,8 +1229,6 @@ gnc_preferences_dialog_create(GtkWindow *parent)
     gnc_builder_add_from_file (builder, "dialog-preferences.glade", "retain_days_adj");
     gnc_builder_add_from_file (builder, "dialog-preferences.glade", "tab_width_adj");
     gnc_builder_add_from_file (builder, "dialog-preferences.glade", "date_formats");
-    gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-styles");
-    gnc_builder_add_from_file (builder, "dialog-preferences.glade", "toolbar-icon-sizes");
     gnc_builder_add_from_file (builder, "dialog-preferences.glade", "gnucash_preferences_dialog");
 
     dialog = GTK_WIDGET(gtk_builder_get_object (builder, "gnucash_preferences_dialog"));
diff --git a/gnucash/gnome-utils/gnc-main-window.c b/gnucash/gnome-utils/gnc-main-window.c
index 8089191..ae4505f 100644
--- a/gnucash/gnome-utils/gnc-main-window.c
+++ b/gnucash/gnome-utils/gnc-main-window.c
@@ -3340,28 +3340,6 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
     LEAVE ("");
 }
 
-static void
-gnc_main_window_update_toolbar (gpointer prefs, gchar *pref, gpointer user_data)
-{
-    GncMainWindow *window;
-    GtkToolbar *tb;
-    GncMainWindowPrivate *priv;
-    gint selection;
-
-    window = GNC_MAIN_WINDOW(user_data);
-    priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
-    tb = GTK_TOOLBAR(priv->toolbar);
-
-    selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
-    if (gtk_toolbar_get_style (tb) != selection)
-        gtk_toolbar_set_style (tb, selection);
-
-    selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
-    // prefs has only small and large icons so add 2 to get right enum
-    if (gtk_toolbar_get_icon_size (tb) != selection + 2)
-        gtk_toolbar_set_icon_size (tb, selection + 2);
-}
-
 /*
  * Based on code from Epiphany (src/ephy-window.c)
  */
@@ -3728,13 +3706,6 @@ gnc_main_window_setup_window (GncMainWindow *window)
                            GNC_PREF_TAB_POSITION_RIGHT,
                            gnc_main_window_update_tab_position,
                            window);
-
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
-                           gnc_main_window_update_toolbar, window);
-
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
-                           gnc_main_window_update_toolbar, window);
-
     gnc_main_window_update_tab_position(NULL, NULL, window);
 
     gnc_main_window_init_menu_updaters(window);
@@ -3867,13 +3838,6 @@ gnc_main_window_add_widget (GtkUIManager *merge,
     if (GTK_IS_TOOLBAR (widget))
     {
         priv->toolbar = widget;
-
-        gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
-            gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
-
-        // prefs has only small and large icons so add 2 to get right enum
-        gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
-           (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
     }
 
     gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index 8d924c0..6a0bfe2 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -210,16 +210,6 @@
       <summary>Display the notebook tabs at the right of the window.</summary>
       <description>This setting determines the edge at which the tabs for switching pages in notebooks are drawn. Possible values are "top", "left", "bottom" and "right". It defaults to "top".</description>
     </key>
-    <key name="toolbar-style" type="i">
-      <default>3</default>
-      <summary>Toolbar Style choice</summary>
-      <description>This setting controls how the toolbar icons are displayed.</description>
-    </key>
-        <key name="toolbar-icon-size" type="i">
-      <default>1</default>
-      <summary>Toolbar Icon Size</summary>
-      <description>This setting controls the size of the toolbar icons.</description>
-    </key>
     <key name="summarybar-position-top" type="b">
       <default>false</default>
       <summary>Display the summary bar at the top of the page.</summary>
@@ -351,7 +341,7 @@
       <description>This sets the number of characters before auto complete starts for description, notes and memo fields.</description>
     </key>
   </schema>
-
+  
   <schema id="org.gnucash.general.report" path="/org/gnucash/general/report/">
     <key name="use-new-window" type="b">
       <default>false</default>
diff --git a/gnucash/gtkbuilder/dialog-preferences.glade b/gnucash/gtkbuilder/dialog-preferences.glade
index 58dfc66..4b88f4e 100644
--- a/gnucash/gtkbuilder/dialog-preferences.glade
+++ b/gnucash/gtkbuilder/dialog-preferences.glade
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.20.4 -->
+<!-- Generated with glade 3.20.2 -->
 <interface>
   <requires lib="gtk+" version="3.10"/>
   <object class="GtkAdjustment" id="auto_decimal_places_adj">
@@ -97,40 +97,6 @@
     <property name="step_increment">1</property>
     <property name="page_increment">10</property>
   </object>
-  <object class="GtkListStore" id="toolbar-icon-sizes">
-    <columns>
-      <!-- column-name sizes-text -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Small Icons</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Large Icons</col>
-      </row>
-    </data>
-  </object>
-  <object class="GtkListStore" id="toolbar-styles">
-    <columns>
-      <!-- column-name styles-text -->
-      <column type="gchararray"/>
-    </columns>
-    <data>
-      <row>
-        <col id="0" translatable="yes">Icons</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Text</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Icons and Text</col>
-      </row>
-      <row>
-        <col id="0" translatable="yes">Icons and Important Text</col>
-      </row>
-    </data>
-  </object>
   <object class="GtkDialog" id="gnucash_preferences_dialog">
     <property name="can_focus">False</property>
     <property name="title" translatable="yes">GnuCash Preferences</property>
@@ -3275,114 +3241,6 @@ many months before the current month:</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkComboBox" id="pref/general/toolbar-icon-size">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="has_tooltip">True</property>
-                    <property name="tooltip_markup">Specify the icon size for the toolbars.</property>
-                    <property name="tooltip_text" translatable="yes">Specify the icon size for the toolbars.</property>
-                    <property name="halign">start</property>
-                    <property name="margin_left">12</property>
-                    <property name="model">toolbar-icon-sizes</property>
-                    <property name="active">1</property>
-                    <property name="id_column">0</property>
-                    <child>
-                      <object class="GtkCellRendererText" id="toolbar-icon-renderer"/>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">15</property>
-                    <property name="width">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkComboBox" id="pref/general/toolbar-style">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="has_tooltip">True</property>
-                    <property name="tooltip_markup">Change the way the toolbar items are displayed.</property>
-                    <property name="tooltip_text" translatable="yes">Change the way the toolbar items are displayed.</property>
-                    <property name="halign">start</property>
-                    <property name="margin_left">12</property>
-                    <property name="model">toolbar-styles</property>
-                    <property name="active">3</property>
-                    <property name="id_column">0</property>
-                    <child>
-                      <object class="GtkCellRendererText" id="toolbar-style-renderer"/>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">18</property>
-                    <property name="width">2</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label22">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="label" translatable="yes"><b>Toolbar Icon Size</b></property>
-                    <property name="use_markup">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">14</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label23">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="halign">start</property>
-                    <property name="label" translatable="yes"><b>Toolbar Style</b></property>
-                    <property name="use_markup">True</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">17</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label24">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">13</property>
-                  </packing>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="label25">
-                    <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                  </object>
-                  <packing>
-                    <property name="left_attach">0</property>
-                    <property name="top_attach">16</property>
-                  </packing>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
-                  <placeholder/>
-                </child>
-                <child>
                   <placeholder/>
                 </child>
                 <child>
diff --git a/libgnucash/core-utils/gnc-prefs.h b/libgnucash/core-utils/gnc-prefs.h
index 4c9137c..41c241d 100644
--- a/libgnucash/core-utils/gnc-prefs.h
+++ b/libgnucash/core-utils/gnc-prefs.h
@@ -71,8 +71,6 @@
 #define GNC_PREF_DATE_BACKMONTHS     "date-backmonths"
 #define GNC_PREF_SHOW_LEAF_ACCT_NAMES "show-leaf-account-names"
 #define GNC_PREF_ENTER_MOVES_TO_END  "enter-moves-to-end"
-#define GNC_PREF_TOOLBAR_STYLE        "toolbar-style"
-#define GNC_PREF_TOOLBAR_ICON_SIZE    "toolbar-icon-size"
 /* Register preferences */
 #define GNC_PREF_DRAW_HOR_LINES      "draw-horizontal-lines"
 #define GNC_PREF_DRAW_VERT_LINES     "draw-vertical-lines"

commit fe371534c2e2c0f0d39e555754877f80532b53f2
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Jul 31 17:29:52 2018 +0200

    Revert "Add toolbar preference changes to embedded-window."
    
    This reverts commit a75eb4c8ec2668e4e79895b2923ca6a816c90fe1.

diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index c32d1de..605d7dd 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -1,6 +1,6 @@
 /*
  * gnc-main-window.c -- GtkWindow which represents the
- *  GnuCash main window.
+ *	GnuCash main window.
  *
  * Copyright (C) 2003 Jan Arne Petersen <jpetersen at uni-bonn.de>
  * Copyright (C) 2003 David Hampton <hampton at employees.org>
@@ -38,7 +38,6 @@
 #include "gnc-plugin-manager.h"
 #include "gnc-ui.h"
 #include "gnc-window.h"
-#include "gnc-prefs.h"
 #include "dialog-utils.h"
 
 /* Static Globals *******************************************************/
@@ -309,13 +308,6 @@ gnc_embedded_window_add_widget (GtkUIManager *merge,
     if (GTK_IS_TOOLBAR (widget))
     {
         priv->toolbar = widget;
-
-        gtk_toolbar_set_style (GTK_TOOLBAR(priv->toolbar),
-            gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
-
-        // prefs has only small and large icons so add 2 to get right enum
-        gtk_toolbar_set_icon_size (GTK_TOOLBAR(priv->toolbar),
-           (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
     }
 
     gtk_box_pack_start (GTK_BOX (priv->menu_dock), widget, FALSE, FALSE, 0);

commit 2203118d99f28a08f29af20e163e26ee61fb1fa9
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Tue Jul 31 17:29:38 2018 +0200

    Revert "Add the toolbar preference changes to window-reconcile."
    
    This reverts commit 0199fef5847fc60f5ed36e1dcf9cc4ed0717dedc.

diff --git a/gnucash/gnome/window-reconcile.c b/gnucash/gnome/window-reconcile.c
index 1bcf896..4446eb1 100644
--- a/gnucash/gnome/window-reconcile.c
+++ b/gnucash/gnome/window-reconcile.c
@@ -81,8 +81,6 @@ struct _RecnWindow
 
     GtkUIManager *ui_merge;
     GtkActionGroup *action_group;
-    GtkWidget *dock;
-    GtkWidget *toolbar;
 
     GtkWidget *starting;         /* The starting balance                 */
     GtkWidget *ending;           /* The ending balance                   */
@@ -1681,44 +1679,13 @@ recnWindow (GtkWidget *parent, Account *account)
 static void
 recnWindow_add_widget (GtkUIManager *merge,
                        GtkWidget *widget,
-                       RecnWindow *recnData)
+                       GtkBox *dock)
 {
-
-    if (GTK_IS_TOOLBAR (widget))
-    {
-      recnData->toolbar = widget;
-
-        gtk_toolbar_set_style (GTK_TOOLBAR(widget),
-            gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE));
-
-        // prefs has only small and large icons so add 2 to get right enum
-        gtk_toolbar_set_icon_size (GTK_TOOLBAR(widget),
-           (gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE)) + 2);
-    }
-
-    gtk_box_pack_start (GTK_BOX (recnData->dock), widget, FALSE, FALSE, 0);
+    gtk_box_pack_start (GTK_BOX (dock), widget, FALSE, FALSE, 0);
     gtk_widget_show (widget);
 }
 
 
-static void
-recn_window_update_toolbar (gpointer prefs, gchar *pref, RecnWindow *recnData)
-{
-    GtkToolbar *tb;
-    gint selection;
-
-    tb = GTK_TOOLBAR(recnData->toolbar);
-
-    selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE);
-    if (gtk_toolbar_get_style (tb) != selection)
-        gtk_toolbar_set_style (tb, selection);
-
-    selection = gnc_prefs_get_int (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE);
-    // prefs has only small and large icons so add 2 to get right enum
-    if (gtk_toolbar_get_icon_size (tb) != selection + 2)
-        gtk_toolbar_set_icon_size (tb, selection + 2);
-}
-
 /********************************************************************\
  * recnWindowWithBalance
  *
@@ -1785,9 +1752,8 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
         GError *error = NULL;
 
         recnData->ui_merge = gtk_ui_manager_new ();
-        recnData->dock = dock;
         g_signal_connect (recnData->ui_merge, "add_widget",
-                          G_CALLBACK (recnWindow_add_widget), recnData);
+                          G_CALLBACK (recnWindow_add_widget), dock);
 
         action_group = gtk_action_group_new ("ReconcileWindowActions");
         recnData->action_group = action_group;
@@ -1965,13 +1931,6 @@ recnWindowWithBalance (Account *account, gnc_numeric new_ending,
         recnRefresh (recnData);
     }
 
-    /* track toolbar preference changes */
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
-                           recn_window_update_toolbar, recnData);
-
-    gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
-                           recn_window_update_toolbar, recnData);
-
     /* Allow resize */
     gtk_window_set_resizable(GTK_WINDOW(recnData->window), TRUE);
     gtk_widget_show_all(recnData->window);
@@ -2055,12 +2014,6 @@ recn_destroy_cb (GtkWidget *w, gpointer data)
     if (recnData->delete_refresh)
         gnc_resume_gui_refresh ();
 
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_STYLE,
-                                 recn_window_update_toolbar, recnData);
-
-    gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, GNC_PREF_TOOLBAR_ICON_SIZE,
-                                 recn_window_update_toolbar, recnData);
-
     g_free (recnData);
 }
 



Summary of changes:
 gnucash/gnome-utils/dialog-preferences.c    |   2 -
 gnucash/gnome-utils/gnc-embedded-window.c   |  10 +-
 gnucash/gnome-utils/gnc-main-window.c       |  36 -------
 gnucash/gnome/window-reconcile.c            |  53 +---------
 gnucash/gschemas/org.gnucash.gschema.xml.in |  12 +--
 gnucash/gtkbuilder/dialog-preferences.glade | 144 +---------------------------
 libgnucash/core-utils/gnc-prefs.h           |   2 -
 7 files changed, 6 insertions(+), 253 deletions(-)



More information about the gnucash-changes mailing list