Re: New Masked Calender for GnuCash

2016-11-06 Thread Amin Aghabeiki
Hi Christian

A copy of my code now available  here
 , a fork of GnuCash
under my account in Jalali branch.

Date Picker not implimented
you can switch between Gregorian and Jalali in preference  date/time
setting

Regards
Amin




On Thu, Nov 3, 2016 at 5:18 AM, Christian Stimming 
wrote:

> Dear Amin,
>
> can you put your current code online somewhere, such as in some github
> fork? I
> would be interested to see which parts of gnucash you actually changed.
> Maybe
> in "our world-view" the change seems too incomplete, but if you say your
> change would already be an improvement for users with Jalali calendar, we
> might consider this again. But we would have to see your code for that.
>
> Thanks!
>
> Christian
>
>
> Am Dienstag, 1. November 2016, 12:49:40 schrieb Amin Aghabeiki:
> > > Right, you're overriding the display methods.  You didn't mention
> setting
> >
> > up a preference, did you do that or are you assuming everyone in the
> fa_IR
> > locale will want to use your Jalali calendar?
> >
> > yes I add a setting in preference.
> >
> > >Not that comes to mind, and besides anything more hackish isn't likely
> to
> >
> > get merged.
> >
> > Noted !
> >
> > Is it true I flow the implementation of * gnucash-date-picker* and change
> > to Jalalian Calender ?
> >
> > Regards
> > Amin
> >
> > On Tue, Nov 1, 2016 at 11:54 AM, John Ralls  wrote:
> > > > On Oct 31, 2016, at 8:27 PM, Amin Aghabeiki <
> amin.aghabe...@gmail.com>
> > >
> > > wrote:
> > > > I use Mask instead of Override because I just show Jalalian Date to
> user
> > >
> > > and rest of back-end function ( event current Gregorian Date-Picker )
> work
> > > with Gregorian Date ( when user select an date in Gregorian Date-Picker
> > > automatically convert to Jalalian Date in cell ) . may be in technical
> the
> > > Override is true word for this kind of  implementation.
> > >
> > > Right, you're overriding the display methods.  You didn't mention
> setting
> > > up a preference, did you do that or are you assuming everyone in the
> fa_IR
> > > locale will want to use your Jalali calendar?
> > >
> > > > About date picker , there is not any easier way ?
> > >
> > > Not that comes to mind, and besides anything more hackish isn't likely
> to
> > > get merged.
> > >
> > > Regards,
> > > John Ralls
> >
> > ___
> > gnucash-devel mailing list
> > gnucash-devel@gnucash.org
> > https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: New Masked Calender for GnuCash

2016-11-06 Thread John Ralls

> On Nov 6, 2016, at 6:23 PM, Amin Aghabeiki  wrote:
> 
> yep , its fantastic guide  , thanks a late Geert

And I'm not Geert, which is why you should always copy the list on all replies. 
;-)

Regards,
John Ralls

> 
> Regards
> Amin
> 
> On 11/6/16, John Ralls  wrote:
>> 
>>> On Nov 5, 2016, at 6:09 AM, Geert Janssens 
>>> wrote:
>>> 
>>> On Friday 04 November 2016 08:08:46 John Ralls wrote:
> On Nov 3, 2016, at 8:39 PM, Amin Aghabeiki
> > wrote:
> 
> Hi John
> 
> I plane to change check box for calendar to combo box but its really
> complicated there is any guide  to add combo box in preference?
>>> 
>>> Which check box are you referring to here ?
 
 Amin,
 
 No, I've never worked with the preferences dialog. Perhaps Geert can
 offer some help.
 
 Regards,
 John Ralls
>>> 
>>> Hmm, it's been a while. Let's see what I remember...
>>> 
>>> I assume you want to add a combobox in which the user can select the
>>> calendar widget to use (Gregorian vs Jalali).
>>> 
>>> There are several examples you can follow in the preferences already. The
>>> date-format combobox is probably a good start.
>>> 
>>> First you should define your combobox in the glade interface file
>>> (src/gnome-utils/gtkbuilder/dialog-preferences.glade). Note the name needs
>>> a particular format, which I'll get back to later.
>>> 
>>> Each combobox needs a model, which you can also define in the same glade
>>> file. For the date-format combobox this is a gtkliststore with the name
>>> "date-formats". You'll need to define one similar for your combobox.
>>> 
>>> Next, all settings you see in the preferences dialog are stored in
>>> gsettings. Gsettings uses xml configuration files to define its settings.
>>> You'll need to create the schema for your specific preference. The schema
>>> are stored in gsettings subdirectories in various places of the code. The
>>> other date-time related settings are defined in
>>> src/gnome/gsettings/org.gnucash.gschema.xml.in.in   
>>> Again you can follow the example of the date-format preference. You will
>>> need to add a key to the general schema for your preference. It will store
>>> an integer value which is the selected line number in the combobox'
>>> liststore (though 0-based). This sounds more complicated than it is
>>> really. If you offer the user two options in your combobox, like this:
>>> Gregorian calendar
>>> Jalali calendar
>>> and the user selects "Jalali calendar", the value to store in the
>>> preference will be 1. Otherwise it will be 0. Note that I believe 0 should
>>> be the default to avoid unexpected changes to existing users.
>>> 
>>> And now for a crucial part: the name of your combobox in the glade file
>>> should be the gsettings path of your preference prefixed with "pref/". For
>>> the date-format preference for example this becomes:
>>> pref/general/date-format
>>> The combobox called that way will be tied automatically to the date-format
>>> gsettings preference in the general section in gsettings. This part is
>>> crucial. If the name of the widget is not correctly matched to the
>>> gsettings key, your preference will not work.
>>> 
>>> Lastly, due to the way gtkbuilder works, you'll have to explicitly tell
>>> gnucash to load the liststore you have defined for your combobox. It will
>>> load the combobox automatically, but not the liststore. This needs one
>>> more line in src/gnome-utils/dialog-preferences.c around line 1084.
>>> 
>>> After all that is done, your preference should just work.
>>> 
>>> For readability you should add a #define for the key of your preference in
>>> your own code, starting with "GNC_PREF_" and use that in combination with
>>> GNC_PREFS_GROUP_GENERAL in your calls to gnc_prefs_get_int to query the
>>> value of the new preference.
>>> 
>>> Finally, you may want to listen for changes in your new preference in
>>> order to update date/time widgets on open registers, report-option dialogs
>>> and anywhere else you are offering the jalali calendar as alternative. You
>>> can register callbacks to your preference via "gnc_prefs_register_cb"
>>> 
>>> Is that sufficient to get you going ?
>> 
>> That would be an excellent wiki article...
>> 
>> Regards,
>> John Ralls
>> 
>> 
>> 


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Report account-piecharts.scm does not work

2016-11-06 Thread David T. via gnucash-devel
Robert,

I have a dashboard set up to run on startup, with the Assets, Expenses, and 
Income reports included on it, so I run this every day in 3 of its four 
incarnations without problem. 

 I will note that count-accounts seems to be involved with the depth setting. 
Is there some way that you’ve cleared it?

David


> On Nov 7, 2016, at 1:18 AM, Robert Fewell <14ubo...@gmail.com> wrote:
> 
> Thanks for looking, that is very strange as it fails every time.
> 
> If I copy the maint version of account-piecharts.scm over to my running
> master version it works and see a pie chart. Replace with the master
> version and it fails as above. Created a new file with two asset
> transactions in it and it still fails. Use the same file on my windows
> master version and it fails in the same way.
> 
> Does it work for any body else ?
> 
> Might try rebuilding the windows master version to the latest git.
> 
> Bob
> 
> On 6 November 2016 at 16:46, Geert Janssens 
> wrote:
> 
>> Robert,
>> 
>> 
>> 
>> I looked into this, but don't see anything obviously wrong. More even, I
>> can't reproduce the error. The chart works just fine for me...
>> 
>> 
>> 
>> Do you have a test file I can play with to try and reproduce it here ?
>> 
>> 
>> 
>> Geert
>> 
>> 
>> 
>> On Sunday 06 November 2016 14:22:50 Robert Fewell wrote:
>> 
>>> Hi,
>> 
>>> 
>> 
>>> I was looking at this report as part of changing the plot size to use
>> 
>>> percentage values instead of pixels but it does not work, this is
>> 
>>> before I made any changes. It can be accessed from the "Asset
>> 
>>> Piechart" report.
>> 
>>> 
>> 
>>> The error I get is below and I have checked with my windows VM built
>> 
>>> with master that I get the same...
>> 
>>> 
>> 
>>> 756: 10 (begin (set! html #) (set! html #) (set! html #))
>> 
>>> 757: 11* (set! html (gnc:report-render-html report #t))
>> 
>>> 757: 12* [gnc:report-render-html # #t]
>> 
>>> 716: 13 (if (and (not #) (gnc:report-ctext report))
>> 
>>> (gnc:report-ctext report) ...)
>> 
>>> 724: 14 (let ((template #) (doc #f)) (set! doc (if template # #f))
>> 
>>> doc) 727: 15* (set! doc (if template (let* (# # # ...) (if # # ...)
>> 
>>> ...) ...)) 727: 16* (if template (let* (# # # ...) (if # # ...) ...)
>> 
>>> ...) 728: 17 (let* (# # # #) (if # # #) (gnc:report-set-ctext!
>> 
>>> report html) ...)
>> 
>>> 730: 18* [# #]
>> 
>>> In
>> 
>>> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>> 
>>> ts.scm: 645: 19 [piechart-renderer # "Assets"
>> 
>>> "5c7fd8a1fe9a4cd38884ff54214aa88a" ...]
>> 
>>> In unknown file:
>> 
>>> ...
>> 
>>> ?: 20 (letrec (# # # # ...) (if # # #) (gnc:report-finished) ...)
>> 
>>> In
>> 
>>> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>> 
>>> ts.scm: 502: 21* (count-accounts 1 topl-accounts)
>> 
>>> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>> 
>>> ts.scm:502:26: In expression (count-accounts 1 topl-accounts):
>> 
>>> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>> 
>>> ts.scm:502:26: Variable used before given a value: count-accounts
>> 
>>> 
>> 
>>> 
>> 
>>> Looking at git this file has not been changed for about a year but the
>> 
>>> commit that has stopped it working is "Add piechart report grouping
>> 
>>> by commodity."
>> 
>>> 
>> 
>>> I have poked at this for a day and have got no where so if any one can
>> 
>>> fix it great.
>> 
>>> 
>> 
>>> Bob
>> 
>>> ___
>> 
>>> gnucash-devel mailing list
>> 
>>> gnucash-devel@gnucash.org
>> 
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>> 
>> 
>> 
> ___
> gnucash-devel mailing list
> gnucash-devel@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Report account-piecharts.scm does not work

2016-11-06 Thread Robert Fewell
Thanks for looking, that is very strange as it fails every time.

If I copy the maint version of account-piecharts.scm over to my running
master version it works and see a pie chart. Replace with the master
version and it fails as above. Created a new file with two asset
transactions in it and it still fails. Use the same file on my windows
master version and it fails in the same way.

Does it work for any body else ?

Might try rebuilding the windows master version to the latest git.

Bob

On 6 November 2016 at 16:46, Geert Janssens 
wrote:

> Robert,
>
>
>
> I looked into this, but don't see anything obviously wrong. More even, I
> can't reproduce the error. The chart works just fine for me...
>
>
>
> Do you have a test file I can play with to try and reproduce it here ?
>
>
>
> Geert
>
>
>
> On Sunday 06 November 2016 14:22:50 Robert Fewell wrote:
>
> > Hi,
>
> >
>
> > I was looking at this report as part of changing the plot size to use
>
> > percentage values instead of pixels but it does not work, this is
>
> > before I made any changes. It can be accessed from the "Asset
>
> > Piechart" report.
>
> >
>
> > The error I get is below and I have checked with my windows VM built
>
> > with master that I get the same...
>
> >
>
> > 756: 10 (begin (set! html #) (set! html #) (set! html #))
>
> > 757: 11* (set! html (gnc:report-render-html report #t))
>
> > 757: 12* [gnc:report-render-html # #t]
>
> > 716: 13 (if (and (not #) (gnc:report-ctext report))
>
> > (gnc:report-ctext report) ...)
>
> > 724: 14 (let ((template #) (doc #f)) (set! doc (if template # #f))
>
> > doc) 727: 15* (set! doc (if template (let* (# # # ...) (if # # ...)
>
> > ...) ...)) 727: 16* (if template (let* (# # # ...) (if # # ...) ...)
>
> > ...) 728: 17 (let* (# # # #) (if # # #) (gnc:report-set-ctext!
>
> > report html) ...)
>
> > 730: 18* [# #]
>
> > In
>
> > /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>
> > ts.scm: 645: 19 [piechart-renderer # "Assets"
>
> > "5c7fd8a1fe9a4cd38884ff54214aa88a" ...]
>
> > In unknown file:
>
> > ...
>
> > ?: 20 (letrec (# # # # ...) (if # # #) (gnc:report-finished) ...)
>
> > In
>
> > /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>
> > ts.scm: 502: 21* (count-accounts 1 topl-accounts)
>
> > /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>
> > ts.scm:502:26: In expression (count-accounts 1 topl-accounts):
>
> > /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
>
> > ts.scm:502:26: Variable used before given a value: count-accounts
>
> >
>
> >
>
> > Looking at git this file has not been changed for about a year but the
>
> > commit that has stopped it working is "Add piechart report grouping
>
> > by commodity."
>
> >
>
> > I have poked at this for a day and have got no where so if any one can
>
> > fix it great.
>
> >
>
> > Bob
>
> > ___
>
> > gnucash-devel mailing list
>
> > gnucash-devel@gnucash.org
>
> > https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>
>
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Report account-piecharts.scm does not work

2016-11-06 Thread Geert Janssens
Robert,

I looked into this, but don't see anything obviously wrong. More even, I can't 
reproduce 
the error. The chart works just fine for me...

Do you have a test file I can play with to try and reproduce it here ?

Geert

On Sunday 06 November 2016 14:22:50 Robert Fewell wrote:
> Hi,
> 
> I was looking at this report as part of changing the plot size to use
> percentage values instead of pixels but it does not work, this is
> before I made any changes. It can be accessed from the "Asset
> Piechart" report.
> 
> The error I get is below and I have checked with my windows VM  built
> with master that I get the same...
> 
>  756: 10  (begin (set! html #) (set! html #) (set! html #))
>  757: 11* (set! html (gnc:report-render-html report #t))
>  757: 12* [gnc:report-render-html # #t]
>  716: 13  (if (and (not #) (gnc:report-ctext report))
> (gnc:report-ctext report) ...)
>  724: 14  (let ((template #) (doc #f)) (set! doc (if template # #f))
> doc) 727: 15* (set! doc (if template (let* (# # # ...) (if # # ...)
> ...) ...)) 727: 16* (if template (let* (# # # ...) (if # # ...) ...)
> ...) 728: 17  (let* (# # # #) (if # # #) (gnc:report-set-ctext!
> report html) ...)
>  730: 18* [# #]
> In
> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
> ts.scm: 645: 19  [piechart-renderer # "Assets"
> "5c7fd8a1fe9a4cd38884ff54214aa88a" ...]
> In unknown file:
> ...
>?: 20  (letrec (# # # # ...) (if # # #) (gnc:report-finished) ...)
> In
> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
> ts.scm: 502: 21* (count-accounts 1 topl-accounts)
> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
> ts.scm:502:26: In expression (count-accounts 1 topl-accounts):
> /usr/share/gnucash/scm/gnucash/report/standard-reports/account-piechar
> ts.scm:502:26: Variable used before given a value: count-accounts
> 
> 
> Looking at git this file has not been changed for about a year but the
> commit that has stopped it working is "Add piechart report grouping
> by commodity."
> 
> I have poked at this for a day and have got no where so if any one can
> fix it great.
> 
> Bob
> ___
> gnucash-devel mailing list
> gnucash-devel@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Guile gnucash modules documentation

2016-11-06 Thread John Ralls

> On Nov 6, 2016, at 12:25 AM, Sébastien de Menten  wrote:
> 
> Cross posting to gnucash-devel as probably more a dev question.
> Essentially: is there any way to get some documentation (even just the list
> of modules with symbols exported) on the guile gnucash bindings ?

For the bindings you can use the C documentation, just change the underscores 
(_) into hyphens (-). The only listing of what's exported is in the swig 
interface files, e.g. src/engine/engine.i. That covers about a third of the 
Scheme functionality, the rest being functions written in Scheme. AFAIK there 
is no documentation of that beyond the comments in the source files and of 
course the code itself.

Regards,
John Ralls


___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Report account-piecharts.scm does not work

2016-11-06 Thread Robert Fewell
Hi,

I was looking at this report as part of changing the plot size to use
percentage values instead of pixels but it does not work, this is before I
made any changes. It can be accessed from the "Asset Piechart" report.

The error I get is below and I have checked with my windows VM  built with
master that I get the same...

 756: 10  (begin (set! html #) (set! html #) (set! html #))
 757: 11* (set! html (gnc:report-render-html report #t))
 757: 12* [gnc:report-render-html # #t]
 716: 13  (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext
report) ...)
 724: 14  (let ((template #) (doc #f)) (set! doc (if template # #f)) doc)
 727: 15* (set! doc (if template (let* (# # # ...) (if # # ...) ...) ...))
 727: 16* (if template (let* (# # # ...) (if # # ...) ...) ...)
 728: 17  (let* (# # # #) (if # # #) (gnc:report-set-ctext! report html)
...)
 730: 18* [# #]
In
/usr/share/gnucash/scm/gnucash/report/standard-reports/account-piecharts.scm:
 645: 19  [piechart-renderer # "Assets" "5c7fd8a1fe9a4cd38884ff54214aa88a"
...]
In unknown file:
...
   ?: 20  (letrec (# # # # ...) (if # # #) (gnc:report-finished) ...)
In
/usr/share/gnucash/scm/gnucash/report/standard-reports/account-piecharts.scm:
 502: 21* (count-accounts 1 topl-accounts)
/usr/share/gnucash/scm/gnucash/report/standard-reports/account-piecharts.scm:502:26:
In expression (count-accounts 1 topl-accounts):
/usr/share/gnucash/scm/gnucash/report/standard-reports/account-piecharts.scm:502:26:
Variable used before given a value: count-accounts


Looking at git this file has not been changed for about a year but the
commit that has stopped it working is "Add piechart report grouping by
commodity."

I have poked at this for a day and have got no where so if any one can fix
it great.

Bob
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Fwd: Guile gnucash modules documentation

2016-11-06 Thread Sébastien de Menten
Cross posting to gnucash-devel as probably more a dev question.
Essentially: is there any way to get some documentation (even just the list
of modules with symbols exported) on the guile gnucash bindings ?

Sébastien
-- Forwarded message --
From: "Sébastien de Menten" 
Date: Nov 2, 2016 02:00
Subject: Guile gnucash modules documentation
To: 
Cc:

Is there a place where we can find documentation on the functions available
> from guile to write report ?
> Diving back in scheme bring good memories but these are not sufficient to
> understand how to use guile with gnucash.
> For instance, how can I get back just the current session ?
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel