[Gnucash-changes] Enable translation of the SortType enumeration to/from a string.

David Hampton hampton at cvs.gnucash.org
Thu Jun 30 19:36:56 EDT 2005


Log Message:
-----------
Enable translation of the SortType enumeration to/from a string.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash/src/gnome:
        gnc-split-reg.c
        gnc-split-reg.h

Revision Data
-------------
Index: gnc-split-reg.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/gnc-split-reg.h,v
retrieving revision 1.7.4.3
retrieving revision 1.7.4.4
diff -Lsrc/gnome/gnc-split-reg.h -Lsrc/gnome/gnc-split-reg.h -u -r1.7.4.3 -r1.7.4.4
--- src/gnome/gnc-split-reg.h
+++ src/gnome/gnc-split-reg.h
@@ -182,19 +182,22 @@
  * but this provides a simple case statement internally.  This should
  * probably not actually be exposed in the external interface....
  */
-typedef enum {
-  BY_NONE = 0,
-  BY_STANDARD,
-  BY_DATE,
-  BY_DATE_ENTERED,
-  BY_DATE_RECONCILED,
-  BY_NUM,
-  BY_AMOUNT,
-  BY_MEMO,
-  BY_DESC,
-  BY_ACTION,
-  BY_NOTES
-} SortType;
+#define ENUM_LIST_SORTTYPE(_) \
+  _(BY_NONE,) \
+  _(BY_STANDARD,) \
+  _(BY_DATE,) \
+  _(BY_DATE_ENTERED,) \
+  _(BY_DATE_RECONCILED,) \
+  _(BY_NUM,) \
+  _(BY_AMOUNT,) \
+  _(BY_MEMO,) \
+  _(BY_DESC,) \
+  _(BY_ACTION,) \
+  _(BY_NOTES,)
+
+DEFINE_ENUM(SortType, ENUM_LIST_SORTTYPE)
+AS_STRING_DEC(SortType, ENUM_LIST_SORTTYPE)
+FROM_STRING_DEC(SortType, ENUM_LIST_SORTTYPE)
 
 /**
  * Flags for creation-time selection of what subwidgets are to be created.
Index: gnc-split-reg.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/gnome/gnc-split-reg.c,v
retrieving revision 1.19.4.20
retrieving revision 1.19.4.21
diff -Lsrc/gnome/gnc-split-reg.c -Lsrc/gnome/gnc-split-reg.c -u -r1.19.4.20 -r1.19.4.21
--- src/gnome/gnc-split-reg.c
+++ src/gnome/gnc-split-reg.c
@@ -202,6 +202,8 @@
                                        GtkAllocation *allocation,
                                        gpointer user_data);
 
+FROM_STRING_FUNC(SortType, ENUM_LIST_SORTTYPE)
+AS_STRING_FUNC(SortType, ENUM_LIST_SORTTYPE)
 
 guint
 gnc_split_reg_get_type( void )


More information about the gnucash-changes mailing list