mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Code clean up on register2 files
Remove unused, unused set variables and also comment out some additional code
This commit is contained in:
parent
3e7235070f
commit
1002576cef
@ -833,7 +833,6 @@ void
|
||||
gnc_tree_control_split_reg_reinit (GncTreeViewSplitReg *view, gpointer data)
|
||||
{
|
||||
Transaction *trans;
|
||||
Split *split;
|
||||
GtkWidget *dialog, *window;
|
||||
gint response;
|
||||
const gchar *warning;
|
||||
@ -1082,7 +1081,6 @@ gnc_tree_control_split_reg_reverse_current (GncTreeViewSplitReg *view)
|
||||
GtkWidget *window;
|
||||
Transaction *trans = NULL, *new_trans = NULL;
|
||||
GList *snode = NULL;
|
||||
gboolean changed = FALSE;
|
||||
|
||||
ENTER(" ");
|
||||
|
||||
@ -1174,7 +1172,6 @@ gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
|
||||
Transaction *trans;
|
||||
Split *blank_split;
|
||||
Split *split, *trans_split;
|
||||
gboolean changed = FALSE;
|
||||
gboolean use_split_action_for_num_field = FALSE;
|
||||
|
||||
ENTER("");
|
||||
@ -1313,7 +1310,6 @@ gnc_tree_control_split_reg_duplicate_current (GncTreeViewSplitReg *view)
|
||||
{
|
||||
Transaction *new_trans;
|
||||
int trans_split_index;
|
||||
int split_index;
|
||||
const char *in_num = NULL;
|
||||
const char *in_tnum = NULL;
|
||||
char *out_num;
|
||||
@ -1649,16 +1645,11 @@ gboolean gnc_tree_control_split_reg_is_current_movable_updown (GncTreeViewSplitR
|
||||
gboolean
|
||||
gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
RowDepth depth;
|
||||
Transaction *dirty_trans;
|
||||
Transaction *blank_trans;
|
||||
Transaction *trans;
|
||||
Account *account;
|
||||
Split *blank_split;
|
||||
const char *memo;
|
||||
const char *desc;
|
||||
Split *split, *current_trans_split;
|
||||
// Split *split;
|
||||
// Split *current_trans_split;
|
||||
|
||||
ENTER("view=%p, reg_closing=%s", view, reg_closing ? "TRUE" : "FALSE");
|
||||
|
||||
@ -1674,17 +1665,14 @@ gnc_tree_control_split_reg_save (GncTreeViewSplitReg *view, gboolean reg_closing
|
||||
if (reg_closing)
|
||||
view->reg_closing = TRUE;
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
|
||||
blank_split = gnc_tree_control_split_reg_get_blank_split (view);
|
||||
dirty_trans = gnc_tree_view_split_reg_get_dirty_trans (view);
|
||||
blank_trans = gnc_tree_control_split_reg_get_blank_trans (view);
|
||||
|
||||
/* get the handle to the current split and transaction */
|
||||
split = gnc_tree_view_split_reg_get_current_split (view);
|
||||
// split = gnc_tree_view_split_reg_get_current_split (view);
|
||||
trans = gnc_tree_view_split_reg_get_current_trans (view);
|
||||
|
||||
current_trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
|
||||
// current_trans_split = gnc_tree_control_split_reg_get_current_trans_split (view);
|
||||
|
||||
if (trans == NULL)
|
||||
{
|
||||
@ -1961,7 +1949,6 @@ gnc_tree_control_split_reg_get_account_by_name (GncTreeViewSplitReg *view, const
|
||||
const char *placeholder = _("The account %s does not allow transactions.");
|
||||
const char *missing = _("The account %s does not exist. "
|
||||
"Would you like to create it?");
|
||||
char *account_name;
|
||||
Account *account;
|
||||
|
||||
if (!name || (strlen(name) == 0))
|
||||
@ -2069,7 +2056,7 @@ gnc_tree_control_split_reg_copy_trans (GncTreeViewSplitReg *view)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
Transaction *from_trans;
|
||||
Account *from_acc, *anchor;
|
||||
Account *anchor;
|
||||
|
||||
g_return_if_fail (GNC_IS_TREE_VIEW_SPLIT_REG (view));
|
||||
|
||||
@ -2146,7 +2133,7 @@ void
|
||||
gnc_tree_control_auto_complete (GncTreeViewSplitReg *view, Transaction *trans, const gchar *new_text)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
Transaction *btrans, *dirty_trans;
|
||||
Transaction *btrans;
|
||||
GtkListStore *desc_list;
|
||||
GtkTreeIter iter;
|
||||
gboolean valid;
|
||||
|
@ -366,8 +366,6 @@ gnc_tree_model_split_reg_prefs_changed (gpointer prefs, gchar *pref, gpointer us
|
||||
static void
|
||||
gnc_tree_model_split_reg_init (GncTreeModelSplitReg *model)
|
||||
{
|
||||
GncTreeModelSplitRegPrivate *priv;
|
||||
|
||||
ENTER("model %p", model);
|
||||
while (model->stamp == 0)
|
||||
{
|
||||
@ -391,14 +389,10 @@ gnc_tree_model_split_reg_init (GncTreeModelSplitReg *model)
|
||||
static void
|
||||
gnc_tree_model_split_reg_finalize (GObject *object)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
|
||||
ENTER("model split reg %p", object);
|
||||
g_return_if_fail (object != NULL);
|
||||
g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (object));
|
||||
|
||||
model = GNC_TREE_MODEL_SPLIT_REG (object);
|
||||
|
||||
if (G_OBJECT_CLASS (parent_class)->finalize)
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
LEAVE(" ");
|
||||
@ -616,8 +610,6 @@ void
|
||||
gnc_tree_model_split_reg_load (GncTreeModelSplitReg *model, GList *slist, Account *default_account)
|
||||
{
|
||||
GncTreeModelSplitRegPrivate *priv;
|
||||
GList *node;
|
||||
gint rows = 0;
|
||||
|
||||
ENTER("#### Load ModelSplitReg = %p and slist length is %d ####", model, g_list_length (slist));
|
||||
|
||||
@ -1521,7 +1513,6 @@ gnc_tree_model_split_reg_get_value (GtkTreeModel *tree_model,
|
||||
GncTreeModelSplitReg *model = GNC_TREE_MODEL_SPLIT_REG (tree_model);
|
||||
const GncGUID *guid;
|
||||
GList *tnode;
|
||||
gint depth, *indices;
|
||||
|
||||
g_return_if_fail (GNC_IS_TREE_MODEL_SPLIT_REG (model));
|
||||
|
||||
@ -2116,7 +2107,6 @@ GtkTreePath *
|
||||
gnc_tree_model_split_reg_get_path_to_split_and_trans (GncTreeModelSplitReg *model, Split *split, Transaction *trans)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GList *slist;
|
||||
gint tpos, spos, number;
|
||||
|
||||
ENTER("transaction is %p, split is %p", trans, split);
|
||||
@ -2160,7 +2150,6 @@ gnc_tree_model_split_reg_get_path_to_split_and_trans (GncTreeModelSplitReg *mode
|
||||
|
||||
if (split != NULL)
|
||||
{
|
||||
slist = xaccTransGetSplitList (trans);
|
||||
/* Level 3 */
|
||||
spos = xaccTransGetSplitIndex (trans, split);
|
||||
if (spos == -1)
|
||||
@ -3022,7 +3011,6 @@ gnc_tree_model_split_reg_update_account_list (GncTreeModelSplitReg *model)
|
||||
Account *acc;
|
||||
GtkTreeIter iter;
|
||||
GList *accts, *accts_cpy, *ptr;
|
||||
gboolean valid;
|
||||
const gchar *name;
|
||||
gchar *fname;
|
||||
gint i;
|
||||
|
@ -425,7 +425,6 @@ gchar *
|
||||
gnc_tree_util_split_reg_get_date_help (GDate *date)
|
||||
{
|
||||
char string[1024];
|
||||
struct tm tm;
|
||||
|
||||
if (g_date_valid (date))
|
||||
{
|
||||
@ -824,20 +823,19 @@ gnc_tree_util_split_reg_get_debcred_entry (GncTreeViewSplitReg *view,
|
||||
void
|
||||
gnc_tree_util_split_reg_set_value_for (GncTreeViewSplitReg *view, Transaction *trans, Split *split, gnc_numeric input, gboolean force)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
// GncTreeModelSplitReg *model;
|
||||
GtkWidget *window;
|
||||
Account *anchor;
|
||||
Account *acct = xaccSplitGetAccount (split);
|
||||
gnc_commodity *currency;
|
||||
gnc_numeric value, amount, rate;
|
||||
// Account *anchor;
|
||||
// Account *acct = xaccSplitGetAccount (split);
|
||||
// gnc_commodity *currency;
|
||||
|
||||
ENTER("set_value_for trans %p and split %p input %s force %d", trans, split, gnc_numeric_to_string (input), force);
|
||||
|
||||
currency = xaccTransGetCurrency (trans);
|
||||
// currency = xaccTransGetCurrency (trans);
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
// model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
|
||||
anchor = gnc_tree_model_split_reg_get_anchor (model);
|
||||
// anchor = gnc_tree_model_split_reg_get_anchor (model);
|
||||
|
||||
if (gnc_numeric_zero_p (input))
|
||||
{
|
||||
|
@ -98,8 +98,8 @@ static void gtv_sr_edited_normal_cb (GtkCellRendererText *cell, const gchar *pat
|
||||
static void gtv_sr_edited_template_cb (GtkCellRendererText *cell, const gchar *path_string,
|
||||
const gchar *new_text, gpointer user_data);
|
||||
|
||||
static void start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
|
||||
const gchar *path, gpointer user_data); //FIXME This may not be needed
|
||||
//static void start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
|
||||
// const gchar *path, gpointer user_data); //FIXME This may not be needed
|
||||
|
||||
static void gtv_sr_begin_edit (GncTreeViewSplitReg *view, Transaction *trans);
|
||||
|
||||
@ -110,11 +110,11 @@ static void gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditab
|
||||
|
||||
static void gtv_sr_editing_canceled_cb (GtkCellRenderer *cr, gpointer user_data);
|
||||
|
||||
static void gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
|
||||
GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
|
||||
//static void gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
|
||||
// GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
|
||||
|
||||
static void gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
|
||||
GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
|
||||
//static void gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
|
||||
// GtkTreeIter *iter, gpointer user_data); //FIXME This may not be needed
|
||||
|
||||
static void gtv_sr_selection_move_delete_cb (GncTreeModelSplitReg *model, gpointer item, gpointer user_data);
|
||||
|
||||
@ -548,15 +548,11 @@ gnc_tree_view_split_reg_dispose (GObject *object)
|
||||
static void
|
||||
gnc_tree_view_split_reg_finalize (GObject *object)
|
||||
{
|
||||
GncTreeViewSplitReg *view;
|
||||
|
||||
gnc_leave_return_if_fail(object != NULL);
|
||||
gnc_leave_return_if_fail(GNC_IS_TREE_VIEW_SPLIT_REG (object));
|
||||
|
||||
ENTER("split reg view %p", object);
|
||||
|
||||
view = GNC_TREE_VIEW_SPLIT_REG (object);
|
||||
|
||||
if (G_OBJECT_CLASS(parent_class)->finalize)
|
||||
(* G_OBJECT_CLASS(parent_class)->finalize) (object);
|
||||
|
||||
@ -1823,8 +1819,6 @@ gtv_sr_cdf0 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
|
||||
{
|
||||
GNCPrintAmountInfo print_info;
|
||||
|
||||
gnc_commodity *split_com = xaccAccountGetCommodity (xaccSplitGetAccount (split));
|
||||
|
||||
print_info = gnc_default_price_print_info();
|
||||
print_info.min_decimal_places = 2;
|
||||
|
||||
@ -2207,13 +2201,12 @@ gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
|
||||
gboolean is_split, is_blank, is_trow1, is_trow2;
|
||||
gboolean editable = FALSE, expanded = FALSE;
|
||||
gboolean read_only = FALSE;
|
||||
gboolean open_edited = FALSE;
|
||||
gnc_numeric num;
|
||||
// gboolean open_edited = FALSE;
|
||||
const gchar *s = "";
|
||||
const gchar *row_color;
|
||||
RowDepth depth;
|
||||
// RowDepth depth;
|
||||
gint *indices;
|
||||
Account *anchor = view->priv->anchor;
|
||||
// Account *anchor = view->priv->anchor;
|
||||
char type;
|
||||
|
||||
ENTER("");
|
||||
@ -2231,7 +2224,7 @@ gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
|
||||
|
||||
spath = gtk_tree_model_get_path (GTK_TREE_MODEL (s_model), s_iter);
|
||||
|
||||
depth = gtk_tree_path_get_depth (spath);
|
||||
// depth = gtk_tree_path_get_depth (spath);
|
||||
|
||||
indices = gtk_tree_path_get_indices (spath);
|
||||
|
||||
@ -2259,7 +2252,7 @@ gtv_sr_cdf1 (GtkTreeViewColumn *col, GtkCellRenderer *cell, GtkTreeModel *s_mode
|
||||
if (xaccTransIsOpen (trans) && (view->priv->dirty_trans != trans))
|
||||
{
|
||||
read_only = TRUE;
|
||||
open_edited = TRUE;
|
||||
// open_edited = TRUE;
|
||||
}
|
||||
|
||||
/* Test for a transaction type of invoice, always read only */
|
||||
@ -2490,17 +2483,18 @@ gtv_sr_transaction_changed_confirm (GncTreeViewSplitReg *view,
|
||||
/*###########################################################################
|
||||
vvvvv edit function call backs vvvvvv
|
||||
#############################################################################*/
|
||||
#ifdef skip
|
||||
static void
|
||||
start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
|
||||
const gchar *path_string, gpointer user_data)
|
||||
{
|
||||
GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
GncTreeModelSplitReg *model;
|
||||
// GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
// GncTreeModelSplitReg *model;
|
||||
GtkTreePath *path;
|
||||
//g_print("\n\nstart_edit\n");
|
||||
/*FIXME Not sure if this is required, leave for now ? */
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
// model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
|
||||
gtv_sr_editable_start_editing_cb (cr, editable, path_string, user_data);
|
||||
/* g_signal_connect(G_OBJECT(editable), "editing-done", (GCallback) editing_done_cb, view); */
|
||||
@ -2514,7 +2508,7 @@ start_edit (GtkCellRenderer *cr, GtkCellEditable *editable,
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* Open Transaction for editing */
|
||||
static void
|
||||
@ -2692,7 +2686,8 @@ gtv_sr_finish_edit (GncTreeViewSplitReg *view)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#ifdef skip
|
||||
//FIXME Not used yet
|
||||
/* This is used in g_idle_add to finish an edit */
|
||||
static gboolean
|
||||
gtv_sr_idle_finish_edit (GncTreeViewSplitReg *view)
|
||||
@ -2716,6 +2711,7 @@ gtv_sr_idle_cancel_edit (GtkCellRenderer *cr)
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* This is used in g_idle_add to repopulate the transfer cell */
|
||||
static gboolean
|
||||
@ -2765,7 +2761,6 @@ gtv_sr_titles (GncTreeViewSplitReg *view, RowDepth depth)
|
||||
GList *columns;
|
||||
GList *column;
|
||||
gint i;
|
||||
RowDepth temp_depth;
|
||||
gboolean is_template;
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
@ -3570,7 +3565,6 @@ gtv_sr_button_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data)
|
||||
GncTreeModelSplitReg *model;
|
||||
GtkTreePath *mpath, *spath;
|
||||
GtkTreeViewColumn *col;
|
||||
ViewCol viewcol;
|
||||
GtkTreeIter m_iter;
|
||||
Split *split = NULL;
|
||||
Split *rotate_split = NULL;
|
||||
@ -3840,11 +3834,9 @@ gtv_sr_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_data)
|
||||
gboolean trans_changed = FALSE;
|
||||
gint *start_indices;
|
||||
gint *next_indices;
|
||||
gboolean keyup = FALSE;
|
||||
Transaction *btrans, *ctrans, *hetrans;
|
||||
gboolean goto_blank = FALSE;
|
||||
gboolean next_trans = TRUE;
|
||||
gint depth;
|
||||
|
||||
// spath is where we are, before key press...
|
||||
gtk_tree_view_get_cursor (GTK_TREE_VIEW (view), &spath, &col);
|
||||
@ -4134,7 +4126,6 @@ gtv_sr_motion_cb (GtkTreeSelection *sel, gpointer user_data)
|
||||
{
|
||||
GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
GncTreeModelSplitReg *model;
|
||||
GtkTreeModel *s_model;
|
||||
GtkTreePath *mpath, *spath;
|
||||
Split *split = NULL;
|
||||
Transaction *trans = NULL;
|
||||
@ -4148,8 +4139,6 @@ gtv_sr_motion_cb (GtkTreeSelection *sel, gpointer user_data)
|
||||
|
||||
ENTER("View is %p and Model is %p", view, model);
|
||||
|
||||
s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
|
||||
|
||||
DEBUG("Current trans %p, Split %p, Depth %d and Dirty Trans %p", view->priv->current_trans, view->priv->current_split,
|
||||
view->priv->current_depth, view->priv->dirty_trans);
|
||||
|
||||
@ -4669,7 +4658,6 @@ gtv_sr_edited_template_cb (GtkCellRendererText *cell, const gchar *path_string,
|
||||
Transaction *trans;
|
||||
gboolean is_trow1, is_trow2, is_split, is_blank;
|
||||
ViewCol viewcol;
|
||||
char *error_loc = NULL;
|
||||
Account *anchor = view->priv->anchor;
|
||||
|
||||
editable = g_object_get_data (G_OBJECT (cell), "cell-editable");
|
||||
@ -5325,7 +5313,7 @@ gtv_sr_ed_key_press_cb (GtkWidget *widget, GdkEventKey *event, gpointer user_dat
|
||||
GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
GncTreeModelSplitReg *model;
|
||||
GtkTreeViewColumn *col;
|
||||
GtkTreePath *spath, *start_spath;
|
||||
GtkTreePath *spath;
|
||||
gboolean goto_blank = FALSE;
|
||||
gboolean next_trans = TRUE;
|
||||
Transaction *btrans, *ctrans;
|
||||
@ -5527,8 +5515,7 @@ gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable
|
||||
{
|
||||
GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
GncTreeModelSplitReg *model;
|
||||
GtkTreeModel *s_model;
|
||||
GtkTreePath *spath, *mpath, *fpath;
|
||||
GtkTreePath *spath;
|
||||
GtkEntry *entry = NULL;
|
||||
ViewCol viewcol;
|
||||
RowDepth depth;
|
||||
@ -5545,8 +5532,6 @@ gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
|
||||
s_model = gtk_tree_view_get_model (GTK_TREE_VIEW (view));
|
||||
|
||||
/* Description / Notes / Memo / Accounts Completion Lists */
|
||||
description_list = gnc_tree_model_split_reg_get_description_list (model);
|
||||
notes_list = gnc_tree_model_split_reg_get_notes_list (model);
|
||||
@ -5814,34 +5799,34 @@ gtv_sr_editable_start_editing_cb (GtkCellRenderer *cr, GtkCellEditable *editable
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
|
||||
#ifdef skip
|
||||
// Handle the "match-selected" signal
|
||||
static void
|
||||
gtv_sr_match_selected_cb (GtkEntryCompletion *widget, GtkTreeModel *model,
|
||||
GtkTreeIter *iter, gpointer user_data)
|
||||
{
|
||||
GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
// GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
|
||||
//FIXME g_print("gtv_sr_match_selected_cb\n\n");
|
||||
|
||||
/* Not sure what I am going to put in here yet if anything */
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef skip
|
||||
// Handle the "changed" signal
|
||||
static void
|
||||
gtv_sr_changed_cb (GtkCellRendererCombo *widget, gchar *path_string,
|
||||
GtkTreeIter *iter, gpointer user_data)
|
||||
{
|
||||
GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
// GncTreeViewSplitReg *view = GNC_TREE_VIEW_SPLIT_REG (user_data);
|
||||
|
||||
//FIXME g_print("gtv_sr_changed_cb path string is '%s'\n\n", path_string);
|
||||
|
||||
/* Not sure what I am going to put in here yet if anything */
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Handle the "editing-canceled" signal
|
||||
static void
|
||||
@ -5976,10 +5961,6 @@ gnc_tree_view_split_reg_get_dirty_trans (GncTreeViewSplitReg *view)
|
||||
void
|
||||
gnc_tree_view_split_reg_set_dirty_trans (GncTreeViewSplitReg *view, Transaction *trans)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
|
||||
if (trans == NULL)
|
||||
{
|
||||
g_object_set_data (G_OBJECT (view), "data-edited", GINT_TO_POINTER (FALSE));
|
||||
@ -6114,10 +6095,6 @@ gnc_tree_view_split_reg_delete_current_trans (GncTreeViewSplitReg *view)
|
||||
gboolean
|
||||
gnc_tree_view_split_reg_enter (GncTreeViewSplitReg *view)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
|
||||
model = gnc_tree_view_split_reg_get_model_from_view (view);
|
||||
|
||||
/* Make sure we have stopped editing */
|
||||
gnc_tree_view_split_reg_finish_edit (view);
|
||||
|
||||
@ -6341,11 +6318,12 @@ gnc_tree_view_split_reg_expand_trans (GncTreeViewSplitReg *view, Transaction *tr
|
||||
|
||||
if (gtk_tree_view_get_visible_range (GTK_TREE_VIEW (view), &start_path, &end_path))
|
||||
{
|
||||
gint *indices_start, *indices_end;
|
||||
// gint *indices_start;
|
||||
gint *indices_end;
|
||||
gint lines = 0;
|
||||
|
||||
/* The first and last visible path */
|
||||
indices_start = gtk_tree_path_get_indices (start_path);
|
||||
// indices_start = gtk_tree_path_get_indices (start_path);
|
||||
indices_end = gtk_tree_path_get_indices (end_path);
|
||||
|
||||
if (model->use_double_line)
|
||||
|
@ -600,9 +600,6 @@ gnc_plugin_page_register2_new_common (GNCLedgerDisplay2 *ledger)
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GncPluginPage *plugin_page;
|
||||
|
||||
GncTreeModelSplitReg *model;
|
||||
GtkTreeView *tv;
|
||||
|
||||
GNCSplitReg2 *gsr;
|
||||
|
||||
const GList *item;
|
||||
@ -610,7 +607,6 @@ gnc_plugin_page_register2_new_common (GNCLedgerDisplay2 *ledger)
|
||||
gchar *label;
|
||||
gchar *label_color;
|
||||
QofQuery *q;
|
||||
Account *account;
|
||||
|
||||
/* Is there an existing page? */
|
||||
gsr = gnc_ledger_display2_get_user_data (ledger);
|
||||
@ -789,13 +785,11 @@ static void
|
||||
gnc_plugin_page_register2_finalize (GObject *object)
|
||||
{
|
||||
GncPluginPageRegister2 *page;
|
||||
GncPluginPageRegister2Private *priv;
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (object));
|
||||
|
||||
ENTER("object %p", object);
|
||||
page = GNC_PLUGIN_PAGE_REGISTER2 (object);
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
LEAVE(" ");
|
||||
@ -1079,7 +1073,6 @@ gnc_plugin_page_register2_create_widget (GncPluginPage *plugin_page)
|
||||
GncTreeModelSplitReg *model;
|
||||
Account *acct;
|
||||
gchar **filter;
|
||||
gchar *order;
|
||||
int filter_changed = 0;
|
||||
|
||||
ENTER("page %p", plugin_page);
|
||||
@ -1434,7 +1427,6 @@ gnc_plugin_page_register2_restore_edit_menu (GncPluginPage *page,
|
||||
GKeyFile *key_file,
|
||||
const gchar *group_name)
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GtkAction *action;
|
||||
GError *error = NULL;
|
||||
gchar *style_name;
|
||||
@ -1443,7 +1435,6 @@ gnc_plugin_page_register2_restore_edit_menu (GncPluginPage *page,
|
||||
gboolean show_extra_dates;
|
||||
|
||||
ENTER(" ");
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
|
||||
|
||||
/* Convert the style name to an index */
|
||||
style_name = g_key_file_get_string (key_file, group_name,
|
||||
@ -1749,14 +1740,12 @@ void
|
||||
gnc_plugin_page_register2_set_filter (GncPluginPage *plugin_page, const gchar *filter )
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GNCLedgerDisplay2Type ledger_type;
|
||||
GNCLedgerDisplay2 *ld;
|
||||
Account *leader;
|
||||
gchar *default_filter;
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE(plugin_page);
|
||||
ld = priv->ledger;
|
||||
ledger_type = gnc_ledger_display2_type (ld);
|
||||
leader = gnc_ledger_display2_leader (ld);
|
||||
|
||||
if (leader != NULL)
|
||||
@ -1968,10 +1957,9 @@ gnc_plugin_page_register2_filter_time2dmy (time64 raw_time)
|
||||
{
|
||||
struct tm * timeinfo;
|
||||
gchar date_string[11];
|
||||
gint i;
|
||||
|
||||
timeinfo = gnc_localtime (&raw_time);
|
||||
i = strftime (date_string, 11, "%d-%m-%Y", timeinfo);
|
||||
strftime (date_string, 11, "%d-%m-%Y", timeinfo);
|
||||
PINFO("Date string is %s", date_string);
|
||||
|
||||
gnc_tm_free (timeinfo);
|
||||
@ -2093,7 +2081,6 @@ static void
|
||||
get_filter_times (GncPluginPageRegister2 *page)
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GtkWidget *button, *today, *gde;
|
||||
time64 time_val;
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
|
||||
@ -2642,7 +2629,7 @@ gnc_plugin_page_register2_cmd_print_check (GtkAction *action,
|
||||
}
|
||||
else if (ledger_type == LD2_GL && model->type == SEARCH_LEDGER2)
|
||||
{
|
||||
Account *common_acct = NULL, *account;
|
||||
Account *common_acct = NULL;
|
||||
splits = qof_query_run (gnc_ledger_display2_get_query (priv->ledger));
|
||||
/* Make sure each split is from the same account */
|
||||
for (item = splits; item; item = g_list_next (item))
|
||||
@ -2700,15 +2687,11 @@ static void
|
||||
gnc_plugin_page_register2_cmd_cut (GtkAction *action,
|
||||
GncPluginPageRegister2 *page) //this works
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GncTreeViewSplitReg *view;
|
||||
GtkWidget *window, *widget;
|
||||
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
|
||||
|
||||
ENTER("(action %p, page %p)", action, page);
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
|
||||
view = gnc_ledger_display2_get_split_view_register (priv->ledger);
|
||||
|
||||
window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
|
||||
widget = gtk_window_get_focus (GTK_WINDOW (window));
|
||||
@ -2725,15 +2708,11 @@ static void
|
||||
gnc_plugin_page_register2_cmd_copy (GtkAction *action,
|
||||
GncPluginPageRegister2 *page) //this works
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GncTreeViewSplitReg *view;
|
||||
GtkWidget *window, *widget;
|
||||
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
|
||||
|
||||
ENTER("(action %p, page %p)", action, page);
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
|
||||
view = gnc_ledger_display2_get_split_view_register (priv->ledger);
|
||||
|
||||
window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
|
||||
widget = gtk_window_get_focus (GTK_WINDOW (window));
|
||||
@ -2750,15 +2729,11 @@ static void
|
||||
gnc_plugin_page_register2_cmd_paste (GtkAction *action,
|
||||
GncPluginPageRegister2 *page) //this works
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GncTreeViewSplitReg *view;
|
||||
GtkWidget *window, *widget;
|
||||
|
||||
g_return_if_fail(GNC_IS_PLUGIN_PAGE_REGISTER2 (page));
|
||||
|
||||
ENTER("(action %p, page %p)", action, page);
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (page);
|
||||
view = gnc_ledger_display2_get_split_view_register (priv->ledger);
|
||||
|
||||
window = gnc_plugin_page_get_window (GNC_PLUGIN_PAGE (page));
|
||||
widget = gtk_window_get_focus (GTK_WINDOW (window));
|
||||
@ -3009,12 +2984,11 @@ gnc_plugin_page_register2_cmd_view_filter_by (GtkAction *action,
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GNCLedgerDisplay2Type ledger_type;
|
||||
GtkWidget *dialog, *toggle, *button, *start_date, *end_date, *table, *hbox;
|
||||
GtkWidget *dialog, *toggle, *button, *table, *hbox;
|
||||
time64 start_time, end_time, time_val;
|
||||
GtkBuilder *builder;
|
||||
gboolean sensitive, value;
|
||||
Query *query;
|
||||
GList *split_list;
|
||||
gchar *title;
|
||||
int i;
|
||||
|
||||
@ -3257,7 +3231,6 @@ gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action,
|
||||
GncPluginPageRegister2 *plugin_page) // this works
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GncTreeModelSplitReg *model;
|
||||
GncTreeViewSplitReg *view;
|
||||
gboolean show_extra_dates;
|
||||
|
||||
@ -3267,7 +3240,6 @@ gnc_plugin_page_register2_cmd_style_extra_dates (GtkToggleAction *action,
|
||||
g_return_if_fail (GNC_IS_PLUGIN_PAGE_REGISTER2 (plugin_page));
|
||||
|
||||
priv = GNC_PLUGIN_PAGE_REGISTER2_GET_PRIVATE (plugin_page);
|
||||
model = gnc_ledger_display2_get_split_model_register (priv->ledger);
|
||||
|
||||
view = gnc_ledger_display2_get_split_view_register (priv->ledger);
|
||||
|
||||
@ -3532,7 +3504,6 @@ gnc_plugin_page_register2_cmd_jump (GtkAction *action,
|
||||
{
|
||||
GncPluginPageRegister2Private *priv;
|
||||
GncPluginPage *new_page;
|
||||
GncPluginPageRegister2 *new_reg_page;
|
||||
GtkWidget *window;
|
||||
GNCLedgerDisplay2 *ld;
|
||||
GncTreeViewSplitReg *view, *new_view;
|
||||
|
@ -189,12 +189,9 @@ static void
|
||||
gnc_plugin_register2_finalize (GObject *object)
|
||||
{
|
||||
GncPluginRegister2 *plugin;
|
||||
GncPluginRegister2Private *priv;
|
||||
|
||||
g_return_if_fail (GNC_IS_PLUGIN_REGISTER2 (object));
|
||||
|
||||
plugin = GNC_PLUGIN_REGISTER2 (object);
|
||||
priv = GNC_PLUGIN_REGISTER2_GET_PRIVATE(plugin);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_REGISTER2 (plugin));
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
@ -216,11 +216,12 @@ static
|
||||
void
|
||||
gsr2_setup_table (GNCSplitReg2 *gsr)
|
||||
{
|
||||
GncTreeModelSplitReg *model;
|
||||
// GncTreeModelSplitReg *model;
|
||||
|
||||
ENTER("gsr=%p", gsr);
|
||||
|
||||
model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
|
||||
// This dose not do any thing
|
||||
// model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
|
||||
|
||||
LEAVE(" ");
|
||||
}
|
||||
@ -229,7 +230,6 @@ static
|
||||
void
|
||||
gsr2_create_table (GNCSplitReg2 *gsr)
|
||||
{
|
||||
GtkWidget *register_widget;
|
||||
GncTreeViewSplitReg *view;
|
||||
GncTreeModelSplitReg *model;
|
||||
GtkTreeModel *s_model;
|
||||
@ -243,7 +243,6 @@ gsr2_create_table (GNCSplitReg2 *gsr)
|
||||
GKeyFile *state_file = gnc_state_get_current();
|
||||
const GncGUID * guid;
|
||||
Account * account;
|
||||
const gchar *sort_string;
|
||||
|
||||
account = gnc_ledger_display2_leader (gsr->ledger);
|
||||
guid = xaccAccountGetGUID (account);
|
||||
@ -565,9 +564,6 @@ gsr2_redraw_all_cb (GncTreeViewSplitReg *view, gpointer user_data)
|
||||
GNCPriceDB *pricedb = gnc_pricedb_get_db (book);
|
||||
gnc_commodity *commodity = xaccAccountGetCommodity (leader);
|
||||
gnc_commodity *currency = gnc_default_currency ();
|
||||
gnc_numeric currency_value =
|
||||
gnc_pricedb_convert_balance_latest_price(pricedb, amount,
|
||||
commodity, currency);
|
||||
print_info = gnc_commodity_print_info (currency, TRUE);
|
||||
xaccSPrintAmount (string, amount, print_info);
|
||||
gnc_set_label_color (gsr->value_label, amount);
|
||||
@ -663,7 +659,6 @@ gsr2_create_balancing_transaction (QofBook *book, Account *account,
|
||||
static void
|
||||
gnc_split_reg2_sort_changed_cb (GtkTreeSortable *sortable, gpointer user_data)
|
||||
{
|
||||
Query *query;
|
||||
GNCSplitReg2 *gsr = user_data;
|
||||
GncTreeViewSplitReg *view;
|
||||
GncTreeModelSplitReg *model;
|
||||
@ -679,8 +674,6 @@ gnc_split_reg2_sort_changed_cb (GtkTreeSortable *sortable, gpointer user_data)
|
||||
view = gnc_ledger_display2_get_split_view_register (gsr->ledger);
|
||||
model = gnc_ledger_display2_get_split_model_register (gsr->ledger);
|
||||
|
||||
query = gnc_ledger_display2_get_query (gsr->ledger);
|
||||
|
||||
sort_depth = gnc_tree_view_reg_get_selected_row_depth (view);
|
||||
if (sort_depth != 0)
|
||||
model->sort_depth = sort_depth;
|
||||
@ -966,7 +959,6 @@ void
|
||||
gnc_split_reg2_determine_read_only (GNCSplitReg2 *gsr) //this works
|
||||
{
|
||||
dialog_args *args = g_malloc (sizeof (dialog_args));
|
||||
GncTreeViewSplitReg *view;
|
||||
|
||||
if (qof_book_is_readonly (gnc_get_current_book()))
|
||||
{
|
||||
|
@ -948,12 +948,9 @@ gnc_reconcile_window_button_press_cb (GtkWidget *widget,
|
||||
RecnWindow2 *recnData)
|
||||
{
|
||||
GNCQueryView *qview = GNC_QUERY_VIEW (widget);
|
||||
GtkTreeModel *model;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreePath *path;
|
||||
|
||||
model = gtk_tree_view_get_model (GTK_TREE_VIEW (qview));
|
||||
|
||||
if (event->button == 3 && event->type == GDK_BUTTON_PRESS)
|
||||
{
|
||||
|
||||
|
@ -519,6 +519,8 @@ gnc_ledger_display2_parent (void *user_data)
|
||||
return gnc_ledger_display2_get_parent( ld );
|
||||
}
|
||||
|
||||
#ifdef skip
|
||||
//FIXME Not used ?
|
||||
static void
|
||||
gnc_ledger_display2_set_watches (GNCLedgerDisplay2 *ld, GList *splits)
|
||||
{
|
||||
@ -541,6 +543,7 @@ gnc_ledger_display2_set_watches (GNCLedgerDisplay2 *ld, GList *splits)
|
||||
QOF_EVENT_MODIFY);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
refresh_handler (GHashTable *changes, gpointer user_data)
|
||||
@ -702,7 +705,7 @@ gnc_ledger_display2_internal (Account *lead_account, Query *q,
|
||||
GNCLedgerDisplay2 *ld;
|
||||
gint limit;
|
||||
const char *klass;
|
||||
GList *splits;
|
||||
// GList *splits;
|
||||
gboolean display_subaccounts = FALSE;
|
||||
gboolean is_gl = FALSE;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user