mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
More register cleanup.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5171 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e5af9794bb
commit
9c6209f360
@ -315,7 +315,7 @@ gnucash_ui_init(void)
|
||||
NULL, "Register",
|
||||
"Register hint font");
|
||||
|
||||
xaccRecnCellSetStringGetter(gnc_get_reconcile_str);
|
||||
gnc_recn_cell_set_string_getter (gnc_get_reconcile_str);
|
||||
|
||||
/* gnc_default_ui_start */
|
||||
gnucash_style_init();
|
||||
|
@ -1286,7 +1286,7 @@ xaccSRSaveRegEntryToSCM (SplitRegister *reg, SCM trans_scm, SCM split_scm,
|
||||
char flag;
|
||||
|
||||
cell = gnc_table_layout_get_cell (reg->table->layout, RECN_CELL);
|
||||
flag = xaccRecnCellGetFlag ((RecnCell *) cell);
|
||||
flag = gnc_recn_cell_get_flag ((RecnCell *) cell);
|
||||
|
||||
gnc_split_scm_set_reconcile_state(split_scm, flag);
|
||||
}
|
||||
@ -2095,9 +2095,9 @@ xaccSRActuallySaveChangedCells (SplitRegister *reg,
|
||||
cell = (RecnCell *) gnc_table_layout_get_cell (reg->table->layout,
|
||||
RECN_CELL);
|
||||
|
||||
DEBUG ("RECN: %c", xaccRecnCellGetFlag (cell));
|
||||
DEBUG ("RECN: %c", gnc_recn_cell_get_flag (cell));
|
||||
|
||||
xaccSplitSetReconcile (split, xaccRecnCellGetFlag (cell));
|
||||
xaccSplitSetReconcile (split, gnc_recn_cell_get_flag (cell));
|
||||
}
|
||||
|
||||
if (gnc_table_layout_get_cell_changed (reg->table->layout, ACTN_CELL, TRUE))
|
||||
@ -3351,9 +3351,8 @@ xaccSRConfirmHandler (VirtualLocation virt_loc,
|
||||
return TRUE;
|
||||
|
||||
if (gnc_table_layout_get_cell_changed (reg->table->layout, RECN_CELL, FALSE))
|
||||
recn = xaccRecnCellGetFlag ((RecnCell *)
|
||||
gnc_table_layout_get_cell (reg->table->layout,
|
||||
RECN_CELL));
|
||||
recn = gnc_recn_cell_get_flag
|
||||
((RecnCell *) gnc_table_layout_get_cell (reg->table->layout, RECN_CELL));
|
||||
else
|
||||
recn = xaccSplitGetReconcile (split);
|
||||
|
||||
@ -3879,7 +3878,7 @@ xaccSRLoadRegister (SplitRegister *reg, GList * slist,
|
||||
gnc_get_account_separator ());
|
||||
|
||||
/* set the confirmation callback for the reconcile cell */
|
||||
xaccRecnCellSetConfirmCB
|
||||
gnc_recn_cell_set_confirm_cb
|
||||
((RecnCell *)
|
||||
gnc_table_layout_get_cell (reg->table->layout, RECN_CELL),
|
||||
recn_cell_confirm, reg);
|
||||
|
@ -56,13 +56,11 @@ static RecnCellStringGetter string_getter = NULL;
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_REGISTER;
|
||||
|
||||
static void RecnSetValue (BasicCell *_cell, const char *value);
|
||||
static void gnc_recn_cell_set_value (BasicCell *_cell, const char *value);
|
||||
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
static const char *
|
||||
RecnCellGetString (char reconciled_flag)
|
||||
gnc_recn_cell_get_string (char reconciled_flag)
|
||||
{
|
||||
static char str[2] = { 0, 0 };
|
||||
|
||||
@ -74,10 +72,8 @@ RecnCellGetString (char reconciled_flag)
|
||||
return str;
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
static gboolean
|
||||
RecnEnter (BasicCell *_cell,
|
||||
gnc_recn_cell_enter (BasicCell *_cell,
|
||||
int *cursor_position,
|
||||
int *start_selection,
|
||||
int *end_selection)
|
||||
@ -93,42 +89,38 @@ RecnEnter (BasicCell *_cell,
|
||||
else
|
||||
cell->reconciled_flag = NREC;
|
||||
|
||||
xaccRecnCellSetFlag (cell, cell->reconciled_flag);
|
||||
gnc_recn_cell_set_flag (cell, cell->reconciled_flag);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
static void
|
||||
xaccInitRecnCell (RecnCell *cell)
|
||||
gnc_recn_cell_init (RecnCell *cell)
|
||||
{
|
||||
gnc_basic_cell_init (&cell->cell);
|
||||
|
||||
xaccRecnCellSetFlag (cell, NREC);
|
||||
gnc_recn_cell_set_flag (cell, NREC);
|
||||
cell->confirm_cb = NULL;
|
||||
|
||||
cell->cell.enter_cell = RecnEnter;
|
||||
cell->cell.set_value = RecnSetValue;
|
||||
cell->cell.enter_cell = gnc_recn_cell_enter;
|
||||
cell->cell.set_value = gnc_recn_cell_set_value;
|
||||
}
|
||||
|
||||
BasicCell *
|
||||
xaccMallocRecnCell (void)
|
||||
gnc_recn_cell_new (void)
|
||||
{
|
||||
RecnCell * cell;
|
||||
|
||||
cell = g_new0 (RecnCell, 1);
|
||||
|
||||
xaccInitRecnCell (cell);
|
||||
gnc_recn_cell_init (cell);
|
||||
|
||||
return &cell->cell;
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
/* assumes we are given the untranslated form */
|
||||
static void
|
||||
RecnSetValue (BasicCell *_cell, const char *value)
|
||||
gnc_recn_cell_set_value (BasicCell *_cell, const char *value)
|
||||
{
|
||||
RecnCell *cell = (RecnCell *) _cell;
|
||||
char flag;
|
||||
@ -155,13 +147,11 @@ RecnSetValue (BasicCell *_cell, const char *value)
|
||||
break;
|
||||
}
|
||||
|
||||
xaccRecnCellSetFlag (cell, flag);
|
||||
gnc_recn_cell_set_flag (cell, flag);
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
void
|
||||
xaccRecnCellSetFlag (RecnCell *cell, char reconciled_flag)
|
||||
gnc_recn_cell_set_flag (RecnCell *cell, char reconciled_flag)
|
||||
{
|
||||
const char *string;
|
||||
|
||||
@ -169,33 +159,27 @@ xaccRecnCellSetFlag (RecnCell *cell, char reconciled_flag)
|
||||
|
||||
cell->reconciled_flag = reconciled_flag;
|
||||
|
||||
string = RecnCellGetString (reconciled_flag);
|
||||
string = gnc_recn_cell_get_string (reconciled_flag);
|
||||
|
||||
gnc_basic_cell_set_value_internal (&cell->cell, string);
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
char
|
||||
xaccRecnCellGetFlag (RecnCell *cell)
|
||||
gnc_recn_cell_get_flag (RecnCell *cell)
|
||||
{
|
||||
g_return_val_if_fail (cell != NULL, NREC);
|
||||
|
||||
return cell->reconciled_flag;
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
void
|
||||
xaccRecnCellSetStringGetter (RecnCellStringGetter getter)
|
||||
gnc_recn_cell_set_string_getter (RecnCellStringGetter getter)
|
||||
{
|
||||
string_getter = getter;
|
||||
}
|
||||
|
||||
/* ================================================ */
|
||||
|
||||
void
|
||||
xaccRecnCellSetConfirmCB (RecnCell *cell, RecnCellConfirm confirm_cb,
|
||||
gnc_recn_cell_set_confirm_cb (RecnCell *cell, RecnCellConfirm confirm_cb,
|
||||
gpointer data)
|
||||
{
|
||||
g_return_if_fail (cell != NULL);
|
||||
@ -203,5 +187,3 @@ xaccRecnCellSetConfirmCB (RecnCell *cell, RecnCellConfirm confirm_cb,
|
||||
cell->confirm_cb = confirm_cb;
|
||||
cell->confirm_data = data;
|
||||
}
|
||||
|
||||
/* --------------- end of file ---------------------- */
|
||||
|
@ -57,18 +57,15 @@ typedef struct _RecnCell
|
||||
gpointer confirm_data;
|
||||
} RecnCell;
|
||||
|
||||
BasicCell * xaccMallocRecnCell (void);
|
||||
BasicCell * gnc_recn_cell_new (void);
|
||||
|
||||
void xaccRecnCellSetFlag (RecnCell *cell, char reconciled_flag);
|
||||
char xaccRecnCellGetFlag (RecnCell *cell);
|
||||
void gnc_recn_cell_set_flag (RecnCell *cell, char reconciled_flag);
|
||||
char gnc_recn_cell_get_flag (RecnCell *cell);
|
||||
|
||||
void xaccRecnCellSetConfirmCB (RecnCell *cell,
|
||||
void gnc_recn_cell_set_confirm_cb (RecnCell *cell,
|
||||
RecnCellConfirm confirm_cb,
|
||||
gpointer data);
|
||||
|
||||
void xaccRecnCellSetStringGetter (RecnCellStringGetter getter);
|
||||
void gnc_recn_cell_set_string_getter (RecnCellStringGetter getter);
|
||||
|
||||
|
||||
#endif /* __RECN_CELL_C__ */
|
||||
|
||||
/* --------------- end of file ---------------------- */
|
||||
#endif
|
||||
|
@ -57,7 +57,7 @@ gnc_register_init (void)
|
||||
|
||||
gnc_register_add_cell_type (PRICE_CELL_TYPE_NAME, gnc_price_cell_new);
|
||||
|
||||
gnc_register_add_cell_type (RECN_CELL_TYPE_NAME, xaccMallocRecnCell);
|
||||
gnc_register_add_cell_type (RECN_CELL_TYPE_NAME, gnc_recn_cell_new);
|
||||
|
||||
gnc_register_add_cell_type (QUICKFILL_CELL_TYPE_NAME,
|
||||
xaccMallocQuickFillCell);
|
||||
|
Loading…
Reference in New Issue
Block a user