Re: r21517 - gnucash/trunk/src/libqof/qof - Add is_readonly

2011-11-05 Thread Christian Stimming
Hi John,

Am Freitag, 4. November 2011 schrieb John Ralls:
> > Trac: http://svn.gnucash.org/trac/changeset/21517
> > 
> > Modified:
> >   gnucash/trunk/src/libqof/qof/qofsession-p.h
> >   gnucash/trunk/src/libqof/qof/qofsession.c
> >   gnucash/trunk/src/libqof/qof/qofsession.h
> > 
> > Log:
> > Add is_readonly attribute to QofSession class.
> 
> Why do we need this? QofBook already has a read-only attribute which
> prevents even editing instances, so there shouldn't ever be anything to
> save in a read-only session.

I've seen the read-only attribute in QofBook. However, it is not sufficient. 

My goal is to implement a "read-only" operation mode of gnucash, so that our 
infamous "The database is locked" dialog offers the choice "Open read-only" 
(instead of or additionally to "Open anyway").

For this, the read-only attribute needs to be stored in the same place as the 
database URL. That one is stored in QofSession, so the fact it's a read-only 
URL needs to be stored in QofSession, too.

Also, the fact that it's read-only needs to be stored already during 
qof_session_begin(), but at that time, no QofBook exists so far. The 
QofBook(s) won't be created before qof_session_load, but at that point the 
read-only attribute needs already be decided upon. So that's another reason 
for this addition.

In my planned feature, if the QofSession is read-only == TRUE, all of the 
QofBook(s) inside that session will also have read-only == TRUE.

> If there are leaks in QofBook's read-only
> block, fix that. It's not a good plan to let the user do a bunch of edits
> and then say "Oops, this session is read only, so you can't save your
> work!"

Both are needed, and both will have the same value - for this use case. There 
might be other use cases where the QofSession is read-write but (one of) its 
QofBook(s) is not.

Best Regards,

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


Re: Re : Fwd: French translation for GnuCash ...

2011-11-05 Thread Cristian Marchi

Thanks for the update. The translation is online!

Regards
Cristian

Il 02/11/2011 15:14, jerome ha scritto:

Hello,


Some new translated sentences, and fixed spacing issues, web pages' translation 
is now around 92%.


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


Re: Auto-Complete Search Method

2011-11-05 Thread Yawar Amin
Hi,

On 2011-11-04, at 22:41, GreenLED wrote:

> […]
> In short, when you search using auto-complete, completely IGNORE
> place-holder accounts. In this way, you can reach your desired account MUCH
> faster, and much more effectively.

I think until you get leaf-node search for accounts, you might find using 
account codes useful–see [1] for an intro to account codes, and [2] for a way 
to use account codes to enter transactions very quickly.

HTH,

Yawar

[1] http://article.gmane.org/gmane.comp.gnome.apps.gnucash.user/35395
[2] http://article.gmane.org/gmane.comp.gnome.apps.gnucash.user/38170



PGP.sig
Description: This is a digitally signed message part
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: r21516 Commit message

2011-11-05 Thread Yawar Amin
Hi Mike,

On Thu, Nov 3, 2011 at 1:37 PM, Mike Evans wrote:

> The commit message should be:
>
> Bug #457401 - Print invoice should not be disabled for unposted invoices
> Enable printing of unposted invoices.
>
> I'm using git and forgot the change to change the commit message.
> Apologies.
>

You can use git notes to append a messages to that commit in the public
repository as well.

git notes add 



Then, to share the note with the public repository,

git push origin refs/notes/*

Regards,

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


Re: r21517 - gnucash/trunk/src/libqof/qof - Add is_readonly

2011-11-05 Thread John Ralls

On Nov 5, 2011, at 1:31 AM, Christian Stimming wrote:

> Hi John,
> 
> Am Freitag, 4. November 2011 schrieb John Ralls:
>>> Trac: http://svn.gnucash.org/trac/changeset/21517
>>> 
>>> Modified:
>>>  gnucash/trunk/src/libqof/qof/qofsession-p.h
>>>  gnucash/trunk/src/libqof/qof/qofsession.c
>>>  gnucash/trunk/src/libqof/qof/qofsession.h
>>> 
>>> Log:
>>> Add is_readonly attribute to QofSession class.
>> 
>> Why do we need this? QofBook already has a read-only attribute which
>> prevents even editing instances, so there shouldn't ever be anything to
>> save in a read-only session.
> 
> I've seen the read-only attribute in QofBook. However, it is not sufficient. 
> 
> My goal is to implement a "read-only" operation mode of gnucash, so that our 
> infamous "The database is locked" dialog offers the choice "Open read-only" 
> (instead of or additionally to "Open anyway").
> 
> For this, the read-only attribute needs to be stored in the same place as the 
> database URL. That one is stored in QofSession, so the fact it's a read-only 
> URL needs to be stored in QofSession, too.
> 
> Also, the fact that it's read-only needs to be stored already during 
> qof_session_begin(), but at that time, no QofBook exists so far. The 
> QofBook(s) won't be created before qof_session_load, but at that point the 
> read-only attribute needs already be decided upon. So that's another reason 
> for this addition.
> 
> In my planned feature, if the QofSession is read-only == TRUE, all of the 
> QofBook(s) inside that session will also have read-only == TRUE.
> 
>> If there are leaks in QofBook's read-only
>> block, fix that. It's not a good plan to let the user do a bunch of edits
>> and then say "Oops, this session is read only, so you can't save your
>> work!"
> 
> Both are needed, and both will have the same value - for this use case. There 
> might be other use cases where the QofSession is read-write but (one of) its 
> QofBook(s) is not.

Christian,

That's an excellent idea, but I think you need to re-analyze the code a bit. In 
particular, this section of src/gnome-utils/gnc-file.c, in gnc_post_file_open():

870if (uh_oh && (io_err == ERR_SQL_DB_TOO_OLD ||
871  io_err == ERR_SQL_DB_TOO_NEW))
872{
873qof_book_mark_readonly(qof_session_get_book(new_session));
874uh_oh = FALSE;
875}

This is the *same function* that displays that dialog box. All that you need is 
a button on the dialog box to set a local variable in that function and add the 
variable as a condition to the above conditional and you're done.

While QofSession has facilities for multiple books, it really only made sense 
to do that in the old "gemini" book-closing scheme, which was never fully 
implemented (and a large part of which I removed over the summer) -- and in any 
case it allows only one open/active book (qof_session_get_book() doesn't return 
a list). What use-case do you have in mind that would need multiple books in a 
session, especially multiple *active* books? 

What you implemented contemplates a situation where the (a?) book is writable 
but the session isn't, so the user has been allowed to make edits but is 
blocked from saving them. What possible use-case would make that acceptable? 

qof_session_safe_save() is for upgrading the sql database in place. I can 
understand that if the file/session/db is to be read-only that that should be 
blocked, but that can be accomplished inside of gnc_post_file_open(), the only 
place that safe_save() is called.

Regards,
John Ralls


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


Re: Auto-Complete Search Method

2011-11-05 Thread Keith Bellairs
In my chart of accounts, the leaf nodes are not necessarily unique names. I
need the parent accounts to uniquely ID an account.

That said, I like the way mint.com (shudder) searches. It does a substring
search on all the "accounts" and presents a gradually shrinking set of
matches. That would work nicely for me.

Keith
Guelph ON

On Fri, Nov 4, 2011 at 10:41 PM, GreenLED  wrote:

> A screenshot for reference as you read:
> http://www.handysite.org/view/auto-complete.jpg
>
> I haven't used GnuCash for a long period of time, but I've noticed a
> particular search behavior that I would like to alter. When you search for
> an account to apply to a transaction (i.e. Typing "Cash" in the "Transfer"
> column of an account), it only searches by using the "exact" method of
> searching. You must barrel through your hierarchy BEFORE you can get to the
> specific account you are looking for. For example, if you are searching for
> the "Cash" account, in my books this would fall under the "top-level"
> account (placeholder) called "Assets". Keep in mind, this is of course
> particular to my situation, but note that many other companies would have
> some sort of hierarchy setup just like this (MANY times MUCH more complex).
> What would be nice is if you could set the "level" at which the
> auto-complete searches. So, in this example, if we set search depth level
> to
> "2" that means if we simply type in "Cash" (NOT "Assets:Cash"), we would
> see
> "Assets:Cash" show up in the listing. Notice what's happening. We are
> SKIPPING the first hierarchical account called "Assets" so that we can
> arrive at the account we need at a much faster pace. Any account PAST this
> point is subject to this auto-complete search. As an added note, it might
> be
> a good idea to REMOVE or have the option to remove accounts in the searched
> accounts that do NOT match our auto-complete search. As I think about this
> as well, we might have a switch to completely "skip" or "ignore"
> place-holder accounts. i think this might even be a much better solution.
>
> In short, when you search using auto-complete, completely IGNORE
> place-holder accounts. In this way, you can reach your desired account MUCH
> faster, and much more effectively. I hope I have made myself clear. If not,
> please do reply with your comments or questions. I would be willing to pay
> someone to implement this feature, it so imperative in accounting to be
> able
> to complete small tasks quickly so you can focus on the bigger tasks
> without
> the extra "fluff" or work involved in something as small as searching for
> an
> account in your ledger.
>
> --
> View this message in context:
> http://gnucash.1415818.n4.nabble.com/Auto-Complete-Search-Method-tp3992350p3992350.html
> Sent from the GnuCash - Dev mailing list archive at Nabble.com.
> ___
> 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: Auto-Complete Search Method

2011-11-05 Thread GreenLED
"In my chart of accounts, the leaf nodes are not necessarily unique names. I 
need the parent accounts to uniquely ID an account. 

That said, I like the way mint.com (shudder) searches. It does a substring 
search on all the "accounts" and presents a gradually shrinking set of 
matches. That would work nicely for me."

The "elimination" method of searching is almost exactly what I had in mind.
I think (if I'm not mistaken) Quicken/QuickBooks has some sort of method
like this.

Is there some way to "submit" a request for such a feature?

--
View this message in context: 
http://gnucash.1415818.n4.nabble.com/Auto-Complete-Search-Method-tp3992350p3994430.html
Sent from the GnuCash - Dev mailing list archive at Nabble.com.
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel