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