GnuCash  4.11-137-g155922540d+
Files | Data Structures | Macros | Typedefs | Enumerations | Enumerator | Functions

Register2 is a reimplementation of the original Register with new classes based on GtkListView. More...

Files

file  gnc-plugin-page-register2.h
 
file  gnc-plugin-register2.h
 
file  gnc-split-reg2.h
 
file  gnc-tree-control-split-reg.h
 
file  gnc-tree-model-split-reg.h
 
file  gnc-tree-util-split-reg.h
 
file  gnc-tree-view-split-reg.h
 
file  gnc-ledger-display2.h
 Public declarations for GncLedgerDisplay2 class.
 

Data Structures

struct  GncPluginPageRegister2
 
struct  GncPluginPageRegister2Class
 
struct  GncPluginRegister2
 
struct  GncPluginRegister2Class
 
struct  GNCSplitReg2
 
struct  GNCSplitReg2Class
 
struct  GncTreeModelSplitReg
 The instance data structure for an account tree model. More...
 
struct  GncTreeModelSplitRegClass
 The class data structure for an account tree model. More...
 
struct  GncTreeViewSplitReg
 
struct  GncTreeViewSplitRegClass
 

Macros

#define GNC_TYPE_PLUGIN_PAGE_REGISTER2   (gnc_plugin_page_register2_get_type ())
 
#define GNC_PLUGIN_PAGE_REGISTER2(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2))
 
#define GNC_PLUGIN_PAGE_REGISTER2_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2Class))
 
#define GNC_IS_PLUGIN_PAGE_REGISTER2(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER2))
 
#define GNC_IS_PLUGIN_PAGE_REGISTER2_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_PAGE_REGISTER2))
 
#define GNC_PLUGIN_PAGE_REGISTER2_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_PAGE_REGISTER2, GncPluginPageRegister2Class))
 
#define GNC_PLUGIN_PAGE_REGISTER2_NAME   "GncPluginPageRegister2"
 
#define GNC_TYPE_PLUGIN_REGISTER2   (gnc_plugin_register2_get_type ())
 
#define GNC_PLUGIN_REGISTER2(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2))
 
#define GNC_PLUGIN_REGISTER2_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Class))
 
#define GNC_IS_PLUGIN_REGISTER2(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_REGISTER2))
 
#define GNC_IS_PLUGIN_REGISTER2_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_REGISTER2))
 
#define GNC_PLUGIN_REGISTER2_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_REGISTER2, GncPluginRegister2Class))
 
#define GNC_PLUGIN_REGISTER2_NAME   "gnc-plugin-register2"
 
#define GNC_SPLIT_REG2(obj)   G_TYPE_CHECK_INSTANCE_CAST( obj, gnc_split_reg2_get_type(), GNCSplitReg2 )
 
#define GNC_SPLIT_REG2_CLASS(klass)   G_TYPE_CHECK_CLASS_CAST( klass, gnc_split_reg2_get_type(), GNCSplitReg2Class )
 
#define IS_GNC_SPLIT_REG2(obj)   G_TYPE_CHECK_INSTANCE_TYPE( obj, gnc_split_reg2_get_type() )
 
#define GNC_TYPE_TREE_MODEL_SPLIT_REG   (gnc_tree_model_split_reg_get_type ())
 
#define GNC_TREE_MODEL_SPLIT_REG(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitReg))
 
#define GNC_TREE_MODEL_SPLIT_REG_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitRegClass))
 
#define GNC_IS_TREE_MODEL_SPLIT_REG(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_MODEL_SPLIT_REG))
 
#define GNC_IS_TREE_MODEL_SPLIT_REG_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_MODEL_SPLIT_REG))
 
#define GNC_TREE_MODEL_SPLIT_REG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_MODEL_SPLIT_REG, GncTreeModelSplitRegClass))
 
#define GNC_TREE_MODEL_SPLIT_REG_NAME   "GncTreeModelSplitReg"
 
#define NUM_OF_TRANS   30
 
#define GNC_TYPE_TREE_VIEW_SPLIT_REG   (gnc_tree_view_split_reg_get_type ())
 
#define GNC_TREE_VIEW_SPLIT_REG(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitReg))
 
#define GNC_TREE_VIEW_SPLIT_REG_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitRegClass))
 
#define GNC_IS_TREE_VIEW_SPLIT_REG(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_TREE_VIEW_SPLIT_REG))
 
#define GNC_IS_TREE_VIEW_SPLIT_REG_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_TREE_VIEW_SPLIT_REG))
 
#define GNC_TREE_VIEW_SPLIT_REG_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_TREE_VIEW_SPLIT_REG, GncTreeViewSplitRegClass))
 

Typedefs

typedef GNC_SPLIT_REG_ITEM GNC_SPLIT_REG2_ITEM
 
typedef GtkWidget *(* SRGetParentCallback2) (gpointer user_data)
 Callback function type - Used to get parent window.
 
typedef void(* GNCLedgerDisplay2Destroy) (GNCLedgerDisplay2 *ld)
 
typedef GtkWidget *(* GNCLedgerDisplay2GetParent) (GNCLedgerDisplay2 *ld)
 
typedef void(* GNCLedgerDisplay2SetHelp) (GNCLedgerDisplay2 *ld, const char *help_str)
 

Enumerations

enum  SplitRegisterType2 {
  BANK_REGISTER2, CASH_REGISTER2, ASSET_REGISTER2, CREDIT_REGISTER2,
  LIABILITY_REGISTER2, INCOME_REGISTER2, EXPENSE_REGISTER2, EQUITY_REGISTER2,
  STOCK_REGISTER2, CURRENCY_REGISTER2, RECEIVABLE_REGISTER2, PAYABLE_REGISTER2,
  TRADING_REGISTER2, NUM_SINGLE_REGISTER_TYPES2, GENERAL_JOURNAL2 = NUM_SINGLE_REGISTER_TYPES2, INCOME_LEDGER2,
  PORTFOLIO_LEDGER2, SEARCH_LEDGER2, NUM_REGISTER_TYPES2
}
 Register types. More...
 
enum  SplitRegisterStyle2 { REG2_STYLE_LEDGER, REG2_STYLE_AUTO_LEDGER, REG2_STYLE_JOURNAL }
 Register styles.
 
enum  GncTreeModelSplitRegColumn {
  GNC_TREE_MODEL_SPLIT_REG_COL_GUID, GNC_TREE_MODEL_SPLIT_REG_COL_DATE, GNC_TREE_MODEL_SPLIT_REG_COL_DUEDATE, GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT,
  GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES, GNC_TREE_MODEL_SPLIT_REG_COL_TRANSFERVOID, GNC_TREE_MODEL_SPLIT_REG_COL_RECN, GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT,
  GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT, GNC_TREE_MODEL_SPLIT_REG_COL_LAST_VISIBLE = GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT, GNC_TREE_MODEL_SPLIT_REG_COL_RO, GNC_TREE_MODEL_SPLIT_REG_COL_NUM_VIS,
  GNC_TREE_MODEL_SPLIT_REG_COL_ACT_VIS, GNC_TREE_MODEL_SPLIT_REG_NUM_COLUMNS
}
 
enum  GncTreeModelSplitRegUpdate {
  VIEW_HOME, VIEW_UP, VIEW_PGUP, VIEW_GOTO,
  VIEW_PGDOWN, VIEW_DOWN, VIEW_END
}
 
enum  RowDepth { TOP, TRANS1, TRANS2, SPLIT3 }
 
enum  ViewCol {
  COL_END_OF_LIST = -1, COL_CONTROL, COL_DATE, COL_DUEDATE,
  COL_NUMACT, COL_DESCNOTES, COL_TRANSFERVOID, COL_RECN,
  COL_TYPE, COL_VALUE, COL_AMOUNT, COL_AMTVAL,
  COL_RATE, COL_PRICE, COL_DEBIT, COL_CREDIT,
  COL_BALANCE, COL_STATUS, COL_COMM
}
 
enum  GNCLedgerDisplay2Type { LD2_SINGLE, LD2_SUBACCOUNT, LD2_GL }
 

Functions

GType gnc_plugin_page_register2_get_type (void)
 Retrieve the type number for the plugin page. More...
 
GncPluginPagegnc_plugin_page_register2_new (Account *account, gboolean subaccounts)
 Create a new "register" plugin page, given a pointer to an account. More...
 
GncPluginPagegnc_plugin_page_register2_new_ledger (GNCLedgerDisplay2 *ledger)
 Create a new "register" plugin page, given a pointer to an already created ledger. More...
 
GncPluginPagegnc_plugin_page_register2_new_gl (void)
 Create a new "register" plugin page containing a general journal. More...
 
void gnc_plugin_page_register2_set_options (GncPluginPage *plugin_page, gint lines_default, gboolean read_only)
 Set various register options on a newly created "register" plugin page. More...
 
GNCSplitReg2 * gnc_plugin_page_register2_get_gsr (GncPluginPage *plugin_page)
 Get the GNCSplitReg data structure associated with this register page. More...
 
GNCLedgerDisplay2 * gnc_plugin_page_register2_get_ledger (GncPluginPage *plugin_page)
 Get the GNCLedgerDisplay data structure associated with this register page. More...
 
Query * gnc_plugin_page_register2_get_query (GncPluginPage *plugin_page)
 Get the Query associated with this "register" plugin page. More...
 
Accountgnc_plugin_page_register2_get_account (GncPluginPageRegister2 *page)
 Get the Account associated with this register page. More...
 
GType gnc_plugin_register2_get_type (void)
 
GncPlugingnc_plugin_register2_new (void)
 
GType gnc_split_reg2_get_type (void)
 GTK-related; gets an identifier for the class of GNCSplitRegs.
 
GtkWidget * gnc_split_reg2_new (GNCLedgerDisplay2 *ld, GtkWindow *parent, gint numberOfLines, gboolean read_only)
 Creates and returns a GNCSplitReg. More...
 
GncTreeViewSplitReggnc_split_reg2_get_register (GNCSplitReg2 *gsr)
 Returns the GncTreeView Split Register in effect for this GNCSplitReg.
 
GtkWidget * gnc_split_reg2_create_summary_bar (GNCSplitReg2 *gsr)
 Create and returns a summarybar for this GNCSplitReg.
 
void gnc_split_reg2_change_style (GNCSplitReg2 *gsr, SplitRegisterStyle2 style)
 Gets/sets the style of the GNCSplitReg.
 
GtkWidget * gnc_split_reg2_get_summarybar (GNCSplitReg2 *gsr)
 Can return NULL if the indicated subwidget was not created.
 
void gnc_split_reg2_jump_to_split (GNCSplitReg2 *gsr, Split *split)
 Jump to split.
 
void gnc_split_reg2_jump_to_split_amount (GNCSplitReg2 *gsr, Split *split)
 Move the cursor to the split in the non-blank amount column.
 
void gnc_split_reg2_raise (GNCSplitReg2 *gsr)
 Raise an existing register window to the front.
 
gboolean gnc_split_reg2_get_read_only (GNCSplitReg2 *gsr)
 Callers can use this to determine if they need to reflect some "read-only" status in the window which contains the GNCSplitReg. More...
 
void gnc_split_reg2_balancing_entry (GNCSplitReg2 *gsr, Account *account, time64 statement_date, gnc_numeric balancing_amount)
 
void gnc_split_reg2_set_moved_cb (GNCSplitReg2 *gsr, GFunc cb, gpointer cb_data)
 
gboolean gnc_tree_control_split_reg_trans_open_and_warn (GncTreeViewSplitReg *view, Transaction *trans)
 
gboolean gnc_tree_control_split_reg_trans_test_for_edit (GncTreeViewSplitReg *view, Transaction *trans)
 
void gnc_tree_control_split_reg_exchange_rate (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_schedule_current_trans (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_void_current_trans (GncTreeViewSplitReg *view, const char *reason)
 
void gnc_tree_control_split_reg_unvoid_current_trans (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_control_split_reg_jump_to_blank (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_jump_to (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean amount)
 
void gnc_tree_control_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing)
 
void gnc_tree_control_split_reg_goto_rel_trans_row (GncTreeViewSplitReg *view, gint relative)
 
void gnc_tree_control_split_reg_enter (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_reinit (GncTreeViewSplitReg *view, gpointer data)
 
void gnc_tree_control_split_reg_reverse_current (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_delete (GncTreeViewSplitReg *view, gpointer data)
 
Transaction * gnc_tree_control_split_reg_get_blank_trans (GncTreeViewSplitReg *view)
 
Split * gnc_tree_control_split_reg_get_current_trans_split (GncTreeViewSplitReg *view)
 
Split * gnc_tree_control_split_reg_get_blank_split (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_control_split_reg_move_current_entry_updown (GncTreeViewSplitReg *reg, gboolean move_up)
 This implements the command of moving the current entry (where the cursor is currently located) one row upwards or downwards (depending on the move_up parameter), effectively swapping this row and the other row. More...
 
gboolean gnc_tree_control_split_reg_is_current_movable_updown (GncTreeViewSplitReg *view, gboolean move_up)
 Query whether the current entry (where the cursor is currently located) can be moved one row upwards or downwards (depending on the move_up parameter). More...
 
gboolean gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing)
 
gboolean gnc_tree_control_split_reg_recn_change (GncTreeViewSplitReg *view, GtkTreePath *spath)
 
gboolean gnc_tree_control_split_reg_recn_test (GncTreeViewSplitReg *view, GtkTreePath *spath)
 
gboolean gnc_tree_control_split_reg_balance_trans (GncTreeViewSplitReg *view, Transaction *trans)
 
Accountgnc_tree_control_split_reg_get_account_by_name (GncTreeViewSplitReg *view, const char *name)
 
void gnc_tree_control_split_reg_cut_trans (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_copy_trans (GncTreeViewSplitReg *view)
 
void gnc_tree_control_split_reg_paste_trans (GncTreeViewSplitReg *view)
 
void gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans, const gchar *new_text)
 
GType gnc_tree_model_split_reg_get_type (void)
 Get the type of split register tree plugin. More...
 
GncTreeModelSplitReggnc_tree_model_split_reg_new (SplitRegisterType2 reg_type, SplitRegisterStyle2 style, gboolean use_double_line, gboolean is_template, gboolean mismatched_commodities)
 Create new model and set options for register. More...
 
void gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Account *default_account)
 Load the model from a slist and set default account for register. More...
 
void gnc_tree_model_split_reg_set_template_account (GncTreeModelSplitReg *model, Account *template_account)
 Sets the template account. More...
 
Accountgnc_tree_model_split_reg_get_template_account (GncTreeModelSplitReg *model)
 Returns the template account. More...
 
gboolean gnc_tree_model_split_reg_get_template (GncTreeModelSplitReg *model)
 Return TRUE if this is a template register. More...
 
void gnc_tree_model_split_reg_destroy (GncTreeModelSplitReg *model)
 Destroy the model. More...
 
void gnc_tree_model_split_reg_set_data (GncTreeModelSplitReg *model, gpointer user_data, SRGetParentCallback2 get_parent)
 Sets the user data and callback hooks for the register. More...
 
void gnc_tree_model_split_reg_update_query (GncTreeModelSplitReg *model, Query *query)
 Update the query for the register. More...
 
GtkWidget * gnc_tree_model_split_reg_get_parent (GncTreeModelSplitReg *model)
 Returns the parent Window of the register. More...
 
void gnc_tree_model_split_reg_config (GncTreeModelSplitReg *model, SplitRegisterType2 newtype, SplitRegisterStyle2 newstyle, gboolean use_double_line)
 Set style and type for register. More...
 
Accountgnc_tree_model_split_reg_get_anchor (GncTreeModelSplitReg *model)
 Return the default account for this register model. More...
 
void gnc_tree_model_split_reg_commit_blank_split (GncTreeModelSplitReg *model)
 Commit the blank split. More...
 
void gnc_tree_model_split_reg_set_display (GncTreeModelSplitReg *model, gboolean subacc, gboolean gl)
 Set display general journal and show sub accounts. More...
 
void gnc_tree_model_split_reg_move (GncTreeModelSplitReg *model, GncTreeModelSplitRegUpdate model_update)
 Change transactions in the tlist based on view movement. More...
 
void gnc_tree_model_split_reg_sync_scrollbar (GncTreeModelSplitReg *model)
 
Transaction * gnc_tree_model_split_reg_get_first_trans (GncTreeModelSplitReg *model)
 Return the first transaction, opposite to blank transaction in the full list. More...
 
gboolean gnc_tree_model_split_reg_trans_is_in_view (GncTreeModelSplitReg *model, Transaction *trans)
 Return TRUE if transaction is in the view list. More...
 
GtkListStore * gnc_tree_model_split_reg_get_description_list (GncTreeModelSplitReg *model)
 
GtkListStore * gnc_tree_model_split_reg_get_notes_list (GncTreeModelSplitReg *model)
 
GtkListStore * gnc_tree_model_split_reg_get_memo_list (GncTreeModelSplitReg *model)
 
GtkListStore * gnc_tree_model_split_reg_get_action_list (GncTreeModelSplitReg *model)
 
GtkListStore * gnc_tree_model_split_reg_get_acct_list (GncTreeModelSplitReg *model)
 
void gnc_tree_model_split_reg_update_num_list (GncTreeModelSplitReg *model)
 
void gnc_tree_model_split_reg_update_action_list (GncTreeModelSplitReg *model)
 
void gnc_tree_model_split_reg_update_account_list (GncTreeModelSplitReg *model)
 
void gnc_tree_model_split_reg_update_completion (GncTreeModelSplitReg *model)
 
gboolean gnc_tree_model_split_reg_get_split_and_trans (GncTreeModelSplitReg *model, GtkTreeIter *iter, gboolean *is_trow1, gboolean *is_trow2, gboolean *is_split, gboolean *is_blank, Split **split, Transaction **trans)
 
gboolean gnc_tree_model_split_reg_set_blank_split_parent (GncTreeModelSplitReg *model, Transaction *trans, gboolean remove_only)
 
Split * gnc_tree_model_split_get_blank_split (GncTreeModelSplitReg *model)
 
gboolean gnc_tree_model_split_reg_is_blank_split_parent (GncTreeModelSplitReg *model, Transaction *trans)
 
Transaction * gnc_tree_model_split_get_blank_trans (GncTreeModelSplitReg *model)
 
gboolean gnc_tree_model_split_reg_get_iter_from_trans_and_split (GncTreeModelSplitReg *model, Transaction *trans, Split *split, GtkTreeIter *iter1, GtkTreeIter *iter2)
 
gchar * gnc_tree_model_split_reg_get_row_color (GncTreeModelSplitReg *model, gboolean is_trow1, gboolean is_trow2, gboolean is_split, gint num)
 
gchar * gnc_tree_model_split_reg_get_tooltip (GncTreeModelSplitReg *model, gint position)
 
void gnc_tree_model_split_reg_set_current_trans_by_position (GncTreeModelSplitReg *model, gint position)
 
gboolean gnc_tree_model_split_reg_get_read_only (GncTreeModelSplitReg *model, Transaction *trans)
 
gboolean gnc_tree_model_split_reg_get_sub_account (GncTreeModelSplitReg *model)
 
GtkTreePath * gnc_tree_model_split_reg_get_path_to_split_and_trans (GncTreeModelSplitReg *model, Split *split, Transaction *trans)
 
gboolean gnc_tree_model_split_reg_is_blank_trans (GncTreeModelSplitReg *model, GtkTreeIter *iter)
 
Split * gnc_tree_model_split_reg_trans_get_split_equal_to_ancestor (const Transaction *trans, const Account *ancestor)
 
gint gnc_tree_model_split_reg_sort_iter_compare_func (GtkTreeModel *tm, GtkTreeIter *a, GtkTreeIter *b, gpointer user_data)
 
gboolean gnc_tree_util_split_reg_has_rate (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_util_split_reg_needs_conv_rate (GncTreeViewSplitReg *view, Transaction *trans, Account *acc)
 
const char * gnc_tree_util_split_reg_get_transfer_entry (Split *split, gboolean *is_multi)
 
const char * gnc_tree_util_split_reg_template_get_transfer_entry (Split *split)
 
const char * gnc_tree_util_split_reg_template_get_fdebt_entry (Split *split)
 
const char * gnc_tree_util_split_reg_template_get_fcred_entry (Split *split)
 
gchar * gnc_tree_util_split_reg_get_date_help (GDate *date)
 
void gnc_tree_util_split_reg_parse_date (GDate *parsed, const char *datestr)
 
gboolean gnc_tree_util_split_reg_rotate (GncTreeViewSplitReg *view, GtkTreeViewColumn *col, Transaction *trans, Split *split)
 
gboolean gnc_tree_util_split_reg_is_multi (Split *split)
 
gboolean gnc_tree_util_split_reg_needs_amount (GncTreeViewSplitReg *view, Split *split)
 
void gnc_tree_util_split_reg_set_value_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input, gboolean force)
 
void gnc_tree_util_split_reg_save_amount_values (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input)
 
gnc_numeric gnc_tree_util_split_reg_get_value_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean is_blank)
 
gboolean gnc_tree_util_split_reg_get_debcred_entry (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean is_blank, gnc_numeric *ret_num, GNCPrintAmountInfo *ret_print_info)
 
void gnc_tree_util_set_number_for_input (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input, gint viewcol)
 
void gnc_tree_util_set_value_for_amount (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input)
 
gnc_numeric gnc_tree_util_get_rate_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gboolean is_blank)
 
GType gnc_tree_view_split_reg_get_type (void)
 
GncTreeViewSplitReggnc_tree_view_split_reg_new_with_model (GncTreeModelSplitReg *model)
 
void gnc_tree_view_split_reg_block_selection (GncTreeViewSplitReg *view, gboolean block)
 
void gnc_tree_view_split_reg_default_selection (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_view_split_reg_set_format (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_set_read_only (GncTreeViewSplitReg *view, gboolean read_only)
 
void gnc_tree_view_split_reg_set_dirty_trans (GncTreeViewSplitReg *view, Transaction *trans)
 
Transaction * gnc_tree_view_split_reg_get_current_trans (GncTreeViewSplitReg *view)
 
Split * gnc_tree_view_split_reg_get_current_split (GncTreeViewSplitReg *view)
 
Transaction * gnc_tree_view_split_reg_get_dirty_trans (GncTreeViewSplitReg *view)
 
GtkTreePath * gnc_tree_view_split_reg_get_current_path (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_set_current_path (GncTreeViewSplitReg *view, GtkTreePath *mpath)
 
RowDepth gnc_tree_view_reg_get_selected_row_depth (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_set_uiupdate_cb (GncTreeViewSplitReg *view, GFunc cb, gpointer cb_data)
 
gboolean gnc_tree_view_split_reg_call_uiupdate_cb (GncTreeViewSplitReg *view)
 Call the moved_cb callback that is used to update the page ui, if it is set. More...
 
void gnc_tree_view_split_reg_refresh_from_prefs (GncTreeViewSplitReg *view)
 
GtkWidget * gnc_tree_view_split_reg_get_parent (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_view_split_reg_trans_expanded (GncTreeViewSplitReg *view, Transaction *trans)
 
void gnc_tree_view_split_reg_expand_trans (GncTreeViewSplitReg *view, Transaction *trans)
 
void gnc_tree_view_split_reg_collapse_trans (GncTreeViewSplitReg *view, Transaction *trans)
 
const char * gnc_tree_view_split_reg_get_credit_debit_string (GncTreeViewSplitReg *view, gboolean credit)
 
gnc_commodity * gnc_tree_view_split_reg_get_reg_commodity (GncTreeViewSplitReg *view)
 
GtkTreePath * gnc_tree_view_split_reg_get_sort_path_from_model_path (GncTreeViewSplitReg *view, GtkTreePath *mpath)
 
GtkTreePath * gnc_tree_view_split_reg_get_model_path_from_sort_path (GncTreeViewSplitReg *view, GtkTreePath *spath)
 
GncTreeModelSplitReggnc_tree_view_split_reg_get_model_from_view (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_view_split_reg_scroll_to_cell (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_view_split_reg_scroll_to_bsplit (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_delete_current_split (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_delete_current_trans (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_reinit_trans (GncTreeViewSplitReg *view)
 
gboolean gnc_tree_view_split_reg_enter (GncTreeViewSplitReg *view)
 
void gnc_tree_view_split_reg_cancel_edit (GncTreeViewSplitReg *view, gboolean reg_closing)
 
void gnc_tree_view_split_reg_finish_edit (GncTreeViewSplitReg *view)
 
Accountgnc_ledger_display2_leader (GNCLedgerDisplay2 *ld)
 returns the 'lead' account of a ledger display, or NULL if none. More...
 
GNCLedgerDisplay2Type gnc_ledger_display2_type (GNCLedgerDisplay2 *ld)
 
void gnc_ledger_display2_set_user_data (GNCLedgerDisplay2 *ld, gpointer user_data)
 get and set the user data associated with the ledger
 
gpointer gnc_ledger_display2_get_user_data (GNCLedgerDisplay2 *ld)
 
void gnc_ledger_display2_set_handlers (GNCLedgerDisplay2 *ld, GNCLedgerDisplay2Destroy destroy, GNCLedgerDisplay2GetParent get_parent)
 set the handlers used by the ledger display
 
void gnc_ledger_display2_set_split_view_register (GNCLedgerDisplay2 *ld, GncTreeViewSplitReg *view)
 Set and Get the tree view used by the ledger display.
 
GncTreeViewSplitReggnc_ledger_display2_get_split_view_register (GNCLedgerDisplay2 *ld)
 
void gnc_ledger_display2_set_split_view_refresh (GNCLedgerDisplay2 *ld, gboolean ok)
 
GtkWidget * gnc_ledger_display2_get_parent (GNCLedgerDisplay2 *ld)
 Returns the parent of a given ledger display.
 
GncTreeModelSplitReggnc_ledger_display2_get_split_model_register (GNCLedgerDisplay2 *ld)
 return the split register associated with a ledger display
 
GNCLedgerDisplay2 * gnc_ledger_display2_simple (Account *account)
 opens up a register window to display a single account
 
GNCLedgerDisplay2 * gnc_ledger_display2_subaccounts (Account *account, gboolean mismatched_commodities)
 opens up a register window to display the parent account and all of its children. More...
 
GNCLedgerDisplay2 * gnc_ledger_display2_gl (void)
 opens up a general ledger window
 
GNCLedgerDisplay2 * gnc_ledger_display2_template_gl (char *id)
 Displays a template ledger. More...
 
GNCLedgerDisplay2 * gnc_ledger_display2_query (Query *query, SplitRegisterType2 type, SplitRegisterStyle2 style)
 display a general ledger for an arbitrary query
 
void gnc_ledger_display2_set_query (GNCLedgerDisplay2 *ledger_display, Query *q)
 Set the query used for a register. More...
 
Query * gnc_ledger_display2_get_query (GNCLedgerDisplay2 *ld)
 return the query associated with a ledger
 
GNCLedgerDisplay2 * gnc_ledger_display2_find_by_query (Query *q)
 If the given ledger display still exists, return it. More...
 
void gnc_ledger_display2_refresh (GNCLedgerDisplay2 *ledger_display)
 redisplay/redraw only the indicated window. More...
 
void gnc_ledger_display2_refresh_by_split_register (GncTreeModelSplitReg *model)
 
void gnc_ledger_display2_refresh_sched (GNCLedgerDisplay2 *ld, GList *splits)
 This is used to load the register for the schedule.
 
void gnc_ledger_display2_refilter (GNCLedgerDisplay2 *ld)
 Refilter the register.
 
void gnc_ledger_display2_close (GNCLedgerDisplay2 *ledger_display)
 close the window
 
gboolean gnc_ledger_display2_default_double_line (GNCLedgerDisplay2 *gld)
 Returns a boolean of whether this display should be single or double lined mode by default.
 

Detailed Description

Register2 is a reimplementation of the original Register with new classes based on GtkListView.

Enumeration Type Documentation

◆ SplitRegisterType2

Register types.

"registers" are single-account display windows. "ledgers" are multiple-account display windows

Definition at line 61 of file gnc-tree-model-split-reg.h.

62 {
63  BANK_REGISTER2, //0
64  CASH_REGISTER2, //1
65  ASSET_REGISTER2, //2
66  CREDIT_REGISTER2, //3
67  LIABILITY_REGISTER2, //4
68  INCOME_REGISTER2, //5
69  EXPENSE_REGISTER2, //6
70  EQUITY_REGISTER2, //7
71  STOCK_REGISTER2, //8
72  CURRENCY_REGISTER2, //9
73  RECEIVABLE_REGISTER2, //10
74  PAYABLE_REGISTER2, //11
75  TRADING_REGISTER2, //12
76  NUM_SINGLE_REGISTER_TYPES2, //13
77 
78  GENERAL_JOURNAL2 = NUM_SINGLE_REGISTER_TYPES2, //13
79  INCOME_LEDGER2, //14
80  PORTFOLIO_LEDGER2, //15
81  SEARCH_LEDGER2, //16
82 
83  NUM_REGISTER_TYPES2 //17
SplitRegisterType2
Register types.

Function Documentation

◆ gnc_ledger_display2_find_by_query()

GNCLedgerDisplay2* gnc_ledger_display2_find_by_query ( Query *  q)

If the given ledger display still exists, return it.

Otherwise, return NULL

Definition at line 862 of file gnc-ledger-display2.c.

863 {
864  GNCLedgerDisplay2 *ledger_display;
865  GncTreeModelSplitReg *model;
866 
867  if (!q)
868  return NULL;
869 
870  ledger_display = gnc_find_first_gui_component (REGISTER_GL_CM_CLASS, find_by_query, q);
871 
872  if (ledger_display)
873  {
874  model = ledger_display->model;
875  // To get a new search page from a general journal, search register is a LD2_GL also.
876  if (model->type == GENERAL_JOURNAL2)
877  ledger_display = NULL;
878  }
879  return ledger_display;
880 }
SplitRegisterType2 type
FIXME ? This may be the wrong place for these, may be the view ?
The instance data structure for an account tree model.

◆ gnc_ledger_display2_leader()

Account* gnc_ledger_display2_leader ( GNCLedgerDisplay2 *  ld)

returns the 'lead' account of a ledger display, or NULL if none.

returns the 'lead' account of a ledger display, or NULL if none.

Definition at line 106 of file gnc-ledger-display2.c.

107 {
108  if (!ld)
109  return NULL;
110 
111  return xaccAccountLookup (&ld->leader, gnc_get_current_book ());
112 }
Account * xaccAccountLookup(const GncGUID *guid, QofBook *book)
The xaccAccountLookup() subroutine will return the account associated with the given id...
Definition: Account.cpp:2050

◆ gnc_ledger_display2_refresh()

void gnc_ledger_display2_refresh ( GNCLedgerDisplay2 *  ledger_display)

redisplay/redraw only the indicated window.

Both routines do same thing, they differ only by the argument they take.

Definition at line 959 of file gnc-ledger-display2.c.

960 {
961  ENTER("ld=%p", ld);
962 
963  if (!ld)
964  {
965  LEAVE("no display");
966  return;
967  }
968 
969  if (ld->loading)
970  {
971  LEAVE("already loading");
972  return;
973  }
974 
975  // Update the query before refresh
976  gnc_tree_model_split_reg_update_query (ld->model, ld->query);
977  gnc_ledger_display2_refresh_internal (ld, qof_query_run (ld->query));
978  LEAVE(" ");
979 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
void gnc_tree_model_split_reg_update_query(GncTreeModelSplitReg *model, Query *query)
Update the query for the register.
GList * qof_query_run(QofQuery *query)
Perform the query, return the results.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ledger_display2_set_query()

void gnc_ledger_display2_set_query ( GNCLedgerDisplay2 *  ledger_display,
Query *  q 
)

Set the query used for a register.

Definition at line 850 of file gnc-ledger-display2.c.

851 {
852  if (!ledger_display || !q)
853  return;
854 
855  g_return_if_fail (ledger_display->ld_type == LD2_GL);
856 
857  qof_query_destroy (ledger_display->query);
858  ledger_display->query = qof_query_copy (q);
859 }
QofQuery * qof_query_copy(QofQuery *q)
Make a copy of the indicated query.
Definition: qofquery.cpp:1002
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.

◆ gnc_ledger_display2_subaccounts()

GNCLedgerDisplay2* gnc_ledger_display2_subaccounts ( Account account,
gboolean  mismatched_commodities 
)

opens up a register window to display the parent account and all of its children.

Definition at line 385 of file gnc-ledger-display2.c.

386 {
387  SplitRegisterType2 reg_type;
388  GNCLedgerDisplay2 *ld;
389 
390  ENTER("account=%p", account);
391 
392  reg_type = gnc_get_reg_type (account, LD2_SUBACCOUNT);
393 
394  ld = gnc_ledger_display2_internal (account, NULL, LD2_SUBACCOUNT,
395  reg_type, REG2_STYLE_JOURNAL, FALSE,
396  FALSE,mismatched_commodities);
397  LEAVE("%p", ld);
398  return ld;
399 }
SplitRegisterType2
Register types.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_ledger_display2_template_gl()

GNCLedgerDisplay2* gnc_ledger_display2_template_gl ( char *  id)

Displays a template ledger.

This lists template Splits from the given ScheduledTransaction.

Really, requires a GList of scheduled transactions and kvp-frame data.

Parameters
idThe string version of the GncGUID of the context of template transaction being edited in this template GL. As used by scheduled transactions, this is the GncGUID of the SX itself which is magically the name of the (template) account which contains the transactions for this scheduled transaction. That's right. The stringified GncGUID of the SX is the name of the SX'es template account.

Definition at line 460 of file gnc-ledger-display2.c.

461 {
462  QofBook *book;
463  Query *q;
464  GNCLedgerDisplay2 *ld;
465  GncTreeModelSplitReg *model;
466  Account *root, *acct;
467  gboolean isTemplateModeTrue;
468 
469  ENTER("id=%s", id ? id : "(null)");
470 
471  acct = NULL;
472  isTemplateModeTrue = TRUE;
473 
474  q = qof_query_create_for(GNC_ID_SPLIT);
475 
476  book = gnc_get_current_book ();
477  qof_query_set_book (q, book);
478 
479  if ( id != NULL )
480  {
481  root = gnc_book_get_template_root (book);
482  acct = gnc_account_lookup_by_name(root, id);
483  g_assert( acct );
484  xaccQueryAddSingleAccountMatch (q, acct, QOF_QUERY_AND);
485  }
486 
487  ld = gnc_ledger_display2_internal (NULL, q, LD2_GL,
488  SEARCH_LEDGER2,
489  REG2_STYLE_JOURNAL,
490  FALSE,
491  isTemplateModeTrue,
492  FALSE);
493 
494 
496  if ( acct )
497  {
499  }
500 
501  LEAVE("%p", ld);
502  return ld;
503 }
Account * gnc_book_get_template_root(const QofBook *book)
Returns the template group from the book.
Definition: SX-book.c:65
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
Account * gnc_account_lookup_by_name(const Account *parent, const char *name)
The gnc_account_lookup_by_name() subroutine fetches the account by name from the descendants of the s...
Definition: Account.cpp:3083
void qof_query_set_book(QofQuery *query, QofBook *book)
Set the book to be searched.
GncTreeModelSplitReg * gnc_ledger_display2_get_split_model_register(GNCLedgerDisplay2 *ld)
return the split register associated with a ledger display
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
void gnc_tree_model_split_reg_set_template_account(GncTreeModelSplitReg *model, Account *template_account)
Sets the template account.
The instance data structure for an account tree model.

◆ gnc_plugin_page_register2_get_account()

Account* gnc_plugin_page_register2_get_account ( GncPluginPageRegister2 page)

Get the Account associated with this register page.

Parameters
pageA "register" page.
Returns
The account if the register contains only a single account, or an account and its sub-accounts. NULL otherwise.

Definition at line 799 of file gnc-plugin-page-register2.c.

800 {
802  GNCLedgerDisplay2Type ledger_type;
803  Account *leader;
804 
805  priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
806  ledger_type = gnc_ledger_display2_type (priv->ledger);
807  leader = gnc_ledger_display2_leader (priv->ledger);
808 
809  if ((ledger_type == LD2_SINGLE) || (ledger_type == LD2_SUBACCOUNT))
810  return leader;
811  return NULL;
812 }
Account * gnc_ledger_display2_leader(GNCLedgerDisplay2 *ld)
Implementations.

◆ gnc_plugin_page_register2_get_gsr()

GNCSplitReg2* gnc_plugin_page_register2_get_gsr ( GncPluginPage plugin_page)

Get the GNCSplitReg data structure associated with this register page.

Parameters
plugin_pageA "register" page.

Definition at line 3882 of file gnc-plugin-page-register2.c.

3883 {
3884  GncPluginPageRegister2 *page;
3886 
3887  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page), NULL);
3888 
3889  page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
3890  priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
3891 
3892  return priv->gsr;
3893 }

◆ gnc_plugin_page_register2_get_ledger()

GNCLedgerDisplay2* gnc_plugin_page_register2_get_ledger ( GncPluginPage plugin_page)

Get the GNCLedgerDisplay data structure associated with this register page.

Parameters
plugin_pageA "register" page.

Definition at line 3897 of file gnc-plugin-page-register2.c.

3898 {
3899  GncPluginPageRegister2 *page;
3901 
3902  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page), NULL);
3903 
3904  page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
3905  priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
3906 
3907  return priv->ledger;
3908 }

◆ gnc_plugin_page_register2_get_query()

Query* gnc_plugin_page_register2_get_query ( GncPluginPage plugin_page)

Get the Query associated with this "register" plugin page.

Parameters
plugin_pageA "register" page.
Returns
The query.

Get the Query associated with this "register" plugin page.

Parameters
pageA pointer to the GncPluginPage.

Definition at line 1839 of file gnc-plugin-page-register2.c.

1840 {
1841  GncPluginPageRegister2 *page;
1843 
1844  g_return_val_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page), NULL);
1845 
1846  page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
1847  priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
1848  return gnc_ledger_display2_get_query (priv->ledger);
1849 }
Query * gnc_ledger_display2_get_query(GNCLedgerDisplay2 *ld)
return the query associated with a ledger

◆ gnc_plugin_page_register2_get_type()

GType gnc_plugin_page_register2_get_type ( void  )

Retrieve the type number for the plugin page.

Returns
The type number.

◆ gnc_plugin_page_register2_new()

GncPluginPage* gnc_plugin_page_register2_new ( Account account,
gboolean  subaccounts 
)

Create a new "register" plugin page, given a pointer to an account.

Parameters
accountThe pointer to the account to embed in the register.
subaccountsTRUE if all the sub-accounts of the specified account should be included in the register.
Returns
The newly created plugin page.

Definition at line 652 of file gnc-plugin-page-register2.c.

653 {
654  GNCLedgerDisplay2 *ledger;
655  GncPluginPage *page;
657  gnc_commodity* com0;
658  gnc_commodity* com1;
659 
660 /*################## Added for Reg2 #################*/
661  const GList *item;
662  GncPluginPageRegister *old_register_page;
663 /*################## Added for Reg2 #################*/
664 
665  ENTER("account=%p, subaccounts=%s", account,
666  subaccounts ? "TRUE" : "FALSE");
667 
668 /*################## Added for Reg2 #################*/
669  // We test for the old register being open here, ie matching account guids
670  item = gnc_gobject_tracking_get_list (GNC_PLUGIN_PAGE_REGISTER_NAME);
671  for ( ; item; item = g_list_next (item))
672  {
673  Account *old_account;
674  old_register_page = (GncPluginPageRegister *)item->data;
675  old_account = gnc_plugin_page_register_get_account (old_register_page);
676 
677  if (guid_equal (xaccAccountGetGUID (account), xaccAccountGetGUID (old_account)))
678  {
679  GtkWindow *window = GTK_WINDOW (gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (old_register_page)));
680  gnc_error_dialog (window, "%s",
681  _("You have tried to open an account in the new register while it is open in the old register."));
682  return NULL;
683  }
684  }
685 /*################## Added for Reg2 #################*/
686  com0 = gnc_account_get_currency_or_parent(account);
687  com1 = gnc_account_foreach_descendant_until(account,gnc_plug_page_register_check_commodity,com0);
688  if (subaccounts)
689  ledger = gnc_ledger_display2_subaccounts (account,com1!=NULL);
690  else
691  ledger = gnc_ledger_display2_simple (account);
692 
693  page = gnc_plugin_page_register2_new_common (ledger);
694  priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
695  priv->key = *xaccAccountGetGUID (account);
696 
697  LEAVE("%p", page);
698  return page;
699 }
GtkWidget * gnc_plugin_page_get_window(GncPluginPage *page)
Retrieve a pointer to the GncMainWindow (GtkWindow) containing this page.
The instance data structure for a content plugin.
const GList * gnc_gobject_tracking_get_list(const gchar *name)
Get a list of all known objects of a specified type.
GNCLedgerDisplay2 * gnc_ledger_display2_subaccounts(Account *account, gboolean mismatched_commodities)
opens up a register window to display the parent account and all of its children. ...
gpointer gnc_account_foreach_descendant_until(const Account *acc, AccountCb2 thunk, gpointer user_data)
This method will traverse all children of this accounts and their descendants, calling 'func' on each...
Definition: Account.cpp:3253
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define xaccAccountGetGUID(X)
Definition: Account.h:248
gboolean guid_equal(const GncGUID *guid_1, const GncGUID *guid_2)
Given two GUIDs, return TRUE if they are non-NULL and equal.
Definition: guid.cpp:204
gnc_commodity * gnc_account_get_currency_or_parent(const Account *account)
Returns a gnc_commodity that is a currency, suitable for being a Transaction's currency.
Definition: Account.cpp:3455
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
Account * gnc_plugin_page_register_get_account(GncPluginPageRegister *page)
Get the Account associated with this register page.
GNCLedgerDisplay2 * gnc_ledger_display2_simple(Account *account)
opens up a register window to display a single account

◆ gnc_plugin_page_register2_new_gl()

GncPluginPage* gnc_plugin_page_register2_new_gl ( void  )

Create a new "register" plugin page containing a general journal.

Returns
The newly created plugin page.

Definition at line 702 of file gnc-plugin-page-register2.c.

703 {
704  GNCLedgerDisplay2 *ledger;
705 
706  ledger = gnc_ledger_display2_gl ();
707  return gnc_plugin_page_register2_new_common (ledger);
708 }
GNCLedgerDisplay2 * gnc_ledger_display2_gl(void)
opens up a general ledger window

◆ gnc_plugin_page_register2_new_ledger()

GncPluginPage* gnc_plugin_page_register2_new_ledger ( GNCLedgerDisplay2 *  ledger)

Create a new "register" plugin page, given a pointer to an already created ledger.

This function should be used when the ledger already exists. (E.G. From the "find transaction" code, or from the scheduled transaction code.)

Parameters
ledgerThe pointer to the ledger to embed into the register.
Returns
The newly created plugin page.

Definition at line 711 of file gnc-plugin-page-register2.c.

712 {
713  return gnc_plugin_page_register2_new_common (ledger);
714 }

◆ gnc_plugin_page_register2_set_options()

void gnc_plugin_page_register2_set_options ( GncPluginPage plugin_page,
gint  lines_default,
gboolean  read_only 
)

Set various register options on a newly created "register" plugin page.

Parameters
plugin_pageThe "register" page to modify.
lines_defaultUsed to calculate the minimum preferred height of the plugin page.
read_onlyTrue if the register should be read-only.

Definition at line 3866 of file gnc-plugin-page-register2.c.

3869 {
3870  GncPluginPageRegister2 *page;
3872 
3873  g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2(plugin_page));
3874 
3875  page = GNC_PLUGIN_PAGE_REGISTER2 (plugin_page);
3876  priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(page);
3877  priv->lines_default = lines_default;
3878  priv->read_only = read_only;
3879 }

◆ gnc_split_reg2_get_read_only()

gboolean gnc_split_reg2_get_read_only ( GNCSplitReg2 *  gsr)

Callers can use this to determine if they need to reflect some "read-only" status in the window which contains the GNCSplitReg.

Returns
TRUE if the register is read-only, FALSE if not.

Definition at line 1126 of file gnc-split-reg2.c.

1127 {
1128  g_assert (gsr);
1129 
1130  // reset read_only flag
1131  gsr->read_only = FALSE;
1132  gnc_split_reg2_determine_read_only (gsr, FALSE);
1133  return gsr->read_only;
1134 }

◆ gnc_split_reg2_new()

GtkWidget* gnc_split_reg2_new ( GNCLedgerDisplay2 *  ld,
GtkWindow *  parent,
gint  numberOfLines,
gboolean  read_only 
)

Creates and returns a GNCSplitReg.

Parameters
ldThe GNCLedgerDisplay to use for display.
parentThe containing window.
numberOfLinesThe initial number of lines for the register.
read_onlyIf the contained register should be setup read-only.

Definition at line 162 of file gnc-split-reg2.c.

166 {
167  GNCSplitReg2 *gsrToRet;
168 
169  ENTER("ld=%p, parent=%p, numberOfLines=%d, read_only=%s",
170  ld, parent, numberOfLines, read_only ? "TRUE" : "FALSE");
171 
172  gsrToRet = g_object_new (gnc_split_reg2_get_type(), NULL);
173 
174  gsrToRet->numRows = numberOfLines;
175  gsrToRet->read_only = read_only;
176 
177  gsrToRet->ledger = ld;
178  gsrToRet->window = GTK_WIDGET (parent);
179 
180  gnc_split_reg2_init2 (gsrToRet);
181 
182  LEAVE("%p", gsrToRet);
183  return GTK_WIDGET (gsrToRet);
184 }
GType gnc_split_reg2_get_type(void)
GTK-related; gets an identifier for the class of GNCSplitRegs.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282

◆ gnc_tree_control_split_reg_is_current_movable_updown()

gboolean gnc_tree_control_split_reg_is_current_movable_updown ( GncTreeViewSplitReg view,
gboolean  move_up 
)

Query whether the current entry (where the cursor is currently located) can be moved one row upwards or downwards (depending on the move_up parameter).

Parameters
move_upIf TRUE, it is asked whether the current entry can be moved upwards, otherwise downwards.
Returns
Whether the current entry can be moved into the queried direction

Definition at line 1645 of file gnc-tree-control-split-reg.c.

1647 {
1648  return gtcsr_move_current_entry_updown(view, move_up, FALSE);
1649 }

◆ gnc_tree_control_split_reg_move_current_entry_updown()

gboolean gnc_tree_control_split_reg_move_current_entry_updown ( GncTreeViewSplitReg reg,
gboolean  move_up 
)

This implements the command of moving the current entry (where the cursor is currently located) one row upwards or downwards (depending on the move_up parameter), effectively swapping this row and the other row.

If the other row is empty (or it is the blank entry), nothing will happen.

Parameters
move_upIf TRUE, the current entry is moved upwards, otherwise downwards.
Returns
Whether the current entry has been moved into the queried direction

Definition at line 1639 of file gnc-tree-control-split-reg.c.

1641 {
1642  return gtcsr_move_current_entry_updown(view, move_up, TRUE);
1643 }

◆ gnc_tree_model_split_reg_commit_blank_split()

void gnc_tree_model_split_reg_commit_blank_split ( GncTreeModelSplitReg model)

Commit the blank split.

Definition at line 2557 of file gnc-tree-model-split-reg.c.

2558 {
2559  Split *bsplit;
2560  GList *tnode, *snode;
2561  GtkTreeIter iter;
2562 
2563  ENTER(" ");
2564 
2565  tnode = model->priv->bsplit_parent_node;
2566  bsplit = model->priv->bsplit;
2567 
2568  if (!tnode || !tnode->data) {
2569  LEAVE("blank split has no trans");
2570  return;
2571  }
2572 
2573  if (xaccTransGetSplitIndex (tnode->data, bsplit) == -1) {
2574  LEAVE("blank split has been removed from this trans");
2575  return;
2576  }
2577 
2578  snode = g_list_find (xaccTransGetSplitList (tnode->data), bsplit);
2579  if (!snode) {
2580  LEAVE("Failed to turn blank split into real split");
2581  return;
2582  }
2583 
2584  /* If we haven't set an amount yet, and there's an imbalance, use that. */
2585  if (gnc_numeric_zero_p (xaccSplitGetAmount (bsplit)))
2586  {
2587  gnc_numeric imbal = gnc_numeric_neg (xaccTransGetImbalanceValue (tnode->data));
2588  if (!gnc_numeric_zero_p (imbal))
2589  {
2590  gnc_numeric amount, rate;
2591  Account *acct = xaccSplitGetAccount (bsplit);
2592  xaccSplitSetValue (bsplit, imbal);
2593 
2595  {
2596  amount = imbal;
2597  }
2598  else
2599  {
2600  rate = xaccTransGetAccountConvRate (tnode->data, acct);
2601  amount = gnc_numeric_mul (imbal, rate, xaccAccountGetCommoditySCU (acct), GNC_HOW_RND_ROUND);
2602  }
2603  if (gnc_numeric_check (amount) == GNC_ERROR_OK)
2604  {
2605  xaccSplitSetAmount (bsplit, amount);
2606  }
2607  }
2608  }
2609  /* Mark the old blank split as changed */
2610  iter = gtm_sr_make_iter (model, SPLIT, tnode, snode);
2611  gtm_sr_changed_row_at (model, &iter);
2612  gtm_sr_make_new_blank_split (model);
2613 
2614  LEAVE(" ");
2615 }
void xaccSplitSetValue(Split *split, gnc_numeric val)
The xaccSplitSetValue() method sets the value of this split in the transaction's commodity.
Definition: gmock-Split.cpp:92
int xaccAccountGetCommoditySCU(const Account *acc)
Return the SCU for the account.
Definition: Account.cpp:2701
gnc_numeric gnc_numeric_neg(gnc_numeric a)
Returns a newly created gnc_numeric that is the negative of the given gnc_numeric value...
gboolean gnc_commodity_equal(const gnc_commodity *a, const gnc_commodity *b)
This routine returns TRUE if the two commodities are equal.
gboolean gnc_numeric_zero_p(gnc_numeric a)
Returns 1 if the given gnc_numeric is 0 (zero), else returns 0.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
void xaccSplitSetAmount(Split *split, gnc_numeric amt)
The xaccSplitSetAmount() method sets the amount in the account's commodity that the split should have...
Definition: gmock-Split.cpp:77
gnc_numeric xaccTransGetImbalanceValue(const Transaction *trans)
The xaccTransGetImbalanceValue() method returns the total value of the transaction.
gnc_numeric gnc_numeric_mul(gnc_numeric a, gnc_numeric b, gint64 denom, gint how)
Multiply a times b, returning the product.
Use unbiased ("banker's") rounding.
Definition: gnc-numeric.h:173
int xaccTransGetSplitIndex(const Transaction *trans, const Split *split)
Inverse of xaccTransGetSplit()
Definition: Transaction.c:2311
Account * xaccSplitGetAccount(const Split *split)
Returns the account of this split, which was set through xaccAccountInsertSplit().
Definition: gmock-Split.cpp:53
gnc_commodity * xaccAccountGetCommodity(const Account *acc)
Get the account's commodity.
Definition: Account.cpp:3448
gnc_commodity * xaccTransGetCurrency(const Transaction *trans)
Returns the valuation commodity of this transaction.
Definition: Transaction.c:1367
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
GNCNumericErrorCode gnc_numeric_check(gnc_numeric in)
Check for error signal in value.
No error.
Definition: gnc-numeric.h:224
SplitList * xaccTransGetSplitList(const Transaction *trans)
The xaccTransGetSplitList() method returns a GList of the splits in a transaction.
gnc_numeric xaccSplitGetAmount(const Split *split)
Returns the amount of the split in the account's commodity.
Definition: gmock-Split.cpp:69

◆ gnc_tree_model_split_reg_config()

void gnc_tree_model_split_reg_config ( GncTreeModelSplitReg model,
SplitRegisterType2  newtype,
SplitRegisterStyle2  newstyle,
gboolean  use_double_line 
)

Set style and type for register.

Definition at line 962 of file gnc-tree-model-split-reg.c.

964 {
965  model->type = newtype;
966 
967  if (model->type >= NUM_SINGLE_REGISTER_TYPES2)
968  newstyle = REG2_STYLE_JOURNAL;
969 
970  model->style = newstyle;
971  model->use_double_line = use_double_line;
972 }
gboolean use_double_line
FIXME ? As above, whether to use two lines per transaction.
SplitRegisterType2 type
FIXME ? This may be the wrong place for these, may be the view ?
SplitRegisterStyle2 style
FIXME ? This may be the wrong place for these, may be the view ?

◆ gnc_tree_model_split_reg_destroy()

void gnc_tree_model_split_reg_destroy ( GncTreeModelSplitReg model)

Destroy the model.

Definition at line 919 of file gnc-tree-model-split-reg.c.

920 {
922 
923  ENTER("Model is %p", model);
924 
925  priv = model->priv;
926 
927  g_object_unref (priv->description_list);
928  g_object_unref (priv->notes_list);
929  g_object_unref (priv->memo_list);
930  g_object_unref (priv->action_list);
931  g_object_unref (priv->account_list);
932 
933  gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
934  GNC_PREF_ACCOUNTING_LABELS,
935  gnc_tree_model_split_reg_prefs_changed,
936  model);
937  gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL,
938  GNC_PREF_ACCOUNT_SEPARATOR,
939  gnc_tree_model_split_reg_prefs_changed,
940  model);
941  LEAVE(" ");
942 }
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
The instance private data for the split register tree model.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
void gnc_prefs_remove_cb_by_func(const gchar *group, const gchar *pref_name, gpointer func, gpointer user_data)
Remove a function that was registered for a callback when the given preference changed.
Definition: gnc-prefs.c:143

◆ gnc_tree_model_split_reg_get_anchor()

Account* gnc_tree_model_split_reg_get_anchor ( GncTreeModelSplitReg model)

Return the default account for this register model.

Definition at line 2669 of file gnc-tree-model-split-reg.c.

2670 {
2671  g_return_val_if_fail(GNC_IS_TREE_MODEL_SPLIT_REG(model), NULL);
2672  return model->priv->anchor;
2673 }

◆ gnc_tree_model_split_reg_get_first_trans()

Transaction* gnc_tree_model_split_reg_get_first_trans ( GncTreeModelSplitReg model)

Return the first transaction, opposite to blank transaction in the full list.

Definition at line 782 of file gnc-tree-model-split-reg.c.

783 {
785  GList *node;
786  Transaction *trans;
787 
788  priv = model->priv;
789 
790  node = g_list_first (priv->full_tlist);
791 
792  trans = node->data;
793 
794  if (trans == priv->btrans)
795  {
796  node = g_list_last (priv->full_tlist);
797  trans = node->data;
798  }
799  return trans;
800 }
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_get_parent()

GtkWidget* gnc_tree_model_split_reg_get_parent ( GncTreeModelSplitReg model)

Returns the parent Window of the register.

Definition at line 3284 of file gnc-tree-model-split-reg.c.

3285 {
3287  GtkWidget *parent = NULL;
3288 
3289  priv = model->priv;
3290 
3291  if (priv->get_parent)
3292  parent = priv->get_parent (priv->user_data);
3293 
3294  return parent;
3295 }
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_get_template()

gboolean gnc_tree_model_split_reg_get_template ( GncTreeModelSplitReg model)

Return TRUE if this is a template register.

Definition at line 911 of file gnc-tree-model-split-reg.c.

912 {
913  return model->is_template;
914 }
gboolean is_template
Are we using a template.

◆ gnc_tree_model_split_reg_get_template_account()

Account* gnc_tree_model_split_reg_get_template_account ( GncTreeModelSplitReg model)

Returns the template account.

Definition at line 897 of file gnc-tree-model-split-reg.c.

898 {
900  Account *acct;
901 
902  priv = model->priv;
903 
904  acct = xaccAccountLookup (priv->template_account, priv->book);
905  return acct;
906 }
The instance private data for the split register tree model.
Account * xaccAccountLookup(const GncGUID *guid, QofBook *book)
The xaccAccountLookup() subroutine will return the account associated with the given id...
Definition: Account.cpp:2050

◆ gnc_tree_model_split_reg_get_type()

GType gnc_tree_model_split_reg_get_type ( void  )

Get the type of split register tree plugin.

Returns
A GType.

Definition at line 233 of file gnc-tree-model-split-reg.c.

234 {
235  static GType gnc_tree_model_split_reg_type = 0;
236 
237  if (gnc_tree_model_split_reg_type == 0)
238  {
239  static const GTypeInfo our_info =
240  {
241  sizeof (GncTreeModelSplitRegClass), /* class_size */
242  NULL, /* base_init */
243  NULL, /* base_finalize */
244  (GClassInitFunc) gnc_tree_model_split_reg_class_init,
245  NULL, /* class_finalize */
246  NULL, /* class_data */
247  sizeof (GncTreeModelSplitReg), /* */
248  0, /* n_preallocs */
249  (GInstanceInitFunc) gnc_tree_model_split_reg_init
250  };
251 
252  static const GInterfaceInfo tree_model_info =
253  {
254  (GInterfaceInitFunc) gnc_tree_model_split_reg_tree_model_init,
255  NULL,
256  NULL
257  };
258 
259  gnc_tree_model_split_reg_type = g_type_register_static (GNC_TYPE_TREE_MODEL,
260  GNC_TREE_MODEL_SPLIT_REG_NAME,
261  &our_info, 0);
262 
263  g_type_add_interface_static (gnc_tree_model_split_reg_type,
264  GTK_TYPE_TREE_MODEL,
265  &tree_model_info);
266  }
267  return gnc_tree_model_split_reg_type;
268 }
The class data structure for an account tree model.
The instance data structure for an account tree model.

◆ gnc_tree_model_split_reg_load()

void gnc_tree_model_split_reg_load ( GncTreeModelSplitReg model,
GList *  slist,
Account default_account 
)

Load the model from a slist and set default account for register.

Definition at line 609 of file gnc-tree-model-split-reg.c.

610 {
612 
613  ENTER("#### Load ModelSplitReg = %p and slist length is %d ####", model, g_list_length (slist));
614 
615  priv = model->priv;
616 
617  /* Clear the treeview */
618  gtm_sr_remove_all_rows (model);
619  priv->full_tlist = NULL;
620  priv->tlist = NULL;
621 
622  if (model->current_trans == NULL)
623  model->current_trans = priv->btrans;
624 
625  /* Get a list of Unique Transactions from an slist */
626  priv->full_tlist = xaccSplitListGetUniqueTransactionsReversed (slist);
627 
628  /* Add the blank transaction to the full_tlist */
629  priv->full_tlist = g_list_prepend (priv->full_tlist, priv->btrans);
630 
631  if (model->sort_direction == GTK_SORT_ASCENDING)
632  priv->full_tlist = g_list_reverse (priv->full_tlist);
633 
634  // Update the scrollbar
635  gnc_tree_model_split_reg_sync_scrollbar (model);
636 
637  model->number_of_trans_in_full_tlist = g_list_length (priv->full_tlist);
638 
639  if (model->number_of_trans_in_full_tlist < NUM_OF_TRANS*3)
640  {
641  // Copy the full_tlist to tlist
642  priv->tlist = g_list_copy (priv->full_tlist);
643  }
644  else
645  {
646  if (model->position_of_trans_in_full_tlist < (NUM_OF_TRANS*3))
647  gtm_sr_reg_load (model, VIEW_HOME, NUM_OF_TRANS*3);
648 
649  else if (model->position_of_trans_in_full_tlist >
650  model->number_of_trans_in_full_tlist - (NUM_OF_TRANS*3))
651  gtm_sr_reg_load (model, VIEW_END, NUM_OF_TRANS*3);
652 
653  else
654  gtm_sr_reg_load (model, VIEW_GOTO, model->position_of_trans_in_full_tlist);
655  }
656 
657  PINFO("#### Register for Account '%s' has %d transactions and %d splits and tlist is %d ####",
658  default_account ? xaccAccountGetName (default_account) : "NULL", g_list_length (priv->full_tlist), g_list_length (slist), g_list_length (priv->tlist));
659 
660  /* Update the completion model liststores */
661  g_idle_add ((GSourceFunc) gnc_tree_model_split_reg_update_completion, model);
662 
663  priv->anchor = default_account;
664  priv->bsplit_parent_node = NULL;
665 
666  LEAVE("#### Leave Model Load ####");
667 }
gint number_of_trans_in_full_tlist
The total number of transactions in full_tlist.
gint position_of_trans_in_full_tlist
The position of current transaction in full_tlist.
#define PINFO(format, args...)
Print an informational note.
Definition: qoflog.h:256
GtkSortType sort_direction
This is the direction of sort.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
Transaction * current_trans
Current transaction.
The instance private data for the split register tree model.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
const char * xaccAccountGetName(const Account *acc)
Get the account&#39;s name.
Definition: Account.cpp:3301

◆ gnc_tree_model_split_reg_move()

void gnc_tree_model_split_reg_move ( GncTreeModelSplitReg model,
GncTreeModelSplitRegUpdate  model_update 
)

Change transactions in the tlist based on view movement.

Definition at line 671 of file gnc-tree-model-split-reg.c.

672 {
674  GList *inode, *dnode;
675  gint rows = 0;
676  gint icount = 0;
677  gint dcount = 0;
678 
679  priv = model->priv;
680 
681  // if list is not long enough, return
682  if (g_list_length (priv->full_tlist) < NUM_OF_TRANS*3)
683  return;
684 
685  if ((model_update == VIEW_UP) && (model->current_row < NUM_OF_TRANS) && (priv->tlist_start > 0))
686  {
687  gint dblock_end = 0;
688  gint iblock_start = priv->tlist_start - NUM_OF_TRANS;
689  gint iblock_end = priv->tlist_start - 1;
690  gint dblock_start = priv->tlist_start + NUM_OF_TRANS*2;
691 
692  if (iblock_start < 0)
693  iblock_start = 0;
694 
695  icount = iblock_end - iblock_start + 1;
696 
697  dcount = icount;
698  dblock_end = dblock_start + dcount - 1;
699 
700  priv->tlist_start = iblock_start;
701 
702  // Insert at the front end
703  for (inode = g_list_nth (priv->full_tlist, iblock_end); inode; inode = inode->prev)
704  {
705  Transaction *trans = inode->data;
706 
707  gtm_sr_insert_trans (model, trans, TRUE);
708 
709  rows++;
710 
711  if (rows == icount)
712  break;
713  }
714  rows = 0;
715  // Delete at the back end
716  for (dnode = g_list_nth (priv->full_tlist, dblock_end); dnode; dnode = dnode->prev)
717  {
718  Transaction *trans = dnode->data;
719 
720  gtm_sr_delete_trans (model, trans);
721 
722  rows++;
723 
724  if (rows == dcount)
725  break;
726  }
727  g_signal_emit_by_name (model, "refresh_view");
728  }
729 
730  if ((model_update == VIEW_DOWN) && (model->current_row > NUM_OF_TRANS*2) && (priv->tlist_start < (g_list_length (priv->full_tlist) - NUM_OF_TRANS*3 )))
731  {
732  gint dblock_end = 0;
733  gint iblock_start = priv->tlist_start + NUM_OF_TRANS*3;
734  gint iblock_end = iblock_start + NUM_OF_TRANS - 1;
735  gint dblock_start = priv->tlist_start;
736 
737  if (iblock_start < 0)
738  iblock_start = 0;
739 
740  if (iblock_end > g_list_length (priv->full_tlist))
741  iblock_end = g_list_length (priv->full_tlist) - 1;
742 
743  icount = iblock_end - iblock_start + 1;
744 
745  dcount = icount;
746  dblock_end = dblock_start + dcount;
747 
748  priv->tlist_start = dblock_end;
749 
750  // Insert at the back end
751  for (inode = g_list_nth (priv->full_tlist, iblock_start); inode; inode = inode->next)
752  {
753  Transaction *trans = inode->data;
754 
755  gtm_sr_insert_trans (model, trans, FALSE);
756 
757  rows++;
758 
759  if (rows == icount)
760  break;
761  }
762  rows = 0;
763  // Delete at the front end
764  for (dnode = g_list_nth (priv->full_tlist, dblock_start); dnode; dnode = dnode->next)
765  {
766  Transaction *trans = dnode->data;
767 
768  gtm_sr_delete_trans (model, trans);
769 
770  rows++;
771 
772  if (rows == dcount)
773  break;
774  }
775  g_signal_emit_by_name (model, "refresh_view");
776  }
777 }
gint current_row
Current row in treeview.
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_new()

GncTreeModelSplitReg* gnc_tree_model_split_reg_new ( SplitRegisterType2  reg_type,
SplitRegisterStyle2  style,
gboolean  use_double_line,
gboolean  is_template,
gboolean  mismatched_commodities 
)

Create new model and set options for register.

Definition at line 453 of file gnc-tree-model-split-reg.c.

455 {
456  GncTreeModelSplitReg *model;
458 
459  ENTER("Create Model");
460 
461  model = g_object_new (GNC_TYPE_TREE_MODEL_SPLIT_REG, NULL);
462 
463  priv = model->priv;
464  priv->book = gnc_get_current_book();
465  priv->display_gl = FALSE;
466  priv->display_subacc = FALSE;
467 
468  model->type = reg_type;
469  model->style = style;
470  model->use_double_line = use_double_line;
471  model->is_template = is_template;
472  model->mismatched_commodities = mismatched_commodities;
473 
474  model->sort_col = 1;
475  model->sort_depth = 1;
476  model->sort_direction = GTK_SORT_ASCENDING;
477 
478  model->current_trans = NULL;
479  model->current_row = -1;
480 
481  /* Setup the blank transaction */
482  priv->btrans = xaccMallocTransaction (priv->book);
483 
484  /* Setup the blank split */
485  priv->bsplit = xaccMallocSplit (priv->book);
486  priv->bsplit_node = g_list_append (priv->bsplit_node, priv->bsplit);
487 
488  /* Setup some config entries */
489  model->use_accounting_labels = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL, GNC_PREF_ACCOUNTING_LABELS);
490  model->use_gnc_color_theme = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_USE_GNUCASH_COLOR_THEME);
491  model->alt_colors_by_txn = gnc_prefs_get_bool (GNC_PREFS_GROUP_GENERAL_REGISTER, GNC_PREF_ALT_COLOR_BY_TRANS);
492  model->read_only = FALSE;
493 
494  /* Create the ListStores for the auto completion / combo's */
495  priv->description_list = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER);
496  priv->notes_list = gtk_list_store_new (1, G_TYPE_STRING);
497  priv->memo_list = gtk_list_store_new (1, G_TYPE_STRING);
498  priv->action_list = gtk_list_store_new (1, G_TYPE_STRING);
499  priv->account_list = gtk_list_store_new (3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER);
500 
501  priv->event_handler_id = qof_event_register_handler
502  ((QofEventHandler)gnc_tree_model_split_reg_event_handler, model);
503 
504  LEAVE("model %p", model);
505  return model;
506 }
Transaction * xaccMallocTransaction(QofBook *book)
The xaccMallocTransaction() will malloc memory and initialize it.
Definition: Transaction.c:511
gboolean use_double_line
FIXME ? As above, whether to use two lines per transaction.
gint current_row
Current row in treeview.
void(* QofEventHandler)(QofInstance *ent, QofEventId event_type, gpointer handler_data, gpointer event_data)
Handler invoked when an event is generated.
Definition: qofevent.h:89
gboolean read_only
register is read only
gboolean is_template
Are we using a template.
gint sort_col
This is the column the sort direction is based on.
gboolean use_gnc_color_theme
whether to use the gnucash built-in color theme
SplitRegisterType2 type
FIXME ? This may be the wrong place for these, may be the view ?
GtkSortType sort_direction
This is the direction of sort.
#define ENTER(format, args...)
Print a function entry debugging message.
Definition: qoflog.h:272
gboolean alt_colors_by_txn
whether to use alternative colors by transaction
gint qof_event_register_handler(QofEventHandler handler, gpointer user_data)
Register a handler for events.
Definition: qofevent.cpp:73
Transaction * current_trans
Current transaction.
gboolean use_accounting_labels
whether to use accounting Labels
SplitRegisterStyle2 style
FIXME ? This may be the wrong place for these, may be the view ?
gint sort_depth
This is the row the sort direction is based on.
gboolean mismatched_commodities
Are there different commodities.
The instance private data for the split register tree model.
Split * xaccMallocSplit(QofBook *book)
Constructor.
Definition: gmock-Split.cpp:37
gboolean gnc_prefs_get_bool(const gchar *group, const gchar *pref_name)
Get a boolean value from the preferences backend.
#define LEAVE(format, args...)
Print a function exit debugging message.
Definition: qoflog.h:282
The instance data structure for an account tree model.

◆ gnc_tree_model_split_reg_set_data()

void gnc_tree_model_split_reg_set_data ( GncTreeModelSplitReg model,
gpointer  user_data,
SRGetParentCallback2  get_parent 
)

Sets the user data and callback hooks for the register.

Definition at line 947 of file gnc-tree-model-split-reg.c.

949 {
951 
952 /*FIXME This is used to get the parent window, maybe move to view */
953  priv = model->priv;
954 
955  priv->user_data = user_data;
956  priv->get_parent = get_parent;
957 }
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_set_display()

void gnc_tree_model_split_reg_set_display ( GncTreeModelSplitReg model,
gboolean  subacc,
gboolean  gl 
)

Set display general journal and show sub accounts.

Definition at line 2620 of file gnc-tree-model-split-reg.c.

2621 {
2622  GncTreeModelSplitRegPrivate *priv = model->priv;
2623 
2624  priv->display_subacc = subacc;
2625  priv->display_gl = gl;
2626 }
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_set_template_account()

void gnc_tree_model_split_reg_set_template_account ( GncTreeModelSplitReg model,
Account template_account 
)

Sets the template account.

Definition at line 886 of file gnc-tree-model-split-reg.c.

887 {
889 
890  priv = model->priv;
891  priv->template_account = xaccAccountGetGUID (template_account);
892 }
#define xaccAccountGetGUID(X)
Definition: Account.h:248
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_trans_is_in_view()

gboolean gnc_tree_model_split_reg_trans_is_in_view ( GncTreeModelSplitReg model,
Transaction *  trans 
)

Return TRUE if transaction is in the view list.

Definition at line 805 of file gnc-tree-model-split-reg.c.

806 {
808 
809  priv = model->priv;
810 
811  if (g_list_index (priv->tlist, trans) == -1)
812  return FALSE;
813  else
814  return TRUE;
815 }
The instance private data for the split register tree model.

◆ gnc_tree_model_split_reg_update_query()

void gnc_tree_model_split_reg_update_query ( GncTreeModelSplitReg model,
Query *  query 
)

Update the query for the register.

Definition at line 984 of file gnc-tree-model-split-reg.c.

985 {
986  GSList *p1 = NULL, *p2 = NULL, *standard;
987 
988  time64 start;
989  struct tm tm;
990 
991  standard = g_slist_prepend (NULL, QUERY_DEFAULT_SORT);
992 
993  PINFO("## gnc_tree_model_split_reg_update_query - query is %p ##", query);
994 
995  switch (model->sort_col)
996  {
997  case GNC_TREE_MODEL_SPLIT_REG_COL_DATE:
998  if (model->sort_depth == 1)
999  {
1000  p1 = g_slist_prepend (p1, TRANS_DATE_POSTED);
1001  p1 = g_slist_prepend (p1, SPLIT_TRANS);
1002  p2 = standard;
1003  }
1004  else if (model->sort_depth == 2)
1005  {
1006  p1 = g_slist_prepend (p1, TRANS_DATE_ENTERED);
1007  p1 = g_slist_prepend (p1, SPLIT_TRANS);
1008  p2 = standard;
1009  }
1010  else if (model->sort_depth == 3)
1011  {
1012  p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
1013  p1 = g_slist_prepend (p1, SPLIT_DATE_RECONCILED);
1014  p2 = standard;
1015  }
1016  break;
1017 
1018  case GNC_TREE_MODEL_SPLIT_REG_COL_DESCNOTES:
1019  if (model->sort_depth == 1)
1020  {
1021  p1 = g_slist_prepend (p1, TRANS_DESCRIPTION);
1022  p1 = g_slist_prepend (p1, SPLIT_TRANS);
1023  p2 = standard;
1024  }
1025  else if (model->sort_depth == 2)
1026  {
1027  p1 = g_slist_prepend (p1, TRANS_NOTES);
1028  p1 = g_slist_prepend (p1, SPLIT_TRANS);
1029  p2 = standard;
1030  }
1031  else if (model->sort_depth == 3)
1032  {
1033  p1 = g_slist_prepend (p1, SPLIT_MEMO);
1034  p2 = standard;
1035  }
1036  break;
1037 
1038  case GNC_TREE_MODEL_SPLIT_REG_COL_NUMACT:
1039  if (model->sort_depth == 1)
1040  {
1041  p1 = g_slist_prepend (p1, TRANS_NUM);
1042  p1 = g_slist_prepend (p1, SPLIT_TRANS);
1043  p2 = standard;
1044  }
1045  else if ((model->sort_depth == 2) || (model->sort_depth == 3))
1046  {
1047  p1 = g_slist_prepend (p1, SPLIT_ACTION);
1048  p2 = standard;
1049  }
1050  break;
1051 
1052  case GNC_TREE_MODEL_SPLIT_REG_COL_RECN:
1053  {
1054  p1 = g_slist_prepend (p1, SPLIT_RECONCILE);
1055  p1 = g_slist_prepend (p1, SPLIT_DATE_RECONCILED);
1056  p2 = standard;
1057  }
1058  break;
1059 
1060  case GNC_TREE_MODEL_SPLIT_REG_COL_DEBIT:
1061  case GNC_TREE_MODEL_SPLIT_REG_COL_CREDIT:
1062  {
1063  p1 = g_slist_prepend (p1, SPLIT_VALUE);
1064  p2 = standard;
1065  }
1066  break;
1067 
1068  default:
1069  p1 = standard;
1070  break;
1071  }
1072 
1073  //FIXME Not sure why I need to do this, refresh / sort change segfaults on gl
1074  if (model->priv->display_gl == TRUE && model->type == GENERAL_JOURNAL2)
1075  {
1077  tm.tm_mon--; /* Default the register to the last month's worth of transactions. */
1078  start = gnc_mktime (&tm);
1079  xaccQueryAddDateMatchTT (query, TRUE, start, FALSE, 0, QOF_QUERY_AND);
1080  }
1081 
1082  qof_query_set_sort_order (query, p1, p2, NULL);
1083 
1084 }
#define PINFO(format, args...)
Print an informational note.
Definition: qoflog.h:256
void qof_query_set_sort_order(QofQuery *q, QofQueryParamList *params1, QofQueryParamList *params2, QofQueryParamList *params3)
When a query is run, the results are sorted before being returned.
Definition: qofquery.cpp:1232
gint sort_col
This is the column the sort direction is based on.
SplitRegisterType2 type
FIXME ? This may be the wrong place for these, may be the view ?
void gnc_tm_get_today_start(struct tm *tm)
The gnc_tm_get_today_start() routine takes a pointer to a struct tm and fills it in with the first se...
Definition: gnc-date.cpp:1332
gint sort_depth
This is the row the sort direction is based on.
time64 gnc_mktime(struct tm *time)
calculate seconds from the epoch given a time struct
Definition: gnc-date.cpp:230
#define QUERY_DEFAULT_SORT
Default sort object type.
Definition: qofquery.h:106
gint64 time64
Many systems, including Microsoft Windows and BSD-derived Unixes like Darwin, are retaining the int-3...
Definition: gnc-date.h:93

◆ gnc_tree_view_split_reg_call_uiupdate_cb()

gboolean gnc_tree_view_split_reg_call_uiupdate_cb ( GncTreeViewSplitReg view)

Call the moved_cb callback that is used to update the page ui, if it is set.

If it is not set, this function does nothing.

Returns
FALSE so that this function can be used in g_idle_add()

Definition at line 6332 of file gnc-tree-view-split-reg.c.

6333 {
6334  g_assert(view);
6335  if (view->uiupdate_cb)
6336  (view->uiupdate_cb)(view, view->uiupdate_cb_data);
6337  return FALSE;
6338 }