Allowing the user to select the currency symbol

John Ralls jralls at ceridwen.us
Thu Oct 3 22:52:52 EDT 2013


On Oct 3, 2013, at 4:39 PM, Frédéric Perrin <fred at fperrin.net> wrote:

> Le jeudi 26 à 17:21, Derek Atkins a écrit :
>>> And the complexity of "I'll store in (GConf|the data file) one
>>> user-defined field per currency" seems much lower than "I'll store
>>> enough data to recreate the entire currency at data-file load time" ;
>>> I don't think I can acheive the second.
>> 
>> Actually, the second is already there.  You just need to extend the data
>> object and extend the existing UI.
>> 
>> Internally GnuCash treats a Currency like a special-case of of a
>> Commodity. So you can leverage all the Commodity editing tools to add
>> a Currency Editing tool. Et Voila.
> 
> You're right, after getting over my fear of GTK and actually diving into
> the code, it was not too hard to do. We now have one more field in the
> commodity editor, that allow setting the currency symbol.
> 
> First draft of the code is at http://code.fperrin.net/gnucash.git,
> branch symbols-per-file (gitweb browser at
> http://gitweb.fperrin.net/?p=gnucash.git;a=shortlog;h=refs/heads/symbols-per-file).
> File backends other than XML are not supported, and I'm note sure how
> the user_symbol interacts with non-currency commodities.
> 
> Of course, a small screenshot :
> http://brol.fperrin.net/gnucash/currency-editor-symbol.png

Please open a bug report and attach your patch (git format-patch is *perfect*) for review.

But first, rather than adding elements to the database, we generally add new fields with KVP,
which maintains backwards compatibility for the database. It would save an iteration or three
of "needs work" on your patch if you handle the persistence that way.

Regards,
John Ralls


More information about the gnucash-devel mailing list