diff --git a/src/gnome/dialog-add.c b/src/gnome/dialog-add.c index ebf1d7b7c1..2177b06e7a 100644 --- a/src/gnome/dialog-add.c +++ b/src/gnome/dialog-add.c @@ -340,7 +340,7 @@ gnc_ui_accWindow_create_callback(GtkWidget * dialog, gpointer data) if ((Account *)accData->parentAccount) { xaccInsertSubAccount ((Account *)accData->parentAccount, account); } else { - xaccGroupInsertAccount(xaccSessionGetGroup(current_session), account ); + xaccGroupInsertAccount(gncGetCurrentGroup(), account ); } xaccAccountCommitEdit (account); @@ -406,6 +406,8 @@ accWindow (AccountGroup *grp) accData = (AccWindow *)g_malloc(sizeof(AccWindow)); + /* if no account group specified, assume top-level group */ + if (!grp) grp = gncGetCurrentGroup(); accData->parentAccount = grp; accData->newAccount = xaccMallocAccount(); @@ -605,8 +607,7 @@ accWindow (AccountGroup *grp) /* Append this new subtree to the current tree item */ gtk_tree_item_set_subtree(GTK_TREE_ITEM(treeItem), GTK_WIDGET(subtree)); - gnc_ui_accWindow_tree_fill(GTK_TREE(subtree), - xaccSessionGetGroup(current_session)); + gnc_ui_accWindow_tree_fill(GTK_TREE(subtree), gncGetCurrentGroup()); } /*** Callbacks ****************************************************/ diff --git a/src/gnome/window-main.c b/src/gnome/window-main.c index a2f2b4f6b7..44f556eb1b 100644 --- a/src/gnome/window-main.c +++ b/src/gnome/window-main.c @@ -1,7 +1,7 @@ /********************************************************************\ * MainWindow.c -- the main window, and associated helper functions * * and callback functions for xacc (X-Accountant) * - * Copyright (C) 1998,1999 Jeremy Collins * + * Copyright (C) 1998,1999 Jeremy Collins * * Copyright (C) 1998 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * @@ -24,25 +24,25 @@ #include "config.h" -#include "gnucash.h" -#include "top-level.h" -#include "messages.h" -#include "version.h" -#include "util.h" +#include "AccWindow.h" +#include "dialog-options.h" +#include "FileDialog.h" +#include "g-wrap.h" +#include "gnucash.h" #include "MainWindow.h" +#include "messages.h" #include "RegWindow.h" +#include "top-level.h" +#include "version.h" #include "window-mainP.h" #include "window-help.h" -#include "dialog-options.h" -#include "AccWindow.h" +#include "util.h" -#include "g-wrap.h" /* This static indicates the debugging module that this .o belongs to. */ static short module = MOD_GUI; -#include "util.h" enum { FMB_NEW, @@ -314,13 +314,6 @@ acct_ctree_unselect(GtkWidget *widget, GtkCTreeNode *row, gint column) return TRUE; } -Session * -gnc_main_window_get_session(gncUIWidget w) { - /* FIXME: right now there's only one session. Eventually we might - allow multiple windows open. */ - return(current_session); -} - static void gnc_ui_refresh_statusbar() { @@ -335,8 +328,7 @@ gnc_ui_refresh_statusbar() Account *acc; int nacc; - grp = xaccSessionGetGroup (current_session); - //if (!grp) grp = topgroup; + grp = gncGetCurrentGroup (); nacc = xaccGroupGetNumAccounts (grp); for (i=0; i