fix ccess method to the topgroup

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@1807 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Linas Vepstas
1999-07-06 06:03:26 +00:00
parent b87e557c5c
commit 8d9e520567
2 changed files with 17 additions and 24 deletions

View File

@@ -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 ****************************************************/

View File

@@ -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<nacc; i++) {
int acc_type;
@@ -479,7 +471,7 @@ gnc_ui_refresh_tree()
parent = gtk_object_get_data(GTK_OBJECT(app), "ctree_parent");
ctree = gtk_object_get_data(GTK_OBJECT(app), "ctree");
accts = xaccSessionGetGroup(current_session);
accts = gncGetCurrentGroup();
gtk_ctree_remove_node(ctree, parent);
@@ -705,7 +697,7 @@ mainWindow() {
GtkWidget *statusbar;
GtkWidget *ctree;
GtkCTreeNode *parent = NULL;
AccountGroup *accts = xaccSessionGetGroup(current_session);
AccountGroup *accts = gncGetCurrentGroup();
gchar *ctitles[] = {ACC_NAME_STR, DESC_STR, BALN_STR};
/* Create ctree */