r23271 - gnucash/trunk/src - Gnc-Prefs: add convenience functions for int64 and coords typed preferences

Geert Janssens gjanssens at code.gnucash.org
Mon Oct 7 10:31:38 EDT 2013


Author: gjanssens
Date: 2013-10-07 10:31:37 -0400 (Mon, 07 Oct 2013)
New Revision: 23271
Trac: http://svn.gnucash.org/trac/changeset/23271

Modified:
   gnucash/trunk/src/app-utils/gnc-accounting-period.c
   gnucash/trunk/src/core-utils/gnc-prefs.c
   gnucash/trunk/src/core-utils/gnc-prefs.h
   gnucash/trunk/src/gnome/dialog-print-check.c
   gnucash/trunk/src/gnome/dialog-print-check2.c
Log:
Gnc-Prefs: add convenience functions for int64 and coords typed preferences

coords are a pair of floats

Modified: gnucash/trunk/src/app-utils/gnc-accounting-period.c
===================================================================
--- gnucash/trunk/src/app-utils/gnc-accounting-period.c	2013-10-07 14:31:22 UTC (rev 23270)
+++ gnucash/trunk/src/app-utils/gnc-accounting-period.c	2013-10-07 14:31:37 UTC (rev 23271)
@@ -66,11 +66,7 @@
 
 
     if (gnc_prefs_get_bool (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_CHOICE_ABS))
-    {
-        GVariant *var = gnc_prefs_get_value(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE);
-        time = g_variant_get_int64 (var);
-        g_variant_unref (var);
-    }
+        time = gnc_prefs_get_int64 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE);
     else
     {
         which = gnc_prefs_get_int(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_PERIOD);
@@ -90,12 +86,7 @@
     int which;
 
     if (gnc_prefs_get_bool (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_CHOICE_ABS))
-    {
-        GVariant *var = gnc_prefs_get_value(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_DATE);
-        time = g_variant_get_int64 (var);
-        time = gnc_time64_get_day_end(time);
-        g_variant_unref (var);
-    }
+        time = gnc_prefs_get_int64 (GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_DATE);
     else
     {
         which = gnc_prefs_get_int(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_PERIOD);

Modified: gnucash/trunk/src/core-utils/gnc-prefs.c
===================================================================
--- gnucash/trunk/src/core-utils/gnc-prefs.c	2013-10-07 14:31:22 UTC (rev 23270)
+++ gnucash/trunk/src/core-utils/gnc-prefs.c	2013-10-07 14:31:37 UTC (rev 23271)
@@ -212,6 +212,17 @@
 }
 
 
+gint64 gnc_prefs_get_int64 (const gchar *group,
+                            const gchar *pref_name)
+{
+    gint64 result = 0;
+    GVariant *var = gnc_prefs_get_value(group, pref_name);
+    result = g_variant_get_int64 (var);
+    g_variant_unref (var);
+    return result;
+}
+
+
 gdouble gnc_prefs_get_float (const gchar *group,
                              const gchar *pref_name)
 {
@@ -241,7 +252,22 @@
         return 0;
 }
 
+void
+gnc_prefs_get_coords (const gchar *group,
+                      const gchar *pref_name,
+                      gdouble *x, gdouble *y)
+{
+    GVariant *coords = gnc_prefs_get_value (group, pref_name);
 
+    *x = 0;
+    *y = 0;
+
+    if (g_variant_is_of_type (coords, (const GVariantType *) "(dd)") )
+        g_variant_get (coords, "(dd)", x, y);
+    g_variant_unref (coords);
+}
+
+
 GVariant *gnc_prefs_get_value (const gchar *group,
                                const gchar *pref_name)
 {
@@ -274,6 +300,15 @@
 }
 
 
+gboolean gnc_prefs_set_int64 (const gchar *group,
+                              const gchar *pref_name,
+                              gint64 value)
+{
+    GVariant *var = g_variant_new ("x",value);
+    return gnc_prefs_set_value (group, pref_name, var);
+}
+
+
 gboolean gnc_prefs_set_float (const gchar *group,
                               const gchar *pref_name,
                               gdouble value)
@@ -307,6 +342,15 @@
 }
 
 
+gboolean gnc_prefs_set_coords (const gchar *group,
+                               const gchar *pref_name,
+                               gdouble x, gdouble y)
+{
+    GVariant *var = g_variant_new ("(dd)",x, y);
+    return gnc_prefs_set_value (group, pref_name, var);
+}
+
+
 gboolean gnc_prefs_set_value (const gchar *group,
                               const gchar *pref_name,
                               GVariant *value)

Modified: gnucash/trunk/src/core-utils/gnc-prefs.h
===================================================================
--- gnucash/trunk/src/core-utils/gnc-prefs.h	2013-10-07 14:31:22 UTC (rev 23270)
+++ gnucash/trunk/src/core-utils/gnc-prefs.h	2013-10-07 14:31:37 UTC (rev 23271)
@@ -282,6 +282,21 @@
 gint gnc_prefs_get_int (const gchar *group,
                         const gchar *pref_name);
 
+/** Get an 64 bit integer value from the preferences backend.
+ *
+ *  @param group This string specifies the group to which the preference belongs
+ *
+ *  @param preference This string is the name of the particular preference within
+ *  the named group of the preferences backend.
+ *
+ *  @return This function returns the 64 bit integer value stored at the
+ *  requested preference in the preferences backend.  If the preference has never been
+ *  set, this function passes on the default value returned by the preferences backend.
+ *  If there is an error in processing, zero will be returned.
+ */
+gint64 gnc_prefs_get_int64 (const gchar *group,
+                            const gchar *pref_name);
+
 /** Get an float value from the preferences backend.
  *
  *  @param group This string specifies the group to which the preference belongs
@@ -327,6 +342,23 @@
 gint gnc_prefs_get_enum (const gchar *group,
                          const gchar *pref_name);
 
+/** Get a pair of coordinates from the preferences backend.
+ *
+ *  @param group This string specifies the group to which the preference belongs
+ *
+ *  @param preference This string is the name of the particular preference within
+ *  the named group of the preferences backend.
+ *
+ *  @param x The x coordinate to retrieve.
+ *
+ *  @param y The y coordinate to retrieve.
+ *
+ *  If there is an error in processing, both coordinates will be set to zero.
+ */
+void gnc_prefs_get_coords (const gchar *group,
+                           const gchar *pref_name,
+                           gdouble *x, gdouble *y);
+
 /** Get an arbitrary combination of values from the preferences backend.  This
  *  combination of values can be anything that can be encapsulated
  *  in a GVariant structure.
@@ -386,6 +418,22 @@
                             const gchar *pref_name,
                             gint value);
 
+/** Store a 64 bit integer value into the preferences backend.
+ *
+ *  @param group This string specifies the group to which the preference belongs
+ *
+ *  @param preference This string is the name of the particular preference within
+ *  the named group of the preferences backend.
+ *
+ *  @param value The 64 bit integer number to be stored.
+ *
+ *  @return This function returns true if the value was set successfully
+ *  on the preference or false if not.
+ */
+gboolean gnc_prefs_set_int64 (const gchar *group,
+                              const gchar *pref_name,
+                              gint64 value);
+
 /** Store a float value into the preferences backend.
  *
  *  @param group This string specifies the group to which the preference belongs
@@ -437,6 +485,25 @@
                              const gchar *pref_name,
                              gint value);
 
+/** Store coordinates into the preferences backend. Coordinates consist of
+ *  a pair of floating point values (x and y).
+ *
+ *  @param group This string specifies the group to which the preference belongs
+ *
+ *  @param preference This string is the name of the particular preference within
+ *  the named group of the preferences backend.
+ *
+ *  @param x The x coordinate to be stored.
+ *
+ *  @param y The y coordinate to be stored.
+ *
+ *  @return This function returns true if the value was set successfully
+ *  on the preference or false if not.
+ */
+gboolean gnc_prefs_set_coords (const gchar *group,
+                               const gchar *pref_name,
+                               gdouble x, gdouble y);
+
 /** Store an arbitrary combination of values into the preferences backend.
  *
  *  @param group This string specifies the group to which the preference belongs

Modified: gnucash/trunk/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check.c	2013-10-07 14:31:22 UTC (rev 23270)
+++ gnucash/trunk/src/gnome/dialog-print-check.c	2013-10-07 14:31:37 UTC (rev 23271)
@@ -353,34 +353,6 @@
 }
 
 
-/* This function is used by the custom format dialog to save position values
- * in the preferences database.
- */
-static void
-save_float_pair (const char *group, const char *pref, double a, double b)
-{
-    GVariant *coords = g_variant_new ("(dd)", a, b);
-    gnc_prefs_set_value (group, pref, coords);
-}
-
-
-/* This function is used by the custom format dialog to restore position
- * values from the preferences database.
- */
-static void
-get_float_pair (const char *group, const char *pref, double *a, double *b)
-{
-    GVariant *coords = gnc_prefs_get_value (group, pref);
-
-    *a = 0;
-    *b = 0;
-
-    if (g_variant_is_of_type (coords, (const GVariantType *) "(dd)") )
-        g_variant_get (coords, "(dd)", a, b);
-    g_variant_unref (coords);
-}
-
-
 /* This function returns a string containing the check address in a five-line
  * format.
  *
@@ -582,37 +554,37 @@
     }
 
     /* Custom format page */
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE,
                     gtk_spin_button_get_value(pcd->payee_x),
                     gtk_spin_button_get_value(pcd->payee_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE,
                     gtk_spin_button_get_value(pcd->date_x),
                     gtk_spin_button_get_value(pcd->date_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS,
                     gtk_spin_button_get_value(pcd->words_x),
                     gtk_spin_button_get_value(pcd->words_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER,
                     gtk_spin_button_get_value(pcd->number_x),
                     gtk_spin_button_get_value(pcd->number_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES,
                     gtk_spin_button_get_value(pcd->notes_x),
                     gtk_spin_button_get_value(pcd->notes_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO,
                     gtk_spin_button_get_value(pcd->memo_x),
                     gtk_spin_button_get_value(pcd->memo_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS,
                     gtk_spin_button_get_value(pcd->address_x),
                     gtk_spin_button_get_value(pcd->address_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT,
                     gtk_spin_button_get_value(pcd->splits_amount_x),
                     gtk_spin_button_get_value(pcd->splits_amount_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO,
                     gtk_spin_button_get_value(pcd->splits_memo_x),
                     gtk_spin_button_get_value(pcd->splits_memo_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT,
                     gtk_spin_button_get_value(pcd->splits_account_x),
                     gtk_spin_button_get_value(pcd->splits_account_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION,
                     gtk_spin_button_get_value(pcd->translation_x),
                     gtk_spin_button_get_value(pcd->translation_y));
     gnc_prefs_set_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION,
@@ -672,38 +644,38 @@
     }
 
     /* Custom format page */
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y);
     gtk_spin_button_set_value(pcd->payee_x, x);
     gtk_spin_button_set_value(pcd->payee_y, y);
 
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y);
     gtk_spin_button_set_value(pcd->date_x, x);
     gtk_spin_button_set_value(pcd->date_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y);
     gtk_spin_button_set_value(pcd->words_x, x);
     gtk_spin_button_set_value(pcd->words_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y);
     gtk_spin_button_set_value(pcd->number_x, x);
     gtk_spin_button_set_value(pcd->number_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y);
     gtk_spin_button_set_value(pcd->address_x, x);
     gtk_spin_button_set_value(pcd->address_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y);
     gtk_spin_button_set_value(pcd->notes_x, x);
     gtk_spin_button_set_value(pcd->notes_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y);
     gtk_spin_button_set_value(pcd->memo_x, x);
     gtk_spin_button_set_value(pcd->memo_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y);
     gtk_spin_button_set_value(pcd->splits_amount_x, x);
     gtk_spin_button_set_value(pcd->splits_amount_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y);
     gtk_spin_button_set_value(pcd->splits_memo_x, x);
     gtk_spin_button_set_value(pcd->splits_memo_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y);
     gtk_spin_button_set_value(pcd->splits_account_x, x);
     gtk_spin_button_set_value(pcd->splits_account_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y);
     gtk_spin_button_set_value(pcd->translation_x, x);
     gtk_spin_button_set_value(pcd->translation_y, y);
     x = gnc_prefs_get_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION);

Modified: gnucash/trunk/src/gnome/dialog-print-check2.c
===================================================================
--- gnucash/trunk/src/gnome/dialog-print-check2.c	2013-10-07 14:31:22 UTC (rev 23270)
+++ gnucash/trunk/src/gnome/dialog-print-check2.c	2013-10-07 14:31:37 UTC (rev 23271)
@@ -353,35 +353,6 @@
 }
 
 
-/* This function is used by the custom format dialog to save position values
- * in the preferences database.
- */
-static void
-save_float_pair (const char *group, const char *pref, double a, double b)
-{
-    GVariant *coords = g_variant_new ("(dd)", a, b);
-    gnc_prefs_set_value (group, pref, coords);
-    g_variant_unref (coords);
-}
-
-
-/* This function is used by the custom format dialog to restore position
- * values from the preferences database.
- */
-static void
-get_float_pair (const char *group, const char *pref, double *a, double *b)
-{
-    GVariant *coords = gnc_prefs_get_value (group, pref);
-
-    *a = 0;
-    *b = 0;
-
-    if (g_variant_is_of_type (coords, (const GVariantType *) "(dd)") )
-        g_variant_get (coords, "(dd)", a, b);
-    g_variant_unref (coords);
-}
-
-
 /* This function returns a string containing the check address in a five-line
  * format.
  *
@@ -583,37 +554,37 @@
     }
 
     /* Custom format page */
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE,
                     gtk_spin_button_get_value(pcd->payee_x),
                     gtk_spin_button_get_value(pcd->payee_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE,
                     gtk_spin_button_get_value(pcd->date_x),
                     gtk_spin_button_get_value(pcd->date_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS,
                     gtk_spin_button_get_value(pcd->words_x),
                     gtk_spin_button_get_value(pcd->words_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER,
                     gtk_spin_button_get_value(pcd->number_x),
                     gtk_spin_button_get_value(pcd->number_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES,
                     gtk_spin_button_get_value(pcd->notes_x),
                     gtk_spin_button_get_value(pcd->notes_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO,
                     gtk_spin_button_get_value(pcd->memo_x),
                     gtk_spin_button_get_value(pcd->memo_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS,
                     gtk_spin_button_get_value(pcd->address_x),
                     gtk_spin_button_get_value(pcd->address_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT,
                     gtk_spin_button_get_value(pcd->splits_amount_x),
                     gtk_spin_button_get_value(pcd->splits_amount_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO,
                     gtk_spin_button_get_value(pcd->splits_memo_x),
                     gtk_spin_button_get_value(pcd->splits_memo_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT,
                     gtk_spin_button_get_value(pcd->splits_account_x),
                     gtk_spin_button_get_value(pcd->splits_account_y));
-    save_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION,
+    gnc_prefs_set_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION,
                     gtk_spin_button_get_value(pcd->translation_x),
                     gtk_spin_button_get_value(pcd->translation_y));
     gnc_prefs_set_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION,
@@ -673,38 +644,38 @@
     }
 
     /* Custom format page */
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_PAYEE, &x, &y);
     gtk_spin_button_set_value(pcd->payee_x, x);
     gtk_spin_button_set_value(pcd->payee_y, y);
 
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_DATE, &x, &y);
     gtk_spin_button_set_value(pcd->date_x, x);
     gtk_spin_button_set_value(pcd->date_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_WORDS, &x, &y);
     gtk_spin_button_set_value(pcd->words_x, x);
     gtk_spin_button_set_value(pcd->words_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NUMBER, &x, &y);
     gtk_spin_button_set_value(pcd->number_x, x);
     gtk_spin_button_set_value(pcd->number_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ADDRESS, &x, &y);
     gtk_spin_button_set_value(pcd->address_x, x);
     gtk_spin_button_set_value(pcd->address_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_NOTES, &x, &y);
     gtk_spin_button_set_value(pcd->notes_x, x);
     gtk_spin_button_set_value(pcd->notes_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_MEMO, &x, &y);
     gtk_spin_button_set_value(pcd->memo_x, x);
     gtk_spin_button_set_value(pcd->memo_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_AMOUNT, &x, &y);
     gtk_spin_button_set_value(pcd->splits_amount_x, x);
     gtk_spin_button_set_value(pcd->splits_amount_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_MEMO, &x, &y);
     gtk_spin_button_set_value(pcd->splits_memo_x, x);
     gtk_spin_button_set_value(pcd->splits_memo_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_SPLITS_ACCOUNT, &x, &y);
     gtk_spin_button_set_value(pcd->splits_account_x, x);
     gtk_spin_button_set_value(pcd->splits_account_y, y);
-    get_float_pair(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y);
+    gnc_prefs_get_coords(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_TRANSLATION, &x, &y);
     gtk_spin_button_set_value(pcd->translation_x, x);
     gtk_spin_button_set_value(pcd->translation_y, y);
     x = gnc_prefs_get_float(GNC_PREFS_GROUP, GNC_PREF_CUSTOM_ROTATION);



More information about the gnucash-changes mailing list