*** empty log message ***

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2143 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-03-31 09:48:20 +00:00
parent 47abc657dd
commit 7d20dfc4aa
15 changed files with 633 additions and 446 deletions

View File

@ -15,3 +15,4 @@ xacc
errs*
gnucash.motif
gnucash.gnome
make-gnucash-patch

108
ChangeLog
View File

@ -1,3 +1,111 @@
2000-03-31 Rob Browning <rlb@cs.utexas.edu>
* src/scm/bootstrap.scm.in: use new GNC_EXPANDED_ vars.
* src/scm/Makefile.in: set top_srcdir and include Makefile.init
* src/reports/pathconfig.h.in: use new GNC_EXPANDED_ vars.
* src/quotes/gnc-prices.in: new file.
* src/quotes/gnc-prices: deleted.
* src/guile/gnucash.h.in: use new GNC_EXPANDED_ vars.
* src/guile/i18n.h.in: use new GNC_EXPANDED_ vars.
* src/guile/Makefile.in (top_srcdir): set.
* src/Makefile.in: minor cleanups and safety code.
* make-gnucash-patch.in: new file.
* make-gnucash-patch: deleted.
* lib/Makefile.in: re-configure g-wrap after every distclean and
rebuild/install it on every build.
* gnucash: fix the doc-path to match the new structure. This
fixes things back the way they were, but now we need to add
runtime locale detection.
* doc/build-system: new file - should eventually cover
build-system info and justifications.
* configure.in: changes to accomodate the new GNC_EXPANDED_*
vars. See doc/build-system for a summary.
* Makefile.init.in (ABSOLUTE_TOP_SRCDIR): set
(top_srcdir): don't set (it has to be set in each separate Makefile.in)
* Makefile.config.finish: deleted.
* Makefile.in: minor cleanup -- some safety checks.
* Makefile.common: Clear all the .SUFFIXES rules. They were
causing weird behaviors when I was trying to create some new
implicit rules.
* src/scm/printing/number-to-words.scm: scope gnc:depend and
gnc:support calls.
* src/scm/printing/print-check.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-dialog-utils.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-file.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-guess-map.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-import.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-objects.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-parse.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-to-gnc.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/qif-utils.scm: scope gnc:depend and
gnc:support calls.
* src/scm/qif-import/simple-obj.scm: scope gnc:depend and
gnc:support calls.
* src/scm/main.scm: fix load-path problems.
2000-03-31 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/gnome/window-register.c (gnc_transaction_delete_query): ok, we
can't destroy the dialog on close, because we need the widgets to be
there afterwards. gtk_widget_destroy() the dialog instead.
* src/register/splitreg.c: add a SEARCH_LEDGER register type. Don't
include the balance field in 'ledger' style registers.
* src/register/gnome/gnucash-style.c (gnucash_style_layout_init):
new layouts for ledgers -- they don't have a balance field. We'll
probably need to redo them if we add a xto field. Broke out the
actual layout construction into separate functions.
2000-03-30 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/SplitLedger.c (xaccSRSaveRegEntry): remove the 'special
case' for setting the price. It is no longer needed.
* src/gnome/window-register.c (gnc_reg_set_window_name): set the
name regardless of whether there is a leader.
* src/SplitLedger.c (xaccSRLoadRegister): fixed a possible memory
leak in destroying the buffer
2000-03-29 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/scm/report/transaction-report.scm: bug fixes and speed

View File

@ -1,25 +0,0 @@
# -*-makefile-*-
# This file is used at the end of the configure run. It handles
# setting up the runtime paths that will be embedded into the gnucash
# binary. It can't be done using AC_OUTPUT because we'd need to
# expand a variable that's defined in terms of ${prefix} before
# AC_OUTPUT, and prefix isn't guaranteed to be defined until AC_OUTPUT
# is called.
include ./Makefile.init
PWD := $(shell pwd)
all:
perl -p \
-e "s|\@GNC_RUNTIME_SHAREDIR\@|${GNC_SHAREDIR}|o;" \
-e "s|\@GNC_RUNTIME_CONFIGDIR\@|${GNC_SHAREDIR}|o" \
< src/scm/bootstrap.scm.in > src/scm/bootstrap.scm
perl -p \
-e "s|\@GNC_RUNTIME_SHAREDIR\@|${GNC_SHAREDIR}|o;" \
-e "s|\@GNC_RUNTIME_CONFIGDIR\@|${GNC_SHAREDIR}|o" \
< src/guile/gnucash.h.in > src/guile/gnucash.h
cd lib/g-wrap && \
./configure --prefix=${PWD}/lib/g-wrap-install

View File

@ -49,12 +49,21 @@ all:
# definitions of *_SRCS, etc., but before the usage of *_OBJS.
include @top_srcdir@/Makefile.common
g-wrap-install:
# Right now we only configure g-wrap once per make distclean, but we
# try and re-build every make.
g-wrap.configure:
(cd g-wrap && ./configure --prefix=${PWD}/g-wrap-install)
touch g-wrap.configure
DIST_TRASH += g-wrap.configure
g-wrap-install: g-wrap.configure
(cd g-wrap && ${MAKE})
(cd g-wrap && ${MAKE} install)
TRASH += g-wrap-install
.PHONY: g-wrap-install
# this make dist is a quick hack to avoid build problems that
# # naive builders are suffering from. Doing a 'make dist' makes
# build problems go away.

View File

@ -150,3 +150,4 @@ lib/g-wrap/conf-h.in
lib/g-wrap/stamp-h.in
lib/g-wrap/*/Makefile.in
src/guile/i18n.h
make-gnucash-patch

View File

@ -48,6 +48,7 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/locale/en_GB/LC_MESSAGES/gnucash.mo
/usr/share/locale/fr/LC_MESSAGES/gnucash.mo
/usr/share/locale/sv/LC_MESSAGES/gnucash.mo
%config /usr/etc/gnucash
%doc /usr/doc/gnucash
%doc /usr/man/man1/gnucash.1
%doc /usr/man/man1/gnc-prices.1

View File

@ -1,70 +0,0 @@
Summary: A program to keep track of finances.
Name: xacc
Version: 1.0.17
Release: 1
Source: http://www.cs.hmc.edu/~rclark/xacc/download/xacc-1.0.17.tar.gz
Source1: xacc.wmconfig
URL: http://www.cs.hmc.edu/~rclark/xacc/
Group: Applications/Finance
Copyright: GPL
%description
X-Accountant is a program to keep track of your finances. Some of the
features are:
- Multiple accounts, which can be open at the same time. Create one
xacc account for each of your bank accounts.
- Each account keeps a running balance and a reconciled balance, so
you can keep track of the checks that have cleared your account.
- A simple interface. If you can use the register in the back of your
checkbook, you can use xacc. Automatic account reconciling. At the
end of the month, open up the reconcile window, enter your bank
statement's ending balance, and check off the transactions that appear
in the bank statement. This makes it easy to track down any discrepancies.
- QuickFill... if you begin typing in the description field, and the
text matches a previous transaction, hitting TAB will copy that
previous transaction. Handy if you have similar transactions on a
regular basis.
- Stock/Mutual Fund Portfolios. Track stocks individually (one per
account) or in portfolio of accounts (a group of accounts that can
be displayed together).
- Quicken File Import. Import Quicken QIF files.
%changelog
* Tue Feb 17 1998 Otto Hammersmith <otto@redhat.com>
- updated to 1.0.17, author hopes it will fix some problems with core dumps
* Mon Jan 26 1998 Otto Hammersmith <otto@redhat.com>
- built the package
%prep
%setup
%build
./configure --prefix=/usr
make depend
make
%install
install -d /usr/share/xacc
install -m 755 xacc /usr/bin/xacc
install -m 755 xacc.bin /usr/bin/xacc.bin
cp -pr Docs /usr/share/xacc
install -d /etc/X11/wmconfig
install -m 644 -o root -g root $RPM_SOURCE_DIR/xacc.wmconfig /etc/X11/wmconfig/xacc
%files
%doc README TODO
/usr/bin/xacc
/usr/bin/xacc.bin
/usr/share/xacc
/etc/X11/wmconfig/xacc

View File

@ -1,3 +0,0 @@
xacc name "X-Accountant"
xacc exec "xacc &"
xacc group Applications/Finance

View File

@ -1,82 +0,0 @@
Summary: Un programme de suivi de vos finances personnelles.
Name: xacc
Version: 1.0.18
Release: 1
Source: ftp://ftp.gnucash.org/pub/xacc/xacc_fr-1.0.18.tar.gz
Source1: xacc.wmconfig
URL: http://www.gnucash.org/xacc/
Group: Applications/Finance
Copyright: GPL
%description
X-Accountant est un programme de suivis de vos finances personnelles.
Quelques une de ces fonctions sont :
- Des comptes multiples, qui peuvent etre ouvert en meme temps.Creez un
compte xacc pour chacun de vos compptes bancaires.
- Chaque compte conserve un solde actuel et un solde de rapprochement,
alors vous pouvez suivre les verifications qui ont ete pointes sur
votre compte.
- Une interface simple. Si vous savez utiliser le talon de votre
chequier, vous savez utiliser xacc. Rapprochement automatique des
comptes. A la fin du mois, ouvrez la fenetre de rapprochement,
entrez le solde final de votre releve de compte et pointez les
transactions qui apparaissent sur votre releve de compte.Cela rend
facile le depistage de n'importe quelle discordance.
- QuickFill (saisie rapide)... lorsque vous commencez une saisie
dans les champs de description , s'il retrouve une precedente transaction,
il vous la propose,frappez <TAB> copiera alors la precedente transaction.
Commode si vous avez des transactions semblables assez regulierement .
- Portefeuille d'actions/de societes d'investissements (n.d.t: pour ces
dernieres FCP et SICAV en France). Suivis d'actions individuellement
(une par compte)ou dans un portefeuille de comptes (un groupe de comptes
qui peuvent etre affiches ensemble ).
- Importation des fichiers QIF de Quicken .
%changelog
* Dim 14 Jun 1998 Linas Vepstas <linas@linas.org>
- mise a jour vers 1.0.18, diverses corrections, quelques plantages
* Mar 17 Fev 1998 Otto Hammersmith <otto@redhat.com>
- mise a jour vers 1.0.17, l'auteur espere qu'il fixera quelques
problemes avec les plantages.
* Lun 26 Jan 1998 Otto Hammersmith <otto@redhat.com>
- construction du paquet
%prep
%setup
%build
./configure --prefix=/usr
make depend
make
make static
%install
install -d /usr/share/xacc
install -m 755 xacc /usr/bin/xacc
install -m 755 xacc.bin /usr/bin/xacc.bin
install -m 755 xacc-static.bin /usr/bin/xacc-static.bin
cp -pr Docs /usr/share/xacc
install -d /etc/X11/wmconfig
install -m 644 -o root -g root $RPM_SOURCE_DIR/xacc.wmconfig /etc/X11/wmconfig/xacc
%files
%doc README TODO CHANGES COPYING README.francais LISEZ.MOI
/usr/bin/xacc
/usr/bin/xacc.bin
/usr/bin/xacc-static.bin
/usr/share/xacc
/etc/X11/wmconfig/xacc

View File

@ -53,30 +53,33 @@ include @top_srcdir@/Makefile.common
default: $(OBJS)
motif motif.static: ${MOTIF_OBJS}
@cd engine; $(MAKE) default
@cd register; $(MAKE) motif
@cd reports; $(MAKE) default
@cd g-wrap; $(MAKE) motif
@cd swig; $(MAKE) motif
@cd guile; $(MAKE) default
@cd motif; $(MAKE) $@
@cd scm && $(MAKE) default
@cd engine && $(MAKE) default
@cd register && $(MAKE) motif
@cd reports && $(MAKE) default
@cd g-wrap && $(MAKE) motif
@cd swig && $(MAKE) motif
@cd guile && $(MAKE) default
@cd motif && $(MAKE) $@
gnome gnome.static: ${GNOME_OBJS}
@cd engine; $(MAKE) default
@cd register; $(MAKE) gnome
@cd reports; $(MAKE) default
@cd g-wrap; $(MAKE) gnome
@cd swig; $(MAKE) gnome
@cd guile; $(MAKE) default
@cd gnome; $(MAKE) $@
@cd scm && $(MAKE) default
@cd engine && $(MAKE) default
@cd register && $(MAKE) gnome
@cd reports && $(MAKE) default
@cd g-wrap && $(MAKE) gnome
@cd swig && $(MAKE) gnome
@cd guile && $(MAKE) default
@cd gnome && $(MAKE) $@
qt qt.static: $(QT_OBJS)
@cd engine; $(MAKE) default
@cd register; $(MAKE) qt
@cd reports; $(MAKE) default
@cd g-wrap; $(MAKE) qt
@cd swig; $(MAKE) qt
@cd guile; $(MAKE) default
@cd qt; $(MAKE) $@
@cd scm && $(MAKE) default
@cd engine && $(MAKE) default
@cd register && $(MAKE) qt
@cd reports && $(MAKE) default
@cd g-wrap && $(MAKE) qt
@cd swig && $(MAKE) qt
@cd guile && $(MAKE) default
@cd qt && $(MAKE) $@
.PHONY: default qt qt.static gnome gnome.static motif motif.static all

1
src/quotes/.cvsignore Normal file
View File

@ -0,0 +1 @@
gnc-prices

13
src/quotes/gnc-prices → src/quotes/gnc-prices.in Executable file → Normal file
View File

@ -13,15 +13,13 @@
# hack alert -- this pathname should *NOT* be hard-coded, nor should the
# ones below it.
use lib '/usr/lib/gnucash';
use lib '/usr/local/lib/gnucash';
use lib '/opt/gnucash/lib/gnucash';
use lib '@GNC_EXPANDED_LIBDIR@';
use Quote;
use gnucash;
# --------------------------------------------------
# @account_list = &account_flatlist ($account_group);
# This routine accepts a pointer to a group, returns
# This rouine accepts a pointer to a group, returns
# a flat list of all of the children in the group.
sub account_flatlist
@ -59,7 +57,6 @@ sub checkprice
my $dayte = $_[1];
my ($query, $datesecs, $earliest, $latest);
my ($splitlist, $i, $split, $action);
my $retn_value = 0;
$datesecs = gnucash::xaccScanDateS ($dayte);
$earliest = $datesecs - 16*3600; # subtract 16 hours
@ -71,17 +68,17 @@ sub checkprice
$i = 0;
$split = gnucash::IthSplit ($splitlist, $i);
while ($split && ($retn_value == 0))
while ($split)
{
$action = gnucash::xaccSplitGetAction ($split);
if ($action eq "Price") { $retn_value = 1; }
if ($action eq "Price") { return 1; }
$i++;
$split = gnucash::IthSplit ($splitlist, $i);
}
gnucash::xaccFreeQuery ($query);
return $retn_value;
return 0;
}
# --------------------------------------------------

View File

@ -251,197 +251,417 @@ style_layout_info_destroy (CellLayoutInfo *li)
}
static void
layout_init_normal(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[1][8] = {{0.10, 0.07, 0.25, 0.20, 0.02, 0.12, 0.12, 0.12}};
CellLayoutData ld[1][8] =
{{{STRING_FIXED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,10,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (1, 8);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_ledger(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[1][7] = {{0.10, 0.07, 0.32, 0.25, 0.02, 0.12, 0.12}};
CellLayoutData ld[1][7] =
{{{STRING_FIXED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,10,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (1, 7);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_double(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[2][8] = {{0.10, 0.07, 0.25, 0.20, 0.02, 0.12, 0.12, 0.12},
{0.10, 0.07, 0.83, 0.0, 0.0, 0.0, 0.0, 0.0}};
CellLayoutData ld[2][8] =
{{{STRING_FIXED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,1,0,1,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,2,0,7,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (2, 8);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_ledger_double(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[2][7] = {{0.10, 0.07, 0.32, 0.25, 0.02, 0.12, 0.12},
{0.10, 0.07, 0.83, 0.0, 0.0, 0.0, 0.0}};
CellLayoutData ld[2][7] =
{{{STRING_FIXED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,1,0,1,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,2,0,7,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (2, 7);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_stock(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[1][11] = {{0.09, 0.06, 0.20, 0.14, 0.01, 0.10,
0.10, 0.07, 0.07, 0.07, 0.09}};
CellLayoutData ld[1][11] =
{{{STRING_FIXED,RESIZABLE, 0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (1, 11);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_stock_ledger(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[1][10] = {{0.09, 0.06, 0.24, 0.19, 0.01, 0.10,
0.10, 0.07, 0.07, 0.07}};
CellLayoutData ld[1][10] =
{{{STRING_FIXED,RESIZABLE, 0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN | FILL,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED,0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (1, 10);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_stock_double(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[2][11] = {{0.09, 0.06, 0.20, 0.14, 0.01,
0.10, 0.10, 0.07, 0.07, 0.07, 0.09},
{0.0, 0.15, 0.11, 0.74, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
CellLayoutData ld[2][11] =
{{{STRING_FIXED, RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN | FILL,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED, 0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,1,0,1,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,2,0,10,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (2, 11);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
static void
layout_init_stock_ledger_double(GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
int i, j;
double perc[2][10] = {{0.09, 0.06, 0.24, 0.19, 0.01,
0.10, 0.10, 0.07, 0.07, 0.07},
{0.0, 0.15, 0.11, 0.74, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0}};
CellLayoutData ld[2][10] =
{{{STRING_FIXED, RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,date_str},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,3,0,5,0,0,0,0,0,0,0,NULL},
{CHARS_MIN,RESIZABLE,0,0,20,0,0,0,0,0,0,0,0,0,NULL},
{STRING_MIN | FILL,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,XFRM_STR},
{STRING_FIXED, 0,1,0,0,0,0,0,0,0,0,0,0,0,"R"},
{CHARS_MIN | CHARS_MAX,RESIZABLE,0,0,9,0,10,0,0,0,0,0,0,0,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL},
{SAME_SIZE,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,5,NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,1,0,1,0,0,NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED,RESIZABLE,0,0,0,0,0,0,0,2,0,10,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
{PIXELS_FIXED,0,0,0,0,0,0,0,0,0,0,0,0,0,NULL},
}};
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (2, 10);
g_hash_table_insert (sheet->layout_info_hash_table,
style_get_key (style), layout_info);
style->layout_info = layout_info;
layout_info->refcount++;
}
/* FIXME: read this from a config file */
/* keep this in sync with splitreg.c */
void
gnucash_style_layout_init (GnucashSheet *sheet, SheetBlockStyle *style)
{
CellLayoutInfo *layout_info;
char date_str[128];
printDate(date_str, 29, 12, 2000);
strcat(date_str, "0");
layout_info = g_hash_table_lookup (sheet->layout_info_hash_table,
style_get_key (style));
if (layout_info != NULL)
{
style->layout_info = layout_info;
layout_info->refcount++;
return;
}
switch (style->reg_type) {
case BANK_REGISTER:
case CASH_REGISTER:
case ASSET_REGISTER:
case CREDIT_REGISTER:
case LIABILITY_REGISTER:
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:
case INCOME_LEDGER:
case GENERAL_LEDGER:
switch (style->cursor_type) {
case GNUCASH_CURSOR_HEADER:
case GNUCASH_CURSOR_SINGLE:
case GNUCASH_CURSOR_TRANS:
case GNUCASH_CURSOR_SPLIT:
{
int i, j;
double perc[1][8] = {{0.10, 0.07, 0.25, 0.20, 0.02, 0.12, 0.12, 0.12}};
CellLayoutData ld[1][8] =
{{{STRING_FIXED, RESIZABLE, 0, 0,0,0,0,0,0,0,0,0, 0, 0, date_str},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 3, 0, 5,0,0,0,0,0, 0, 0, NULL},
{CHARS_MIN | FILL, RESIZABLE, 0, 0,20,0,0,0,0,0,0,0, 0,0, NULL},
{STRING_MIN, RESIZABLE, 0, 0, 0 ,0, 10 ,0,0,0,0,0, 0, 0, XFRM_STR},
{STRING_FIXED, 0, 1, 0,0,0,0,0,0,0,0,0, 0, 0, "R"},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 9,0, 10,0,0,0,0,0, 0, 0, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
}};
layout_info = g_hash_table_lookup (sheet->layout_info_hash_table, style_get_key (style));
if (!layout_info) {
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (1, 8);
g_hash_table_insert (sheet->layout_info_hash_table, style_get_key (style), layout_info);
}
style->layout_info = layout_info;
layout_info->refcount++;
case BANK_REGISTER:
case CASH_REGISTER:
case ASSET_REGISTER:
case CREDIT_REGISTER:
case LIABILITY_REGISTER:
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:
switch (style->cursor_type) {
case GNUCASH_CURSOR_HEADER:
case GNUCASH_CURSOR_SINGLE:
case GNUCASH_CURSOR_TRANS:
case GNUCASH_CURSOR_SPLIT:
layout_init_normal(sheet, style);
break;
case GNUCASH_CURSOR_DOUBLE:
layout_init_double(sheet, style);
break;
default:
break;
}
break;
case GNUCASH_CURSOR_DOUBLE:
{
int i, j;
double perc[2][8] = {{0.10, 0.07, 0.25, 0.20, 0.02, 0.12, 0.12, 0.12},
{0.10, 0.07, 0.83, 0.0, 0.0, 0.0, 0.0, 0.0}};
CellLayoutData ld[2][8] =
{{{STRING_FIXED, RESIZABLE, 0, 0,0,0,0,0,0,0,0,0, 0, 0, date_str},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 3, 0, 5,0,0,0,0,0, 0, 0, NULL},
{CHARS_MIN | FILL, RESIZABLE, 0, 0,20,0,0,0,0,0,0,0, 0,0, NULL},
{STRING_MIN, RESIZABLE, 0, 0, 0 ,0,0 ,0,0,0,0,0, 0, 0, XFRM_STR},
{STRING_FIXED, 0, 1, 0,0,0,0,0,0,0,0,0, 0, 0, "R"},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 9,0, 10,0,0,0,0,0, 0, 0, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED, RESIZABLE, 0, 0, 0,0,0,0,0,1,0,1, 0,0, NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED, RESIZABLE, 0, 0, 0,0,0,0,0,2,0,7, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
}};
layout_info = g_hash_table_lookup (sheet->layout_info_hash_table, style_get_key (style));
if (!layout_info) {
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (2, 8);
g_hash_table_insert (sheet->layout_info_hash_table, style_get_key (style), layout_info);
}
style->layout_info = layout_info;
layout_info->refcount++;
}
break;
case INCOME_LEDGER:
case GENERAL_LEDGER:
case SEARCH_LEDGER:
switch (style->cursor_type) {
case GNUCASH_CURSOR_HEADER:
case GNUCASH_CURSOR_SINGLE:
case GNUCASH_CURSOR_TRANS:
case GNUCASH_CURSOR_SPLIT:
layout_init_ledger(sheet, style);
break;
case GNUCASH_CURSOR_DOUBLE:
layout_init_ledger_double(sheet, style);
break;
default:
break;
}
break;
case STOCK_REGISTER:
case CURRENCY_REGISTER:
switch (style->cursor_type) {
case GNUCASH_CURSOR_HEADER:
case GNUCASH_CURSOR_SINGLE:
case GNUCASH_CURSOR_TRANS:
case GNUCASH_CURSOR_SPLIT:
layout_init_stock(sheet, style);
break;
case GNUCASH_CURSOR_DOUBLE:
layout_init_stock_double(sheet, style);
break;
}
case PORTFOLIO_LEDGER:
switch (style->cursor_type) {
case GNUCASH_CURSOR_HEADER:
case GNUCASH_CURSOR_SINGLE:
case GNUCASH_CURSOR_TRANS:
case GNUCASH_CURSOR_SPLIT:
layout_init_stock_ledger(sheet, style);
break;
case GNUCASH_CURSOR_DOUBLE:
layout_init_stock_ledger_double(sheet, style);
break;
}
default:
break;
}
break;
case STOCK_REGISTER:
case PORTFOLIO:
case CURRENCY_REGISTER:
switch (style->cursor_type)
{
case GNUCASH_CURSOR_HEADER:
case GNUCASH_CURSOR_SINGLE:
case GNUCASH_CURSOR_TRANS:
case GNUCASH_CURSOR_SPLIT:
{
int i, j;
double perc[1][11] = {{0.09, 0.06, 0.20, 0.14, 0.01, 0.10, 0.10, 0.07, 0.07, 0.07, 0.09}};
CellLayoutData ld[1][11] =
{{{STRING_FIXED, RESIZABLE, 0, 0,0,0,0,0,0,0,0,0, 0, 0, date_str},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 3, 0, 5,0,0,0,0,0, 0, 0, NULL},
{CHARS_MIN | FILL, RESIZABLE, 0, 0,20,0,0,0,0,0,0,0, 0,0, NULL},
{STRING_MIN, RESIZABLE, 0, 0, 0 ,0, 0 ,0,0,0,0,0, 0, 0, XFRM_STR},
{STRING_FIXED, 0, 1, 0,0,0,0,0,0,0,0,0, 0, 0, "R"},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 9,0, 10,0,0,0,0,0, 0, 0, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
}};
layout_info = g_hash_table_lookup (sheet->layout_info_hash_table, style_get_key (style));
if (!layout_info) {
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (1, 11);
g_hash_table_insert (sheet->layout_info_hash_table, style_get_key (style), layout_info);
}
style->layout_info = layout_info;
layout_info->refcount++;
}
break;
case GNUCASH_CURSOR_DOUBLE:
{
int i, j;
double perc[2][11] = {{0.09, 0.06, 0.20, 0.14, 0.01, 0.10, 0.10, 0.07, 0.07, 0.07, 0.09},
{0.0, 0.15, 0.11, 0.74, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}};
CellLayoutData ld[2][11] =
{{{STRING_FIXED, RESIZABLE, 0, 0,0,0,0,0,0,0,0,0, 0, 0, date_str},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 3, 0, 5,0,0,0,0,0, 0, 0, NULL},
{CHARS_MIN, RESIZABLE, 0, 0,20,0,0,0,0,0,0,0, 0,0, NULL},
{STRING_MIN | FILL, RESIZABLE, 0, 0, 0 ,0, 0 ,0,0,0,0,0, 0, 0, XFRM_STR},
{STRING_FIXED, 0, 1, 0,0,0,0,0,0,0,0,0, 0, 0, "R"},
{CHARS_MIN | CHARS_MAX, RESIZABLE, 0, 0, 9,0, 10,0,0,0,0,0, 0, 0, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL},
{SAME_SIZE, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,5, NULL}},
{{LEFT_ALIGNED|RIGHT_ALIGNED, RESIZABLE, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED, RESIZABLE, 0, 0, 0,0,0,0,0,1,0,1, 0,0, NULL},
{LEFT_ALIGNED|RIGHT_ALIGNED, RESIZABLE, 0, 0, 0,0,0,0,0,2,0,10, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
{PIXELS_FIXED, 0, 0, 0, 0,0,0,0,0,0,0,0, 0,0, NULL},
}};
layout_info = g_hash_table_lookup (sheet->layout_info_hash_table, style_get_key (style));
if (!layout_info) {
layout_info = style_layout_info_new (style);
SET_CELL_LAYOUT_DATA (2, 11);
g_hash_table_insert (sheet->layout_info_hash_table, style_get_key (style), layout_info);
}
style->layout_info = layout_info;
layout_info->refcount++;
}
break;
}
default:
break;
}
}

View File

@ -226,11 +226,15 @@ configLabels (SplitRegister *reg)
LABEL (CRED, DEFICIT_STR);
break;
case STOCK_REGISTER:
case PORTFOLIO:
case PORTFOLIO_LEDGER:
case CURRENCY_REGISTER:
LABEL (DEBT, SOLD_STR);
LABEL (CRED, BOUGHT_STR);
break;
case SEARCH_LEDGER:
LABEL (DEBT, DEBIT_STR);
LABEL (CRED, CREDIT_STR);
break;
default:
break;
}
@ -244,7 +248,7 @@ configLabels (SplitRegister *reg)
/* ============================================== */
/* configAction strings into the action cell */
/* hack alert -- this stuf really, really should be in a config file ... */
/* hack alert -- this stuff really, really should be in a config file ... */
static void
configAction (SplitRegister *reg)
@ -254,6 +258,7 @@ configAction (SplitRegister *reg)
/* setup custom labels for the debit/credit columns */
switch (type) {
case BANK_REGISTER:
case SEARCH_LEDGER: /* broken ! FIXME bg */
xaccAddComboCellMenuItem ( reg->actionCell, DEPOSIT_STR);
xaccAddComboCellMenuItem ( reg->actionCell, WITHDRAW_STR);
xaccAddComboCellMenuItem ( reg->actionCell, CHECK_STR);
@ -308,7 +313,7 @@ configAction (SplitRegister *reg)
xaccAddComboCellMenuItem ( reg->actionCell, EQUITY_STR);
break;
case STOCK_REGISTER:
case PORTFOLIO:
case PORTFOLIO_LEDGER:
case CURRENCY_REGISTER:
xaccAddComboCellMenuItem ( reg->actionCell, BUY_STR);
xaccAddComboCellMenuItem ( reg->actionCell, SELL_STR);
@ -368,7 +373,7 @@ configLayout (SplitRegister *reg)
{
CellBlock *curs, *header;
int type = (reg->type) & REG_TYPE_MASK;
// int style = (reg->type) & REG_STYLE_MASK;
gncBoolean include_balance = GNC_T;
int i;
/* define header for macros */
@ -385,6 +390,11 @@ configLayout (SplitRegister *reg)
}
switch (type) {
case INCOME_LEDGER:
case GENERAL_LEDGER:
case SEARCH_LEDGER:
include_balance = GNC_F;
/* fall through */
case BANK_REGISTER:
case CASH_REGISTER:
case ASSET_REGISTER:
@ -393,9 +403,6 @@ configLayout (SplitRegister *reg)
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:
case INCOME_LEDGER: /* hack alert do xto cell too */
case GENERAL_LEDGER: /* hack alert do xto cell too */
{
curs = reg->double_cursor;
FANCY (DATE, date, 0, 0);
@ -405,7 +412,10 @@ configLayout (SplitRegister *reg)
BASIC (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (BALN, balance, 7, 0);
if (include_balance) {
FANCY (BALN, balance, 7, 0);
}
FANCY (ACTN, action, 1, 1);
FANCY (MEMO, memo, 2, 1);
@ -417,7 +427,10 @@ configLayout (SplitRegister *reg)
BASIC (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (BALN, balance, 7, 0);
if (include_balance) {
FANCY (BALN, balance, 7, 0);
}
curs = reg->split_cursor;
FANCY (ACTN, action, 1, 0);
@ -435,14 +448,19 @@ configLayout (SplitRegister *reg)
BASIC (RECN, recn, 4, 0);
FANCY (DEBT, debit, 5, 0);
FANCY (CRED, credit, 6, 0);
FANCY (BALN, balance, 7, 0);
if (include_balance) {
FANCY (BALN, balance, 7, 0);
}
break;
}
/* --------------------------------------------------------- */
case PORTFOLIO_LEDGER:
include_balance = GNC_F;
/* fall through */
case STOCK_REGISTER:
case PORTFOLIO:
case CURRENCY_REGISTER:
{
/* prep the second row of the double style */
@ -457,7 +475,10 @@ configLayout (SplitRegister *reg)
FANCY (PRIC, price, 7, 0);
FANCY (VALU, value, 8, 0);
FANCY (SHRS, shrs, 9, 0);
FANCY (BALN, balance, 10, 0);
if (include_balance) {
FANCY (BALN, balance, 10, 0);
}
FANCY (ACTN, action, 1, 1);
FANCY (MEMO, memo, 2, 1);
@ -473,8 +494,11 @@ configLayout (SplitRegister *reg)
FANCY (PRIC, price, 7, 0);
FANCY (VALU, value, 8, 0);
FANCY (SHRS, shrs, 9, 0);
FANCY (BALN, balance, 10, 0);
if (include_balance) {
FANCY (BALN, balance, 10, 0);
}
curs = reg->split_cursor;
FANCY (ACTN, action, 1, 0);
FANCY (MEMO, memo, 2, 0);
@ -494,25 +518,22 @@ configLayout (SplitRegister *reg)
FANCY (PRIC, price, 7, 0);
FANCY (VALU, value, 8, 0);
FANCY (SHRS, shrs, 9, 0);
FANCY (BALN, balance, 10, 0);
if (include_balance) {
FANCY (BALN, balance, 10, 0);
}
break;
}
/* --------------------------------------------------------- */
default:
PERR ("configLayout(): "
"unknown register type %d \n", type);
PERR ("configLayout(): unknown register type %d \n", type);
break;
}
}
/* ============================================== */
/* define the traversal order */
/* negative cells mean "traverse out of table" */
/* hack alert -- redesign so that we hop from one row to the next, if desired. */
/* hack alert -- if show_tamount or show_samount is set then don't traverse there */
/* hack alert -- fix show_txfrm also ... */
/* define the traversal order -- negative cells mean "traverse out of table" */
/* Right Traversals */
@ -840,43 +861,46 @@ configCursors (SplitRegister *reg)
static void
mallocCursors (SplitRegister *reg)
{
int type = (reg->type) & REG_TYPE_MASK;
int type = (reg->type) & REG_TYPE_MASK;
switch (type) {
case BANK_REGISTER:
case CASH_REGISTER:
case ASSET_REGISTER:
case CREDIT_REGISTER:
case LIABILITY_REGISTER:
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:
switch (type) {
case BANK_REGISTER:
case CASH_REGISTER:
case ASSET_REGISTER:
case CREDIT_REGISTER:
case LIABILITY_REGISTER:
case INCOME_REGISTER:
case EXPENSE_REGISTER:
case EQUITY_REGISTER:
reg->num_cols = 8;
break;
case INCOME_LEDGER: /* hack alert do xto cell too */
case GENERAL_LEDGER: /* hack alert do xto cell too */
reg->num_cols = 8;
break;
case INCOME_LEDGER:
case GENERAL_LEDGER:
case SEARCH_LEDGER:
reg->num_cols = 7;
break;
case STOCK_REGISTER:
case PORTFOLIO:
case CURRENCY_REGISTER:
reg->num_cols = 11;
break;
default:
break;
}
case STOCK_REGISTER:
case CURRENCY_REGISTER:
reg->num_cols = 11;
break;
case PORTFOLIO_LEDGER:
reg->num_cols = 10;
default:
break;
}
reg->num_header_rows = 1;
reg->header = xaccMallocCellBlock (reg->num_header_rows, reg->num_cols);
reg->num_header_rows = 1;
reg->header = xaccMallocCellBlock (reg->num_header_rows, reg->num_cols);
/* cursors used in the single & double line displays */
reg->single_cursor = xaccMallocCellBlock (1, reg->num_cols);
reg->double_cursor = xaccMallocCellBlock (2, reg->num_cols);
/* the two cursors used for multi-line and dynamic displays */
reg->trans_cursor = xaccMallocCellBlock (1, reg->num_cols);
reg->split_cursor = xaccMallocCellBlock (1, reg->num_cols);
/* cursors used in the single & double line displays */
reg->single_cursor = xaccMallocCellBlock (1, reg->num_cols);
reg->double_cursor = xaccMallocCellBlock (2, reg->num_cols);
/* the two cursors used for multi-line and dynamic displays */
reg->trans_cursor = xaccMallocCellBlock (1, reg->num_cols);
reg->split_cursor = xaccMallocCellBlock (1, reg->num_cols);
}
/* ============================================== */
@ -1024,7 +1048,7 @@ xaccInitSplitRegister (SplitRegister *reg, int type)
/* number format for share quantities in stock ledgers */
switch (type & REG_TYPE_MASK) {
case STOCK_REGISTER:
case PORTFOLIO:
case PORTFOLIO_LEDGER:
case CURRENCY_REGISTER:
xaccSetPriceCellSharesValue (reg->debitCell, GNC_T);
xaccSetPriceCellSharesValue (reg->creditCell, GNC_T);
@ -1093,7 +1117,7 @@ xaccConfigSplitRegister (SplitRegister *reg, int newtype)
reg->type = newtype;
/* Make sure that any GUI elements associated with this reconfig
* are properly initialized. */
* are properly initialized. */
xaccCreateCursor (reg->table, reg->single_cursor);
xaccCreateCursor (reg->table, reg->double_cursor);
xaccCreateCursor (reg->table, reg->trans_cursor);

View File

@ -70,7 +70,9 @@
#define GENERAL_LEDGER 11
#define INCOME_LEDGER 12
#define PORTFOLIO 13
#define PORTFOLIO_LEDGER 13
#define SEARCH_LEDGER 14
#define REG_TYPE_MASK 0xff
/*