Is there a way to "Clear all contents/delete all transactions" for a fresh start?

Derek Atkins warlord at MIT.EDU
Fri Nov 4 12:39:49 EDT 2016


John Ralls <jralls at ceridwen.us> writes:

>> On Nov 4, 2016, at 7:29 AM, Derek Atkins <warlord at mit.edu> wrote:
>> 
>> John Ralls <jralls at ceridwen.us> writes:
>> 
>>> That would require that he start from the command line by specifying
>>> the path to the executable, which doesn't engage Launch Services and
>>> so doesn't send the NSApplicationOpenFile notification (the one that
>>> GnuCash doesn't know how to interpret). The `open` command doesn't
>>> pass command-line arguments, it is equivalent to double-clicking on
>>> the file in Finder so it would pass NSApplicationOpenFile if you ran
>>> `open foo.gnucash` on the command line.
>> 
>> So.... how hard would it be to get GnuCash to handle the
>> NSApplicationOpenFile notification?  I'm curious what it would
>> entail/require, as I have no idea.
>
> ATM we initialize the OSX application object and start the CFRunLoop
> in gnc_main_window_show_all_windows(). We'd need to split that so that
> we initialize it in inner_main() and register a handler for the
> g_signal "NSApplicationOpenFile". The hard part is dealing with the
> race between opening the default file and handling the signal.

It's too bad that it's sent as a signal...  I don't know how to handle
that race condition.  Is there some other signal that would signify that
we're NOT going to receive one,?  Or can we "solve" the race by making an
assumption that the signal would arrive within some (short) period of
time?

I guess this is a bad assumption by Apple that apps default the opening
empty.

> Regards,
> John Ralls

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list