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

John Ralls jralls at ceridwen.us
Fri Nov 4 16:01:46 EDT 2016


> On Nov 4, 2016, at 12:42 PM, Derek Atkins <derek at ihtfp.com> wrote:
> 
> Hi,
> 
> On Fri, November 4, 2016 3:20 pm, John Ralls wrote:
>> 
> [snip]
>>> 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.
>> 
>> Sort of, there's also applicationShouldOpenEmptyFile and
>> applicationOpenEmptyFile, presumably sent if there is no file indicated by
>> LaunchServices.
> 
> Hmm...  So COULD we start up and wait for SOME signal from LaunchServices?
> Maybe we block for a few seconds before falling back?

In theory we'd get one or the other within a few ticks of initializing NSApplication. It'd be wise to write a little test program before beginning surgery on GnuCash.
 
> 
>> No, it's a mismatch between the way startup is managed in Cocoa and Gtk+.
>> Unsurprisingly neither AppKit nor Gtk is designed with integration between
>> the two in mind.
> 
> One would think that some of the integration would have considered it.
> 
> What does GIMP do on Mac?  We're not the only gtk app ported.

I think they're using the same gtk-mac-integration library we do. Mitch Natterer wrote the original Carbon version for GIMP and Richard Hult generalized it for other applications. Paul Davis (of Ardour) and I re-implemented it for Carbon. They hung on to Mitch's code for a long time but I don't think it works after MacOS X 10.8 or 10.9. AFAIK they don't catch the notification either, though they have a much less-weird startup routine than we do (not hard).

Regards,
John Ralls




More information about the gnucash-user mailing list