mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Cleanup api.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5276 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
321f9cd09d
commit
d9053adcce
@ -77,7 +77,7 @@ sr_balance_trans (SplitRegister *reg, Transaction *trans)
|
||||
other_account = xaccSplitGetAccount (other_split);
|
||||
}
|
||||
|
||||
default_account = sr_get_default_account (reg);
|
||||
default_account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
/* If the two pointers are the same, the account from other_split
|
||||
* is actually the default account. We must make other_account
|
||||
@ -112,11 +112,13 @@ sr_balance_trans (SplitRegister *reg, Transaction *trans)
|
||||
else
|
||||
default_value = 0;
|
||||
|
||||
choice = gnc_choose_radio_option_dialog_parented (xaccSRGetParent (reg),
|
||||
title,
|
||||
message,
|
||||
default_value,
|
||||
radio_list);
|
||||
choice = gnc_choose_radio_option_dialog_parented
|
||||
(gnc_split_register_get_parent (reg),
|
||||
title,
|
||||
message,
|
||||
default_value,
|
||||
radio_list);
|
||||
|
||||
g_list_free (radio_list);
|
||||
|
||||
switch (choice)
|
||||
@ -193,7 +195,7 @@ gnc_split_register_move_cursor (VirtualLocation *p_new_virt_loc,
|
||||
if (!reg)
|
||||
return;
|
||||
|
||||
info = xaccSRGetInfo (reg);
|
||||
info = gnc_split_register_get_info (reg);
|
||||
pending_trans = xaccTransLookup (&info->pending_trans_guid);
|
||||
|
||||
PINFO ("start callback %d %d \n",
|
||||
@ -225,7 +227,7 @@ gnc_split_register_move_cursor (VirtualLocation *p_new_virt_loc,
|
||||
new_trans = xaccSRGetTrans (reg, new_virt_loc.vcell_loc);
|
||||
|
||||
/* The split we are moving to */
|
||||
new_split = sr_get_split (reg, new_virt_loc.vcell_loc);
|
||||
new_split = gnc_split_register_get_split (reg, new_virt_loc.vcell_loc);
|
||||
|
||||
/* The split at the transaction line we are moving to */
|
||||
new_trans_split = xaccSRGetTransSplit (reg, new_virt_loc.vcell_loc, NULL);
|
||||
@ -318,7 +320,7 @@ gnc_split_register_move_cursor (VirtualLocation *p_new_virt_loc,
|
||||
new_virt_loc.vcell_loc = reg->table->current_cursor_loc.vcell_loc;
|
||||
|
||||
new_trans = xaccSRGetTrans (reg, new_virt_loc.vcell_loc);
|
||||
new_split = sr_get_split (reg, new_virt_loc.vcell_loc);
|
||||
new_split = gnc_split_register_get_split (reg, new_virt_loc.vcell_loc);
|
||||
new_trans_split = xaccSRGetTransSplit (reg, new_virt_loc.vcell_loc, NULL);
|
||||
new_class = gnc_split_register_get_cursor_class (reg,
|
||||
new_virt_loc.vcell_loc);
|
||||
@ -474,7 +476,7 @@ gnc_find_split_in_reg_by_memo (SplitRegister *reg, const char *memo,
|
||||
Transaction *trans;
|
||||
VirtualCellLocation vcell_loc = { virt_row, virt_col };
|
||||
|
||||
split = sr_get_split (reg, vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, vcell_loc);
|
||||
trans = xaccSplitGetParent (split);
|
||||
|
||||
if (trans == last_trans)
|
||||
@ -515,7 +517,7 @@ gnc_find_trans_in_reg_by_desc (SplitRegister *reg, const char *description)
|
||||
Transaction *trans;
|
||||
VirtualCellLocation vcell_loc = { virt_row, virt_col };
|
||||
|
||||
split = sr_get_split (reg, vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, vcell_loc);
|
||||
trans = xaccSplitGetParent(split);
|
||||
|
||||
if (trans == last_trans)
|
||||
@ -537,7 +539,7 @@ gnc_split_register_auto_completion (SplitRegister *reg,
|
||||
gncTableTraversalDir dir,
|
||||
VirtualLocation *p_new_virt_loc)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Transaction *pending_trans = xaccTransLookup (&info->pending_trans_guid);
|
||||
Split *blank_split = xaccSplitLookup (&info->blank_split_guid);
|
||||
Transaction *blank_trans = xaccSplitGetParent (blank_split);
|
||||
@ -611,9 +613,9 @@ gnc_split_register_auto_completion (SplitRegister *reg,
|
||||
return FALSE;
|
||||
|
||||
/* find a transaction to auto-complete on */
|
||||
if (sr_get_default_account (reg) != NULL)
|
||||
if (gnc_split_register_get_default_account (reg) != NULL)
|
||||
{
|
||||
Account *account = sr_get_default_account (reg);
|
||||
Account *account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
auto_trans = xaccAccountFindTransByDesc(account, desc);
|
||||
}
|
||||
@ -630,11 +632,12 @@ gnc_split_register_auto_completion (SplitRegister *reg,
|
||||
xaccTransBeginEdit (trans);
|
||||
gnc_copy_trans_onto_trans (auto_trans, trans, FALSE, FALSE);
|
||||
|
||||
if (sr_get_default_account (reg) != NULL)
|
||||
if (gnc_split_register_get_default_account (reg) != NULL)
|
||||
{
|
||||
Account *default_account = sr_get_default_account (reg);
|
||||
Account *default_account;
|
||||
GList *node;
|
||||
|
||||
default_account = gnc_split_register_get_default_account (reg);
|
||||
blank_split = NULL;
|
||||
|
||||
for (node = xaccTransGetSplitList (trans); node; node = node->next)
|
||||
@ -736,9 +739,9 @@ gnc_split_register_auto_completion (SplitRegister *reg,
|
||||
PRIC_CELL, NULL);
|
||||
|
||||
/* find a split to auto-complete on */
|
||||
if (sr_get_default_account (reg) != NULL)
|
||||
if (gnc_split_register_get_default_account (reg) != NULL)
|
||||
{
|
||||
Account *account = sr_get_default_account (reg);
|
||||
Account *account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
auto_split = gnc_find_split_in_account_by_memo (account, memo,
|
||||
unit_price);
|
||||
@ -831,7 +834,7 @@ gnc_split_register_traverse (VirtualLocation *p_new_virt_loc,
|
||||
if (!reg)
|
||||
return FALSE;
|
||||
|
||||
info = xaccSRGetInfo (reg);
|
||||
info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (info->first_pass)
|
||||
return FALSE;
|
||||
@ -913,7 +916,7 @@ gnc_split_register_traverse (VirtualLocation *p_new_virt_loc,
|
||||
|
||||
message = g_strdup_printf (format, name);
|
||||
|
||||
result = gnc_verify_dialog_parented (xaccSRGetParent (reg),
|
||||
result = gnc_verify_dialog_parented (gnc_split_register_get_parent (reg),
|
||||
message, TRUE);
|
||||
if (!result)
|
||||
break;
|
||||
@ -1031,8 +1034,9 @@ gnc_split_register_traverse (VirtualLocation *p_new_virt_loc,
|
||||
message = _("The current transaction has been changed.\n"
|
||||
"Would you like to record it?");
|
||||
|
||||
result = gnc_verify_cancel_dialog_parented (xaccSRGetParent (reg),
|
||||
message, GNC_VERIFY_YES);
|
||||
result = gnc_verify_cancel_dialog_parented
|
||||
(gnc_split_register_get_parent (reg),
|
||||
message, GNC_VERIFY_YES);
|
||||
}
|
||||
|
||||
switch (result)
|
||||
@ -1047,7 +1051,7 @@ gnc_split_register_traverse (VirtualLocation *p_new_virt_loc,
|
||||
Split *trans_split;
|
||||
CursorClass new_class;
|
||||
|
||||
new_split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
new_split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
trans_split = xaccSRGetTransSplit (reg, virt_loc.vcell_loc, NULL);
|
||||
new_class = gnc_split_register_get_cursor_class (reg,
|
||||
virt_loc.vcell_loc);
|
||||
@ -1107,7 +1111,8 @@ gnc_split_register_recn_cell_confirm (char old_flag, gpointer data)
|
||||
if (!confirm)
|
||||
return TRUE;
|
||||
|
||||
return gnc_verify_dialog_parented (xaccSRGetParent (reg), message, TRUE);
|
||||
return gnc_verify_dialog_parented (gnc_split_register_get_parent (reg),
|
||||
message, TRUE);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -135,7 +135,7 @@ void
|
||||
xaccSRLoadRegister (SplitRegister *reg, GList * slist,
|
||||
Account *default_account)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Split *blank_split = xaccSplitLookup (&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup (&info->pending_trans_guid);
|
||||
CursorBuffer *cursor_buffer;
|
||||
|
@ -50,7 +50,7 @@ gnc_split_register_save_cells (gpointer save_data,
|
||||
{
|
||||
SRSaveData *sd = save_data;
|
||||
SplitRegister *reg = user_data;
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Transaction *trans;
|
||||
Split *other_split = NULL;
|
||||
Split *split;
|
||||
@ -95,7 +95,7 @@ gnc_split_register_save_cells (gpointer save_data,
|
||||
|
||||
if (gnc_num_cell_set_last_num ((NumCell *) cell, value))
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
Transaction *blank_trans = xaccSplitGetParent (blank_split);
|
||||
|
||||
@ -303,7 +303,7 @@ gnc_split_register_save_template_cells (gpointer save_data,
|
||||
{
|
||||
SRSaveData *sd = save_data;
|
||||
SplitRegister *reg = user_data;
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Transaction *trans;
|
||||
Split *split;
|
||||
Split *other_split = NULL;
|
||||
|
@ -68,7 +68,7 @@ use_security_cells (SplitRegister *reg, VirtualLocation virt_loc)
|
||||
Account *account;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return TRUE;
|
||||
|
||||
@ -217,7 +217,7 @@ gnc_split_register_get_tcredit_label (VirtualLocation virt_loc,
|
||||
gpointer user_data)
|
||||
{
|
||||
SplitRegister *reg = user_data;
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (info->tcredit_str)
|
||||
return info->tcredit_str;
|
||||
@ -242,7 +242,7 @@ gnc_split_register_get_tdebit_label (VirtualLocation virt_loc,
|
||||
gpointer user_data)
|
||||
{
|
||||
SplitRegister *reg = user_data;
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (info->tdebit_str)
|
||||
return info->tdebit_str;
|
||||
@ -303,7 +303,7 @@ get_trans_total_amount (SplitRegister *reg, Transaction *trans)
|
||||
Account *account;
|
||||
gnc_numeric total = gnc_numeric_zero ();
|
||||
|
||||
account = sr_get_default_account (reg);
|
||||
account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
if (!account)
|
||||
return total;
|
||||
@ -331,7 +331,7 @@ get_trans_last_split (SplitRegister *reg, Transaction *trans)
|
||||
Account *account;
|
||||
Split *last_split = NULL;
|
||||
|
||||
account = sr_get_default_account (reg);
|
||||
account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
if (!account)
|
||||
return last_split;
|
||||
@ -381,7 +381,7 @@ gnc_split_register_get_shares_fg_color (VirtualLocation virt_loc,
|
||||
if (!use_red_for_negative)
|
||||
return black;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return black;
|
||||
|
||||
@ -419,7 +419,7 @@ gnc_split_register_get_balance_fg_color (VirtualLocation virt_loc,
|
||||
if (!use_red_for_negative)
|
||||
return black;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return black;
|
||||
|
||||
@ -611,7 +611,7 @@ gnc_split_register_get_date_entry (VirtualLocation virt_loc,
|
||||
Split *split;
|
||||
Timespec ts;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
trans = xaccSplitGetParent (split);
|
||||
if (!trans)
|
||||
return NULL;
|
||||
@ -631,7 +631,7 @@ gnc_split_register_get_num_entry (VirtualLocation virt_loc,
|
||||
Transaction *trans;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
trans = xaccSplitGetParent (split);
|
||||
|
||||
return xaccTransGetNum (trans);
|
||||
@ -647,7 +647,7 @@ gnc_split_register_get_desc_entry (VirtualLocation virt_loc,
|
||||
Transaction *trans;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
trans = xaccSplitGetParent (split);
|
||||
|
||||
return xaccTransGetDescription (trans);
|
||||
@ -663,7 +663,7 @@ gnc_split_register_get_notes_entry (VirtualLocation virt_loc,
|
||||
Transaction *trans;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
trans = xaccSplitGetParent (split);
|
||||
|
||||
return xaccTransGetNotes (trans);
|
||||
@ -678,7 +678,7 @@ gnc_split_register_get_recn_entry (VirtualLocation virt_loc,
|
||||
SplitRegister *reg = user_data;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return NULL;
|
||||
|
||||
@ -704,7 +704,7 @@ gnc_split_register_get_action_entry (VirtualLocation virt_loc,
|
||||
SplitRegister *reg = user_data;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
return xaccSplitGetAction (split);
|
||||
}
|
||||
@ -718,7 +718,7 @@ gnc_split_register_get_memo_entry (VirtualLocation virt_loc,
|
||||
SplitRegister *reg = user_data;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
return xaccSplitGetMemo (split);
|
||||
}
|
||||
@ -730,12 +730,12 @@ gnc_split_register_get_balance_entry (VirtualLocation virt_loc,
|
||||
gpointer user_data)
|
||||
{
|
||||
SplitRegister *reg = user_data;
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
gnc_numeric balance;
|
||||
gboolean is_trans;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
if (split == xaccSplitLookup (&info->blank_split_guid))
|
||||
return NULL;
|
||||
@ -753,7 +753,7 @@ gnc_split_register_get_balance_entry (VirtualLocation virt_loc,
|
||||
|
||||
account = xaccSplitGetAccount (split);
|
||||
if (!account)
|
||||
account = sr_get_default_account (reg);
|
||||
account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
if (gnc_reverse_balance (account))
|
||||
balance = gnc_numeric_neg (balance);
|
||||
@ -775,7 +775,7 @@ gnc_split_register_get_price_entry (VirtualLocation virt_loc,
|
||||
if (!use_security_cells (reg, virt_loc))
|
||||
return NULL;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
price = xaccSplitGetSharePrice (split);
|
||||
if (gnc_numeric_zero_p (price))
|
||||
@ -797,7 +797,7 @@ gnc_split_register_get_shares_entry (VirtualLocation virt_loc,
|
||||
if (!use_security_cells (reg, virt_loc))
|
||||
return NULL;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
shares = xaccSplitGetAmount (split);
|
||||
if (gnc_numeric_zero_p (shares))
|
||||
@ -816,7 +816,7 @@ gnc_split_register_get_tshares_entry (VirtualLocation virt_loc,
|
||||
gnc_numeric total;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
total = get_trans_total_amount (reg, xaccSplitGetParent (split));
|
||||
|
||||
@ -835,7 +835,7 @@ gnc_split_register_get_xfrm_entry (VirtualLocation virt_loc,
|
||||
Split *split;
|
||||
Split *s;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
g_free (name);
|
||||
|
||||
@ -857,7 +857,7 @@ gnc_split_register_get_mxfrm_entry (VirtualLocation virt_loc,
|
||||
Split *split;
|
||||
Split *s;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return NULL;
|
||||
|
||||
@ -895,7 +895,7 @@ gnc_split_register_get_tdebcred_entry (VirtualLocation virt_loc,
|
||||
gnc_numeric total;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return NULL;
|
||||
|
||||
@ -931,7 +931,7 @@ gnc_split_register_get_debcred_entry (VirtualLocation virt_loc,
|
||||
is_debit = gnc_cell_name_equal
|
||||
(gnc_table_get_cell_name (reg->table, virt_loc), DEBT_CELL);
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
if (!split)
|
||||
{
|
||||
@ -1010,7 +1010,7 @@ gnc_split_register_get_debcred_io_flags (VirtualLocation virt_loc,
|
||||
SplitRegister *reg = user_data;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
|
||||
if (safe_strcmp ("stock-split", xaccSplitGetType (split)) == 0)
|
||||
return XACC_CELL_ALLOW_NONE;
|
||||
@ -1034,7 +1034,7 @@ static gboolean
|
||||
gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
|
||||
{
|
||||
SplitRegister *reg = user_data;
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Split *split;
|
||||
char recn;
|
||||
|
||||
@ -1043,7 +1043,7 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
|
||||
if (info->change_confirmed)
|
||||
return TRUE;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return TRUE;
|
||||
|
||||
@ -1065,7 +1065,7 @@ gnc_split_register_confirm (VirtualLocation virt_loc, gpointer user_data)
|
||||
if (!confirm)
|
||||
return TRUE;
|
||||
|
||||
confirm = gnc_verify_dialog_parented (xaccSRGetParent (reg),
|
||||
confirm = gnc_verify_dialog_parented (gnc_split_register_get_parent (reg),
|
||||
message, FALSE);
|
||||
|
||||
info->change_confirmed = confirm;
|
||||
@ -1100,7 +1100,7 @@ gnc_template_register_get_xfrm_entry (VirtualLocation virt_loc,
|
||||
kvp_frame *kvpf;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return NULL;
|
||||
|
||||
@ -1134,7 +1134,7 @@ gnc_template_register_get_fdebt_entry (VirtualLocation virt_loc,
|
||||
kvp_frame *kvpf;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
kvpf = xaccSplitGetSlots (split);
|
||||
|
||||
return kvp_value_get_string
|
||||
@ -1151,7 +1151,7 @@ gnc_template_register_get_fcred_entry (VirtualLocation virt_loc,
|
||||
kvp_frame *kvpf;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
kvpf = xaccSplitGetSlots (split);
|
||||
|
||||
return kvp_value_get_string
|
||||
@ -1168,7 +1168,7 @@ gnc_template_register_get_debcred_entry (VirtualLocation virt_loc,
|
||||
kvp_frame *kvpf;
|
||||
Split *split;
|
||||
|
||||
split = sr_get_split (reg, virt_loc.vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, virt_loc.vcell_loc);
|
||||
if (!split)
|
||||
return gnc_split_register_get_debcred_entry (virt_loc,
|
||||
translate,
|
||||
|
@ -112,12 +112,14 @@ struct sr_info
|
||||
};
|
||||
|
||||
|
||||
SRInfo * xaccSRGetInfo (SplitRegister *reg);
|
||||
SRInfo * gnc_split_register_get_info (SplitRegister *reg);
|
||||
|
||||
gncUIWidget xaccSRGetParent (SplitRegister *reg);
|
||||
gncUIWidget gnc_split_register_get_parent (SplitRegister *reg);
|
||||
|
||||
Split * sr_get_split (SplitRegister *reg, VirtualCellLocation vcell_loc);
|
||||
Account * sr_get_default_account (SplitRegister *reg);
|
||||
Split * gnc_split_register_get_split (SplitRegister *reg,
|
||||
VirtualCellLocation vcell_loc);
|
||||
|
||||
Account * gnc_split_register_get_default_account (SplitRegister *reg);
|
||||
|
||||
Transaction * xaccSRGetTrans (SplitRegister *reg,
|
||||
VirtualCellLocation vcell_loc);
|
||||
|
@ -58,7 +58,7 @@ get_today_midnight (void)
|
||||
* SplitRegister directly. If additional user data is needed, just add
|
||||
* it to the SRInfo structure above. */
|
||||
static void
|
||||
xaccSRInitRegisterData (SplitRegister *reg)
|
||||
gnc_split_register_init_info (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info;
|
||||
|
||||
@ -81,21 +81,21 @@ xaccSRInitRegisterData (SplitRegister *reg)
|
||||
}
|
||||
|
||||
SRInfo *
|
||||
xaccSRGetInfo (SplitRegister *reg)
|
||||
gnc_split_register_get_info (SplitRegister *reg)
|
||||
{
|
||||
if (!reg)
|
||||
return NULL;
|
||||
|
||||
if (reg->sr_info == NULL)
|
||||
xaccSRInitRegisterData (reg);
|
||||
gnc_split_register_init_info (reg);
|
||||
|
||||
return reg->sr_info;
|
||||
}
|
||||
|
||||
gncUIWidget
|
||||
xaccSRGetParent (SplitRegister *reg)
|
||||
gnc_split_register_get_parent (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (reg == NULL)
|
||||
return NULL;
|
||||
@ -107,7 +107,8 @@ xaccSRGetParent (SplitRegister *reg)
|
||||
}
|
||||
|
||||
Split *
|
||||
sr_get_split (SplitRegister *reg, VirtualCellLocation vcell_loc)
|
||||
gnc_split_register_get_split (SplitRegister *reg,
|
||||
VirtualCellLocation vcell_loc)
|
||||
{
|
||||
GUID *guid;
|
||||
|
||||
@ -122,9 +123,9 @@ sr_get_split (SplitRegister *reg, VirtualCellLocation vcell_loc)
|
||||
}
|
||||
|
||||
Account *
|
||||
sr_get_default_account (SplitRegister *reg)
|
||||
gnc_split_register_get_default_account (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
return xaccAccountLookup (&info->default_account);
|
||||
}
|
||||
@ -133,7 +134,7 @@ void
|
||||
gnc_split_register_set_template_account (SplitRegister *reg,
|
||||
Account *template_account)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
g_return_if_fail (reg != NULL);
|
||||
|
||||
@ -148,7 +149,7 @@ xaccSRGetTrans (SplitRegister *reg, VirtualCellLocation vcell_loc)
|
||||
if (!reg || !reg->table)
|
||||
return NULL;
|
||||
|
||||
split = sr_get_split (reg, vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, vcell_loc);
|
||||
|
||||
if (split != NULL)
|
||||
return xaccSplitGetParent(split);
|
||||
@ -157,7 +158,7 @@ xaccSRGetTrans (SplitRegister *reg, VirtualCellLocation vcell_loc)
|
||||
* transaction. Go back one row to find a split in the transaction. */
|
||||
vcell_loc.virt_row--;
|
||||
|
||||
split = sr_get_split (reg, vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, vcell_loc);
|
||||
|
||||
/* This split could be NULL during register initialization. */
|
||||
if (split == NULL)
|
||||
@ -191,7 +192,7 @@ xaccSRGetTransSplit (SplitRegister *reg,
|
||||
if (trans_split_loc)
|
||||
*trans_split_loc = vcell_loc;
|
||||
|
||||
return sr_get_split (reg, vcell_loc);
|
||||
return gnc_split_register_get_split (reg, vcell_loc);
|
||||
}
|
||||
|
||||
vcell_loc.virt_row--;
|
||||
@ -232,7 +233,7 @@ xaccSRFindSplit (SplitRegister *reg,
|
||||
{
|
||||
VirtualCellLocation vc_loc = { v_row, v_col };
|
||||
|
||||
s = sr_get_split (reg, vc_loc);
|
||||
s = gnc_split_register_get_split (reg, vc_loc);
|
||||
t = xaccSplitGetParent(s);
|
||||
|
||||
cursor_class = gnc_split_register_get_cursor_class (reg, vc_loc);
|
||||
@ -311,7 +312,7 @@ xaccSRSetTransVisible (SplitRegister *reg,
|
||||
if (cursor_class != CURSOR_CLASS_SPLIT)
|
||||
return;
|
||||
|
||||
if (only_blank_split && sr_get_split (reg, vcell_loc))
|
||||
if (only_blank_split && gnc_split_register_get_split (reg, vcell_loc))
|
||||
continue;
|
||||
|
||||
gnc_table_set_virt_cell_visible (reg->table, vcell_loc, visible);
|
||||
@ -345,7 +346,7 @@ sr_set_cell_fractions (SplitRegister *reg, Split *split)
|
||||
account = xaccSplitGetAccount (split);
|
||||
|
||||
if (account == NULL)
|
||||
account = sr_get_default_account (reg);
|
||||
account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
cell = (PriceCell *) gnc_table_layout_get_cell (reg->table->layout,
|
||||
SHRS_CELL);
|
||||
@ -387,7 +388,7 @@ sr_get_passive_cursor (SplitRegister *reg)
|
||||
CellBlock *
|
||||
sr_get_active_cursor (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
const char *cursor_name = NULL;
|
||||
|
||||
switch (reg->style)
|
||||
@ -422,7 +423,7 @@ sr_set_last_num (SplitRegister *reg, const char *num)
|
||||
{
|
||||
Account *account;
|
||||
|
||||
account = sr_get_default_account (reg);
|
||||
account = gnc_split_register_get_default_account (reg);
|
||||
if (!account)
|
||||
return;
|
||||
|
||||
|
@ -244,7 +244,7 @@ gnc_split_get_amount_denom (Split *split)
|
||||
void
|
||||
xaccSRExpandCurrentTrans (SplitRegister *reg, gboolean expand)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (!reg)
|
||||
return;
|
||||
@ -308,7 +308,7 @@ xaccSRExpandCurrentTrans (SplitRegister *reg, gboolean expand)
|
||||
gboolean
|
||||
xaccSRCurrentTransExpanded (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (!reg)
|
||||
return FALSE;
|
||||
@ -337,9 +337,9 @@ xaccSRGetCurrentTrans (SplitRegister *reg)
|
||||
* transaction. Go back one row to find a split in the transaction. */
|
||||
vcell_loc = reg->table->current_cursor_loc.vcell_loc;
|
||||
|
||||
vcell_loc.virt_row --;
|
||||
vcell_loc.virt_row--;
|
||||
|
||||
split = sr_get_split (reg, vcell_loc);
|
||||
split = gnc_split_register_get_split (reg, vcell_loc);
|
||||
|
||||
return xaccSplitGetParent (split);
|
||||
}
|
||||
@ -350,13 +350,14 @@ xaccSRGetCurrentSplit (SplitRegister *reg)
|
||||
if (reg == NULL)
|
||||
return NULL;
|
||||
|
||||
return sr_get_split (reg, reg->table->current_cursor_loc.vcell_loc);
|
||||
return gnc_split_register_get_split
|
||||
(reg, reg->table->current_cursor_loc.vcell_loc);
|
||||
}
|
||||
|
||||
Split *
|
||||
xaccSRGetBlankSplit (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
|
||||
return blank_split;
|
||||
@ -447,7 +448,7 @@ xaccSRGetSplitAmountVirtLoc (SplitRegister *reg, Split *split,
|
||||
Split *
|
||||
xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
CursorClass cursor_class;
|
||||
Transaction *trans;
|
||||
@ -491,8 +492,9 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
"Would you like to record it?");
|
||||
GNCVerifyResult result;
|
||||
|
||||
result = gnc_ok_cancel_dialog_parented (xaccSRGetParent(reg),
|
||||
message, GNC_VERIFY_OK);
|
||||
result = gnc_ok_cancel_dialog_parented
|
||||
(gnc_split_register_get_parent (reg),
|
||||
message, GNC_VERIFY_OK);
|
||||
|
||||
if (result == GNC_VERIFY_CANCEL)
|
||||
{
|
||||
@ -546,7 +548,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
date = info->last_date_entered;
|
||||
if (gnc_strisnum (xaccTransGetNum (trans)))
|
||||
{
|
||||
Account *account = sr_get_default_account (reg);
|
||||
Account *account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
if (account)
|
||||
in_num = xaccAccountGetLastNum (account);
|
||||
@ -554,7 +556,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
in_num = xaccTransGetNum (trans);
|
||||
}
|
||||
|
||||
if (!gnc_dup_trans_dialog (xaccSRGetParent (reg),
|
||||
if (!gnc_dup_trans_dialog (gnc_split_register_get_parent (reg),
|
||||
&date, in_num, &out_num))
|
||||
{
|
||||
gnc_resume_gui_refresh ();
|
||||
@ -610,7 +612,7 @@ xaccSRDuplicateCurrent (SplitRegister *reg)
|
||||
static void
|
||||
xaccSRCopyCurrentInternal (SplitRegister *reg, gboolean use_cut_semantics)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
CursorClass cursor_class;
|
||||
Transaction *trans;
|
||||
@ -704,7 +706,7 @@ xaccSRCopyCurrent (SplitRegister *reg)
|
||||
void
|
||||
xaccSRCutCurrent (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
CursorClass cursor_class;
|
||||
Transaction *trans;
|
||||
@ -745,7 +747,7 @@ xaccSRCutCurrent (SplitRegister *reg)
|
||||
void
|
||||
xaccSRPasteCurrent (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
CursorClass cursor_class;
|
||||
Transaction *trans;
|
||||
@ -784,8 +786,8 @@ xaccSRPasteCurrent (SplitRegister *reg)
|
||||
return;
|
||||
|
||||
if (split != NULL)
|
||||
result = gnc_verify_dialog_parented(xaccSRGetParent(reg),
|
||||
message, FALSE);
|
||||
result = gnc_verify_dialog_parented (gnc_split_register_get_parent (reg),
|
||||
message, FALSE);
|
||||
else
|
||||
result = TRUE;
|
||||
|
||||
@ -820,7 +822,7 @@ xaccSRPasteCurrent (SplitRegister *reg)
|
||||
return;
|
||||
|
||||
if (split != blank_split)
|
||||
result = gnc_verify_dialog_parented(xaccSRGetParent(reg),
|
||||
result = gnc_verify_dialog_parented(gnc_split_register_get_parent(reg),
|
||||
message, FALSE);
|
||||
else
|
||||
result = TRUE;
|
||||
@ -840,7 +842,7 @@ xaccSRPasteCurrent (SplitRegister *reg)
|
||||
split_index = gnc_trans_split_index(trans, split);
|
||||
trans_split_index = gnc_trans_split_index(trans, trans_split);
|
||||
|
||||
if ((sr_get_default_account (reg) != NULL) &&
|
||||
if ((gnc_split_register_get_default_account (reg) != NULL) &&
|
||||
(xaccGUIDType(&copied_leader_guid) != GNC_ID_NULL))
|
||||
{
|
||||
new_guid = &info->default_account;
|
||||
@ -869,7 +871,7 @@ xaccSRPasteCurrent (SplitRegister *reg)
|
||||
void
|
||||
xaccSRDeleteCurrentSplit (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid);
|
||||
Transaction *trans;
|
||||
@ -918,7 +920,7 @@ xaccSRDeleteCurrentSplit (SplitRegister *reg)
|
||||
void
|
||||
xaccSRDeleteCurrentTrans (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid);
|
||||
Transaction *trans;
|
||||
@ -985,7 +987,7 @@ xaccSRDeleteCurrentTrans (SplitRegister *reg)
|
||||
void
|
||||
xaccSREmptyCurrentTrans (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Split *blank_split = xaccSplitLookup (&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup (&info->pending_trans_guid);
|
||||
Transaction *trans;
|
||||
@ -1077,7 +1079,7 @@ xaccSRCancelCursorSplitChanges (SplitRegister *reg)
|
||||
void
|
||||
xaccSRCancelCursorTransChanges (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid);
|
||||
|
||||
/* Get the currently open transaction, rollback the edits on it, and
|
||||
@ -1298,7 +1300,7 @@ xaccSRSaveRegEntryToSCM (SplitRegister *reg, SCM trans_scm, SCM split_scm,
|
||||
gboolean
|
||||
xaccSRSaveRegEntry (SplitRegister *reg, gboolean do_commit)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
SRInfo *info = gnc_split_register_get_info(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid);
|
||||
Transaction *blank_trans = xaccSplitGetParent(blank_split);
|
||||
@ -1369,7 +1371,8 @@ xaccSRSaveRegEntry (SplitRegister *reg, gboolean do_commit)
|
||||
/* If we are committing the blank split, add it to the account now */
|
||||
if (trans == blank_trans)
|
||||
{
|
||||
xaccAccountInsertSplit (sr_get_default_account (reg), blank_split);
|
||||
xaccAccountInsertSplit (gnc_split_register_get_default_account (reg),
|
||||
blank_split);
|
||||
xaccTransSetDateEnteredSecs(trans, time(NULL));
|
||||
}
|
||||
|
||||
@ -1494,7 +1497,7 @@ sr_split_auto_calc (SplitRegister *reg, Split *split)
|
||||
account = xaccSplitGetAccount (split);
|
||||
|
||||
if (!account)
|
||||
account = sr_get_default_account (reg);
|
||||
account = gnc_split_register_get_default_account (reg);
|
||||
|
||||
account_type = xaccAccountGetType (account);
|
||||
|
||||
@ -1638,11 +1641,13 @@ sr_split_auto_calc (SplitRegister *reg, Split *split)
|
||||
else
|
||||
default_value = 1;
|
||||
|
||||
choice = gnc_choose_radio_option_dialog_parented (xaccSRGetParent(reg),
|
||||
title,
|
||||
message,
|
||||
default_value,
|
||||
radio_list);
|
||||
choice = gnc_choose_radio_option_dialog_parented
|
||||
(gnc_split_register_get_parent (reg),
|
||||
title,
|
||||
message,
|
||||
default_value,
|
||||
radio_list);
|
||||
|
||||
for (node = radio_list; node; node = node->next)
|
||||
g_free (node->data);
|
||||
|
||||
@ -1788,7 +1793,7 @@ sr_type_to_account_type(SplitRegisterType sr_type)
|
||||
const char *
|
||||
xaccSRGetDebitString (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (!reg)
|
||||
return NULL;
|
||||
@ -1809,7 +1814,7 @@ xaccSRGetDebitString (SplitRegister *reg)
|
||||
const char *
|
||||
xaccSRGetCreditString (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (!reg)
|
||||
return NULL;
|
||||
@ -1831,7 +1836,7 @@ xaccSRGetCreditString (SplitRegister *reg)
|
||||
gboolean
|
||||
xaccSRHasPendingChanges (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Transaction *pending_trans = xaccTransLookup (&info->pending_trans_guid);
|
||||
|
||||
if (reg == NULL)
|
||||
@ -1846,7 +1851,7 @@ xaccSRHasPendingChanges (SplitRegister *reg)
|
||||
void
|
||||
xaccSRShowPresentDivider (SplitRegister *reg, gboolean show_present)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (reg == NULL)
|
||||
return;
|
||||
@ -1857,7 +1862,7 @@ xaccSRShowPresentDivider (SplitRegister *reg, gboolean show_present)
|
||||
gboolean
|
||||
xaccSRFullRefreshOK (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
if (!info)
|
||||
return FALSE;
|
||||
@ -2218,7 +2223,7 @@ void
|
||||
xaccSRSetData (SplitRegister *reg, void *user_data,
|
||||
SRGetParentCallback get_parent)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo (reg);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
|
||||
g_return_if_fail (reg != NULL);
|
||||
|
||||
@ -2229,9 +2234,9 @@ xaccSRSetData (SplitRegister *reg, void *user_data,
|
||||
static void
|
||||
gnc_split_register_cleanup (SplitRegister *reg)
|
||||
{
|
||||
SRInfo *info = xaccSRGetInfo(reg);
|
||||
Split *blank_split = xaccSplitLookup(&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup(&info->pending_trans_guid);
|
||||
SRInfo *info = gnc_split_register_get_info (reg);
|
||||
Split *blank_split = xaccSplitLookup (&info->blank_split_guid);
|
||||
Transaction *pending_trans = xaccTransLookup (&info->pending_trans_guid);
|
||||
Transaction *trans;
|
||||
|
||||
gnc_suspend_gui_refresh ();
|
||||
|
@ -141,7 +141,6 @@ struct split_register
|
||||
|
||||
/* Callback function type */
|
||||
typedef gncUIWidget (*SRGetParentCallback) (gpointer user_data);
|
||||
typedef void (*SRSetHelpCallback) (gpointer user_data, const char *help_str);
|
||||
|
||||
|
||||
/** Prototypes ******************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user