mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/guile/gnucash.c.in (gnc_main): change from main
function so other executables can link with this lib * src/gnc-main.c: new file with gnucash main * src/test/test-stuff.c: add api to turn on success printing * src/test/test-exp-parser.c: new test file for testing expression parser * src/scm/report/income-or-expense-pie.scm: display totals in legend * src/gnome/druid-stock-split.c: check for proper currencies on income & asset accounts. allow price to be recorded. * src/gnome/account-tree.c: add api for setting selectability with a filter function * src/engine/Group.c (xaccGroupRemoveAccount): check for group/account mismatch git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3819 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
96372a16ed
commit
7ae5e34ed6
34
ChangeLog
34
ChangeLog
@ -1,3 +1,37 @@
|
|||||||
|
2001-03-22 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
|
* src/guile/gnucash.c.in (gnc_main): change from main
|
||||||
|
function so other executables can link with this lib
|
||||||
|
|
||||||
|
* src/gnc-main.c: new file with gnucash main
|
||||||
|
|
||||||
|
* src/test/test-stuff.c: add api to turn on success printing
|
||||||
|
|
||||||
|
* src/test/test-exp-parser.c: new test file for testing
|
||||||
|
expression parser
|
||||||
|
|
||||||
|
* src/scm/report/income-or-expense-pie.scm: display totals
|
||||||
|
in legend
|
||||||
|
|
||||||
|
* src/gnome/druid-stock-split.c: check for proper currencies
|
||||||
|
on income & asset accounts. allow price to be recorded.
|
||||||
|
|
||||||
|
* src/gnome/account-tree.c: add api for setting selectability
|
||||||
|
with a filter function
|
||||||
|
|
||||||
|
* src/engine/Group.c (xaccGroupRemoveAccount): check for
|
||||||
|
group/account mismatch
|
||||||
|
|
||||||
|
2001-03-21 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
|
* src/scm/date-utilities.scm: set isdst to -1 before calling
|
||||||
|
mktime
|
||||||
|
|
||||||
|
* src/gnome/window-main.c: put summary info on left side
|
||||||
|
|
||||||
|
* src/gnome/gtkselect.c: don't display button unless there is
|
||||||
|
something to select. put button on left side
|
||||||
|
|
||||||
2001-03-22 Robert Graham Merkel <rgmerk@mira.net>
|
2001-03-22 Robert Graham Merkel <rgmerk@mira.net>
|
||||||
|
|
||||||
* src/scm/date-utilities.scm (moddate): set is-dst to unknown to
|
* src/scm/date-utilities.scm (moddate): set is-dst to unknown to
|
||||||
|
@ -48,6 +48,7 @@ gnucash_SOURCES = \
|
|||||||
FileDialog.c \
|
FileDialog.c \
|
||||||
gnc-component-manager.c \
|
gnc-component-manager.c \
|
||||||
gnc-exp-parser.c \
|
gnc-exp-parser.c \
|
||||||
|
gnc-main.c \
|
||||||
gnc-ui-util.c
|
gnc-ui-util.c
|
||||||
|
|
||||||
noinst_HEADERS = \
|
noinst_HEADERS = \
|
||||||
|
@ -560,6 +560,12 @@ xaccGroupRemoveAccount (AccountGroup *grp, Account *acc)
|
|||||||
* are not yet parented. */
|
* are not yet parented. */
|
||||||
if (!grp) return;
|
if (!grp) return;
|
||||||
|
|
||||||
|
if (acc->parent != grp)
|
||||||
|
{
|
||||||
|
PERR ("account not in group");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
acc->parent = NULL;
|
acc->parent = NULL;
|
||||||
|
|
||||||
grp->accounts = g_list_remove (grp->accounts, acc);
|
grp->accounts = g_list_remove (grp->accounts, acc);
|
||||||
|
31
src/gnc-main.c
Normal file
31
src/gnc-main.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/********************************************************************\
|
||||||
|
* gnc-main.c -- GnuCash main routine *
|
||||||
|
* Copyright (C) 2001 Gnumatic, Inc. *
|
||||||
|
* *
|
||||||
|
* 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 "gnucash.h"
|
||||||
|
|
||||||
|
int
|
||||||
|
main (int argc, char *argv[])
|
||||||
|
{
|
||||||
|
return gnc_main (argc, argv);
|
||||||
|
}
|
@ -174,8 +174,10 @@ gnc_account_tree_init (GNCAccountTree *tree)
|
|||||||
tree->root_account = *xaccGUIDNULL ();
|
tree->root_account = *xaccGUIDNULL ();
|
||||||
tree->current_accounts = NULL;
|
tree->current_accounts = NULL;
|
||||||
tree->ignore_unselect = FALSE;
|
tree->ignore_unselect = FALSE;
|
||||||
tree->filter = NULL;
|
tree->view_filter = NULL;
|
||||||
tree->filter_data = NULL;
|
tree->view_filter_data = NULL;
|
||||||
|
tree->selectable_filter = NULL;
|
||||||
|
tree->selectable_filter_data = NULL;
|
||||||
|
|
||||||
gnc_init_account_view_info(&tree->avi);
|
gnc_init_account_view_info(&tree->avi);
|
||||||
|
|
||||||
@ -894,8 +896,8 @@ gnc_init_account_view_info(AccountViewInfo *avi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/********************************************************************\
|
/********************************************************************\
|
||||||
* gnc_account_tree_set_filter *
|
* gnc_account_tree_set_view_filter *
|
||||||
* sets the account filter to use with the tree *
|
* sets the account view filter to use with the tree *
|
||||||
* *
|
* *
|
||||||
* Args: tree - the tree to set the filter on *
|
* Args: tree - the tree to set the filter on *
|
||||||
* filter - the filter function to use *
|
* filter - the filter function to use *
|
||||||
@ -903,15 +905,36 @@ gnc_init_account_view_info(AccountViewInfo *avi)
|
|||||||
* Returns: nothing *
|
* Returns: nothing *
|
||||||
\********************************************************************/
|
\********************************************************************/
|
||||||
void
|
void
|
||||||
gnc_account_tree_set_filter(GNCAccountTree *tree,
|
gnc_account_tree_set_view_filter(GNCAccountTree *tree,
|
||||||
AccountFilter filter,
|
AccountFilter filter,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
g_return_if_fail(tree != NULL);
|
g_return_if_fail(tree != NULL);
|
||||||
g_return_if_fail(IS_GNC_ACCOUNT_TREE(tree));
|
g_return_if_fail(IS_GNC_ACCOUNT_TREE(tree));
|
||||||
|
|
||||||
tree->filter = filter;
|
tree->view_filter = filter;
|
||||||
tree->filter_data = user_data;
|
tree->view_filter_data = user_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
/********************************************************************\
|
||||||
|
* gnc_account_tree_set_selectable_filter *
|
||||||
|
* sets the account selectable filter to use with the tree *
|
||||||
|
* *
|
||||||
|
* Args: tree - the tree to set the filter on *
|
||||||
|
* filter - the filter function to use *
|
||||||
|
* user_data - the user_data for the callback *
|
||||||
|
* Returns: nothing *
|
||||||
|
\********************************************************************/
|
||||||
|
void
|
||||||
|
gnc_account_tree_set_selectable_filter (GNCAccountTree *tree,
|
||||||
|
AccountFilter filter,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
g_return_if_fail(tree != NULL);
|
||||||
|
g_return_if_fail(IS_GNC_ACCOUNT_TREE(tree));
|
||||||
|
|
||||||
|
tree->selectable_filter = filter;
|
||||||
|
tree->selectable_filter_data = user_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -1087,8 +1110,8 @@ gnc_account_tree_fill(GNCAccountTree *tree,
|
|||||||
PINFO ("acct=%p guid=%s\n",
|
PINFO ("acct=%p guid=%s\n",
|
||||||
account, guid_to_string(xaccAccountGetGUID(account)));
|
account, guid_to_string(xaccAccountGetGUID(account)));
|
||||||
|
|
||||||
if (tree->filter != NULL)
|
if (tree->view_filter != NULL)
|
||||||
if (!tree->filter(account, tree->filter_data))
|
if (!tree->view_filter(account, tree->view_filter_data))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
type = xaccAccountGetType(account);
|
type = xaccAccountGetType(account);
|
||||||
@ -1098,12 +1121,21 @@ gnc_account_tree_fill(GNCAccountTree *tree,
|
|||||||
|
|
||||||
node = gnc_account_tree_insert_row(tree, parent, NULL, account);
|
node = gnc_account_tree_insert_row(tree, parent, NULL, account);
|
||||||
|
|
||||||
|
if (tree->selectable_filter != NULL)
|
||||||
|
{
|
||||||
|
gboolean selectable;
|
||||||
|
|
||||||
|
selectable = tree->selectable_filter (account,
|
||||||
|
tree->selectable_filter_data);
|
||||||
|
|
||||||
|
gtk_ctree_node_set_selectable (GTK_CTREE(tree), node, selectable);
|
||||||
|
}
|
||||||
|
|
||||||
if (g_hash_table_lookup(expanded_accounts, account) != NULL)
|
if (g_hash_table_lookup(expanded_accounts, account) != NULL)
|
||||||
gtk_ctree_expand(GTK_CTREE(tree), node);
|
gtk_ctree_expand(GTK_CTREE(tree), node);
|
||||||
|
|
||||||
/* If this account has children,
|
/* If this account has children,
|
||||||
* then we need to build a subtree and fill it.
|
* then we need to build a subtree and fill it. */
|
||||||
*/
|
|
||||||
acc_children = xaccAccountGetChildren(account);
|
acc_children = xaccAccountGetChildren(account);
|
||||||
if (xaccAccountGetChildren(account) != NULL)
|
if (xaccAccountGetChildren(account) != NULL)
|
||||||
gnc_account_tree_fill(tree, expanded_accounts, node, acc_children);
|
gnc_account_tree_fill(tree, expanded_accounts, node, acc_children);
|
||||||
|
@ -55,8 +55,11 @@ struct _GNCAccountTree
|
|||||||
{
|
{
|
||||||
GtkCTree ctree;
|
GtkCTree ctree;
|
||||||
|
|
||||||
AccountFilter filter;
|
AccountFilter view_filter;
|
||||||
gpointer filter_data;
|
gpointer view_filter_data;
|
||||||
|
|
||||||
|
AccountFilter selectable_filter;
|
||||||
|
gpointer selectable_filter_data;
|
||||||
|
|
||||||
AccountViewInfo avi;
|
AccountViewInfo avi;
|
||||||
|
|
||||||
@ -155,7 +158,11 @@ void gnc_account_tree_set_view_info (GNCAccountTree *tree,
|
|||||||
void gnc_account_tree_get_view_info (GNCAccountTree *tree,
|
void gnc_account_tree_get_view_info (GNCAccountTree *tree,
|
||||||
AccountViewInfo *info);
|
AccountViewInfo *info);
|
||||||
|
|
||||||
void gnc_account_tree_set_filter (GNCAccountTree *tree,
|
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,
|
AccountFilter filter,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
|
|
||||||
|
@ -71,14 +71,20 @@ gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type)
|
|||||||
static void
|
static void
|
||||||
set_cursor_helper (gpointer window, gpointer data)
|
set_cursor_helper (gpointer window, gpointer data)
|
||||||
{
|
{
|
||||||
GtkWidget *widget = GTK_WIDGET(window);
|
GtkWidget *widget;
|
||||||
int type = GPOINTER_TO_INT(data);
|
int type;
|
||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
widget = GTK_WIDGET(window);
|
||||||
|
if (!widget->window)
|
||||||
|
return;
|
||||||
|
|
||||||
|
type = GPOINTER_TO_INT(data);
|
||||||
|
|
||||||
gnc_ui_set_cursor (widget->window, type);
|
gnc_ui_set_cursor (widget->window, type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "glade-support.h"
|
#include "glade-support.h"
|
||||||
#include "gnc-amount-edit.h"
|
#include "gnc-amount-edit.h"
|
||||||
#include "gnc-component-manager.h"
|
#include "gnc-component-manager.h"
|
||||||
|
#include "gnc-currency-edit.h"
|
||||||
#include "gnc-dateedit.h"
|
#include "gnc-dateedit.h"
|
||||||
#include "gnc-exp-parser.h"
|
#include "gnc-exp-parser.h"
|
||||||
#include "gnc-ui.h"
|
#include "gnc-ui.h"
|
||||||
@ -58,6 +59,7 @@ typedef struct
|
|||||||
GtkWidget * distribution_edit;
|
GtkWidget * distribution_edit;
|
||||||
GtkWidget * description_entry;
|
GtkWidget * description_entry;
|
||||||
GtkWidget * price_edit;
|
GtkWidget * price_edit;
|
||||||
|
GtkWidget * price_currency_edit;
|
||||||
|
|
||||||
/* cash in lieu page data */
|
/* cash in lieu page data */
|
||||||
GtkWidget * cash_edit;
|
GtkWidget * cash_edit;
|
||||||
@ -181,6 +183,10 @@ refresh_details_page (StockSplitInfo *info)
|
|||||||
print_info);
|
print_info);
|
||||||
gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->distribution_edit),
|
gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (info->distribution_edit),
|
||||||
xaccAccountGetSecuritySCU (account));
|
xaccAccountGetSecuritySCU (account));
|
||||||
|
|
||||||
|
gnc_currency_edit_set_currency
|
||||||
|
(GNC_CURRENCY_EDIT (info->price_currency_edit),
|
||||||
|
xaccAccountGetCurrency (account));
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -346,6 +352,7 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
Transaction *trans;
|
Transaction *trans;
|
||||||
Account *account;
|
Account *account;
|
||||||
Split *split;
|
Split *split;
|
||||||
|
time_t date;
|
||||||
|
|
||||||
account = xaccAccountLookup (&info->account);
|
account = xaccAccountLookup (&info->account);
|
||||||
g_return_if_fail (account != NULL);
|
g_return_if_fail (account != NULL);
|
||||||
@ -360,12 +367,8 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
|
|
||||||
xaccTransBeginEdit (trans);
|
xaccTransBeginEdit (trans);
|
||||||
|
|
||||||
{
|
|
||||||
time_t date;
|
|
||||||
|
|
||||||
date = gnc_date_edit_get_date (GNC_DATE_EDIT (info->date_edit));
|
date = gnc_date_edit_get_date (GNC_DATE_EDIT (info->date_edit));
|
||||||
xaccTransSetDateSecs (trans, date);
|
xaccTransSetDateSecs (trans, date);
|
||||||
}
|
|
||||||
|
|
||||||
{
|
{
|
||||||
const char *description;
|
const char *description;
|
||||||
@ -390,8 +393,34 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
|
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->price_edit));
|
||||||
if (gnc_numeric_positive_p (amount))
|
if (gnc_numeric_positive_p (amount))
|
||||||
{
|
{
|
||||||
const char *message = "FIXME: we need the pricedb to record.";
|
GNCBook *book;
|
||||||
gnc_error_dialog_parented (GTK_WINDOW (info->window), message);
|
GNCPrice *price;
|
||||||
|
GNCPriceDB *pdb;
|
||||||
|
GNCCurrencyEdit *ce;
|
||||||
|
Timespec ts;
|
||||||
|
|
||||||
|
ce = GNC_CURRENCY_EDIT (info->price_currency_edit);
|
||||||
|
|
||||||
|
ts.tv_sec = date;
|
||||||
|
ts.tv_nsec = 0;
|
||||||
|
|
||||||
|
price = gnc_price_create ();
|
||||||
|
|
||||||
|
gnc_price_set_commodity (price, xaccAccountGetSecurity (account));
|
||||||
|
gnc_price_set_currency (price, gnc_currency_edit_get_currency (ce));
|
||||||
|
gnc_price_set_time (price, ts);
|
||||||
|
gnc_price_set_source (price, "user:stock-split");
|
||||||
|
gnc_price_set_type (price, "unknown");
|
||||||
|
gnc_price_set_value (price, amount);
|
||||||
|
|
||||||
|
book = gncGetCurrentBook ();
|
||||||
|
pdb = gnc_book_get_pricedb (book);
|
||||||
|
|
||||||
|
if (!gnc_pricedb_add_price (pdb, price))
|
||||||
|
gnc_error_dialog_parented (GTK_WINDOW (info->window),
|
||||||
|
_("Error adding price."));
|
||||||
|
|
||||||
|
gnc_price_unref (price);
|
||||||
}
|
}
|
||||||
|
|
||||||
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
|
amount = gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (info->cash_edit));
|
||||||
@ -401,7 +430,6 @@ stock_split_finish (GnomeDruidPage *druidpage,
|
|||||||
|
|
||||||
memo = gtk_entry_get_text (GTK_ENTRY (info->memo_entry));
|
memo = gtk_entry_get_text (GTK_ENTRY (info->memo_entry));
|
||||||
|
|
||||||
|
|
||||||
/* asset split */
|
/* asset split */
|
||||||
account = gnc_account_tree_get_current_account
|
account = gnc_account_tree_get_current_account
|
||||||
(GNC_ACCOUNT_TREE (info->asset_tree));
|
(GNC_ACCOUNT_TREE (info->asset_tree));
|
||||||
@ -459,6 +487,19 @@ druid_cancel (GnomeDruid *druid, gpointer user_data)
|
|||||||
gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
|
gnc_close_gui_component_by_data (DRUID_STOCK_SPLIT_CM_CLASS, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
account_currency_filter (Account *account, gpointer user_data)
|
||||||
|
{
|
||||||
|
StockSplitInfo *info = user_data;
|
||||||
|
Account *split_account = xaccAccountLookup (&info->account);
|
||||||
|
|
||||||
|
if (!account)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
return gnc_commodity_equiv (xaccAccountGetCurrency (split_account),
|
||||||
|
xaccAccountGetCurrency (account));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_stock_split_druid_create (StockSplitInfo *info)
|
gnc_stock_split_druid_create (StockSplitInfo *info)
|
||||||
{
|
{
|
||||||
@ -498,6 +539,7 @@ gnc_stock_split_druid_create (StockSplitInfo *info)
|
|||||||
GtkWidget *box;
|
GtkWidget *box;
|
||||||
GtkWidget *amount;
|
GtkWidget *amount;
|
||||||
GtkWidget *date;
|
GtkWidget *date;
|
||||||
|
GtkWidget *ce;
|
||||||
|
|
||||||
info->description_entry =
|
info->description_entry =
|
||||||
lookup_widget (info->window, "description_entry");
|
lookup_widget (info->window, "description_entry");
|
||||||
@ -516,9 +558,15 @@ gnc_stock_split_druid_create (StockSplitInfo *info)
|
|||||||
amount = gnc_amount_edit_new ();
|
amount = gnc_amount_edit_new ();
|
||||||
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (amount),
|
gnc_amount_edit_set_print_info (GNC_AMOUNT_EDIT (amount),
|
||||||
gnc_default_price_print_info ());
|
gnc_default_price_print_info ());
|
||||||
|
gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (amount), TRUE);
|
||||||
gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (box), amount, TRUE, TRUE, 0);
|
||||||
info->price_edit = amount;
|
info->price_edit = amount;
|
||||||
|
|
||||||
|
box = lookup_widget (info->window, "price_currency_box");
|
||||||
|
ce = gnc_currency_edit_new ();
|
||||||
|
gtk_box_pack_start (GTK_BOX (box), ce, TRUE, TRUE, 0);
|
||||||
|
info->price_currency_edit = ce;
|
||||||
|
|
||||||
page = lookup_widget (info->window, "details_page");
|
page = lookup_widget (info->window, "details_page");
|
||||||
|
|
||||||
gtk_signal_connect (GTK_OBJECT (page), "next",
|
gtk_signal_connect (GTK_OBJECT (page), "next",
|
||||||
@ -555,6 +603,10 @@ gnc_stock_split_druid_create (StockSplitInfo *info)
|
|||||||
|
|
||||||
gnc_account_tree_set_view_info (GNC_ACCOUNT_TREE (tree), &view_info);
|
gnc_account_tree_set_view_info (GNC_ACCOUNT_TREE (tree), &view_info);
|
||||||
|
|
||||||
|
gnc_account_tree_set_selectable_filter (GNC_ACCOUNT_TREE (tree),
|
||||||
|
account_currency_filter,
|
||||||
|
info);
|
||||||
|
|
||||||
gtk_widget_show (tree);
|
gtk_widget_show (tree);
|
||||||
|
|
||||||
scroll = lookup_widget (info->window, "income_scroll");
|
scroll = lookup_widget (info->window, "income_scroll");
|
||||||
@ -576,6 +628,10 @@ gnc_stock_split_druid_create (StockSplitInfo *info)
|
|||||||
|
|
||||||
gnc_account_tree_set_view_info (GNC_ACCOUNT_TREE (tree), &view_info);
|
gnc_account_tree_set_view_info (GNC_ACCOUNT_TREE (tree), &view_info);
|
||||||
|
|
||||||
|
gnc_account_tree_set_selectable_filter (GNC_ACCOUNT_TREE (tree),
|
||||||
|
account_currency_filter,
|
||||||
|
info);
|
||||||
|
|
||||||
gtk_widget_show (tree);
|
gtk_widget_show (tree);
|
||||||
|
|
||||||
scroll = lookup_widget (info->window, "asset_scroll");
|
scroll = lookup_widget (info->window, "asset_scroll");
|
||||||
|
@ -6175,8 +6175,12 @@ create_Stock_Split_Druid (void)
|
|||||||
GtkWidget *hseparator2;
|
GtkWidget *hseparator2;
|
||||||
GtkWidget *label847691;
|
GtkWidget *label847691;
|
||||||
GtkWidget *hbox93;
|
GtkWidget *hbox93;
|
||||||
|
GtkWidget *vbox107;
|
||||||
GtkWidget *label847692;
|
GtkWidget *label847692;
|
||||||
|
GtkWidget *label847715;
|
||||||
|
GtkWidget *vbox108;
|
||||||
GtkWidget *price_box;
|
GtkWidget *price_box;
|
||||||
|
GtkWidget *price_currency_box;
|
||||||
GtkWidget *cash_page;
|
GtkWidget *cash_page;
|
||||||
GdkColor cash_page_bg_color = { 0, 6425, 6425, 28784 };
|
GdkColor cash_page_bg_color = { 0, 6425, 6425, 28784 };
|
||||||
GdkColor cash_page_logo_bg_color = { 0, 65535, 65535, 65535 };
|
GdkColor cash_page_logo_bg_color = { 0, 65535, 65535, 65535 };
|
||||||
@ -6415,20 +6419,49 @@ create_Stock_Split_Druid (void)
|
|||||||
gtk_box_pack_start (GTK_BOX (druid_vbox32), hbox93, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (druid_vbox32), hbox93, FALSE, FALSE, 0);
|
||||||
gtk_container_set_border_width (GTK_CONTAINER (hbox93), 10);
|
gtk_container_set_border_width (GTK_CONTAINER (hbox93), 10);
|
||||||
|
|
||||||
|
vbox107 = gtk_vbox_new (TRUE, 4);
|
||||||
|
gtk_widget_ref (vbox107);
|
||||||
|
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "vbox107", vbox107,
|
||||||
|
(GtkDestroyNotify) gtk_widget_unref);
|
||||||
|
gtk_widget_show (vbox107);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox93), vbox107, FALSE, FALSE, 0);
|
||||||
|
|
||||||
label847692 = gtk_label_new (_("New Price:"));
|
label847692 = gtk_label_new (_("New Price:"));
|
||||||
gtk_widget_ref (label847692);
|
gtk_widget_ref (label847692);
|
||||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "label847692", label847692,
|
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "label847692", label847692,
|
||||||
(GtkDestroyNotify) gtk_widget_unref);
|
(GtkDestroyNotify) gtk_widget_unref);
|
||||||
gtk_widget_show (label847692);
|
gtk_widget_show (label847692);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox93), label847692, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox107), label847692, FALSE, FALSE, 0);
|
||||||
gtk_misc_set_alignment (GTK_MISC (label847692), 1, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (label847692), 1, 0.5);
|
||||||
|
|
||||||
|
label847715 = gtk_label_new (_("Currency:"));
|
||||||
|
gtk_widget_ref (label847715);
|
||||||
|
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "label847715", label847715,
|
||||||
|
(GtkDestroyNotify) gtk_widget_unref);
|
||||||
|
gtk_widget_show (label847715);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox107), label847715, FALSE, FALSE, 0);
|
||||||
|
gtk_misc_set_alignment (GTK_MISC (label847715), 1, 0.5);
|
||||||
|
|
||||||
|
vbox108 = gtk_vbox_new (TRUE, 4);
|
||||||
|
gtk_widget_ref (vbox108);
|
||||||
|
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "vbox108", vbox108,
|
||||||
|
(GtkDestroyNotify) gtk_widget_unref);
|
||||||
|
gtk_widget_show (vbox108);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox93), vbox108, FALSE, FALSE, 0);
|
||||||
|
|
||||||
price_box = gtk_hbox_new (FALSE, 0);
|
price_box = gtk_hbox_new (FALSE, 0);
|
||||||
gtk_widget_ref (price_box);
|
gtk_widget_ref (price_box);
|
||||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "price_box", price_box,
|
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "price_box", price_box,
|
||||||
(GtkDestroyNotify) gtk_widget_unref);
|
(GtkDestroyNotify) gtk_widget_unref);
|
||||||
gtk_widget_show (price_box);
|
gtk_widget_show (price_box);
|
||||||
gtk_box_pack_start (GTK_BOX (hbox93), price_box, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox108), price_box, TRUE, TRUE, 0);
|
||||||
|
|
||||||
|
price_currency_box = gtk_hbox_new (FALSE, 0);
|
||||||
|
gtk_widget_ref (price_currency_box);
|
||||||
|
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "price_currency_box", price_currency_box,
|
||||||
|
(GtkDestroyNotify) gtk_widget_unref);
|
||||||
|
gtk_widget_show (price_currency_box);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox108), price_currency_box, TRUE, TRUE, 0);
|
||||||
|
|
||||||
cash_page = gnome_druid_page_standard_new_with_vals ("", NULL);
|
cash_page = gnome_druid_page_standard_new_with_vals ("", NULL);
|
||||||
gtk_widget_ref (cash_page);
|
gtk_widget_ref (cash_page);
|
||||||
|
@ -9428,6 +9428,17 @@ You may safely leave it blank.</label>
|
|||||||
<fill>False</fill>
|
<fill>False</fill>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkVBox</class>
|
||||||
|
<name>vbox107</name>
|
||||||
|
<homogeneous>True</homogeneous>
|
||||||
|
<spacing>4</spacing>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkLabel</class>
|
<class>GtkLabel</class>
|
||||||
<name>label847692</name>
|
<name>label847692</name>
|
||||||
@ -9446,20 +9457,66 @@ You may safely leave it blank.</label>
|
|||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>GtkHBox</class>
|
<class>GtkLabel</class>
|
||||||
<name>price_box</name>
|
<name>label847715</name>
|
||||||
<homogeneous>False</homogeneous>
|
<label>Currency:</label>
|
||||||
<spacing>0</spacing>
|
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||||
|
<wrap>False</wrap>
|
||||||
|
<xalign>1</xalign>
|
||||||
|
<yalign>0.5</yalign>
|
||||||
|
<xpad>0</xpad>
|
||||||
|
<ypad>0</ypad>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>False</expand>
|
||||||
|
<fill>False</fill>
|
||||||
|
</child>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkVBox</class>
|
||||||
|
<name>vbox108</name>
|
||||||
|
<homogeneous>True</homogeneous>
|
||||||
|
<spacing>4</spacing>
|
||||||
<child>
|
<child>
|
||||||
<padding>0</padding>
|
<padding>0</padding>
|
||||||
<expand>False</expand>
|
<expand>False</expand>
|
||||||
<fill>False</fill>
|
<fill>False</fill>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkHBox</class>
|
||||||
|
<name>price_box</name>
|
||||||
|
<homogeneous>False</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>True</expand>
|
||||||
|
<fill>True</fill>
|
||||||
|
</child>
|
||||||
|
|
||||||
<widget>
|
<widget>
|
||||||
<class>Placeholder</class>
|
<class>Placeholder</class>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>GtkHBox</class>
|
||||||
|
<name>price_currency_box</name>
|
||||||
|
<homogeneous>False</homogeneous>
|
||||||
|
<spacing>0</spacing>
|
||||||
|
<child>
|
||||||
|
<padding>0</padding>
|
||||||
|
<expand>True</expand>
|
||||||
|
<fill>True</fill>
|
||||||
|
</child>
|
||||||
|
|
||||||
|
<widget>
|
||||||
|
<class>Placeholder</class>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -305,6 +305,18 @@ gtk_select_popup_button_leave (GtkWidget *button,
|
|||||||
gtk_signal_emit_stop_by_name (GTK_OBJECT (button), "leave_notify_event");
|
gtk_signal_emit_stop_by_name (GTK_OBJECT (button), "leave_notify_event");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gtk_select_update_button (GtkSelect *select)
|
||||||
|
{
|
||||||
|
if (g_list_length (select->entries) > 1)
|
||||||
|
gtk_widget_show (select->button);
|
||||||
|
else if (g_list_length (select->entries) == 1 &&
|
||||||
|
select->selected == NULL)
|
||||||
|
gtk_widget_show (select->button);
|
||||||
|
else
|
||||||
|
gtk_widget_hide (select->button);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_select_update_entry (GtkList * list, GtkSelect * select)
|
gtk_select_update_entry (GtkList * list, GtkSelect * select)
|
||||||
{
|
{
|
||||||
@ -341,6 +353,9 @@ gtk_select_update_entry (GtkList * list, GtkSelect * select)
|
|||||||
select->selected = NULL;
|
select->selected = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_select_update_button (select);
|
||||||
|
|
||||||
gtk_signal_handler_unblock (GTK_OBJECT (list), select->list_change_id);
|
gtk_signal_handler_unblock (GTK_OBJECT (list), select->list_change_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -522,11 +537,10 @@ gtk_select_init (GtkSelect * select)
|
|||||||
gtk_widget_show (select->empty);
|
gtk_widget_show (select->empty);
|
||||||
gtk_container_add(GTK_CONTAINER(select->entry), select->empty);
|
gtk_container_add(GTK_CONTAINER(select->entry), select->empty);
|
||||||
gtk_container_add (GTK_CONTAINER (select->button), arrow);
|
gtk_container_add (GTK_CONTAINER (select->button), arrow);
|
||||||
|
gtk_box_pack_start (GTK_BOX (select), select->button, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start (GTK_BOX (select), select->entry, TRUE, TRUE, 0);
|
gtk_box_pack_start (GTK_BOX (select), select->entry, TRUE, TRUE, 0);
|
||||||
gtk_box_pack_end (GTK_BOX (select), select->button, FALSE, FALSE, 0);
|
|
||||||
GTK_WIDGET_UNSET_FLAGS (select->button, GTK_CAN_FOCUS);
|
GTK_WIDGET_UNSET_FLAGS (select->button, GTK_CAN_FOCUS);
|
||||||
gtk_widget_show (select->entry);
|
gtk_widget_show (select->entry);
|
||||||
gtk_widget_show (select->button);
|
|
||||||
// gtk_signal_connect (GTK_OBJECT (select->entry), "key_press_event",
|
// gtk_signal_connect (GTK_OBJECT (select->entry), "key_press_event",
|
||||||
// (GtkSignalFunc) gtk_select_entry_key_press, select);
|
// (GtkSignalFunc) gtk_select_entry_key_press, select);
|
||||||
gtk_signal_connect_after (GTK_OBJECT (select->button), "button_press_event",
|
gtk_signal_connect_after (GTK_OBJECT (select->button), "button_press_event",
|
||||||
@ -708,6 +722,7 @@ gtk_select_insert_items (GtkSelect *select, GList *items, gint position)
|
|||||||
copy = g_list_copy(items);
|
copy = g_list_copy(items);
|
||||||
select->entries = g_list_insert_list(select->entries, items, position);
|
select->entries = g_list_insert_list(select->entries, items, position);
|
||||||
gtk_list_insert_items(GTK_LIST(select->list), copy, position);
|
gtk_list_insert_items(GTK_LIST(select->list), copy, position);
|
||||||
|
gtk_select_update_button (select);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -720,6 +735,7 @@ gtk_select_append_items (GtkSelect *select, GList *items)
|
|||||||
copy = g_list_copy(items);
|
copy = g_list_copy(items);
|
||||||
select->entries = g_list_concat(select->entries, items);
|
select->entries = g_list_concat(select->entries, items);
|
||||||
gtk_list_append_items(GTK_LIST(select->list), copy);
|
gtk_list_append_items(GTK_LIST(select->list), copy);
|
||||||
|
gtk_select_update_button (select);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -732,6 +748,7 @@ gtk_select_prepend_items (GtkSelect *select, GList *items)
|
|||||||
copy = g_list_copy(items);
|
copy = g_list_copy(items);
|
||||||
select->entries = g_list_concat(items, select->entries);
|
select->entries = g_list_concat(items, select->entries);
|
||||||
gtk_list_prepend_items(GTK_LIST(select->list), copy);
|
gtk_list_prepend_items(GTK_LIST(select->list), copy);
|
||||||
|
gtk_select_update_button (select);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -762,6 +779,8 @@ gtk_select_remove_items_internal (GtkSelect *select, GList *items,
|
|||||||
gtk_list_remove_items_no_unref(GTK_LIST(select->list), items);
|
gtk_list_remove_items_no_unref(GTK_LIST(select->list), items);
|
||||||
if (do_free)
|
if (do_free)
|
||||||
g_list_free(items);
|
g_list_free(items);
|
||||||
|
|
||||||
|
gtk_select_update_button (select);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1467,7 +1467,8 @@ gnc_main_create_summary_bar (GnomeApp *app, GNCMainInfo *main_info)
|
|||||||
main_info->totals_combo);
|
main_info->totals_combo);
|
||||||
|
|
||||||
gtk_select_select_child (GTK_SELECT(combo_box), def_item->listitem);
|
gtk_select_select_child (GTK_SELECT(combo_box), def_item->listitem);
|
||||||
gtk_box_pack_end (GTK_BOX(summarybar), combo_box, FALSE, FALSE, 5);
|
gtk_box_pack_start (GTK_BOX(summarybar), combo_box, FALSE, FALSE, 5);
|
||||||
|
gtk_widget_show (combo_box);
|
||||||
|
|
||||||
return summarybar;
|
return summarybar;
|
||||||
}
|
}
|
||||||
@ -1638,8 +1639,8 @@ mainWindow (void)
|
|||||||
main_info);
|
main_info);
|
||||||
|
|
||||||
/* Show everything now that it is created */
|
/* Show everything now that it is created */
|
||||||
gtk_widget_show_all (summarybar);
|
gtk_widget_show (summarybar);
|
||||||
gtk_widget_show_all (statusbar);
|
gtk_widget_show (statusbar);
|
||||||
gtk_widget_show (main_info->account_tree);
|
gtk_widget_show (main_info->account_tree);
|
||||||
|
|
||||||
gnc_configure_account_tree (main_info);
|
gnc_configure_account_tree (main_info);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include "gnc-engine-util.h"
|
#include "gnc-engine-util.h"
|
||||||
#include "gnc-html-history.h"
|
#include "gnc-html-history.h"
|
||||||
#include "gnc-html.h"
|
#include "gnc-html.h"
|
||||||
|
#include "gnc-ui.h"
|
||||||
#include "query-user.h"
|
#include "query-user.h"
|
||||||
#include "window-report.h"
|
#include "window-report.h"
|
||||||
|
|
||||||
@ -590,8 +591,12 @@ gnc_report_window_show_report(gnc_report_window * report, int report_id) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
reportWindow(int report_id) {
|
reportWindow(int report_id) {
|
||||||
gnc_report_window * win = gnc_report_window_new(NULL);
|
gnc_report_window * win;
|
||||||
|
|
||||||
|
gnc_set_busy_cursor (NULL);
|
||||||
|
win = gnc_report_window_new(NULL);
|
||||||
gnc_report_window_show_report(win, report_id);
|
gnc_report_window_show_report(win, report_id);
|
||||||
|
gnc_unset_busy_cursor (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -602,9 +607,11 @@ gnc_print_report (int report_id)
|
|||||||
|
|
||||||
html = gnc_html_new ();
|
html = gnc_html_new ();
|
||||||
|
|
||||||
|
gnc_set_busy_cursor (NULL);
|
||||||
location = g_strdup_printf("id=%d", report_id);
|
location = g_strdup_printf("id=%d", report_id);
|
||||||
gnc_html_show_url(html, URL_TYPE_REPORT, location, NULL, FALSE);
|
gnc_html_show_url(html, URL_TYPE_REPORT, location, NULL, FALSE);
|
||||||
g_free(location);
|
g_free(location);
|
||||||
|
gnc_unset_busy_cursor (NULL);
|
||||||
|
|
||||||
gnc_html_print (html);
|
gnc_html_print (html);
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@
|
|||||||
(set-tm:year zd 0)
|
(set-tm:year zd 0)
|
||||||
(set-tm:yday zd 0)
|
(set-tm:yday zd 0)
|
||||||
(set-tm:wday zd 0)
|
(set-tm:wday zd 0)
|
||||||
(set-tm:isdst zd 0)
|
(set-tm:isdst zd -1)
|
||||||
zd))
|
zd))
|
||||||
|
|
||||||
(define SecDelta
|
(define SecDelta
|
||||||
@ -282,6 +282,7 @@
|
|||||||
(set-tm:sec bdt 0)
|
(set-tm:sec bdt 0)
|
||||||
(set-tm:min bdt 0)
|
(set-tm:min bdt 0)
|
||||||
(set-tm:hour bdt 12)
|
(set-tm:hour bdt 12)
|
||||||
|
(set-tm:isdst bdt -1)
|
||||||
(let ((newtime (car (mktime bdt))))
|
(let ((newtime (car (mktime bdt))))
|
||||||
(cons newtime 0))))
|
(cons newtime 0))))
|
||||||
|
|
||||||
@ -290,6 +291,7 @@
|
|||||||
(set-tm:sec bdt 0)
|
(set-tm:sec bdt 0)
|
||||||
(set-tm:min bdt 0)
|
(set-tm:min bdt 0)
|
||||||
(set-tm:hour bdt 0)
|
(set-tm:hour bdt 0)
|
||||||
|
(set-tm:isdst bdt -1)
|
||||||
(let ((newtime (car (mktime bdt))))
|
(let ((newtime (car (mktime bdt))))
|
||||||
(cons newtime 0))))
|
(cons newtime 0))))
|
||||||
|
|
||||||
@ -298,6 +300,7 @@
|
|||||||
(set-tm:sec bdt 59)
|
(set-tm:sec bdt 59)
|
||||||
(set-tm:min bdt 59)
|
(set-tm:min bdt 59)
|
||||||
(set-tm:hour bdt 23)
|
(set-tm:hour bdt 23)
|
||||||
|
(set-tm:isdst bdt -1)
|
||||||
(let ((newtime (car (mktime bdt))))
|
(let ((newtime (car (mktime bdt))))
|
||||||
(cons newtime 0))))
|
(cons newtime 0))))
|
||||||
|
|
||||||
@ -349,7 +352,7 @@
|
|||||||
(set-tm:hour now 0)
|
(set-tm:hour now 0)
|
||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:mon now 0)
|
(set-tm:mon now 0)
|
||||||
(set-tm:isdst now 0)
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now)))))
|
(gnc:secs->timepair (car (mktime now)))))
|
||||||
|
|
||||||
(define (gnc:get-start-prev-year)
|
(define (gnc:get-start-prev-year)
|
||||||
@ -360,7 +363,7 @@
|
|||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:mon now 0)
|
(set-tm:mon now 0)
|
||||||
(set-tm:year now (- (tm:year now) 1))
|
(set-tm:year now (- (tm:year now) 1))
|
||||||
(set-tm:isdst now 0)
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now)))))
|
(gnc:secs->timepair (car (mktime now)))))
|
||||||
|
|
||||||
(define (gnc:get-end-prev-year)
|
(define (gnc:get-end-prev-year)
|
||||||
@ -371,7 +374,7 @@
|
|||||||
(set-tm:mday now 31)
|
(set-tm:mday now 31)
|
||||||
(set-tm:mon now 11)
|
(set-tm:mon now 11)
|
||||||
(set-tm:year now (- (tm:year now) 1))
|
(set-tm:year now (- (tm:year now) 1))
|
||||||
(set-tm:isdst now 0)
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now)))))
|
(gnc:secs->timepair (car (mktime now)))))
|
||||||
|
|
||||||
;; FIXME:: Replace with option when it becomes available
|
;; FIXME:: Replace with option when it becomes available
|
||||||
@ -385,6 +388,7 @@
|
|||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:mon now 6)
|
(set-tm:mon now 6)
|
||||||
(set-tm:year now (- (tm:year now) 1))
|
(set-tm:year now (- (tm:year now) 1))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now))))
|
(gnc:secs->timepair (car (mktime now))))
|
||||||
(begin
|
(begin
|
||||||
(set-tm:sec now 0)
|
(set-tm:sec now 0)
|
||||||
@ -392,6 +396,7 @@
|
|||||||
(set-tm:hour now 0)
|
(set-tm:hour now 0)
|
||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:mon now 6)
|
(set-tm:mon now 6)
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now)))))))
|
(gnc:secs->timepair (car (mktime now)))))))
|
||||||
|
|
||||||
(define (gnc:get-start-prev-fin-year)
|
(define (gnc:get-start-prev-fin-year)
|
||||||
@ -404,6 +409,7 @@
|
|||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:mon now 6)
|
(set-tm:mon now 6)
|
||||||
(set-tm:year now (- (tm:year now) 2))
|
(set-tm:year now (- (tm:year now) 2))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0))
|
(cons (car (mktime now)) 0))
|
||||||
(begin
|
(begin
|
||||||
(set-tm:sec now 0)
|
(set-tm:sec now 0)
|
||||||
@ -412,6 +418,7 @@
|
|||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:mon now 6)
|
(set-tm:mon now 6)
|
||||||
(set-tm:year now (- (tm:year now) 2))
|
(set-tm:year now (- (tm:year now) 2))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0)))))
|
(cons (car (mktime now)) 0)))))
|
||||||
|
|
||||||
(define (gnc:get-end-prev-fin-year)
|
(define (gnc:get-end-prev-fin-year)
|
||||||
@ -423,6 +430,7 @@
|
|||||||
(set-tm:hour now 23)
|
(set-tm:hour now 23)
|
||||||
(set-tm:mday now 30)
|
(set-tm:mday now 30)
|
||||||
(set-tm:mon now 5)
|
(set-tm:mon now 5)
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0))
|
(cons (car (mktime now)) 0))
|
||||||
(begin
|
(begin
|
||||||
(set-tm:sec now 59)
|
(set-tm:sec now 59)
|
||||||
@ -431,6 +439,7 @@
|
|||||||
(set-tm:mday now 30)
|
(set-tm:mday now 30)
|
||||||
(set-tm:mon now 5)
|
(set-tm:mon now 5)
|
||||||
(set-tm:year now (- (tm:year now) 1))
|
(set-tm:year now (- (tm:year now) 1))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0)))))
|
(cons (car (mktime now)) 0)))))
|
||||||
|
|
||||||
(define (gnc:get-start-this-month)
|
(define (gnc:get-start-this-month)
|
||||||
@ -439,6 +448,7 @@
|
|||||||
(set-tm:min now 0)
|
(set-tm:min now 0)
|
||||||
(set-tm:hour now 0)
|
(set-tm:hour now 0)
|
||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0)))
|
(cons (car (mktime now)) 0)))
|
||||||
|
|
||||||
(define (gnc:get-start-prev-month)
|
(define (gnc:get-start-prev-month)
|
||||||
@ -452,6 +462,7 @@
|
|||||||
(set-tm:mon now 11)
|
(set-tm:mon now 11)
|
||||||
(set-tm:year now (- (tm:year now) 1)))
|
(set-tm:year now (- (tm:year now) 1)))
|
||||||
(set-tm:mon now (- (tm:mon now) 1)))
|
(set-tm:mon now (- (tm:mon now) 1)))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0)))
|
(cons (car (mktime now)) 0)))
|
||||||
|
|
||||||
(define (gnc:get-end-prev-month)
|
(define (gnc:get-end-prev-month)
|
||||||
@ -465,6 +476,7 @@
|
|||||||
(set-tm:year (- (tm:year now) 1)))
|
(set-tm:year (- (tm:year now) 1)))
|
||||||
(set-tm:month now (- (tm:month now) 1)))
|
(set-tm:month now (- (tm:month now) 1)))
|
||||||
(set-tm:mday (gnc:days-in-month (+ (tm:month now) 1)) (+ (tm:year) 1900))
|
(set-tm:mday (gnc:days-in-month (+ (tm:month now) 1)) (+ (tm:year) 1900))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0)))
|
(cons (car (mktime now)) 0)))
|
||||||
|
|
||||||
(define (gnc:get-start-current-quarter)
|
(define (gnc:get-start-current-quarter)
|
||||||
@ -474,6 +486,7 @@
|
|||||||
(set-tm:hour now 0)
|
(set-tm:hour now 0)
|
||||||
(set-tm:mday now 1)
|
(set-tm:mday now 1)
|
||||||
(set-tm:month now (- (tm:month now) (mod (tm:month now) 3)))
|
(set-tm:month now (- (tm:month now) (mod (tm:month now) 3)))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now)) 0)))
|
(cons (car (mktime now)) 0)))
|
||||||
|
|
||||||
(define (gnc:get-start-prev-quarter)
|
(define (gnc:get-start-prev-quarter)
|
||||||
@ -488,6 +501,7 @@
|
|||||||
(set-tm:month now 9)
|
(set-tm:month now 9)
|
||||||
(set-tm:year now (- (tm:year now) 1)))
|
(set-tm:year now (- (tm:year now) 1)))
|
||||||
(set-tm:month now (- (tm-month now) 3)))
|
(set-tm:month now (- (tm-month now) 3)))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(cons (car (mktime now) 0))))
|
(cons (car (mktime now) 0))))
|
||||||
|
|
||||||
(define (gnc:get-end-prev-quarter)
|
(define (gnc:get-end-prev-quarter)
|
||||||
@ -501,8 +515,9 @@
|
|||||||
(set-tm:year now (- (tm:year now) 1)))
|
(set-tm:year now (- (tm:year now) 1)))
|
||||||
(set-tm:month now (- (tm:month now)
|
(set-tm:month now (- (tm:month now)
|
||||||
(3 + (mod (tm:month now) 3)))))
|
(3 + (mod (tm:month now) 3)))))
|
||||||
(set-tm:mday (gnc:days-in-month
|
(set-tm:mday now (gnc:days-in-month (+ (tm:month now) 1)
|
||||||
(+ (tm:month now) 1)) (+ (tm:year) 1900))
|
(+ (tm:year) 1900)))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now)))))
|
(gnc:secs->timepair (car (mktime now)))))
|
||||||
|
|
||||||
(define (gnc:get-today)
|
(define (gnc:get-today)
|
||||||
@ -518,7 +533,8 @@
|
|||||||
(let ((month-length (gnc:days-in-month (+ (tm:month now) 1)
|
(let ((month-length (gnc:days-in-month (+ (tm:month now) 1)
|
||||||
(+ (tm:year now) 1900))))
|
(+ (tm:year now) 1900))))
|
||||||
(if (> month-length (tm:mday now))
|
(if (> month-length (tm:mday now))
|
||||||
(set-tm:mday month-length))
|
(set-tm:mday now month-length))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now))))))
|
(gnc:secs->timepair (car (mktime now))))))
|
||||||
|
|
||||||
(define (gnc:get-three-months-ago)
|
(define (gnc:get-three-months-ago)
|
||||||
@ -528,11 +544,11 @@
|
|||||||
(set:tm-month now (+ (tm:month now) 12))
|
(set:tm-month now (+ (tm:month now) 12))
|
||||||
(set:tm-year now (- (tm:year now) 1))))
|
(set:tm-year now (- (tm:year now) 1))))
|
||||||
(set:tm-month now (- (tm:month now) 3))
|
(set:tm-month now (- (tm:month now) 3))
|
||||||
(let ((month-days) (gnc:days-in-month
|
(let ((month-days) (gnc:days-in-month (+ (tm:month now) 1)
|
||||||
(+ (tm:month now) 1)
|
|
||||||
(+ (tm:year now) 1900)))
|
(+ (tm:year now) 1900)))
|
||||||
(if (> (month-days) (tm:mday now))
|
(if (> (month-days) (tm:mday now))
|
||||||
(set-tm:mday now month-days))
|
(set-tm:mday now month-days))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now))))))
|
(gnc:secs->timepair (car (mktime now))))))
|
||||||
|
|
||||||
(define (gnc:get-six-months-ago)
|
(define (gnc:get-six-months-ago)
|
||||||
@ -542,25 +558,23 @@
|
|||||||
(set:tm-month now (+ (tm:month now) 12))
|
(set:tm-month now (+ (tm:month now) 12))
|
||||||
(set:tm-year now (- (tm:year now) 1))))
|
(set:tm-year now (- (tm:year now) 1))))
|
||||||
(set:tm-month now (- (tm:month now) 6))
|
(set:tm-month now (- (tm:month now) 6))
|
||||||
(let ((month-days) (gnc:days-in-month
|
(let ((month-days) (gnc:days-in-month (+ (tm:month now) 1)
|
||||||
(+ (tm:month now) 1)
|
|
||||||
(+ (tm:year now) 1900)))
|
(+ (tm:year now) 1900)))
|
||||||
(if (> (month-days) (tm:mday now))
|
(if (> (month-days) (tm:mday now))
|
||||||
(set-tm:mday now month-days))
|
(set-tm:mday now month-days))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now))))))
|
(gnc:secs->timepair (car (mktime now))))))
|
||||||
|
|
||||||
|
|
||||||
(define (gnc:get-one-year-ago)
|
(define (gnc:get-one-year-ago)
|
||||||
(let ((now (localtime (current-time))))
|
(let ((now (localtime (current-time))))
|
||||||
(set:tm-year now (- (tm:year now) 1))
|
(set:tm-year now (- (tm:year now) 1))
|
||||||
(let ((month-days) (gnc:days-in-month
|
(let ((month-days) (gnc:days-in-month (+ (tm:month now) 1)
|
||||||
(+ (tm:month now) 1)
|
|
||||||
(+ (tm:year now) 1900)))
|
(+ (tm:year now) 1900)))
|
||||||
(if (> (month-days) (tm:mday now))
|
(if (> (month-days) (tm:mday now))
|
||||||
(set-tm:mday now month-days))
|
(set-tm:mday now month-days))
|
||||||
|
(set-tm:isdst now -1)
|
||||||
(gnc:secs->timepair (car (mktime now))))))
|
(gnc:secs->timepair (car (mktime now))))))
|
||||||
|
|
||||||
|
|
||||||
(define (gnc:reldate-initialize)
|
(define (gnc:reldate-initialize)
|
||||||
(begin
|
(begin
|
||||||
(gnc:reldate-string-db 'store 'start-cal-year-string (N_ "Current Year Start"))
|
(gnc:reldate-string-db 'store 'start-cal-year-string (N_ "Current Year Start"))
|
||||||
|
@ -136,8 +136,8 @@
|
|||||||
;; report-currency #t)))))
|
;; report-currency #t)))))
|
||||||
profit-collector-list))
|
profit-collector-list))
|
||||||
(combined (zip double-list accounts))
|
(combined (zip double-list accounts))
|
||||||
(accounts-or-names '())
|
(other-anchor "")
|
||||||
(other-anchor ""))
|
(print-info (gnc:commodity-print-info report-currency #t)))
|
||||||
|
|
||||||
(set! combined
|
(set! combined
|
||||||
(filter (lambda (pair) (not (= 0.0 (car pair))))
|
(filter (lambda (pair) (not (= 0.0 (car pair))))
|
||||||
@ -170,11 +170,6 @@
|
|||||||
(gnc:report-anchor-text
|
(gnc:report-anchor-text
|
||||||
(gnc:make-report name options))))))
|
(gnc:make-report name options))))))
|
||||||
|
|
||||||
(call-with-values (lambda () (unzip2 combined))
|
|
||||||
(lambda (ds as)
|
|
||||||
(set! double-list ds)
|
|
||||||
(set! accounts-or-names as)))
|
|
||||||
|
|
||||||
(gnc:html-piechart-set-title!
|
(gnc:html-piechart-set-title!
|
||||||
chart (if is-income?
|
chart (if is-income?
|
||||||
(_ "Income by Account")
|
(_ "Income by Account")
|
||||||
@ -188,18 +183,24 @@
|
|||||||
|
|
||||||
(gnc:html-piechart-set-width! chart width)
|
(gnc:html-piechart-set-width! chart width)
|
||||||
(gnc:html-piechart-set-height! chart height)
|
(gnc:html-piechart-set-height! chart height)
|
||||||
(gnc:html-piechart-set-data! chart double-list)
|
(gnc:html-piechart-set-data! chart (unzip1 combined))
|
||||||
(gnc:html-piechart-set-labels!
|
(gnc:html-piechart-set-labels!
|
||||||
chart
|
chart
|
||||||
(map (lambda (a) (if (string? a) a (gnc:account-get-full-name a)))
|
(map (lambda (pair)
|
||||||
accounts-or-names))
|
(string-append
|
||||||
|
(if (string? (cadr pair))
|
||||||
|
(cadr pair)
|
||||||
|
(gnc:account-get-full-name (cadr pair)))
|
||||||
|
" - "
|
||||||
|
(gnc:amount->string (car pair) print-info)))
|
||||||
|
combined))
|
||||||
(gnc:html-piechart-set-colors! chart
|
(gnc:html-piechart-set-colors! chart
|
||||||
(gnc:assign-colors (length combined)))
|
(gnc:assign-colors (length combined)))
|
||||||
(let ((urls (map (lambda (a)
|
(let ((urls (map (lambda (pair)
|
||||||
(if (string? a)
|
(if (string? (cadr pair))
|
||||||
other-anchor
|
other-anchor
|
||||||
(gnc:account-anchor-text a)))
|
(gnc:account-anchor-text (cadr pair))))
|
||||||
accounts-or-names)))
|
combined)))
|
||||||
(gnc:html-piechart-set-button-1-slice-urls! chart urls)
|
(gnc:html-piechart-set-button-1-slice-urls! chart urls)
|
||||||
(gnc:html-piechart-set-button-1-legend-urls! chart urls))
|
(gnc:html-piechart-set-button-1-legend-urls! chart urls))
|
||||||
|
|
||||||
|
@ -499,4 +499,4 @@
|
|||||||
(apply gnc:apply-register-report (cons gnc:report-window rest)))
|
(apply gnc:apply-register-report (cons gnc:report-window rest)))
|
||||||
|
|
||||||
(define (gnc:print-register-report . rest)
|
(define (gnc:print-register-report . rest)
|
||||||
(apply gnc:apply-register-report (const gnc:print-report rest)))
|
(apply gnc:apply-register-report (cons gnc:print-report rest)))
|
||||||
|
Loading…
Reference in New Issue
Block a user