From bfe58de193d3af2c202c39f58c355973996df2ff Mon Sep 17 00:00:00 2001 From: David Hampton Date: Fri, 24 Oct 2003 06:49:56 +0000 Subject: [PATCH] Move function declarations to the right header file. Document them as well. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9629 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 8 ++ src/AccWindow.h | 70 ----------- src/Makefile.am | 1 - src/business/business-gnome/dialog-invoice.c | 2 +- src/business/business-ledger/gncEntryLedger.c | 2 +- .../business-ledger/gncEntryLedgerControl.c | 2 +- src/gnome-utils/dialog-account.c | 1 - src/gnome-utils/dialog-account.h | 119 +++++++++++++++++- src/gnome-utils/gnc-account-sel.c | 2 +- src/gnome/gnc-split-reg.c | 2 +- src/gnome/top-level.c | 2 +- src/gnome/window-acct-tree.c | 1 - src/gnome/window-reconcile.c | 2 +- src/gnome/window-register.c | 2 +- src/import-export/import-account-matcher.c | 2 +- .../ledger-core/split-register-control.c | 2 +- 16 files changed, 136 insertions(+), 84 deletions(-) delete mode 100644 src/AccWindow.h diff --git a/ChangeLog b/ChangeLog index 21e343029a..4e9d75d2fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-10-23 David Hampton + + * src/AccWindow.h: + * src/gnome-utils/dialog-account.h: Move function declarations to + the right header file. Document them as well. + + * (various): Include the right header file. + 2003-10-23 Derek Atkins * src/app-utils/prefs.scm: diff --git a/src/AccWindow.h b/src/AccWindow.h deleted file mode 100644 index fde1206327..0000000000 --- a/src/AccWindow.h +++ /dev/null @@ -1,70 +0,0 @@ -/********************************************************************\ - * AccWindow.h -- window for creating new accounts for GnuCash * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 2000 Dave Peticolas * - * * - * 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, write to the Free Software * - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * * - * Author: Rob Clark * - * Internet: rclark@cs.hmc.edu * - * Address: 609 8th Street * - * Huntington Beach, CA 92648-4632 * -\********************************************************************/ - -#ifndef ACC_WINDOW_H -#define ACC_WINDOW_H - -#include "config.h" - -#include "Account.h" -#include "Group.h" - - -/** PROTOTYPES ******************************************************/ -typedef struct _AccountWindow AccountWindow; - -AccountWindow * gnc_ui_new_account_window (AccountGroup *group); -AccountWindow * gnc_ui_new_account_window_with_default(AccountGroup *group, - Account * parent); -AccountWindow * gnc_ui_edit_account_window (Account *account); - -/** - * @param unused The AccountGroup to create in; this isn't used. - * @param valid_types A GList of GNCAccountType gints [as pointers] which are - * allowed to be created. Unlike below, this function makes a copy of the - * valid_types list. - **/ -AccountWindow * gnc_ui_new_account_with_types( AccountGroup *unused, - GList *valid_types ); - -Account * gnc_ui_new_accounts_from_name_window (const char *name); - -/* Note that the caller owns the valid_types list */ -Account * gnc_ui_new_accounts_from_name_window_with_types (const char *name, - GList *valid_types); -/* Notes: - -the caller owns the valid_types list - -the parent parameter has priority over the eventual account path in the name - -all parameters can be NULL -*/ -Account * gnc_ui_new_accounts_from_name_with_defaults (const char *name, - GList *valid_types, - gnc_commodity * default_commodity, - Account * parent); - -void gnc_ui_set_default_new_account_currency (const char *currency); - - -#endif /* ACC_WINDOW_H */ diff --git a/src/Makefile.am b/src/Makefile.am index 66bc145798..ea7530a42f 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -36,7 +36,6 @@ SUBDIRS = $(NONGUI_SUBDIRS) report endif noinst_HEADERS = \ - AccWindow.h \ RecnWindow.h \ gnc-ui.h diff --git a/src/business/business-gnome/dialog-invoice.c b/src/business/business-gnome/dialog-invoice.c index 23ed99ca56..23cb0b8435 100644 --- a/src/business/business-gnome/dialog-invoice.c +++ b/src/business/business-gnome/dialog-invoice.c @@ -60,7 +60,7 @@ #include "dialog-payment.h" #include "dialog-tax-table.h" #include "dialog-billterms.h" -#include "AccWindow.h" +#include "dialog-account.h" #include "guile-mappings.h" #include "dialog-query-list.h" diff --git a/src/business/business-ledger/gncEntryLedger.c b/src/business/business-ledger/gncEntryLedger.c index c5b96913e5..2f4059fd2b 100644 --- a/src/business/business-ledger/gncEntryLedger.c +++ b/src/business/business-ledger/gncEntryLedger.c @@ -28,7 +28,7 @@ #include #include "Account.h" -#include "AccWindow.h" +#include "dialog-account.h" #include "gnc-ui-util.h" #include "combocell.h" #include "pricecell.h" diff --git a/src/business/business-ledger/gncEntryLedgerControl.c b/src/business/business-ledger/gncEntryLedgerControl.c index d2f712a9da..fee426dc85 100644 --- a/src/business/business-ledger/gncEntryLedgerControl.c +++ b/src/business/business-ledger/gncEntryLedgerControl.c @@ -28,8 +28,8 @@ #include #include "Account.h" -#include "AccWindow.h" #include "combocell.h" +#include "dialog-account.h" #include "gnc-component-manager.h" #include "gnc-ui.h" #include "gnc-ui-util.h" diff --git a/src/gnome-utils/dialog-account.c b/src/gnome-utils/dialog-account.c index a07d9e90f5..f53a6de55c 100644 --- a/src/gnome-utils/dialog-account.c +++ b/src/gnome-utils/dialog-account.c @@ -27,7 +27,6 @@ #include #include -#include "AccWindow.h" #include "Transaction.h" #include "dialog-account.h" #include "dialog-commodity.h" diff --git a/src/gnome-utils/dialog-account.h b/src/gnome-utils/dialog-account.h index 1510183cbc..12ded6b672 100644 --- a/src/gnome-utils/dialog-account.h +++ b/src/gnome-utils/dialog-account.h @@ -24,7 +24,124 @@ #ifndef DIALOG_ACCOUNT_H #define DIALOG_ACCOUNT_H -#include "AccWindow.h" +#include "config.h" + +#include "Account.h" +#include "Group.h" + +/** @addtogroup GUI + @{ */ + +/** @file dialog-account.h + * + * This file contains the functions to present a gui to the user for + * creating a new account or editing an existing account. + * + * @brief Dialog fo create/edit an account. + * @author Copyright (C) 1997 Robin D. Clark + * @author Copyright (C) 2000 Dave Peticolas + */ + +/** PROTOTYPES ******************************************************/ +typedef struct _AccountWindow AccountWindow; + +/** @name Non-Modal */ +/** @{ */ + +/** Disply a window for editing the attributes of an existing account. + * + * @param group This parameter is not used. + */ +AccountWindow *gnc_ui_edit_account_window (Account *account); + + +/** Disply a window for creating a new account + * + * @param group This parameter is not used. + */ +AccountWindow *gnc_ui_new_account_window (AccountGroup *group); + + +/** Disply a window for creating a new account. This function will + * also initially set the parent account of the new account to what + * the caller specified. The user is free, however, to choose any + * parent account they wish. + * + * @param group This parameter is not used. + * + * @param parent The initially selected parent account. + */ +AccountWindow *gnc_ui_new_account_window_with_default (AccountGroup *group, + Account * parent); + + +/** Disply a window for creating a new account. This function will + * restrict the available account type values to the list specified by the caller. + * + * @param group This parameter is not used. + * + * @param valid_types A GList of GNCAccountType gints [as pointers] + * which are allowed to be created. The calling function is + * responsible for freeing this list. + */ +AccountWindow *gnc_ui_new_account_with_types (AccountGroup *unused, + GList *valid_types); +/** @} */ + + + +/** @name Modal */ +/** @{ */ + +/** Disply a modal window for creating a new account + * + * @param group This parameter is not used. + */ +Account * gnc_ui_new_accounts_from_name_window (const char *name); + +/** Disply a modal window for creating a new account. This function + * will restrict the available account type values to the list + * specified by the caller. + * + * @param name The account name/path to be created. This parameter + * is not used for determining the initially selected parent account. + * + * @param valid_types A GList of GNCAccountType gints [as pointers] + * which are allowed to be created. The calling function is + * responsible for freeing this list. + * + * @return A pointer to the newly created account. + */ +/* Note that the caller owns the valid_types list */ +Account * gnc_ui_new_accounts_from_name_window_with_types (const char *name, + GList *valid_types); + + +/** Disply a modal window for creating a new account. This function + * will restrict the available account type values to the list + * specified by the caller. + * + * @param name The account name/path to be created. This parameter + * is not used for determining the initially selected parent account. + * + * @param valid_types A GList of GNCAccountType gints [as pointers] + * which are allowed to be created. The calling function is + * responsible for freeing this list. + * + * @param default_commodity The commodity to initially select when + * the dialog is presented. + * + * @param parent The initially selected parent account. + * + * @return A pointer to the newly created account. + */ +Account * gnc_ui_new_accounts_from_name_with_defaults (const char *name, + GList *valid_types, + gnc_commodity * default_commodity, + Account * parent); + +/** @} */ +/** @} */ void gnc_ui_edit_account_window_raise (AccountWindow * winData); diff --git a/src/gnome-utils/gnc-account-sel.c b/src/gnome-utils/gnc-account-sel.c index 317c93fb75..8f5c21f66a 100644 --- a/src/gnome-utils/gnc-account-sel.c +++ b/src/gnome-utils/gnc-account-sel.c @@ -24,7 +24,7 @@ #include "config.h" -#include "AccWindow.h" +#include "dialog-account.h" #include "GNCId.h" #include "gnc-account-sel.h" #include "gnc-exp-parser.h" diff --git a/src/gnome/gnc-split-reg.c b/src/gnome/gnc-split-reg.c index a2310f19f4..695af75d88 100644 --- a/src/gnome/gnc-split-reg.c +++ b/src/gnome/gnc-split-reg.c @@ -36,9 +36,9 @@ #include "window-register.h" #include "Account.h" -#include "AccWindow.h" #include "QueryNew.h" #include "SX-book.h" +#include "dialog-account.h" #include "dialog-scheduledxaction.h" #include "dialog-sx-from-trans.h" #include "global-options.h" diff --git a/src/gnome/top-level.c b/src/gnome/top-level.c index 51658fdbad..a3720aca9d 100644 --- a/src/gnome/top-level.c +++ b/src/gnome/top-level.c @@ -31,10 +31,10 @@ #include #include -#include "AccWindow.h" #include "TransLog.h" #include "backend/gnc-backend-api.h" #include "combocell.h" +#include "dialog-account.h" #include "dialog-commodity.h" #include "dialog-options.h" #include "dialog-transfer.h" diff --git a/src/gnome/window-acct-tree.c b/src/gnome/window-acct-tree.c index 79a5e60409..bc12d157b5 100644 --- a/src/gnome/window-acct-tree.c +++ b/src/gnome/window-acct-tree.c @@ -29,7 +29,6 @@ #include #include "guile-mappings.h" -#include "AccWindow.h" #include "Scrub.h" #include "Scrub3.h" #include "dialog-account.h" diff --git a/src/gnome/window-reconcile.c b/src/gnome/window-reconcile.c index 1b313c7b28..039a80cf8d 100644 --- a/src/gnome/window-reconcile.c +++ b/src/gnome/window-reconcile.c @@ -36,8 +36,8 @@ #include #include -#include "AccWindow.h" #include "Scrub.h" +#include "dialog-account.h" #include "dialog-transfer.h" #include "dialog-utils.h" #include "dialog-transfer.h" diff --git a/src/gnome/window-register.c b/src/gnome/window-register.c index b85f3a6fa9..020d6dbcfe 100644 --- a/src/gnome/window-register.c +++ b/src/gnome/window-register.c @@ -33,8 +33,8 @@ #include #include -#include "AccWindow.h" #include "Scrub.h" +#include "dialog-account.h" #include "dialog-fincalc.h" #include "dialog-find-transactions.h" #include "dialog-transfer.h" diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index 4fb0406872..ceb9fb5fde 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -36,8 +36,8 @@ #include #include "import-account-matcher.h" #include "import-utilities.h" +#include "dialog-account.h" #include "dialog-utils.h" -#include "AccWindow.h" #include "gnc-commodity.h" #include "gnc-engine-util.h" diff --git a/src/register/ledger-core/split-register-control.c b/src/register/ledger-core/split-register-control.c index 996577f042..81c56a113e 100644 --- a/src/register/ledger-core/split-register-control.c +++ b/src/register/ledger-core/split-register-control.c @@ -22,7 +22,7 @@ #include "config.h" -#include "AccWindow.h" +#include "dialog-account.h" #include "Group.h" #include "Scrub.h" #include "combocell.h"