G2 problems & patches

David Hampton hampton-gnucash at rainbolthampton.net
Sun Jul 17 18:17:12 EDT 2005

On Sun, 2005-07-17 at 11:38 -0400, Phil Longstaff wrote:
> A couple of problems I've noticed with G2:
> 1) The equity and income statements have a typo in the scheme code.  I've 
> attached a patch (diffs-reports).  My scheme isn't too good, but I don't see 
> how this could have ever worked.

Agreed. I've applied your change.

> 2) If you make a change to the file and then close G2, it first asks if you 
> really want to close.  Say yes.  The main window disappears and then you are 
> told the file has changed and you are asked if you want to save.  If you say 
> yes, G2 crashes.  The problem is that the main window has been destroyed but 
> gnc-window.c still has a reference to the window in progress_bar_hack_window.

Sigh.  I should have chased that down when I added to code to catch the
window manager delete function and put up the "are you sure you want to
quit" dialog.  I have vestigial code to call the save function as soon
as you click "Quit", only I never finished implementing it because of a
directory ordering problem in the source code.

> I've attached a patch to set the progress-bar window to NULL if the main 
> window is being destroyed (window-diffs).

I took your patch one set further to only NULL out the progress bar
"hack" if the window being closed is the window being used by the
progress bar code.

> I'm a little uneasy about this 
> because I don't know the GTK windowing architecture at all, but it seems to 
> do the trick.

Its not so much the gtk windowing architecture, as the gnucash windowing
architecture overlaid on top of it.  A gnucash "window" is not a gtk
widget, its a gtk interface that can be supplied by any widget.  There
are two window interfaces supplied in gnucash.  There's the gnc-main-
window code that is based on a GtkWindow, and there's the gnc-embedded-
window code thats based on a GtkVbox.  The latter is used for the
scheduled transaction code where a register and its menus gets embedded
into a dialog box.


P.S. In the future please submit "unified" diffs.

More information about the gnucash-devel mailing list