2001-06-02 Dave Peticolas <dave@krondo.com>

* src/scm/report/price-scatter.scm: same as below

	* src/scm/prefs.scm: same as below

	* src/gnc-ui-util.c: same as below

	* src/gnome/druid-qif-import.c: same as below

	* src/gnome/dialog-price-editor.c: same as below

	* src/gnome/dialog-fincalc.c: same as below

	* src/SplitLedger.c: use gnc_default_currency instead
	of gnc_locale_default_currency.

	* src/scm/options-utilities.scm: use new func

	* src/scm/report/transaction-report.scm: handle splits with no
	account

	* src/gnome/dialog-account.c: use new func

	* src/gnome/window-main-summarybar.c: use new func

	* src/guile/gnc.gwp: wrap new func below

	* src/guile/global-options.c (gnc_default_currency): new func
	to return user-set default currency

	* src/engine/gnc-book.c (gnc_book_backup_file): use g_free
	instead of free.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4377 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2001-06-02 21:15:40 +00:00
parent 18b559e084
commit e078856530
13 changed files with 499 additions and 464 deletions

View File

@ -1,3 +1,37 @@
2001-06-02 Dave Peticolas <dave@krondo.com>
* src/scm/report/price-scatter.scm: same as below
* src/scm/prefs.scm: same as below
* src/gnc-ui-util.c: same as below
* src/gnome/druid-qif-import.c: same as below
* src/gnome/dialog-price-editor.c: same as below
* src/gnome/dialog-fincalc.c: same as below
* src/SplitLedger.c: use gnc_default_currency instead
of gnc_locale_default_currency.
* src/scm/options-utilities.scm: use new func
* src/scm/report/transaction-report.scm: handle splits with no
account
* src/gnome/dialog-account.c: use new func
* src/gnome/window-main-summarybar.c: use new func
* src/guile/gnc.gwp: wrap new func below
* src/guile/global-options.c (gnc_default_currency): new func
to return user-set default currency
* src/engine/gnc-book.c (gnc_book_backup_file): use g_free
instead of free.
2001-06-02 Christian Stimming <stimming@tuhh.de>
* po/gnc-glossary.txt: Updated glossary, 15 new terms, and lots of

View File

@ -590,7 +590,7 @@ gnc_split_get_value_denom (Split *split)
denom = xaccAccountGetCurrencySCU (xaccSplitGetAccount (split));
if (denom == 0)
{
gnc_commodity *commodity = gnc_locale_default_currency ();
gnc_commodity *commodity = gnc_default_currency ();
denom = gnc_commodity_get_fraction (commodity);
if (denom == 0)
denom = 100;
@ -607,7 +607,7 @@ gnc_split_get_quantity_denom (Split *split)
denom = xaccAccountGetCommoditySCU (xaccSplitGetAccount (split));
if (denom == 0)
{
gnc_commodity *commodity = gnc_locale_default_currency ();
gnc_commodity *commodity = gnc_default_currency ();
denom = gnc_commodity_get_fraction (commodity);
if (denom == 0)
denom = 100;
@ -644,7 +644,7 @@ sr_set_cell_fractions (SplitRegister *reg, Split *split)
xaccSetPriceCellFraction (reg->sharesCell, 10000);
commodity = gnc_locale_default_currency ();
commodity = gnc_default_currency ();
fraction = gnc_commodity_get_fraction (commodity);
xaccSetPriceCellFraction (reg->debitCell, fraction);
@ -3681,7 +3681,7 @@ xaccSRGetEntryHandler (VirtualLocation virt_loc,
currency = xaccTransGetCurrency (trans);
if (!currency)
currency = gnc_locale_default_currency ();
currency = gnc_default_currency ();
imbalance = gnc_numeric_convert (imbalance,
gnc_commodity_get_fraction (currency),

View File

@ -470,7 +470,8 @@ gnc_book_backup_file(GNCBook *book)
strcat (backup, ".");
strcat (backup, timestamp);
strcat (backup, ".xac");
free (timestamp);
g_free (timestamp);
if(link(datafile, backup) != 0)
{
gnc_book_push_error(

View File

@ -520,7 +520,7 @@ gnc_find_or_create_equity_account (GNCEquityType equity_type,
}
if (!base_name_exists &&
gnc_commodity_equiv (currency, gnc_locale_default_currency ()))
gnc_commodity_equiv (currency, gnc_default_currency ()))
{
g_free (name);
name = g_strdup (base_name);
@ -777,7 +777,7 @@ gnc_default_print_info (gboolean use_symbol)
lc = gnc_localeconv ();
info.commodity = gnc_locale_default_currency ();
info.commodity = gnc_default_currency ();
info.max_decimal_places = lc->frac_digits;
info.min_decimal_places = lc->frac_digits;

View File

@ -1849,9 +1849,7 @@ gnc_ui_new_account_window_internal (Account *base_account,
gnc_resume_gui_refresh ();
commodity = gnc_lookup_currency_option ("International",
"Default Currency",
gnc_locale_default_currency ());
commodity = gnc_default_currency ();
gnc_commodity_edit_set_commodity (GNC_COMMODITY_EDIT (aw->currency_edit),
commodity);

View File

@ -32,6 +32,7 @@
#include "finvar.h"
#include "glade-gnc-dialogs.h"
#include "glade-support.h"
#include "global-options.h"
#include "gnc-amount-edit.h"
#include "gnc-commodity.h"
#include "gnc-component-manager.h"
@ -148,7 +149,7 @@ fi_to_gui(FinCalcDialog *fcd)
pmt = double_to_gnc_numeric (fcd->financial_info.pmt, 100000, GNC_RND_ROUND);
commodity = gnc_locale_default_currency ();
commodity = gnc_default_currency ();
total = gnc_numeric_mul (npp, pmt, gnc_commodity_get_fraction (commodity),
GNC_RND_ROUND);
@ -501,7 +502,7 @@ gnc_ui_fincalc_dialog_create(void)
GtkWidget *hbox;
GtkWidget *edit;
commodity = gnc_locale_default_currency ();
commodity = gnc_default_currency ();
fcd = g_new0(FinCalcDialog, 1);

View File

@ -31,6 +31,7 @@
#include "dialog-utils.h"
#include "glade-gnc-dialogs.h"
#include "glade-support.h"
#include "global-options.h"
#include "gnc-amount-edit.h"
#include "gnc-commodity-edit.h"
#include "gnc-component-manager.h"
@ -301,7 +302,7 @@ price_to_gui (PricesDialog *pdb_dialog)
else
{
commodity = NULL;
currency = gnc_locale_default_currency ();
currency = gnc_default_currency ();
date.tv_sec = time (NULL);
date.tv_nsec = 0;
source = "";

View File

@ -256,7 +256,7 @@ gnc_ui_qif_import_druid_make(void) {
gnc_ui_update_commodity_picker(retval->currency_picker,
GNC_COMMODITY_NS_ISO,
gnc_commodity_get_printname
(gnc_locale_default_currency()));
(gnc_default_currency()));
if(!retval->show_doc_pages) {
gnome_druid_set_page(GNOME_DRUID(retval->druid),

View File

@ -260,10 +260,7 @@ gnc_ui_accounts_recurse (AccountGroup *group, GList **currency_list,
GList *list;
GList *node;
default_currency =
gnc_lookup_currency_option("International",
"Default Currency",
gnc_locale_default_currency ());
default_currency = gnc_default_currency ();
if (euro)
{
@ -366,10 +363,7 @@ gnc_main_window_summary_refresh (GNCMainSummary * summary)
GList *current;
gboolean euro;
default_currency =
gnc_lookup_currency_option("International",
"Default Currency",
gnc_locale_default_currency ());
default_currency = gnc_default_currency ();
euro = gnc_lookup_boolean_option("International",
"Enable EURO support",
@ -460,10 +454,7 @@ gnc_main_window_summary_new (void) {
GNCMainSummary * retval = g_new0(GNCMainSummary, 1);
GtkWidget * summarybar;
GNCCurrencyItem * def_item;
gnc_commodity * default_currency =
gnc_lookup_currency_option ("International",
"Default Currency",
gnc_locale_default_currency ());
gnc_commodity * default_currency = gnc_default_currency ();
retval->hbox = gtk_hbox_new (FALSE, 5);
retval->totals_combo = gtk_select_new ();

View File

@ -199,9 +199,7 @@
pagename name-report-currency
sort-tag
(N_ "Select the currency to display the values of this report in.")
(gnc:option-value
(gnc:lookup-global-option "International"
"Default Currency")))))
(gnc:default-currency))))
;; These are common options for the selection of the report's
;; currency/commodity.

View File

@ -168,8 +168,7 @@
(gnc:make-simple-boolean-option
(N_ "International") (N_ "Enable EURO support")
"d" (N_ "Enables support for the European Union EURO currency")
(gnc:is-euro-currency
(gnc:locale-default-currency))))
(gnc:is-euro-currency (gnc:default-currency))))
;;; Register options

View File

@ -69,7 +69,7 @@
pagename-price optname-price-commodity
"e"
(N_ "Calculate the price of this commodity.")
(gnc:locale-default-currency)))
(gnc:default-currency)))
(add-option
(gnc:make-multichoice-option

View File

@ -36,7 +36,8 @@
(let-syntax ((addto!
(syntax-rules ()
((_ alist element) (set! alist (cons element alist))))))
((_ alist element)
(set! alist (cons element alist))))))
(let ((pagename-sorting (N_ "Sorting"))
(optname-prime-sortkey (N_ "Primary Key"))
@ -105,10 +106,10 @@
(define (render-account-full-name-subheading
split table width subheading-style)
(let ((account (gnc:split-get-account split)))
(add-subheading-row (gnc:make-html-text (gnc:html-markup-anchor
(add-subheading-row (gnc:make-html-text
(gnc:html-markup-anchor
(gnc:account-anchor-text account)
(gnc:account-get-full-name
account)))
(gnc:account-get-full-name account)))
table width subheading-style)))
(define (render-account-code-subheading split table
@ -182,7 +183,8 @@
(define (render-corresponding-account-name-subtotal
table width split total-collector subtotal-style)
(add-subtotal-row table width (total-string
(add-subtotal-row table width
(total-string
(gnc:split-get-corr-account-full-name split))
total-collector subtotal-style))
@ -326,7 +328,9 @@
(account (gnc:split-get-account split))
(account-type (gw:enum-<gnc:AccountType>-val->sym
(gnc:account-get-type account) #f))
(currency (gnc:account-get-commodity account))
(currency (if account
(gnc:account-get-commodity account)
(gnc:default-currency)))
(damount (gnc:split-get-share-amount split))
(split-value (gnc:make-gnc-monetary
currency
@ -372,7 +376,8 @@
(if (used-price column-vector)
(addto!
row-contents
(gnc:make-gnc-monetary currency (gnc:split-get-share-price split))))
(gnc:make-gnc-monetary currency
(gnc:split-get-share-price split))))
(if (used-amount-single column-vector)
(addto! row-contents
(gnc:make-html-table-cell/markup "number-cell"
@ -395,7 +400,8 @@
"number-cell"
(gnc:make-gnc-monetary currency
(gnc:split-get-balance split)))))
(gnc:html-table-append-row/markup! table row-style (reverse row-contents))
(gnc:html-table-append-row/markup! table row-style
(reverse row-contents))
split-value))
(define (trep-options-generator)
@ -436,7 +442,8 @@
(gnc:get-current-group)))
(first-account (gnc:group-get-account
(gnc:get-current-group) 0)))
(cond ((not (null? current-accounts)) (list (car current-accounts)))
(cond ((not (null? current-accounts))
(list (car current-accounts)))
((> num-accounts 0) (list first-account))
(else ()))))
#f #t))
@ -748,12 +755,14 @@ and Income accounts")))))
#t)))
(if multi-rows?
(add-other-split-rows
current table used-columns def:alternate-row-style account-types-to-reverse))
current table used-columns def:alternate-row-style
account-types-to-reverse))
(primary-subtotal-collector 'add
(gnc:gnc-monetary-commodity
split-value)
(gnc:gnc-monetary-amount split-value))
(gnc:gnc-monetary-amount
split-value))
(secondary-subtotal-collector 'add
(gnc:gnc-monetary-commodity
split-value)
@ -771,7 +780,8 @@ and Income accounts")))))
(if secondary-subtotal-pred
(begin
(secondary-subtotal-renderer table width current
(secondary-subtotal-renderer
table width current
secondary-subtotal-collector
def:secondary-subtotal-style)
(secondary-subtotal-collector 'reset #f #f)))
@ -796,15 +806,17 @@ and Income accounts")))))
(if (and secondary-subtotal-pred
(or (not next)
(and next
(not (secondary-subtotal-pred current next)))))
(begin (secondary-subtotal-renderer table width current
(not (secondary-subtotal-pred
current next)))))
(begin (secondary-subtotal-renderer
table width current
secondary-subtotal-collector
def:secondary-subtotal-style)
(secondary-subtotal-collector 'reset #f #f)
(if next
(secondary-subheading-renderer
next table width def:secondary-subtotal-style)))))
next table width
def:secondary-subtotal-style)))))
(do-rows-with-subtotals rest
table