mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove some unused functions/files.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gnucash-gnome2-dev@9588 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -37,7 +37,6 @@ libgncmod_gnome_utils_la_SOURCES = \
|
||||
dialog-utils.c \
|
||||
druid-utils.c \
|
||||
gnc-account-sel.c \
|
||||
gnc-account-tree.c \
|
||||
gnc-amount-edit.c \
|
||||
gnc-commodity-edit.c \
|
||||
gnc-currency-edit.c \
|
||||
@@ -82,7 +81,6 @@ gncinclude_HEADERS = \
|
||||
dialog-utils.h \
|
||||
druid-utils.h \
|
||||
gnc-account-sel.h \
|
||||
gnc-account-tree.h \
|
||||
gnc-amount-edit.h \
|
||||
gnc-commodity-edit.h \
|
||||
gnc-currency-edit.h \
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#include "dialog-commodity.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-general-select.h"
|
||||
#include "gnc-commodity.h"
|
||||
@@ -566,7 +565,7 @@ fill_helper(gpointer key, gpointer value, gpointer data)
|
||||
if(!full_name)
|
||||
full_name = g_strdup("");
|
||||
|
||||
account_field_name = g_strdup(gnc_ui_account_get_field_name(fs->field));
|
||||
account_field_name = g_strdup(gnc_tree_view_account_get_field_name(fs->field));
|
||||
if (!account_field_name)
|
||||
account_field_name = g_strdup("");
|
||||
|
||||
@@ -1198,100 +1197,6 @@ gnc_account_type_list_create(AccountWindow *aw)
|
||||
gtk_clist_moveto(GTK_CLIST(aw->type_list), row, 0, 0.5, 0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
gnc_type_list_row_set_active(GtkCList *type_list, gint type, gboolean state)
|
||||
{
|
||||
GtkStyle *style = gtk_widget_get_style(GTK_WIDGET(type_list));
|
||||
gint row = gtk_clist_find_row_from_data(type_list, (gpointer)type);
|
||||
|
||||
if (state)
|
||||
{
|
||||
gtk_clist_set_selectable(type_list, row, TRUE);
|
||||
gtk_clist_set_background(type_list, row, &style->white);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_clist_unselect_row(type_list, row, 0);
|
||||
gtk_clist_set_selectable(type_list, row, FALSE);
|
||||
gtk_clist_set_background(type_list, row, &style->dark[GTK_STATE_NORMAL]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gnc_parent_tree_select(GNCAccountTree *tree,
|
||||
Account * account,
|
||||
gpointer data)
|
||||
{
|
||||
AccountWindow *aw = data;
|
||||
GNCAccountType parent_type;
|
||||
gboolean compatible;
|
||||
gint type;
|
||||
|
||||
gnc_account_window_set_name (aw);
|
||||
|
||||
if (aw->dialog_type == EDIT_ACCOUNT)
|
||||
return;
|
||||
|
||||
account = gnc_account_tree_get_current_account(tree);
|
||||
|
||||
/* Deleselect any or select top account */
|
||||
if (account == NULL || account == aw->top_level_account)
|
||||
if (aw->valid_types)
|
||||
{
|
||||
GList *node;
|
||||
for (node = aw->valid_types; node; node = node->next)
|
||||
{
|
||||
type = ((GNCAccountType)(node->data));
|
||||
gnc_type_list_row_set_active(GTK_CLIST(aw->type_list), type, TRUE);
|
||||
}
|
||||
}
|
||||
else
|
||||
for (type = 0; type < NUM_ACCOUNT_TYPES; type++)
|
||||
gnc_type_list_row_set_active(GTK_CLIST(aw->type_list), type, TRUE);
|
||||
|
||||
else /* Some other account was selected */
|
||||
{
|
||||
parent_type = xaccAccountGetType(account);
|
||||
|
||||
/* set the allowable account types for this parent */
|
||||
if (aw->valid_types)
|
||||
{
|
||||
GList *node;
|
||||
for (node = aw->valid_types; node; node = node->next)
|
||||
{
|
||||
type = ((GNCAccountType)(node->data));
|
||||
compatible = xaccAccountTypesCompatible (parent_type, type);
|
||||
gnc_type_list_row_set_active (GTK_CLIST(aw->type_list), type,
|
||||
compatible);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (type = 0; type < NUM_ACCOUNT_TYPES; type++)
|
||||
{
|
||||
compatible = xaccAccountTypesCompatible(parent_type, type);
|
||||
gnc_type_list_row_set_active(GTK_CLIST(aw->type_list), type,
|
||||
compatible);
|
||||
}
|
||||
}
|
||||
|
||||
/* now select a new account type if the account class has changed */
|
||||
compatible = xaccAccountTypesCompatible(parent_type, aw->type);
|
||||
if (!compatible)
|
||||
{
|
||||
gint row;
|
||||
aw->type = parent_type;
|
||||
row = gtk_clist_find_row_from_data(GTK_CLIST(aw->type_list),
|
||||
(gpointer)parent_type);
|
||||
gtk_clist_select_row(GTK_CLIST(aw->type_list), row, 0);
|
||||
gtk_clist_moveto(GTK_CLIST(aw->type_list), row, 0, 0.5, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
gnc_account_name_changed_cb(GtkWidget *widget, gpointer data)
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,162 +0,0 @@
|
||||
/*******************************************************************\
|
||||
* account-tree.h -- GNOME account tree functions *
|
||||
* Copyright (C) 1998,1999 Linas Vepstas *
|
||||
* Copyright (C) 2000 Dave Peticolas <peticola@cs.ucdavis.edu> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef GNC_ACCOUNT_TREE_H
|
||||
#define GNC_ACCOUNT_TREE_H
|
||||
|
||||
#include <gtk/gtkctree.h>
|
||||
|
||||
#include "Group.h"
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GNC_TYPE_ACCOUNT_TREE (gnc_account_tree_get_type ())
|
||||
#define GNC_ACCOUNT_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_ACCOUNT_TREE, GNCAccountTree))
|
||||
#define GNC_ACCOUNT_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_ACCOUNT_TREE, GNCAccountTreeClass))
|
||||
#define GNC_IS_ACCOUNT_TREE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_ACCOUNT_TREE))
|
||||
#define GNC_IS_ACCOUNT_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNC_TYPE_ACCOUNT_TREE))
|
||||
|
||||
typedef gboolean (*AccountFilter) (Account *account, gpointer user_data);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gboolean include_type[NUM_ACCOUNT_TYPES];
|
||||
|
||||
gboolean show_field[NUM_ACCOUNT_FIELDS];
|
||||
} AccountViewInfo;
|
||||
|
||||
typedef struct GNCAccountTree_s
|
||||
{
|
||||
GtkCTree ctree;
|
||||
|
||||
AccountFilter view_filter;
|
||||
gpointer view_filter_data;
|
||||
|
||||
AccountFilter selectable_filter;
|
||||
gpointer selectable_filter_data;
|
||||
|
||||
AccountViewInfo avi;
|
||||
|
||||
const gchar * column_headings[NUM_ACCOUNT_FIELDS + 1];
|
||||
|
||||
GtkStyle *deficit_style;
|
||||
|
||||
GUID root_account;
|
||||
|
||||
GList * current_accounts;
|
||||
|
||||
gboolean ignore_unselect;
|
||||
} GNCAccountTree;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GtkCTreeClass parent_class;
|
||||
|
||||
void (*select_account) (GNCAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void (*unselect_account) (GNCAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void (*activate_account) (GNCAccountTree *tree,
|
||||
Account *account);
|
||||
} GNCAccountTreeClass;
|
||||
|
||||
/***********************************************************
|
||||
* public functions *
|
||||
***********************************************************/
|
||||
|
||||
GType gnc_account_tree_get_type (void);
|
||||
|
||||
GtkWidget * gnc_account_tree_new (void);
|
||||
|
||||
GtkWidget * gnc_account_tree_new_with_root (Account *account);
|
||||
|
||||
void gnc_account_tree_refresh (GNCAccountTree *tree);
|
||||
|
||||
gboolean gnc_account_tree_select_account (GNCAccountTree *tree,
|
||||
Account *account,
|
||||
gboolean show_account);
|
||||
|
||||
gboolean gnc_account_tree_select_subaccounts (GNCAccountTree *tree,
|
||||
Account *account,
|
||||
gboolean show_account);
|
||||
|
||||
gboolean gnc_account_tree_select_accounts (GNCAccountTree *tree,
|
||||
GList *account_list,
|
||||
gboolean show_last);
|
||||
|
||||
gboolean gnc_account_tree_unselect_account (GNCAccountTree *tree,
|
||||
Account *account,
|
||||
gboolean show_account);
|
||||
|
||||
gboolean gnc_account_tree_unselect_subaccounts (GNCAccountTree *tree,
|
||||
Account *account,
|
||||
gboolean show_account);
|
||||
|
||||
void gnc_account_tree_expand_account (GNCAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void gnc_account_tree_toggle_account_expansion (GNCAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void gnc_account_tree_expand_all (GNCAccountTree *tree);
|
||||
|
||||
void gnc_account_tree_show_income_expense (GNCAccountTree *tree);
|
||||
|
||||
void gnc_account_tree_hide_income_expense (GNCAccountTree *tree);
|
||||
|
||||
Account * gnc_account_tree_get_current_account (GNCAccountTree *tree);
|
||||
GList * gnc_account_tree_get_current_accounts (GNCAccountTree *tree);
|
||||
|
||||
Account * gnc_account_tree_get_focus_account (GNCAccountTree *tree);
|
||||
|
||||
gboolean gnc_account_tree_account_selected (GNCAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void gnc_account_tree_hide_all_but_name (GNCAccountTree *tree);
|
||||
|
||||
void gnc_init_account_view_info(AccountViewInfo *avi);
|
||||
|
||||
void gnc_account_tree_set_view_info (GNCAccountTree *tree,
|
||||
AccountViewInfo *info);
|
||||
|
||||
void gnc_account_tree_get_view_info (GNCAccountTree *tree,
|
||||
AccountViewInfo *info);
|
||||
|
||||
void gnc_account_tree_set_view_filter (GNCAccountTree *tree,
|
||||
AccountFilter filter,
|
||||
gpointer user_data);
|
||||
|
||||
void gnc_account_tree_set_selectable_filter (GNCAccountTree *tree,
|
||||
AccountFilter filter,
|
||||
gpointer user_data);
|
||||
const char * gnc_ui_account_get_field_name (AccountFieldCode field);
|
||||
const char * gnc_ui_account_get_pref_name (AccountFieldCode field);
|
||||
AccountFieldCode gnc_ui_account_pref_name_to_code (const char *pref_name);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* GNC_ACCOUNT_TREE_H */
|
||||
@@ -139,6 +139,29 @@ gnc_tree_view_account_class_init (GncTreeViewAccountClass *klass)
|
||||
object_class->destroy = gnc_tree_view_account_destroy;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_init_account_view_info *
|
||||
* initialize an account view info structure with default values *
|
||||
* *
|
||||
* Args: avi - structure to initialize *
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
static void
|
||||
gnc_init_account_view_info(AccountViewInfo *avi)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
|
||||
avi->include_type[i] = TRUE;
|
||||
|
||||
for (i = 0; i < NUM_ACCOUNT_FIELDS; i++)
|
||||
avi->show_field[i] = FALSE;
|
||||
|
||||
avi->show_field[ACCOUNT_NAME] = TRUE;
|
||||
avi->show_field[ACCOUNT_DESCRIPTION] = TRUE;
|
||||
avi->show_field[ACCOUNT_TOTAL] = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_tree_view_account_init (GncTreeViewAccount *view)
|
||||
{
|
||||
@@ -346,6 +369,15 @@ gnc_tree_view_account_pref_name_to_field (const char *pref_name)
|
||||
return(GNC_TREE_MODEL_ACCOUNT_COL_NAME);
|
||||
}
|
||||
|
||||
const char *
|
||||
gnc_tree_view_account_get_field_name (AccountFieldCode field)
|
||||
{
|
||||
g_return_val_if_fail ((field >= 0) && (field < GNC_TREE_MODEL_ACCOUNT_COL_LASTNUM), NULL);
|
||||
|
||||
return(gettext(gnc_tree_view_account_defaults[field].field_name));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set the list of columns that will be visible in an account tree view.
|
||||
*/
|
||||
|
||||
@@ -35,9 +35,9 @@
|
||||
#include <gtk/gtktreemodel.h>
|
||||
#include <gtk/gtktreeview.h>
|
||||
|
||||
#include "gnc-account-tree.h"
|
||||
#include "Group.h"
|
||||
#include "eggtreemodelfilter.h"
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -51,6 +51,16 @@ G_BEGIN_DECLS
|
||||
|
||||
/* typedefs & structures */
|
||||
typedef struct GncTreeViewAccountPrivate GncTreeViewAccountPrivate;
|
||||
typedef struct AccountViewInfo_s AccountViewInfo;
|
||||
|
||||
|
||||
struct AccountViewInfo_s
|
||||
{
|
||||
gboolean include_type[NUM_ACCOUNT_TYPES];
|
||||
|
||||
gboolean show_field[NUM_ACCOUNT_FIELDS];
|
||||
};
|
||||
|
||||
|
||||
typedef struct {
|
||||
GtkTreeView parent;
|
||||
@@ -91,6 +101,8 @@ GtkTreeView *gnc_tree_view_account_new (gboolean show_root);
|
||||
/** @name Account Tree View Configuration */
|
||||
/** @{ */
|
||||
|
||||
const char *gnc_tree_view_account_get_field_name (AccountFieldCode field);
|
||||
|
||||
/** Configure (by name) the set of visible columns in an account tree
|
||||
* view. By default, only the account name column is show. The
|
||||
* avalible list of columns can be found in the file
|
||||
|
||||
@@ -55,11 +55,9 @@ libgncgnome_la_SOURCES = \
|
||||
gnc-split-reg.c \
|
||||
gnc-window.c \
|
||||
lot-viewer.c \
|
||||
mainwindow-account-tree.c \
|
||||
reconcile-list.c \
|
||||
tip-of-the-day.c \
|
||||
top-level.c \
|
||||
window-acct-tree.c \
|
||||
window-main.c \
|
||||
window-main-summarybar.c \
|
||||
window-reconcile.c \
|
||||
@@ -105,11 +103,9 @@ noinst_HEADERS = \
|
||||
gnc-window.h \
|
||||
gw-gnc.h \
|
||||
lot-viewer.h \
|
||||
mainwindow-account-tree.h \
|
||||
reconcile-list.h \
|
||||
tip-of-the-day.h \
|
||||
top-level.h \
|
||||
window-acct-tree.h \
|
||||
window-main.h \
|
||||
window-main-summarybar.h \
|
||||
window-reconcile.h \
|
||||
|
||||
@@ -1,292 +0,0 @@
|
||||
/********************************************************************\
|
||||
* mainwindow-account-tree.c -- composite account selection widget *
|
||||
* wrapped up for the main window *
|
||||
* and callback functions for GnuCash *
|
||||
* Copyright (C) 2000 Gnumatic, Inc. *
|
||||
* Written by Robert Merkel <rgmerk@mira.net> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include "mainwindow-account-tree.h"
|
||||
|
||||
|
||||
static GList *mw_acc_trees = NULL;
|
||||
|
||||
enum {
|
||||
SELECT_ACCOUNT_SIGNAL,
|
||||
UNSELECT_ACCOUNT_SIGNAL,
|
||||
ACTIVATE_ACCOUNT_SIGNAL,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static gint mainwinaccounttree_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static void
|
||||
unselect_account_callback(GNCAccountTree *tree, Account *account, gpointer user_data)
|
||||
{
|
||||
GNCMainWinAccountTree *mw_tree = (GNCMainWinAccountTree *) user_data;
|
||||
g_signal_emit(G_OBJECT(mw_tree),
|
||||
mainwinaccounttree_signals[UNSELECT_ACCOUNT_SIGNAL],
|
||||
0,
|
||||
account);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
activate_account_callback(GNCAccountTree *tree, Account *account, gpointer user_data)
|
||||
{
|
||||
GNCMainWinAccountTree *mw_tree = (GNCMainWinAccountTree *) user_data;
|
||||
g_signal_emit(G_OBJECT(mw_tree),
|
||||
mainwinaccounttree_signals[ACTIVATE_ACCOUNT_SIGNAL],
|
||||
0,
|
||||
account);
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
select_account_callback(GNCAccountTree *tree, Account *account, gpointer user_data)
|
||||
{
|
||||
GNCMainWinAccountTree *clicked_window = (GNCMainWinAccountTree *) user_data;
|
||||
GList *list_iterator;
|
||||
GNCMainWinAccountTree *current_window;
|
||||
for(list_iterator = mw_acc_trees; list_iterator; list_iterator=g_list_next(list_iterator))
|
||||
{
|
||||
current_window = list_iterator->data;
|
||||
if(current_window != clicked_window)
|
||||
{
|
||||
gnc_account_tree_unselect_account
|
||||
(current_window->acc_tree,
|
||||
gnc_account_tree_get_current_account(current_window->acc_tree),
|
||||
FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
g_signal_emit(G_OBJECT(clicked_window),
|
||||
mainwinaccounttree_signals[SELECT_ACCOUNT_SIGNAL], 0,
|
||||
account);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_mainwin_account_tree_class_init (GNCMainWinAccountTreeClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
mainwinaccounttree_signals[SELECT_ACCOUNT_SIGNAL] =
|
||||
g_signal_new("select_account",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET(GNCMainWinAccountTreeClass, select_account),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_POINTER);
|
||||
|
||||
mainwinaccounttree_signals[UNSELECT_ACCOUNT_SIGNAL] =
|
||||
g_signal_new("unselect_account",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET(GNCMainWinAccountTreeClass, unselect_account),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_POINTER);
|
||||
|
||||
mainwinaccounttree_signals[ACTIVATE_ACCOUNT_SIGNAL] =
|
||||
g_signal_new("activate_account",
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET(GNCMainWinAccountTreeClass, activate_account),
|
||||
NULL, NULL,
|
||||
g_cclosure_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1,
|
||||
G_TYPE_POINTER);
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_mainwin_account_tree_init(GNCMainWinAccountTree *mwac_tree)
|
||||
{
|
||||
mwac_tree->acc_tree = GNC_ACCOUNT_TREE(gnc_account_tree_new());
|
||||
mwac_tree->scrolled_window = GTK_SCROLLED_WINDOW(gtk_scrolled_window_new(NULL, NULL));
|
||||
|
||||
gtk_scrolled_window_set_policy (mwac_tree->scrolled_window,
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
g_signal_connect (G_OBJECT (mwac_tree->acc_tree), "activate_account",
|
||||
G_CALLBACK (activate_account_callback), mwac_tree);
|
||||
|
||||
g_signal_connect (G_OBJECT(mwac_tree->acc_tree), "select_account",
|
||||
G_CALLBACK (select_account_callback), mwac_tree);
|
||||
|
||||
g_signal_connect (G_OBJECT(mwac_tree->acc_tree), "unselect_account",
|
||||
G_CALLBACK (unselect_account_callback), mwac_tree);
|
||||
|
||||
gtk_container_add(GTK_CONTAINER(mwac_tree->scrolled_window), GTK_WIDGET(mwac_tree->acc_tree));
|
||||
|
||||
gtk_box_pack_start(GTK_BOX(mwac_tree), GTK_WIDGET(mwac_tree->scrolled_window), TRUE, TRUE, 0);
|
||||
gtk_widget_show(GTK_WIDGET(mwac_tree->acc_tree));
|
||||
gtk_widget_show(GTK_WIDGET(mwac_tree->scrolled_window));
|
||||
}
|
||||
|
||||
GType
|
||||
gnc_mainwin_account_tree_get_type ()
|
||||
{
|
||||
static GType mwactree = 0;
|
||||
|
||||
if (mwactree == 0)
|
||||
{
|
||||
static const GTypeInfo mwactree_info =
|
||||
{
|
||||
sizeof (GNCMainWinAccountTreeClass),
|
||||
NULL,
|
||||
NULL,
|
||||
(GClassInitFunc) gnc_mainwin_account_tree_class_init,
|
||||
NULL,
|
||||
NULL,
|
||||
sizeof (GNCMainWinAccountTree),
|
||||
0,
|
||||
(GInstanceInitFunc) gnc_mainwin_account_tree_init
|
||||
};
|
||||
mwactree = g_type_register_static (GTK_TYPE_HBOX,
|
||||
"GNCMainWinAccountTree",
|
||||
&mwactree_info, 0);
|
||||
}
|
||||
|
||||
return mwactree;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Note that the interface was chosen purely because it's the calls needed to
|
||||
* get this working with the existing window-main.c
|
||||
* This is all subject to change
|
||||
*/
|
||||
|
||||
/*******************************************************************************\
|
||||
* gnc_mainwin_account_tree_attach_popup *
|
||||
* attaches a popup window *
|
||||
* *
|
||||
* Args: mwac_trec - the mainwindow account tree to attach to *
|
||||
* popup_info - the popup to attach *
|
||||
* Returns: The menu created. *
|
||||
\*******************************************************************************/
|
||||
|
||||
GtkWidget *
|
||||
gnc_mainwin_account_tree_attach_popup(GNCMainWinAccountTree *mwac_tree,
|
||||
GnomeUIInfo *popup_info,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *popup = gnome_popup_menu_new(popup_info);
|
||||
gnome_popup_menu_attach(popup, GTK_WIDGET(mwac_tree->acc_tree), user_data);
|
||||
return(popup);
|
||||
}
|
||||
|
||||
/*******************************************************************************\
|
||||
* gnc_mainwin_account_tree_set_view_info *
|
||||
* set which accounts get viewed *
|
||||
* *
|
||||
* Args: mwac_tree - the mainwindow account tree to attach to *
|
||||
* new_info - the new view info (see account-tree.c for more details) *
|
||||
* Returns: Nothing *
|
||||
\*******************************************************************************/
|
||||
|
||||
void
|
||||
gnc_mainwin_account_tree_set_view_info(GNCMainWinAccountTree *mwac_tree, AccountViewInfo new_info)
|
||||
{
|
||||
AccountViewInfo old_info;
|
||||
gnc_account_tree_get_view_info(mwac_tree->acc_tree, &old_info);
|
||||
|
||||
if(memcmp(&new_info, &old_info, sizeof(AccountViewInfo)) != 0)
|
||||
{
|
||||
gnc_account_tree_set_view_info(mwac_tree->acc_tree, &new_info);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*******************************************************************************\
|
||||
* gnc_mainwin_account_tree_new *
|
||||
* create a new mainwindow_account_tree *
|
||||
* *
|
||||
* Args: nothing *
|
||||
* Returns : a new fresh-baked mainwindow_account_tree *
|
||||
\*******************************************************************************/
|
||||
|
||||
GtkWidget *
|
||||
gnc_mainwin_account_tree_new()
|
||||
{
|
||||
GtkWidget *tree;
|
||||
guint type_of;
|
||||
type_of = gnc_mainwin_account_tree_get_type();
|
||||
tree = gtk_widget_new(type_of, NULL);
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
/*******************************************************************************\
|
||||
* gnc_mainwin_account_tree_get_current_acount *
|
||||
* get the current account selected in a mainwindow_account_tree *
|
||||
* *
|
||||
* Args: the account tree *
|
||||
* Returns : a pointer to the selected account *
|
||||
\*******************************************************************************/
|
||||
Account *
|
||||
gnc_mainwin_account_tree_get_current_account(GNCMainWinAccountTree *list)
|
||||
{
|
||||
return gnc_account_tree_get_current_account(list->acc_tree);
|
||||
}
|
||||
/*******************************************************************************\
|
||||
* gnc_mainwin_account_tree_get_current_accounts *
|
||||
* get the current account(s) selected in a mainwindow_account_tree *
|
||||
* *
|
||||
* Args: the account tree *
|
||||
* Returns : a Glist of selected accounts *
|
||||
\*******************************************************************************/
|
||||
|
||||
GList *
|
||||
gnc_mainwin_account_tree_get_current_accounts(GNCMainWinAccountTree *list)
|
||||
{
|
||||
return gnc_account_tree_get_current_accounts(list->acc_tree);
|
||||
}
|
||||
|
||||
/*******************************************************************************\
|
||||
* gnc_mainwin_account_tree_toggle_account_expansion *
|
||||
* toggle expans the nominated account to show children (or not) *
|
||||
* *
|
||||
* Args: the account tree *
|
||||
* the account whose children to show/not show *
|
||||
* Returns : nothing *
|
||||
\*******************************************************************************/
|
||||
|
||||
void
|
||||
gnc_mainwin_account_tree_toggle_account_expansion(
|
||||
GNCMainWinAccountTree *mwac_tree, Account *account)
|
||||
{
|
||||
GNCAccountTree *tree = mwac_tree->acc_tree;
|
||||
gnc_account_tree_toggle_account_expansion(tree, account);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
/********************************************************************\
|
||||
* mainwindow-account-tree.h -- composite account selection widget *
|
||||
* wrapped up for the main window *
|
||||
* and callback functions for GnuCash *
|
||||
* Copyright (C) 2000 Gnumatic, Inc. *
|
||||
* Written by Robert Merkel <rgmerk@mira.net> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef GNC_MAINWIN_ACCOUNT_TREE_H
|
||||
#define GNC_MAINWIN_ACCOUNT_TREE_H
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "gnc-account-tree.h"
|
||||
#include "Account.h"
|
||||
|
||||
#define GNC_TYPE_MAINWIN_ACCOUNT_TREE (gnc_mainwin_account_tree_get_type ())
|
||||
#define GNC_MAINWIN_ACCOUNT_TREE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNC_TYPE_MAINWIN_ACCOUNT_TREE, GNCMainWinAccountTree))
|
||||
#define GNC_MAINWIN_ACCOUNT_TREE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GNC_TYPE_MAINWIN_ACCOUNT_TREE, GNCMainWinAccountTreeClass))
|
||||
#define GNC_IS_MAINWIN_ACCOUNT_TREE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNC_TYPE_MAINWIN_ACCOUNT_TREE))
|
||||
|
||||
typedef struct {
|
||||
GtkVBox vbox;
|
||||
GtkScrolledWindow *scrolled_window;
|
||||
GNCAccountTree *acc_tree;
|
||||
} GNCMainWinAccountTree;
|
||||
|
||||
typedef struct {
|
||||
GtkVBoxClass parent_class;
|
||||
|
||||
void (*select_account) (GNCMainWinAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void (*unselect_account) (GNCMainWinAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
void (*activate_account) (GNCMainWinAccountTree *tree,
|
||||
Account *account);
|
||||
} GNCMainWinAccountTreeClass;
|
||||
|
||||
GType gnc_mainwin_account_tree_get_type (void);
|
||||
GtkWidget* gnc_mainwin_account_tree_new (void);
|
||||
|
||||
GtkWidget*
|
||||
gnc_mainwin_account_tree_attach_popup(GNCMainWinAccountTree *tree,
|
||||
GnomeUIInfo *popup_info,
|
||||
gpointer user_data);
|
||||
|
||||
void
|
||||
gnc_mainwin_account_tree_set_view_info(GNCMainWinAccountTree *tree,
|
||||
AccountViewInfo new_info);
|
||||
Account *
|
||||
gnc_mainwin_account_tree_get_current_account(GNCMainWinAccountTree *tree);
|
||||
GList *
|
||||
gnc_mainwin_account_tree_get_current_accounts(GNCMainWinAccountTree *tree);
|
||||
|
||||
void
|
||||
gnc_mainwin_account_tree_toggle_account_expansion (GNCMainWinAccountTree *tree,
|
||||
Account *account);
|
||||
|
||||
#endif /* __GNC_MAINWINDOW_ACCOUNT_TREE_H */
|
||||
@@ -61,6 +61,7 @@
|
||||
#include "gnc-report.h"
|
||||
#include "gnc-split-reg.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnucash-color.h"
|
||||
#include "gnucash-sheet.h"
|
||||
#include "gnucash-style.h"
|
||||
@@ -70,8 +71,6 @@
|
||||
#include "messages.h"
|
||||
#include "split-register.h"
|
||||
#include "top-level.h"
|
||||
/*#include "window-main.h" */
|
||||
#include "window-acct-tree.h"
|
||||
#include "window-register.h"
|
||||
#include "window-report.h"
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,44 +0,0 @@
|
||||
/********************************************************************
|
||||
* window-acct-tree.h -- public account-tree-window functions *
|
||||
* Copyright (C) 1998,1999 Linas Vepstas *
|
||||
* Copyright (C) 2001 Bill Gribble <grib@gnumatic.com> *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of *
|
||||
* the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License*
|
||||
* along with this program; if not, contact: *
|
||||
* *
|
||||
* Free Software Foundation Voice: +1-617-542-5942 *
|
||||
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
********************************************************************/
|
||||
|
||||
#ifndef WINDOW_ACCT_TREE_H
|
||||
#define WINDOW_ACCT_TREE_H
|
||||
|
||||
#include "mainwindow-account-tree.h"
|
||||
#include "window-main.h"
|
||||
|
||||
typedef struct GNCAcctTreeWin_p GNCAcctTreeWin;
|
||||
|
||||
GNCAcctTreeWin * gnc_acct_tree_window_new(const gchar * url);
|
||||
void gnc_acct_tree_window_destroy(GNCAcctTreeWin * win);
|
||||
GtkWidget * gnc_acct_tree_window_get_widget(GNCAcctTreeWin * win);
|
||||
void gnc_acct_tree_window_create_menu(GNCAcctTreeWin * win,
|
||||
GNCMDIChildInfo * child);
|
||||
void gnc_acct_tree_window_create_toolbar(GNCAcctTreeWin * win,
|
||||
GNCMDIChildInfo * child);
|
||||
Account * gnc_acct_tree_window_get_current_account(GNCAcctTreeWin * w);
|
||||
GnomeMDIChild * gnc_acct_tree_window_create_child(const gchar * url);
|
||||
void gnc_main_window_open_accounts(gboolean toplevel);
|
||||
SCM gnc_acct_tree_window_get_options(GNCAcctTreeWin * win);
|
||||
int gnc_acct_tree_window_get_id(GNCAcctTreeWin * win);
|
||||
|
||||
#endif
|
||||
@@ -56,10 +56,8 @@
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-version.h"
|
||||
#include "guile-util.h"
|
||||
#include "mainwindow-account-tree.h"
|
||||
#include "option-util.h"
|
||||
#include "top-level.h"
|
||||
#include "window-acct-tree.h"
|
||||
#include "window-main-summarybar.h"
|
||||
#include "window-main.h"
|
||||
#include "window-reconcile.h"
|
||||
@@ -266,7 +264,6 @@ gnc_main_window_create_child(const gchar * configstring)
|
||||
ENTER(" ");
|
||||
if (!configstring)
|
||||
{
|
||||
gnc_main_window_open_accounts (FALSE);
|
||||
LEAVE("no configstring");
|
||||
return NULL;
|
||||
}
|
||||
@@ -278,9 +275,6 @@ gnc_main_window_create_child(const gchar * configstring)
|
||||
if (!safe_strcmp (type, URL_TYPE_REPORT)) {
|
||||
child = gnc_report_window_create_child(configstring);
|
||||
|
||||
} else if (!safe_strcmp (type, URL_TYPE_ACCTTREE)) {
|
||||
child = gnc_acct_tree_window_create_child(configstring);
|
||||
|
||||
} else {
|
||||
child = NULL;
|
||||
}
|
||||
@@ -488,7 +482,6 @@ gnc_main_window_file_new_window_cb(GtkWidget * widget, gpointer data)
|
||||
{
|
||||
if (!strcmp(mdi->active_child->name, _("Accounts")))
|
||||
{
|
||||
gnc_main_window_open_accounts (TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -775,7 +768,6 @@ gnc_main_window_exit_cb (GtkWidget *widget, gpointer data)
|
||||
static void
|
||||
gnc_main_window_file_new_account_tree_cb(GtkWidget * w, gpointer data)
|
||||
{
|
||||
gnc_main_window_open_accounts(FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user