Re: Source directory restructuring

2017-08-12 Thread John Ralls

> On Aug 13, 2017, at 2:34 AM, Alex Aycinena  wrote:
> 
>> 
>> 
>> On Wed, Aug 9, 2017 at 11:54 AM, John Ralls > 
>>> wrote:
>> 
>>> 
 On Aug 9, 2017, at 9:16 PM, Alex Aycinena >
>>> wrote:
 
> 
> 
> 
> -- Forwarded message --
> From: John Ralls  >
> To: Sumit Bhardwaj >
> Cc: gnucash-devel  >
> Bcc:
> Date: Tue, 8 Aug 2017 20:01:44 +0300
> Subject: Re: Source directory restructuring
> 
>> On Aug 8, 2017, at 5:50 PM, Sumit Bhardwaj > >
>>> wrote:
>> 
>> John,
>> 
>> If the plan is to dump autotools, should we ask also devs to make sure
> that
>> they can build using cmake? I have had problems in the past and
> therefore,
>> I have stuck with autotools so far.
>> 
>> What are the things we want to confirm in the cmake toolchain?
>> cmake
>> cmake install
>> cmake check
>> 
>> Anything else?
> Sumit,
> 
> No. cmake  srcdir && make && make check && make install or
>>> (quite a
> bit faster) cmake -G Ninja  srcdir && ninja check && ninja
>>> install.
> 
> You generally need to at least specify a -DCMAKE_INSTALL_PREFIX unless
>>> you
> want GnuCash installed in /usr/local which back in the day was a
>>> reasonable
> thing to do but isn't really anymore. Because of normal linker
>>> behavior and
> GnuCash's overuse of loadable modules you also need to uninstall before
> building, especially when changing branches. The incantation for that
>>> in
> cmake is xargs rm < install_manifest.txt.
> 
> Geert and I use the cmake+ninja build system most of the time and the
> Windows automated build has been using it for just over a year. I think
> that it's well tested. There's a known problem that the dependency
>>> graph
> doesn't capture everything especially for some of the scheme modules so
> allowing too much parallelism (setting -j too high on a many-core
>>> machine)
> will try to build some things before their dependencies are done.
>>> That's
> not a blocker to dropping autotools. The only loose end at present is
>>> that
> there are still a few rough edges in the dist target that need to be
> cleaned up.
> 
> Regards,
> John Ralls
> 
> 
 
 I switched to cmake and ninja a few months ago when I had trouble
>>> building
 with autotools and I thought everything was working fine. I pushed a
>>> commit
 and found that some changes to unit tests that I had made didn't work
>>> and
 so I accidently broke the build. I had assumed that ninja check, which
>>> had
 been successful, had run the unit tests and hadn't bother to check for
 sure. I was finally able to get autotools to work by not including the
 debug arg in configure and so was able to run the unit test, fix it and
 push the fix. I have been using autotools since to make sure the tests
>>> are
 all run.
 
 My question is whether cmake now runs all the same unit tests.
 
>>> 
>>> Alex,
>>> 
>>> IIRC you flagged those tests as not run and Geert fixed them. Do you
>>> remember what they were?
>>> 
>>> I think that cmake and autotools are running the same set of tests but I
>>> haven't done a test-by-test comparison in a while.
>>> 
>>> Regards,
>>> John Ralls
>>> 
>>> 
>>> ___
>>> gnucash-devel mailing list
>>> gnucash-devel@gnucash.org
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>> 
>> 
>> 
> John,
> 
> I did a test-by-test comparison and found the following:
> 
> in cmake but not exactly the same in autotools:
> 
> Test  #49: scm-test-account
> Test  #50: scm-test-create-account
> Test  #51: scm-test-test-extra
> Test  #52: scm-test-split
> Test  #65: test-real-data
> Test  #74: scm-test-load-module
> Test  #76: test-link-generic-import
> 
> in autotools but not in cmake:
> 
> test-import-map
> test-create-account (is this Test  #50:
> scm-test-create-account?)
> test-test-extras   (is this Test  #51:
> scm-test-test-extra?)
> test-account   (is this Test  #49:
> scm-test-account?)
> test-split (is this Test  #52:
> scm-test-split?)
> test-real-data.sh  (is this Test  #65:
> test-real-data?)
> test-load-module (for app-utils)
> test-app-utils
> test-link (for engine)
> test-link (for import-export)(is this Test  #76:
> test-link-generic-import?)
> 
> I don't see any logs in the 

Suggestion to transaction.scm

2017-08-12 Thread Christopher Lam
I'd like to suggest an addition to transaction.scm. I enjoy using it - I
think it's the most versatile reporting engine.

However the account selector is, to say the least, very fiddly.

This diff will enable 'substring matcher' so that I can search for "^1" for
all of my accountant-related accounts, which matches
Income:Chris^1:Freelance, Expenses:Business^1:* and
Expenses:Household:Electricity^1. So I'd click "Select All" accounts, input
the substring matcher, and it'll filter relevant accounts. It could select
":Auto" which would match "Assets:Fixed:Auto" and "Expenses:Auto:Gas".

I wish to generate some discussion here prior to creating a PR. Or shall I
add into the beefed up transaction.scm that I will prepare a bigger PR next
week?

See screenshot as attachment, and the small diff below

--- transaction.scm
---
index 85bb537..d1a1e72 100644
@@ -33,6 +33,7 @@

 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (srfi srfi-1))
+(use-modules (srfi srfi-13))   ;; needed for string-contains
 (use-modules (gnucash gnc-module))
 (use-modules (gnucash gettext))

@@ -661,6 +662,12 @@
 #f #t))

   (gnc:register-trep-option
+   (gnc:make-string-option
+gnc:pagename-accounts (N_ "Account Matcher")
+"a5" (N_ "Match only above accounts whose fullname constains substring
eg :Travel:")
+""))
+
+  (gnc:register-trep-option
(gnc:make-account-list-option
 gnc:pagename-accounts (N_ "Filter By...")
 "b" (N_ "Filter on these accounts.")
@@ -1422,6 +1429,7 @@ Credit Card, and Income accounts.")
   (gnc:report-starting reportname)
   (let ((document (gnc:make-html-document))
 (c_account_1 (opt-val gnc:pagename-accounts "Accounts"))
+(c_account_matcher (opt-val gnc:pagename-accounts "Account
Matcher"))
 (c_account_2 (opt-val gnc:pagename-accounts "Filter By..."))
 (filter-mode (opt-val gnc:pagename-accounts "Filter Type"))
 (begindate (gnc:timepair-start-day-time
@@ -1444,6 +1452,11 @@ Credit Card, and Income accounts.")
 ;;(gnc:warn "accts in trep-renderer:" c_account_1)
 ;;(gnc:warn "Report Account names:" (get-other-account-names
c_account_1))

+(set! c_account_1
+  (filter (lambda (acc)
+(string-contains (gnc-account-get-full-name acc)
c_account_matcher))
+  c_account_1))
+
 (if (not (or (null? c_account_1) (and-map not c_account_1)))
 (begin
   (qof-query-set-book query (gnc-get-current-book))

On 30 June 2017 at 08:15, Christopher Lam  wrote:

> Hi Doug
>
> I'd be keen to hack scheme to modify the source "Accounts" tree which is
> common to several report types.
>
> Right now you select your originating accounts, and when you 'save' the
> report options, the account guid are hardcoded into the options. This
> causes issues if we modify the chart of accounts. Wouldn't it be nice to
> choose any of the following account ie name/description/notes:
> 1. "Income:Chris:"
> 2. "Expenses:Business:"
> 3. ":Travel" which captures splits from both Expenses:Business:Travel and
> Expenses:Holiday:Travel
> 4. "^1" my favorite, will capture splits from accounts such as
> Expenses:Business^1:etc and Expenses:Household:Electric^1, perfect for the
> accountant. The wife gets to use ^2 :)
>
> Next step could be to search account types (eg INCOME only)
>
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Resizable columns request

2017-08-12 Thread Derek Atkins

All columns can be changed.

The issue is that the description column will auto fill to maximum size.  
So you need to resize columns greater than the window size and then reduce 
the description.


-derek
Sent using my mobile device. Please excuse any typos.



On August 12, 2017 10:04:03 PM Tony Vanson  wrote:


Hi,

It would be a great help to me if the columns in GNUcash could be made 
resizable. I note the column header widths can be changed but the relevant 
columns can not.

I work with Australian dollars and Indonesian rupiah.
$A100,000.00 roughly equates to IDR 1,000,000,000.00, which cannot be 
accommodated in the fixed width columns.

Hoping some future consideration could be given to this problem.
Cheers
Anthony Vanson

Sent from Mail for Windows 10



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
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


Resizable columns request

2017-08-12 Thread Tony Vanson
Hi,

It would be a great help to me if the columns in GNUcash could be made 
resizable. I note the column header widths can be changed but the relevant 
columns can not.
I work with Australian dollars and Indonesian rupiah. 
$A100,000.00 roughly equates to IDR 1,000,000,000.00, which cannot be 
accommodated in the fixed width columns. 
Hoping some future consideration could be given to this problem.
Cheers
Anthony Vanson

Sent from Mail for Windows 10



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: Source directory restructuring

2017-08-12 Thread Alex Aycinena
>
>
> On Wed, Aug 9, 2017 at 11:54 AM, John Ralls  > wrote:
>
>>
>> > On Aug 9, 2017, at 9:16 PM, Alex Aycinena 
>> wrote:
>> >
>> >>
>> >>
>> >>
>> >> -- Forwarded message --
>> >> From: John Ralls 
>> >> To: Sumit Bhardwaj 
>> >> Cc: gnucash-devel 
>> >> Bcc:
>> >> Date: Tue, 8 Aug 2017 20:01:44 +0300
>> >> Subject: Re: Source directory restructuring
>> >>
>> >>> On Aug 8, 2017, at 5:50 PM, Sumit Bhardwaj 
>> wrote:
>> >>>
>> >>> John,
>> >>>
>> >>> If the plan is to dump autotools, should we ask also devs to make sure
>> >> that
>> >>> they can build using cmake? I have had problems in the past and
>> >> therefore,
>> >>> I have stuck with autotools so far.
>> >>>
>> >>> What are the things we want to confirm in the cmake toolchain?
>> >>> cmake
>> >>> cmake install
>> >>> cmake check
>> >>>
>> >>> Anything else?
>> >> Sumit,
>> >>
>> >> No. cmake  srcdir && make && make check && make install or
>> (quite a
>> >> bit faster) cmake -G Ninja  srcdir && ninja check && ninja
>> install.
>> >>
>> >> You generally need to at least specify a -DCMAKE_INSTALL_PREFIX unless
>> you
>> >> want GnuCash installed in /usr/local which back in the day was a
>> reasonable
>> >> thing to do but isn't really anymore. Because of normal linker
>> behavior and
>> >> GnuCash's overuse of loadable modules you also need to uninstall before
>> >> building, especially when changing branches. The incantation for that
>> in
>> >> cmake is xargs rm < install_manifest.txt.
>> >>
>> >> Geert and I use the cmake+ninja build system most of the time and the
>> >> Windows automated build has been using it for just over a year. I think
>> >> that it's well tested. There's a known problem that the dependency
>> graph
>> >> doesn't capture everything especially for some of the scheme modules so
>> >> allowing too much parallelism (setting -j too high on a many-core
>> machine)
>> >> will try to build some things before their dependencies are done.
>> That's
>> >> not a blocker to dropping autotools. The only loose end at present is
>> that
>> >> there are still a few rough edges in the dist target that need to be
>> >> cleaned up.
>> >>
>> >> Regards,
>> >> John Ralls
>> >>
>> >>
>> >
>> > I switched to cmake and ninja a few months ago when I had trouble
>> building
>> > with autotools and I thought everything was working fine. I pushed a
>> commit
>> > and found that some changes to unit tests that I had made didn't work
>> and
>> > so I accidently broke the build. I had assumed that ninja check, which
>> had
>> > been successful, had run the unit tests and hadn't bother to check for
>> > sure. I was finally able to get autotools to work by not including the
>> > debug arg in configure and so was able to run the unit test, fix it and
>> > push the fix. I have been using autotools since to make sure the tests
>> are
>> > all run.
>> >
>> > My question is whether cmake now runs all the same unit tests.
>> >
>>
>> Alex,
>>
>> IIRC you flagged those tests as not run and Geert fixed them. Do you
>> remember what they were?
>>
>> I think that cmake and autotools are running the same set of tests but I
>> haven't done a test-by-test comparison in a while.
>>
>> Regards,
>> John Ralls
>>
>>
>> ___
>> gnucash-devel mailing list
>> gnucash-devel@gnucash.org
>> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
>>
>
>
John,

I did a test-by-test comparison and found the following:

in cmake but not exactly the same in autotools:

Test  #49: scm-test-account
Test  #50: scm-test-create-account
Test  #51: scm-test-test-extra
Test  #52: scm-test-split
Test  #65: test-real-data
Test  #74: scm-test-load-module
Test  #76: test-link-generic-import

in autotools but not in cmake:

test-import-map
test-create-account (is this Test  #50:
scm-test-create-account?)
test-test-extras   (is this Test  #51:
scm-test-test-extra?)
test-account   (is this Test  #49:
scm-test-account?)
test-split (is this Test  #52:
scm-test-split?)
test-real-data.sh  (is this Test  #65:
test-real-data?)
test-load-module (for app-utils)
test-app-utils
test-link (for engine)
test-link (for import-export)(is this Test  #76:
test-link-generic-import?)

I don't see any logs in the test subdirectories after running the tests
with cmake like there are under autotools which make it hard to compare the
two. Also, it would make figuring out a failure hard to do compared with
autotools where you do have the logs. Can this be fixed if we switch to
cmake or am I missing something?

So in summary the missing tests in cmake seem to be: test-import-map (which,
by-the-way, fails randomly from time-to-time), test-load-module (for
app-utils), 

Re: Source directory restructuring

2017-08-12 Thread Geert Janssens
On zaterdag 12 augustus 2017 07:38:31 CEST John Ralls wrote:
> > On Aug 12, 2017, at 6:22 AM, Frank H. Ellenberger
> >  wrote:
> > 
> > Hi,
> > 
> > Am 08.08.2017 um 09:29 schrieb Geert Janssens:
> >> On maandag 7 augustus 2017 21:27:18 CEST John Ralls wrote:
> >>> These are to be top-level directories, so the current src goes away,
> >>> right?
> >>> The rest assumes that to be the case.
> >> 
> >> Yes, I would drop src.
> > 
> > Ahem, if I understand them right, most tools, I am using for e.g.
> > I18N/L10N and documentation expect a directory src.
> 
> That's interesting because most Gnome packages no longer have one and yet
> they all use gettext. What tools are they? Are you sure that 'src' isn't a
> configuration directory?

I was about the ask the same question.

The current state of my work doesn't seem to have any issues. You can test it 
by pulling the 'reorganize-source-dirs' branch from my github repo 
(gjanssens). I intend to make a few more minor tweaks before pushing this to 
master.

So I'm interested to hear which tools you believe would have issues.

Thanks !

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