2001-05-18 Dave Peticolas <dave@krondo.com>

* src/doc/design/engine.texinfo: update docs

	* src/gnome/dialog-price-editor.c: add button to remove
	prices before a user-entered date.

	* src/gnome/file-history.c: fix for menu changes

	* src/scm/report.scm: move reports menu to top-level


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4238 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas
2001-05-18 10:00:14 +00:00
parent 353671c67e
commit c5dfd2b881
8 changed files with 148 additions and 14 deletions

View File

@@ -1,3 +1,14 @@
2001-05-18 Dave Peticolas <dave@krondo.com>
* src/doc/design/engine.texinfo: update docs
* src/gnome/dialog-price-editor.c: add button to remove
prices before a user-entered date.
* src/gnome/file-history.c: fix for menu changes
* src/scm/report.scm: move reports menu to top-level
2001-05-17 James LewisMoss <jimdres@mindspring.com>
* src/engine/Makefile.am (libgncengine_la_SOURCES): remove

View File

@@ -1776,7 +1776,6 @@ Possible values are:
@item ASSET
Denotes a generic asset account.
@item LIABILITY
Denotes a generic liability account.
@@ -2024,6 +2023,15 @@ Return a @code{GList} of the Splits in @var{account}. This list must
not be modified in any way.
@end deftypefun
@deftypefun {char *} xaccAccountGetFullName (Account * @var{account}, const char @var{separator})
Returns the fully qualified name of @var{account} using the given
separator character. The name must be g_freed after use. The fully
qualified name of an account is the concatenation of the names of the
account and all its ancestor accounts starting with the topmost account
and ending with the given account. Each name is separated by the given
character.
@end deftypefun
@node Account Tax API, , Account Getters, Accounts
@subsection Account Tax API
@@ -2067,6 +2075,26 @@ Set the payer name source associated with @var{account}.
@section Account Groups
@tindex AccountGroup
Account Groups are used by the Engine to connect Accounts
together into an Account hierarchy. Account Groups do not
correspond to any accounting concept -- they are specific
to the GnuCash engine. Account Groups contain the following
pieces of information:
@table @asis
@item A list of Accounts
The list Accounts in the Group.
@item A not-saved flag
Indicates whether any information in the hierarchy
rooted at the Group needs to be saved. That includes
Accounts, Splits, and Transactions.
@end table
Account Groups do not have key-value frames or GUIDs.
@node GNCBooks, Scrub, Account Groups, Engine
@section GNCBooks

View File

@@ -172,7 +172,7 @@ gnc_numeric xaccGroupGetBalance (AccountGroup *group);
* The xaccGetAccountRoot () subroutine will find the topmost
* (root) group to which this account belongs.
*/
AccountGroup * xaccGetAccountRoot (Account *group);
AccountGroup * xaccGetAccountRoot (Account *account);
/* The xaccGroupGetParentAccount() subroutine returns the parent
* account of the group, or NULL.

View File

@@ -58,6 +58,7 @@ typedef struct
GtkWidget * price_list;
GtkWidget * edit_button;
GtkWidget * remove_button;
GtkWidget * remove_old_button;
GtkWidget * commodity_edit;
GtkWidget * currency_edit;
@@ -242,6 +243,7 @@ gnc_prices_load_prices (PricesDialog *pdb_dialog)
gtk_widget_set_sensitive (pdb_dialog->edit_button, prices != NULL);
gtk_widget_set_sensitive (pdb_dialog->remove_button, prices != NULL);
gtk_widget_set_sensitive (pdb_dialog->remove_old_button, prices != NULL);
return g_list_length (prices);
}
@@ -523,6 +525,69 @@ remove_clicked (GtkWidget *widget, gpointer data)
}
}
static void
remove_old_clicked (GtkWidget *widget, gpointer data)
{
PricesDialog *pdb_dialog = data;
GtkWidget *dialog;
GtkWidget *label;
GtkWidget *date;
GtkWidget *vbox;
gint result;
dialog = gnome_dialog_new (_("Remove old prices"),
GNOME_STOCK_BUTTON_OK,
GNOME_STOCK_BUTTON_CANCEL,
NULL);
gnome_dialog_set_parent (GNOME_DIALOG (dialog),
GTK_WINDOW (pdb_dialog->dialog));
gnome_dialog_close_hides (GNOME_DIALOG (dialog), FALSE);
vbox = GNOME_DIALOG (dialog)->vbox;
gtk_box_set_spacing (GTK_BOX (vbox), 3);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 3);
label = gtk_label_new (_("All prices before the date below "
"will be deleted."));
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
date = gnc_date_edit_new (time (NULL), FALSE, FALSE);
gtk_object_ref (GTK_OBJECT (date));
gtk_object_sink (GTK_OBJECT (date));
gtk_box_pack_start (GTK_BOX (vbox), date, FALSE, FALSE, 0);
gtk_widget_show (date);
result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
if (result == 0)
{
GNCBook *book = gncGetCurrentBook ();
GNCPriceDB *pdb = gnc_book_get_pricedb (book);
GList *node;
Timespec ts;
ts.tv_sec = gnc_date_edit_get_date (date);
ts.tv_nsec = 0;
for (node = pdb_dialog->prices; node; node = node->next)
{
GNCPrice *price = node->data;
Timespec pt = gnc_price_get_time (price);;
if (timespec_cmp (&pt, &ts) < 0)
gnc_pricedb_remove_price (pdb, price);
}
gnc_gui_refresh_all ();
}
gtk_object_unref (date);
}
static void
add_clicked (GtkWidget *widget, gpointer data)
{
@@ -588,6 +653,8 @@ gnc_prices_select_price_cb (GtkCList *clist, gint row, gint col,
pdb_dialog->price != NULL);
gtk_widget_set_sensitive (pdb_dialog->remove_button,
pdb_dialog->price != NULL);
gtk_widget_set_sensitive (pdb_dialog->remove_old_button,
pdb_dialog->price != NULL);
gnc_prices_set_changed (pdb_dialog, FALSE);
}
@@ -605,6 +672,7 @@ gnc_prices_unselect_price_cb (GtkCTree *ctre, gint row, gint col,
gtk_widget_set_sensitive (pdb_dialog->edit_button, FALSE);
gtk_widget_set_sensitive (pdb_dialog->remove_button, FALSE);
gtk_widget_set_sensitive (pdb_dialog->remove_old_button, FALSE);
gnc_prices_set_changed (pdb_dialog, FALSE);
}
@@ -841,6 +909,12 @@ gnc_prices_dialog_create (GtkWidget * parent, PricesDialog *pdb_dialog)
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (remove_clicked), pdb_dialog);
button = lookup_widget (dialog, "remove_old_button");
pdb_dialog->remove_old_button = button;
gtk_signal_connect (GTK_OBJECT (button), "clicked",
GTK_SIGNAL_FUNC (remove_old_clicked), pdb_dialog);
button = lookup_widget (dialog, "add_button");
gtk_signal_connect (GTK_OBJECT (button), "clicked",

View File

@@ -197,7 +197,7 @@ gnc_history_update_menu(GnomeApp * app)
if (!gnome_app_find_menu_pos (menushell, GNOME_MENU_FILE_PATH, &pos))
return;
path = g_strdup_printf("%s%s", GNOME_MENU_FILE_PATH, "New _Report");
path = g_strdup_printf("%s%s", GNOME_MENU_FILE_PATH, "New _Account Tree");
if (!gnome_app_find_menu_pos (menushell, path, &pos))
return;

View File

@@ -7327,6 +7327,7 @@ create_Prices_Dialog (void)
GtkWidget *hbuttonbox5;
GtkWidget *add_button;
GtkWidget *remove_button;
GtkWidget *remove_old_button;
GtkWidget *edit_button;
GtkWidget *get_quotes_button;
GtkWidget *hbuttonbox4;
@@ -7455,6 +7456,8 @@ create_Prices_Dialog (void)
gtk_widget_show (hbuttonbox5);
gtk_box_pack_start (GTK_BOX (vbox122), hbuttonbox5, FALSE, FALSE, 0);
gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox5), GTK_BUTTONBOX_SPREAD);
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox5), 20);
gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox5), 50, 27);
add_button = gtk_button_new_with_label (_("Add"));
gtk_widget_ref (add_button);
@@ -7474,6 +7477,15 @@ create_Prices_Dialog (void)
GTK_WIDGET_SET_FLAGS (remove_button, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, remove_button, _("Remove the current price"), NULL);
remove_old_button = gtk_button_new_with_label (_("Remove Old..."));
gtk_widget_ref (remove_old_button);
gtk_object_set_data_full (GTK_OBJECT (Prices_Dialog), "remove_old_button", remove_old_button,
(GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (remove_old_button);
gtk_container_add (GTK_CONTAINER (hbuttonbox5), remove_old_button);
GTK_WIDGET_SET_FLAGS (remove_old_button, GTK_CAN_DEFAULT);
gtk_tooltips_set_tip (tooltips, remove_old_button, _("Remove prices older than a user-entered date"), NULL);
edit_button = gtk_button_new_with_label (_("Edit"));
gtk_widget_ref (edit_button);
gtk_object_set_data_full (GTK_OBJECT (Prices_Dialog), "edit_button", edit_button,

View File

@@ -11052,8 +11052,8 @@ quit without making any changes.</text>
<class>GtkHButtonBox</class>
<name>hbuttonbox5</name>
<layout_style>GTK_BUTTONBOX_SPREAD</layout_style>
<spacing>30</spacing>
<child_min_width>85</child_min_width>
<spacing>20</spacing>
<child_min_width>50</child_min_width>
<child_min_height>27</child_min_height>
<child_ipad_x>7</child_ipad_x>
<child_ipad_y>0</child_ipad_y>
@@ -11083,6 +11083,16 @@ quit without making any changes.</text>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>remove_old_button</name>
<tooltip>Remove prices older than a user-entered date</tooltip>
<can_default>True</can_default>
<can_focus>True</can_focus>
<label>Remove Old...</label>
<relief>GTK_RELIEF_NORMAL</relief>
</widget>
<widget>
<class>GtkButton</class>
<name>edit_button</name>

View File

@@ -39,6 +39,7 @@
(define *gnc:_report-next-serial_* 0)
;; Define those strings here to make changes easier and avoid typos.
(define gnc:menuname-reports (N_ "_Reports"))
(define gnc:menuname-asset-liability
(N_ "_Assets & Liabilities"))
(define gnc:menuname-income-expense
@@ -51,24 +52,22 @@
(define gnc:optname-reportname (N_ "Report name"))
(define (gnc:report-menu-setup)
;; since this menu gets added to every child window, we say it
;; comes after the "_File" menu.
(define menu (gnc:make-menu (N_ "New _Report")
(list "_File" "New _Account Tree")))
(define menu (gnc:make-menu gnc:menuname-reports (list "_File")))
(define menu-namer (gnc:new-menu-namer))
(define tax-menu (gnc:make-menu gnc:menuname-taxes
(list "_File" "New _Report" "")))
(list gnc:menuname-reports "")))
(define income-expense-menu
(gnc:make-menu gnc:menuname-income-expense
(list "_File" "New _Report" "")))
(list gnc:menuname-reports "")))
(define asset-liability-menu
(gnc:make-menu gnc:menuname-asset-liability
(list "_File" "New _Report" "")))
(list gnc:menuname-reports "")))
(define utility-menu
(gnc:make-menu gnc:menuname-utility
(list "_File" "New _Report" "")))
(list gnc:menuname-reports "")))
(define menu-hash (make-hash-table 23))
(define (add-report-menu-item name report)
@@ -84,7 +83,7 @@
(set! menu-path
(append menu-path '(""))))
(set! menu-path (append (list "_File" "New _Report") menu-path))
(set! menu-path (append (list gnc:menuname-reports) menu-path))
(if menu-name (set! name menu-name))
@@ -127,7 +126,7 @@
(gnc:make-menu-item
((menu-namer 'add-name) (_ "Welcome Extravaganza"))
(_ "Welcome-to-GnuCash screen")
(list "_File" "New _Report" gnc:menuname-utility "")
(list gnc:menuname-reports gnc:menuname-utility "")
(lambda ()
(gnc:make-welcome-report)))))