Don't blank zero values in the balance column of register.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@2275 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Dave Peticolas 2000-05-08 11:17:05 +00:00
parent deb2e431a3
commit 06ef3213dc
7 changed files with 59 additions and 6 deletions

View File

@ -1,3 +1,16 @@
2000-05-08 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/register/pricecell.c: allow the cell to be blanked directly.
* src/SplitLedger.c (xaccSRLoadRegEntry): explicitly blank the
balance cell for the blank split.
* src/register/splitreg.c (xaccInitSplitRegister): don't blank zeros
on the balance cell by default.
* src/gnome/window-main.c (gnc_main_create_menus): rename the
'Help' menu item to 'Manual'.
2000-05-07 Dave Peticolas <peticola@cs.ucdavis.edu>
* src/guile/i18n.h.in: always include locale.h

View File

@ -1759,7 +1759,11 @@ xaccSRLoadRegEntry (SplitRegister *reg, Split *split)
(EXPENSE_REGISTER == typo)) {
baln = -baln;
}
xaccSetPriceCellValue (reg->balanceCell, baln);
if (split == info->blank_split)
xaccSetPriceCellBlank (reg->balanceCell);
else
xaccSetPriceCellValue (reg->balanceCell, baln);
xaccSetPriceCellValue (reg->shrsCell, xaccSplitGetShareBalance (split));

View File

@ -915,7 +915,7 @@ gnc_main_create_menus(GnomeApp *app, GtkWidget *account_tree,
static GnomeUIInfo helpmenu[] = {
{
GNOME_APP_UI_ITEM,
HELP_MENU_STR_N, TOOLTIP_HELP_N,
MAN_MENU_STR_N, TOOLTIP_MAN_N,
gnc_ui_help_cb, NULL, NULL,
GNOME_APP_PIXMAP_NONE, NULL,
0, 0, NULL

View File

@ -218,6 +218,8 @@
#define TOOLTIP_JUMP_TRANS_N N_("Jump to the corresponding transaction in "\
"the other account")
#define TOOLTIP_JUMP_TRANS _(TOOLTIP_JUMP_TRANS_N)
#define TOOLTIP_MAN_N N_("Open the GnuCash Manual")
#define TOOLTIP_MAN _(TOOLTIP_MAN_N)
#define TOOLTIP_MULTI_LINE_N N_("Show transactions on multiple lines with "\
"one line for each split")
#define TOOLTIP_MULTI_LINE _(TOOLTIP_MULTI_LINE_N)
@ -338,6 +340,8 @@
#define HELP_MENU_STR _(HELP_MENU_STR_N)
#define JUMP_MENU_STR_N N_("_Jump")
#define JUMP_MENU_STR _(JUMP_MENU_STR_N)
#define MAN_MENU_STR_N N_("_Manual")
#define MAN_MENU_STR _(MAN_MENU_STR_N)
#define NEW_MENU_STR_N N_("_New")
#define NEW_MENU_STR _(NEW_MENU_STR_N)
#define NEW_ACC_MENU_STR _("_New Account")

View File

@ -239,15 +239,20 @@ xaccPriceCellPrintValue (PriceCell *cell)
double
xaccGetPriceCellValue (PriceCell *cell)
{
assert(cell != NULL);
if (cell == NULL)
return 0.0;
return cell->amount;
}
void xaccSetPriceCellValue (PriceCell * cell, double amt)
void
xaccSetPriceCellValue (PriceCell * cell, double amt)
{
char *buff;
if (cell == NULL)
return;
cell->amount = amt;
buff = xaccPriceCellPrintValue (cell);
@ -257,6 +262,19 @@ void xaccSetPriceCellValue (PriceCell * cell, double amt)
COLORIZE (cell, amt);
}
void
xaccSetPriceCellBlank (PriceCell *cell)
{
if (cell == NULL)
return;
cell->amount = 0.0;
SET ( &(cell->cell), "");
COLORIZE (cell, 0.0);
}
/* ================================================ */
void
@ -318,9 +336,17 @@ static void
PriceSetValue (BasicCell *_cell, const char *str)
{
PriceCell *cell = (PriceCell *) _cell;
double amt = xaccParseAmount (str, cell->monetary);
double amount;
xaccSetPriceCellValue (cell, amt);
if (str == NULL)
str = "";
if (!cell->blank_zero && (*str == '\0'))
xaccSetPriceCellBlank(cell);
else {
amount = xaccParseAmount (str, cell->monetary);
xaccSetPriceCellValue (cell, amount);
}
}
/* --------------- end of file ---------------------- */

View File

@ -76,6 +76,9 @@ double xaccGetPriceCellValue (PriceCell *cell);
/* updates amount, string format is three decimal places */
void xaccSetPriceCellValue (PriceCell *cell, double amount);
/* Sets the cell as blank, regardless of the blank_zero value */
void xaccSetPriceCellBlank (PriceCell *cell);
/* determines whether 0 values are left blank or printed.
* defaults to true. */
void xaccSetPriceCellBlankZero (PriceCell *cell, gncBoolean);

View File

@ -1120,6 +1120,9 @@ xaccInitSplitRegister (SplitRegister *reg, int type)
reg->balanceCell->cell.input_output = XACC_CELL_ALLOW_SHADOW;
reg->shrsCell->cell.input_output = XACC_CELL_ALLOW_SHADOW;
/* by default, don't blank zeros on the balance cell. */
xaccSetPriceCellBlankZero(reg->balanceCell, GNC_F);
/* The reconcile cell should only be entered with the pointer,
* and only then when the user clicks directly on the cell.
*/