mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
* src/gnome/dialog-progress.c
(gnc_progress_dialog_set_activity_mode): new func * src/guile/gnc.gwp: add new progress dialog api * src/engine/date.h: remove unneeded includes * src/scm/report/income-or-expense-pie.scm: make 'other' slice a link to a new pie report * src/scm/report.scm (gnc:make-report-options): new func * src/register/splitreg.c (configLayout): don't show balance column in stock registers * src/gnc-ui-util.c (xaccSPrintAmount): put currency symbol after quantity for shares values git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3811 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
256be7a33a
commit
75ee724948
18
ChangeLog
18
ChangeLog
@ -1,5 +1,23 @@
|
|||||||
2001-03-20 Dave Peticolas <dave@krondo.com>
|
2001-03-20 Dave Peticolas <dave@krondo.com>
|
||||||
|
|
||||||
|
* src/gnome/dialog-progress.c
|
||||||
|
(gnc_progress_dialog_set_activity_mode): new func
|
||||||
|
|
||||||
|
* src/guile/gnc.gwp: add new progress dialog api
|
||||||
|
|
||||||
|
* src/engine/date.h: remove unneeded includes
|
||||||
|
|
||||||
|
* src/scm/report/income-or-expense-pie.scm: make 'other' slice
|
||||||
|
a link to a new pie report
|
||||||
|
|
||||||
|
* src/scm/report.scm (gnc:make-report-options): new func
|
||||||
|
|
||||||
|
* src/register/splitreg.c (configLayout): don't show balance
|
||||||
|
column in stock registers
|
||||||
|
|
||||||
|
* src/gnc-ui-util.c (xaccSPrintAmount): put currency symbol
|
||||||
|
after quantity for shares values
|
||||||
|
|
||||||
* src/guile/option-util.c (gnc_commit_option): update GUI value
|
* src/guile/option-util.c (gnc_commit_option): update GUI value
|
||||||
|
|
||||||
* src/gnome/gnc-html-guppi.c: new func for shutting down guppi
|
* src/gnome/gnc-html-guppi.c: new func for shutting down guppi
|
||||||
|
@ -32,8 +32,6 @@
|
|||||||
#define __XACC_DATE_H__
|
#define __XACC_DATE_H__
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "config.h"
|
|
||||||
#include "glib.h"
|
|
||||||
|
|
||||||
|
|
||||||
/** Constants *******************************************************/
|
/** Constants *******************************************************/
|
||||||
|
@ -875,6 +875,7 @@ xaccSPrintAmount (char * bufp, gnc_numeric val, GNCPrintAmountInfo info)
|
|||||||
char sign_posn;
|
char sign_posn;
|
||||||
|
|
||||||
gboolean print_sign = TRUE;
|
gboolean print_sign = TRUE;
|
||||||
|
gboolean is_shares = FALSE;
|
||||||
|
|
||||||
if (!bufp)
|
if (!bufp)
|
||||||
return 0;
|
return 0;
|
||||||
@ -887,6 +888,11 @@ xaccSPrintAmount (char * bufp, gnc_numeric val, GNCPrintAmountInfo info)
|
|||||||
currency_symbol = lc->currency_symbol;
|
currency_symbol = lc->currency_symbol;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (info.commodity &&
|
||||||
|
safe_strcmp (GNC_COMMODITY_NS_ISO,
|
||||||
|
gnc_commodity_get_namespace (info.commodity)) != 0)
|
||||||
|
is_shares = TRUE;
|
||||||
|
|
||||||
currency_symbol = gnc_commodity_get_mnemonic (info.commodity);
|
currency_symbol = gnc_commodity_get_mnemonic (info.commodity);
|
||||||
info.use_locale = 0;
|
info.use_locale = 0;
|
||||||
}
|
}
|
||||||
@ -899,8 +905,8 @@ xaccSPrintAmount (char * bufp, gnc_numeric val, GNCPrintAmountInfo info)
|
|||||||
|
|
||||||
if (!info.use_locale)
|
if (!info.use_locale)
|
||||||
{
|
{
|
||||||
cs_precedes = 1; /* currency symbol precedes amount */
|
cs_precedes = is_shares ? 0 : 1;
|
||||||
sep_by_space = 1; /* they are separated by a space */
|
sep_by_space = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -269,6 +269,19 @@ gnc_progress_dialog_set_limits (GNCProgressDialog *progress,
|
|||||||
gnc_progress_dialog_update (progress);
|
gnc_progress_dialog_update (progress);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
gnc_progress_dialog_set_activity_mode (GNCProgressDialog *progress,
|
||||||
|
gboolean activity_mode)
|
||||||
|
{
|
||||||
|
if (progress == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
gtk_progress_set_activity_mode (GTK_PROGRESS (progress->progress_bar),
|
||||||
|
activity_mode);
|
||||||
|
|
||||||
|
gnc_progress_dialog_update (progress);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gnc_progress_dialog_set_cancel_func (GNCProgressDialog *progress,
|
gnc_progress_dialog_set_cancel_func (GNCProgressDialog *progress,
|
||||||
GNCProgressCancelFunc cancel_func,
|
GNCProgressCancelFunc cancel_func,
|
||||||
|
@ -51,6 +51,11 @@ void gnc_progress_dialog_set_heading (GNCProgressDialog *progress,
|
|||||||
void gnc_progress_dialog_set_limits (GNCProgressDialog *progress,
|
void gnc_progress_dialog_set_limits (GNCProgressDialog *progress,
|
||||||
gfloat min, gfloat max);
|
gfloat min, gfloat max);
|
||||||
|
|
||||||
|
/* Set the activity mode. If TRUE, the dialog just indicates
|
||||||
|
* that stuff is happening, rather than a percentage complete. */
|
||||||
|
void gnc_progress_dialog_set_activity_mode (GNCProgressDialog *progress,
|
||||||
|
gboolean activity_mode);
|
||||||
|
|
||||||
/* Set the C function which will be called if the user hits the
|
/* Set the C function which will be called if the user hits the
|
||||||
* 'cancel' button. The cancel function returns a boolean value.
|
* 'cancel' button. The cancel function returns a boolean value.
|
||||||
* If the value is TRUE, the window is hidden. */
|
* If the value is TRUE, the window is hidden. */
|
||||||
|
@ -455,7 +455,6 @@ configLayout (SplitRegister *reg)
|
|||||||
set_cell (reg, curs, DEBT_CELL, 0, 7);
|
set_cell (reg, curs, DEBT_CELL, 0, 7);
|
||||||
set_cell (reg, curs, CRED_CELL, 0, 8);
|
set_cell (reg, curs, CRED_CELL, 0, 8);
|
||||||
set_cell (reg, curs, SHRBALN_CELL, 0, 9);
|
set_cell (reg, curs, SHRBALN_CELL, 0, 9);
|
||||||
set_cell (reg, curs, BALN_CELL, 0, 10);
|
|
||||||
|
|
||||||
curs = reg->cursor_ledger_double;
|
curs = reg->cursor_ledger_double;
|
||||||
copy_cursor_row (reg, curs, reg->cursor_ledger_single, 0);
|
copy_cursor_row (reg, curs, reg->cursor_ledger_single, 0);
|
||||||
@ -471,7 +470,6 @@ configLayout (SplitRegister *reg)
|
|||||||
set_cell (reg, curs, TDEBT_CELL, 0, 7);
|
set_cell (reg, curs, TDEBT_CELL, 0, 7);
|
||||||
set_cell (reg, curs, TCRED_CELL, 0, 8);
|
set_cell (reg, curs, TCRED_CELL, 0, 8);
|
||||||
set_cell (reg, curs, TSHRBALN_CELL, 0, 9);
|
set_cell (reg, curs, TSHRBALN_CELL, 0, 9);
|
||||||
set_cell (reg, curs, TBALN_CELL, 0, 10);
|
|
||||||
|
|
||||||
curs = reg->cursor_journal_double;
|
curs = reg->cursor_journal_double;
|
||||||
copy_cursor_row (reg, curs, reg->cursor_journal_single, 0);
|
copy_cursor_row (reg, curs, reg->cursor_journal_single, 0);
|
||||||
|
@ -74,6 +74,8 @@
|
|||||||
(let ((dialog (gnc:progress-dialog-new
|
(let ((dialog (gnc:progress-dialog-new
|
||||||
(gnc:get-ui-data) #f))
|
(gnc:get-ui-data) #f))
|
||||||
(canceled #f))
|
(canceled #f))
|
||||||
|
(gnc:progress-dialog-set-activity-mode dialog #t)
|
||||||
|
(gnc:progress-dialog-set-heading dialog #f)
|
||||||
(gnc:progress-dialog-set-cancel-scm-func
|
(gnc:progress-dialog-set-cancel-scm-func
|
||||||
dialog
|
dialog
|
||||||
(lambda ()
|
(lambda ()
|
||||||
@ -82,8 +84,6 @@
|
|||||||
#t))
|
#t))
|
||||||
(let loop ((value 0.0))
|
(let loop ((value 0.0))
|
||||||
(gnc:progress-dialog-set-value dialog value)
|
(gnc:progress-dialog-set-value dialog value)
|
||||||
(gnc:progress-dialog-set-heading
|
|
||||||
dialog (number->string value))
|
|
||||||
(sleep 1)
|
(sleep 1)
|
||||||
(if (and (not canceled) (< value 90.0))
|
(if (and (not canceled) (< value 90.0))
|
||||||
(loop (+ value 5.0))))
|
(loop (+ value 5.0))))
|
||||||
|
@ -43,6 +43,11 @@
|
|||||||
(gnc:account-anchor-text acct)
|
(gnc:account-anchor-text acct)
|
||||||
(gnc:account-get-name acct))))
|
(gnc:account-get-name acct))))
|
||||||
|
|
||||||
|
(define (gnc:report-anchor-text report-id)
|
||||||
|
(string-append
|
||||||
|
"gnc-report:id="
|
||||||
|
(number->string report-id)))
|
||||||
|
|
||||||
(define (gnc:assign-colors num-colors)
|
(define (gnc:assign-colors num-colors)
|
||||||
(define base-colors '("red" "orange" "yellow" "green"
|
(define base-colors '("red" "orange" "yellow" "green"
|
||||||
"blue" "purple" "violet"))
|
"blue" "purple" "violet"))
|
||||||
|
@ -205,6 +205,12 @@
|
|||||||
(hash-set! *gnc:_reports_* (gnc:report-id r) r)
|
(hash-set! *gnc:_reports_* (gnc:report-id r) r)
|
||||||
id))
|
id))
|
||||||
|
|
||||||
|
(define (gnc:make-report-options template-name)
|
||||||
|
(let ((template (hash-ref *gnc:_report-templates_* template-name)))
|
||||||
|
(if template
|
||||||
|
(gnc:report-template-new-options template)
|
||||||
|
#f)))
|
||||||
|
|
||||||
(define (gnc:report-remove-by-id id)
|
(define (gnc:report-remove-by-id id)
|
||||||
(let ((r (hash-ref *gnc:_reports_* id)))
|
(let ((r (hash-ref *gnc:_reports_* id)))
|
||||||
(for-each
|
(for-each
|
||||||
@ -214,7 +220,7 @@
|
|||||||
(hash-remove! *gnc:_reports_* id)))
|
(hash-remove! *gnc:_reports_* id)))
|
||||||
|
|
||||||
(define (gnc:find-report id)
|
(define (gnc:find-report id)
|
||||||
(hash-ref *gnc:_reports_* id))
|
(hash-ref *gnc:_reports_* id))
|
||||||
|
|
||||||
(define (gnc:report-tree-collapse tree)
|
(define (gnc:report-tree-collapse tree)
|
||||||
(let ((retval '()))
|
(let ((retval '()))
|
||||||
|
@ -113,7 +113,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 '()))
|
(accounts-or-names '())
|
||||||
|
(other-anchor ""))
|
||||||
|
|
||||||
(set! combined
|
(set! combined
|
||||||
(filter (lambda (pair) (not (= 0.0 (car pair))))
|
(filter (lambda (pair) (not (= 0.0 (car pair))))
|
||||||
@ -123,13 +124,27 @@
|
|||||||
(sort combined
|
(sort combined
|
||||||
(lambda (a b) (> (car a) (car b)))))
|
(lambda (a b) (> (car a) (car b)))))
|
||||||
|
|
||||||
|
;; if too many slices, condense them to an 'other' slice
|
||||||
|
;; and add a link to a new pie report with just those
|
||||||
|
;; accounts
|
||||||
(if (> (length combined) max-slices)
|
(if (> (length combined) max-slices)
|
||||||
(let* ((start (take combined (- max-slices 1)))
|
(let* ((start (take combined (- max-slices 1)))
|
||||||
(finish (drop combined (- max-slices 1)))
|
(finish (drop combined (- max-slices 1)))
|
||||||
(sum (apply + (unzip1 finish))))
|
(sum (apply + (unzip1 finish))))
|
||||||
(set! combined
|
(set! combined
|
||||||
(append start
|
(append start
|
||||||
(list (list sum (_ "Other")))))))
|
(list (list sum (_ "Other")))))
|
||||||
|
(let* ((name (if is-income? "Income Piechart" "Expense Piechart"))
|
||||||
|
(options (gnc:make-report-options name))
|
||||||
|
(account-op (gnc:lookup-option options
|
||||||
|
"Report Options"
|
||||||
|
"Accounts")))
|
||||||
|
(call-with-values (lambda () (unzip2 finish))
|
||||||
|
(lambda (ds as)
|
||||||
|
(gnc:option-set-value account-op as)))
|
||||||
|
(set! other-anchor
|
||||||
|
(gnc:report-anchor-text
|
||||||
|
(gnc:make-report name options))))))
|
||||||
|
|
||||||
(call-with-values (lambda () (unzip2 combined))
|
(call-with-values (lambda () (unzip2 combined))
|
||||||
(lambda (ds as)
|
(lambda (ds as)
|
||||||
@ -157,7 +172,9 @@
|
|||||||
(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 (a)
|
||||||
(if (string? a) "" (gnc:account-anchor-text a)))
|
(if (string? a)
|
||||||
|
other-anchor
|
||||||
|
(gnc:account-anchor-text a)))
|
||||||
accounts-or-names)))
|
accounts-or-names)))
|
||||||
(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))
|
||||||
|
@ -466,8 +466,7 @@
|
|||||||
'in-menu? #f))
|
'in-menu? #f))
|
||||||
|
|
||||||
(define (gnc:apply-register-report func query journal?)
|
(define (gnc:apply-register-report func query journal?)
|
||||||
(let* ((template (hash-ref *gnc:_report-templates_* "Register"))
|
(let* ((options (gnc:make-report-options "Register"))
|
||||||
(options (gnc:report-template-new-options template))
|
|
||||||
(qo (gnc:lookup-option options "__reg" "query"))
|
(qo (gnc:lookup-option options "__reg" "query"))
|
||||||
(jo (gnc:lookup-option options "__reg" "journal")))
|
(jo (gnc:lookup-option options "__reg" "journal")))
|
||||||
(gnc:option-set-value qo query)
|
(gnc:option-set-value qo query)
|
||||||
|
@ -566,28 +566,6 @@
|
|||||||
(end-string (strftime "%x" (localtime (car end)))))
|
(end-string (strftime "%x" (localtime (car end)))))
|
||||||
(string-append (_ "From") " " begin-string (_"To") " " end-string)))
|
(string-append (_ "From") " " begin-string (_"To") " " end-string)))
|
||||||
|
|
||||||
(define (make-account-subheading acc-name from-date)
|
|
||||||
(let* ((separator (string-ref (gnc:account-separator-char) 0))
|
|
||||||
(acc (gnc:get-account-from-full-name
|
|
||||||
(gnc:get-current-group)
|
|
||||||
acc-name
|
|
||||||
separator))
|
|
||||||
(unsigned-balance (d-gnc:account-get-balance-at-date
|
|
||||||
acc
|
|
||||||
from-date
|
|
||||||
#f))
|
|
||||||
(signed-balance (if (gnc:account-reverse-balance? acc)
|
|
||||||
(- unsigned-balance)
|
|
||||||
unsigned-balance)))
|
|
||||||
(string-append acc-name
|
|
||||||
" ("
|
|
||||||
(_ "Opening Balance")
|
|
||||||
" "
|
|
||||||
(gnc:amount->string signed-balance
|
|
||||||
(gnc:account-value-print-info acc #f))
|
|
||||||
")"
|
|
||||||
)))
|
|
||||||
|
|
||||||
(define (get-primary-subtotal-style options)
|
(define (get-primary-subtotal-style options)
|
||||||
(let ((bgcolor (gnc:lookup-option options
|
(let ((bgcolor (gnc:lookup-option options
|
||||||
(N_ "Colors")
|
(N_ "Colors")
|
||||||
|
Loading…
Reference in New Issue
Block a user