more library structure

Chris Shoemaker c.shoemaker at cox.net
Wed Jan 25 18:11:20 EST 2006


On Wed, Jan 25, 2006 at 03:53:13PM -0500, David Hampton wrote:
> On Wed, 2006-01-25 at 14:58 -0500, Chris Shoemaker wrote:
> 
> > I'm going to see how painful it is to move gnc-main-window and its
> > dependencies (e.g. gnc-plugin-manager) from gnome-utils into gnome.
> 
> Have fun.  :-)  Some of that code originally moved from gnome to
> gnome-utils because of compile time dependencies.

Well, I can't say it's fun, but I think I've _alomst_ found a
solution.  I'm betting those compile-time dependencies were from
src/gnc-ui.h.  Having a random header in src/ like that is a really
easy way to create a library dependency nightmare.  We should re-visit
that someday.

But, for now, I created a new function:
   void gnc_ui_set_toplevel(gncUIWidget w);

so that src/gnome can push some GtkWindow down into src/gnome-utils at
gui-init-time.  

Other than that, I had to simplify the account filter dialog creation
function.  When I factored it out of the account-page for use in the
budget-page, I stepped-up to passing a GncPluginPage, because it was
one-up in the object hierarchy, so it was easy.  I wasn't really
thinking about what belongs where.  Now, I've changed it to take the
GtkWindow and the page name, which was all we needed anyway.

One more thing that breaks in the short term, is:
--- gnome-utils/druid-gconf-setup.c     (revision 12978)
+++ gnome-utils/druid-gconf-setup.c     (working copy)
@@ -618,7 +618,8 @@
     switch (response) {
     case GTK_RESPONSE_CANCEL:
     default:
-      gnc_shutdown(42);
+        //gnc_shutdown(42);
+        break;  //FIXME
       /* never returns */

     case GTK_RESPONSE_NO:


I (or someone else) should figure out a better way of handling this. 

I know that it felt NotQuiteRight when I split the gui init into two
levels and stored the application state in gnome-utils.  Basically,
I'm undoing that change and going the other way.  The lifecycle
functions, global application state and main-window stuff is in
gnome/.  The things left in gnome-utils are really more stand-alone
utilities.  


The encouraging thing about this re-organization is that the
dependencies ended up forcing a lot (not all) of moves that really
make sense.  For example, all the GncPlugin and GncPluginPage stuff is
all in one place now - gnome/ - instead of split between both.

Oh darn!  I just found more dependencies.  :( I'm currently looking
something close to:

M      gnome-utils/druid-gconf-setup.c
D      gnome-utils/gnc-embedded-window.c
D      gnome-utils/gnc-embedded-window.h
D      gnome-utils/gnc-plugin.c
D      gnome-utils/gnc-plugin.h
M      gnome-utils/gnc-gnome-utils.c
M      gnome-utils/gnc-gnome-utils.h
D      gnome-utils/gnc-plugin-file-history.c
D      gnome-utils/gnc-plugin-file-history.h
M      gnome-utils/Makefile.am
M      gnome-utils/gw-gnome-utils-spec.scm
D      gnome-utils/gnc-plugin-menu-additions.c
D      gnome-utils/gnc-file.c
D      gnome-utils/gnc-plugin-menu-additions.h
D      gnome-utils/gnc-file.h
D      gnome-utils/gnc-main-window.c
D      gnome-utils/gnc-main-window.h
M      gnome-utils/gnc-tree-view-account.c
M      gnome-utils/gnc-tree-view-account.h
D      gnome-utils/gnc-plugin-page.c
D      gnome-utils/gnc-plugin-page.h
D      gnome-utils/gnc-plugin-manager.c
D      gnome-utils/gnc-window.c
D      gnome-utils/gnc-plugin-manager.h
D      gnome-utils/gnc-window.h
M      gnome-utils/gnc-gui-query.c
A  +   gnome/gnc-embedded-window.c
A  +   gnome/gnc-embedded-window.h
A  +   gnome/gnc-plugin-menu-additions.c
A  +   gnome/gnc-file.c
A  +   gnome/gnc-plugin-menu-additions.h
A  +   gnome/gnc-file.h
A  +   gnome/gnc-main-window.c
A  +   gnome/gnc-main-window.h
M      gnome/gnc-plugin-page-account-tree.c
M      gnome/top-level.c
M      gnome/top-level.h
A  +   gnome/gnc-plugin-page.c
A  +   gnome/gnc-plugin-page.h
A  +   gnome/gnc-plugin.c
A  +   gnome/gnc-plugin.h
M      gnome/gw-gnc-spec.scm
A  +   gnome/gnc-plugin-manager.c
A  +   gnome/gnc-window.c
A  +   gnome/gnc-plugin-file-history.c
A  +   gnome/gnc-plugin-manager.h
A  +   gnome/gnc-window.h
A  +   gnome/gnc-plugin-file-history.h
M      gnome/gnc-plugin-page-budget.c
M      gnome/Makefile.am
M      gnc-ui.h

where the modifications are just what I decribed above.  But, I just
noticed that business/ and import/ both depend on gnc-file, among
other things.  Hmmm... now I can't remember which dependency made me
move gnc-file.  Back to the Rubik's Cube... :(

-chris


More information about the gnucash-devel mailing list