36 #ifdef __G_IR_SCANNER__
37 #undef __G_IR_SCANNER__
39 #include <gdk/gdkkeysyms.h>
40 #include <glib/gi18n.h>
41 #include "gnc-date-edit.h"
46 #include "dialog-options.h"
47 #include "dialog-utils.h"
50 #include "gnc-icons.h"
52 #include "gnc-session.h"
56 #include "option-util.h"
58 #include "gnc-component-manager.h"
63 #include "gnc-recurrence.h"
64 #include "Recurrence.h"
71 #define PLUGIN_PAGE_BUDGET_CM_CLASS "budget-view"
72 #define STATE_SECTION_PREFIX "Budget"
90 TOTALS_TYPE_TRANSFERS,
100 static void gnc_budget_view_finalize(GObject *
object);
104 static gboolean gbv_button_press_cb(
105 GtkWidget *widget, GdkEventButton *event,
GncBudgetView *view);
106 static gboolean gbv_key_press_cb(
107 GtkWidget *treeview, GdkEventKey *event, gpointer userdata);
108 static void gbv_row_activated_cb(
109 GtkTreeView *treeview, GtkTreePath *path, GtkTreeViewColumn *col,
112 static void gbv_selection_changed_cb(
115 static void gbv_treeview_resized_cb(GtkWidget* widget, GtkAllocation* allocation,
GncBudgetView* view);
117 Account* account, guint period_num);
121 GtkTreeView *tree_view;
122 GtkTreeView *totals_tree_view;
127 GList *period_col_list;
128 GList *totals_col_list;
129 GtkTreeViewColumn* total_col;
138 #define GNC_BUDGET_VIEW_GET_PRIVATE(o) \
139 (G_TYPE_INSTANCE_GET_PRIVATE((o), GNC_TYPE_BUDGET_VIEW, GncBudgetViewPrivate))
151 g_return_val_if_fail(GNC_IS_BUDGET(budget), NULL);
154 budget_view = g_object_new(GNC_TYPE_BUDGET_VIEW, NULL);
156 priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
157 priv->budget = budget;
158 priv->key = *gnc_budget_get_guid(budget);
160 priv->total_col = NULL;
161 gbv_create_widget(budget_view);
163 LEAVE(
"new budget view %p", budget_view);
170 GObjectClass *object_class = G_OBJECT_CLASS(klass);
172 gnc_budget_view_parent_class = g_type_class_peek_parent(klass);
174 object_class->finalize = gnc_budget_view_finalize;
176 g_signal_new(
"account-activated", GNC_TYPE_BUDGET_VIEW, G_SIGNAL_RUN_LAST, 0, NULL, NULL, NULL,
177 G_TYPE_NONE, 1, GNC_TYPE_ACCOUNT);
188 gint num_top_accounts;
191 ENTER(
"view %p", budget_view);
192 priv = GNC_BUDGET_VIEW_GET_PRIVATE(budget_view);
195 root = gnc_book_get_root_account(gnc_get_current_book());
198 for (i = 0; i < num_top_accounts; ++i)
209 priv->liabilities = acc;
217 priv->expenses = acc;
226 gnc_budget_view_finalize(GObject *
object)
231 ENTER(
"object %p",
object);
232 view = GNC_BUDGET_VIEW(
object);
233 g_return_if_fail(GNC_IS_BUDGET_VIEW(view));
235 G_OBJECT_CLASS(gnc_budget_view_parent_class)->finalize(
object);
245 g_return_val_if_fail(GNC_IS_BUDGET_VIEW(view), NULL);
247 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
248 return gtk_tree_view_get_selection(GTK_TREE_VIEW(priv->tree_view));
252 gnc_budget_view_get_account_from_path(
GncBudgetView* view, GtkTreePath* path)
256 g_return_val_if_fail(GNC_IS_BUDGET_VIEW(view), NULL);
258 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
267 g_return_val_if_fail(GNC_IS_BUDGET_VIEW(view), NULL);
269 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
280 GtkTreeSelection *selection;
281 GtkTreeView *tree_view;
282 GtkWidget *scrolled_window;
283 GtkWidget *inner_scrolled_window;
285 GtkWidget* inner_vbox;
286 GtkListStore* totals_tree_model;
287 GtkTreeView* totals_tree_view;
288 GtkTreeViewColumn* totals_title_col;
290 GtkWidget* h_separator;
291 gchar *state_section;
294 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
295 vbox = GTK_VBOX(view);
297 gtk_widget_show(GTK_WIDGET(vbox));
298 gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE);
300 scrolled_window = gtk_scrolled_window_new(NULL, NULL);
301 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
302 GTK_POLICY_AUTOMATIC,
304 gtk_widget_show(scrolled_window);
305 gtk_box_pack_start(GTK_BOX(vbox), scrolled_window, TRUE, TRUE, 0);
307 inner_vbox = gtk_vbox_new(FALSE, 0);
308 gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window), GTK_WIDGET(inner_vbox));
309 gtk_widget_show(GTK_WIDGET(inner_vbox));
311 inner_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
312 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(inner_scrolled_window),
314 GTK_POLICY_AUTOMATIC);
315 gtk_widget_show(inner_scrolled_window);
317 gtk_container_add(GTK_CONTAINER(inner_scrolled_window), GTK_WIDGET(tree_view));
320 state_section = g_strjoin(
" ", STATE_SECTION_PREFIX, guidstr, NULL);
321 g_object_set(G_OBJECT(tree_view),
"state-section", state_section, NULL);
322 g_free (state_section);
325 priv->tree_view = tree_view;
326 selection = gtk_tree_view_get_selection(tree_view);
327 gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
329 g_signal_connect(G_OBJECT(tree_view),
"row-activated",
330 G_CALLBACK(gbv_row_activated_cb), view);
331 g_signal_connect(G_OBJECT(tree_view),
"size-allocate",
332 G_CALLBACK(gbv_treeview_resized_cb), view);
335 g_signal_connect(G_OBJECT(selection),
"changed",
336 G_CALLBACK(gbv_selection_changed_cb), view);
337 g_signal_connect(G_OBJECT(tree_view),
"button-press-event",
338 G_CALLBACK(gbv_button_press_cb), view);
339 g_signal_connect_after(G_OBJECT(tree_view),
"key-press-event",
340 G_CALLBACK(gbv_key_press_cb), NULL);
342 gbv_selection_changed_cb(NULL, view);
344 gtk_tree_view_set_headers_visible(tree_view, TRUE);
345 gtk_widget_show(GTK_WIDGET(tree_view));
346 gtk_box_pack_start(GTK_BOX(inner_vbox), GTK_WIDGET(inner_scrolled_window), TRUE, TRUE, 0);
347 priv->fd->tree_view = GNC_TREE_VIEW_ACCOUNT(priv->tree_view);
349 GNC_TREE_VIEW_ACCOUNT(tree_view),
353 totals_tree_model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
354 gtk_list_store_append(totals_tree_model, &iter);
355 gtk_list_store_set(totals_tree_model, &iter, 0, _(
"Income"), 1, TOTALS_TYPE_INCOME, -1);
356 gtk_list_store_append(totals_tree_model, &iter);
357 gtk_list_store_set(totals_tree_model, &iter, 0, _(
"Expenses"), 1, TOTALS_TYPE_EXPENSES, -1);
358 gtk_list_store_append(totals_tree_model, &iter);
359 gtk_list_store_set(totals_tree_model, &iter, 0, _(
"Transfers"), 1, TOTALS_TYPE_TRANSFERS, -1);
360 gtk_list_store_append(totals_tree_model, &iter);
361 gtk_list_store_set(totals_tree_model, &iter, 0, _(
"Total"), 1, TOTALS_TYPE_TOTAL, -1);
363 totals_tree_view = GTK_TREE_VIEW(gtk_tree_view_new());
364 priv->totals_tree_view = totals_tree_view;
366 gtk_widget_show(GTK_WIDGET(totals_tree_view));
367 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(totals_tree_view),
369 gtk_tree_view_set_headers_visible(totals_tree_view, FALSE);
370 gtk_tree_view_set_model(totals_tree_view, GTK_TREE_MODEL(totals_tree_model));
372 totals_title_col = gtk_tree_view_column_new_with_attributes(
"", gtk_cell_renderer_text_new(),
"text", 0, NULL);
373 gtk_tree_view_column_set_expand(totals_title_col, TRUE);
374 gtk_tree_view_column_set_sizing(totals_title_col, GTK_TREE_VIEW_COLUMN_FIXED);
375 gtk_tree_view_append_column(totals_tree_view, totals_title_col);
377 gtk_box_pack_end(GTK_BOX(inner_vbox), GTK_WIDGET(totals_tree_view), FALSE, TRUE, 0);
379 h_separator = gtk_hseparator_new();
380 gtk_widget_show(h_separator);
381 gtk_box_pack_end(GTK_BOX(inner_vbox), h_separator, FALSE, TRUE, 0);
383 gnc_budget_view_refresh(view);
387 #define BUDGET_GUID "Budget GncGUID"
401 gnc_budget_view_save(
GncBudgetView *view, GKeyFile *key_file,
const gchar *group_name)
406 g_return_if_fail(view != NULL);
407 g_return_if_fail(key_file != NULL);
408 g_return_if_fail(group_name != NULL);
410 ENTER(
"view %p, key_file %p, group_name %s", view, key_file, group_name);
412 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
415 gnc_tree_view_account_save(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
416 priv->fd, key_file, group_name);
435 gnc_budget_view_restore(
GncBudgetView* view, GKeyFile *key_file,
const gchar *group_name)
438 GError *error = NULL;
444 g_return_val_if_fail(key_file, FALSE);
445 g_return_val_if_fail(group_name, FALSE);
447 ENTER(
"key_file %p, group_name %s", key_file, group_name);
449 guid_str = g_key_file_get_string(key_file, group_name, BUDGET_GUID,
453 g_warning(
"error reading group %s key %s: %s",
454 group_name, BUDGET_GUID, error->message);
465 bgt = gnc_budget_lookup(&guid, book);
472 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
475 gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
476 priv->fd, key_file, group_name);
494 g_return_if_fail(view != NULL);
496 ENTER(
"view %p", view);
498 priv = GNC_BUDGET_VIEW_GET_PRIVATE (view);
502 g_object_set (G_OBJECT (priv->tree_view),
"state-section", NULL, NULL);
520 gbv_button_press_cb(GtkWidget *widget, GdkEventButton *event,
525 g_return_val_if_fail(view != NULL, FALSE);
527 ENTER(
"widget %p, event %p, page %p", widget, event, page);
535 gbv_key_press_cb(GtkWidget *treeview, GdkEventKey *event, gpointer userdata)
537 GtkTreeView *tv = GTK_TREE_VIEW(treeview);
538 GtkTreeViewColumn *col;
539 GtkTreePath *path = NULL;
541 if (event->type != GDK_KEY_PRESS)
return TRUE;
543 switch (event->keyval)
546 case GDK_ISO_Left_Tab:
550 gtk_tree_view_get_cursor(tv, &path, &col);
551 if (!path)
return TRUE;
557 gnc_tree_view_keynav(GNC_TREE_VIEW(tv), &col, path, event);
559 if (path && gnc_tree_view_path_is_valid(GNC_TREE_VIEW(tv), path))
560 gtk_tree_view_set_cursor(tv, path, col, TRUE);
565 gbv_treeview_resized_cb(GtkWidget* widget, GtkAllocation* allocation,
GncBudgetView* view)
574 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
577 columns = gtk_tree_view_get_columns(GTK_TREE_VIEW(priv->tree_view));
578 ncols = g_list_length(columns);
579 g_list_free(columns);
582 for (i = 0, j = 0; i < ncols; ++i)
585 GtkTreeViewColumn* tree_view_col;
586 GtkTreeViewColumn* totals_view_col;
588 tree_view_col = gtk_tree_view_get_column(priv->tree_view, i);
590 if (gtk_tree_view_column_get_visible(tree_view_col))
592 col_width = gtk_tree_view_column_get_width(tree_view_col);
593 totals_view_col = gtk_tree_view_get_column(priv->totals_tree_view, j);
594 gtk_tree_view_column_set_fixed_width(totals_view_col, col_width);
602 gbv_row_activated_cb(GtkTreeView *treeview, GtkTreePath *path,
609 g_return_if_fail(GNC_IS_BUDGET_VIEW(view));
611 GNC_TREE_VIEW_ACCOUNT(treeview), path);
617 g_signal_emit_by_name(view,
"account-activated", account);
623 gbv_selection_changed_cb(GtkTreeSelection *selection,
GncBudgetView *view)
625 GtkTreeView *tree_view;
635 g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
636 tree_view = gtk_tree_selection_get_tree_view (selection);
638 GNC_TREE_VIEW_ACCOUNT(tree_view));
641 sensitive = (g_list_length(acct_list) > 0);
642 g_list_free(acct_list);
655 budget_accum_helper(
Account* account, gpointer data)
660 if (gnc_budget_is_account_period_value_set(info->budget, account, info->period_num))
662 numeric = gnc_budget_get_account_period_value(info->budget, account, info->period_num);
667 numeric = gbv_get_accumulated_budget_amount(info->budget, account, info->period_num);
673 gbv_get_accumulated_budget_amount(
GncBudget* budget,
Account* account, guint period_num)
677 info.total = gnc_numeric_zero();
678 info.budget = budget;
679 info.period_num = period_num;
691 budget_col_source(
Account *account, GtkTreeViewColumn *col,
692 GtkCellRenderer *cell)
699 budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col),
"budget"));
700 period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(col),
703 if (!gnc_budget_is_account_period_value_set(budget, account, period_num))
711 numeric = gbv_get_accumulated_budget_amount(budget, account, period_num);
713 gnc_account_print_info(account, FALSE));
714 g_object_set(cell,
"foreground",
"dark gray", NULL);
719 numeric = gnc_budget_get_account_period_value(budget, account,
723 strcpy(amtbuff,
"error");
728 gnc_account_print_info(account, FALSE));
729 g_object_set(cell,
"foreground",
"black", NULL);
732 return g_strdup(amtbuff);
743 num_periods = gnc_budget_get_num_periods(budget);
744 for (period_num = 0; period_num < num_periods; ++period_num)
746 if (!gnc_budget_is_account_period_value_set(budget, account, period_num))
750 numeric = gbv_get_accumulated_budget_amount(budget, account, period_num);
756 numeric = gnc_budget_get_account_period_value(budget, account, period_num);
768 budget_total_col_source(
Account *account, GtkTreeViewColumn *col,
769 GtkCellRenderer *cell)
775 budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col),
"budget"));
776 total = bgv_get_total_for_account(account, budget);
778 gnc_account_print_info(account, FALSE));
779 return g_strdup(amtbuff);
783 budget_col_edited(
Account *account, GtkTreeViewColumn *col,
784 const gchar *new_text)
790 if (!xaccParseAmount(new_text, TRUE, &numeric, NULL) &&
791 !(new_text && *new_text ==
'\0'))
794 period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(col),
797 budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col),
"budget"));
799 if (new_text && *new_text ==
'\0')
800 gnc_budget_unset_account_period_value(budget, account, period_num);
802 gnc_budget_set_account_period_value(budget, account, period_num,
808 totals_col_source(GtkTreeViewColumn *col, GtkCellRenderer *cell,
809 GtkTreeModel *s_model, GtkTreeIter *s_iter,
821 view = GNC_BUDGET_VIEW(user_data);
822 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
824 gtk_tree_model_get(s_model, s_iter, 1, &row_type, -1);
825 budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col),
"budget"));
826 period_num = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(col),
829 if (row_type == TOTALS_TYPE_INCOME)
833 value = gbv_get_accumulated_budget_amount(budget, priv->income, period_num);
837 value = bgv_get_total_for_account(priv->income, budget);
840 gnc_account_print_info(priv->income, FALSE));
841 g_object_set(cell,
"foreground",
"black", NULL);
843 else if (row_type == TOTALS_TYPE_EXPENSES)
847 value = gbv_get_accumulated_budget_amount(budget, priv->expenses, period_num);
851 value = bgv_get_total_for_account(priv->expenses, budget);
854 gnc_account_print_info(priv->expenses, FALSE));
855 g_object_set(cell,
"foreground",
"black", NULL);
857 else if (row_type == TOTALS_TYPE_TRANSFERS)
864 assets = gbv_get_accumulated_budget_amount(budget, priv->assets, period_num);
865 liabilities = gbv_get_accumulated_budget_amount(budget, priv->liabilities, period_num);
869 assets = bgv_get_total_for_account(priv->assets, budget);
870 liabilities = bgv_get_total_for_account(priv->liabilities, budget);
874 gnc_account_print_info(priv->assets, FALSE));
875 g_object_set(cell,
"foreground",
"black", NULL);
877 else if (row_type == TOTALS_TYPE_TOTAL)
886 income = gbv_get_accumulated_budget_amount(budget, priv->income, period_num);
887 expenses = gbv_get_accumulated_budget_amount(budget, priv->expenses, period_num);
888 assets = gbv_get_accumulated_budget_amount(budget, priv->assets, period_num);
889 liabilities = gbv_get_accumulated_budget_amount(budget, priv->liabilities, period_num);
893 income = bgv_get_total_for_account(priv->income, budget);
894 expenses = bgv_get_total_for_account(priv->expenses, budget);
895 assets = bgv_get_total_for_account(priv->assets, budget);
896 liabilities = bgv_get_total_for_account(priv->liabilities, budget);
902 gnc_account_print_info(priv->assets, FALSE));
905 g_object_set(cell,
"foreground",
"red", NULL);
909 g_object_set(cell,
"foreground",
"black", NULL);
914 g_strlcpy(amtbuff,
"error",
sizeof(amtbuff));
917 g_object_set(G_OBJECT(cell),
"text", amtbuff,
"xalign", 1.0, NULL);
925 GDate date, nextdate;
926 GtkTreeViewColumn *col;
928 gint num_periods_visible;
933 g_return_if_fail(view != NULL);
934 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
936 col_list = priv->period_col_list;
937 num_periods_visible = g_list_length(col_list);
940 r = gnc_budget_get_recurrence(priv->budget);
942 for (i = 0; i < num_periods_visible; i++)
944 col = GTK_TREE_VIEW_COLUMN(g_list_nth_data(col_list, i));
948 gtk_tree_view_column_set_title(col, title);
950 recurrenceNextInstance(r, &date, &nextdate);
956 static GtkTreeViewColumn*
957 gbv_create_totals_column(
GncBudgetView* view, gint period_num)
960 GtkTreeViewColumn *col;
961 GtkCellRenderer* renderer;
963 g_return_val_if_fail(view != NULL, NULL);
964 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
966 renderer = gtk_cell_renderer_text_new();
967 col = gtk_tree_view_column_new_with_attributes(
"", renderer, NULL);
969 gtk_tree_view_column_set_cell_data_func(col, renderer, totals_col_source, view, NULL);
970 g_object_set_data(G_OBJECT(col),
"budget", priv->budget);
971 g_object_set_data(G_OBJECT(col),
"period_num", GUINT_TO_POINTER(period_num));
972 gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_FIXED);
979 gbv_col_edited_cb(GtkCellRendererText* cell, gchar* path_string, gchar* new_text, gpointer user_data)
985 view = GNC_BUDGET_VIEW(user_data);
986 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
988 gtk_widget_queue_draw(GTK_WIDGET(priv->totals_tree_view));
996 gint num_periods_visible;
997 GtkTreeViewColumn *col;
999 GList *totals_col_list;
1000 ENTER(
"view %p", view);
1002 g_return_if_fail(view != NULL);
1003 priv = GNC_BUDGET_VIEW_GET_PRIVATE(view);
1005 num_periods = gnc_budget_get_num_periods(priv->budget);
1006 col_list = priv->period_col_list;
1007 totals_col_list = priv->totals_col_list;
1008 num_periods_visible = g_list_length(col_list);
1011 while (num_periods_visible > num_periods)
1013 col = GTK_TREE_VIEW_COLUMN((g_list_last(col_list))->data);
1014 gtk_tree_view_remove_column(GTK_TREE_VIEW(priv->tree_view), col);
1015 col_list = g_list_delete_link(col_list, g_list_last(col_list));
1016 num_periods_visible = g_list_length(col_list);
1018 col = GTK_TREE_VIEW_COLUMN((g_list_last(totals_col_list))->data);
1019 gtk_tree_view_remove_column(GTK_TREE_VIEW(priv->totals_tree_view), col);
1020 totals_col_list = g_list_delete_link(totals_col_list, g_list_last(totals_col_list));
1028 if (num_periods_visible != 0 && num_periods > num_periods_visible)
1031 col = priv->total_col;
1032 gtk_tree_view_remove_column(GTK_TREE_VIEW(priv->tree_view), col);
1033 priv->total_col = NULL;
1034 col = gtk_tree_view_get_column(GTK_TREE_VIEW(priv->totals_tree_view), num_periods_visible+1);
1035 gtk_tree_view_remove_column(GTK_TREE_VIEW(priv->totals_tree_view), col);
1039 while (num_periods_visible < num_periods)
1041 GList* renderer_list;
1042 GList* renderer_node;
1045 GNC_TREE_VIEW_ACCOUNT(priv->tree_view),
"",
1046 budget_col_source, budget_col_edited);
1047 g_object_set_data(G_OBJECT(col),
"budget", priv->budget);
1048 g_object_set_data(G_OBJECT(col),
"period_num",
1049 GUINT_TO_POINTER(num_periods_visible));
1050 col_list = g_list_append(col_list, col);
1052 renderer_list = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(col));
1053 for (renderer_node = renderer_list; renderer_node != NULL; renderer_node = g_list_next(renderer_node))
1055 GtkCellRenderer* renderer = GTK_CELL_RENDERER(renderer_node->data);
1056 g_signal_connect(G_OBJECT(renderer),
"edited", (GCallback)gbv_col_edited_cb, view);
1058 g_list_free(renderer_list);
1060 col = gbv_create_totals_column(view, num_periods_visible);
1063 gtk_tree_view_append_column(priv->totals_tree_view, col);
1064 totals_col_list = g_list_append(totals_col_list, col);
1067 num_periods_visible = g_list_length(col_list);
1069 priv->period_col_list = col_list;
1070 priv->totals_col_list = totals_col_list;
1072 if (priv->total_col == NULL)
1075 GNC_TREE_VIEW_ACCOUNT(priv->tree_view), _(
"Total"),
1076 budget_total_col_source, NULL);
1077 g_object_set_data(G_OBJECT(priv->total_col),
"budget", priv->budget);
1079 col = gbv_create_totals_column(view, -1);
1082 gtk_tree_view_append_column(priv->totals_tree_view, col);
1086 gbv_refresh_col_titles(view);
GncBudgetView * gnc_budget_view_new(GncBudget *budget, AccountFilterDialog *fd)
Functions to load, save and get gui state.
gboolean gnc_main_window_button_press_cb(GtkWidget *whatever, GdkEventButton *event, GncPluginPage *page)
GList * gnc_tree_view_account_get_selected_accounts(GncTreeViewAccount *view)
utility functions for the GnuCash UI
GNCAccountType xaccAccountGetType(const Account *acc)
gint gnc_state_drop_sections_for(const gchar *partial_name)
gboolean string_to_guid(const gchar *string, GncGUID *guid)
gnc_numeric gnc_numeric_add(gnc_numeric a, gnc_numeric b, gint64 denom, gint how)
gchar * guid_to_string_buff(const GncGUID *guid, gchar *buff)
#define ENTER(format, args...)
Functions for adding content to a window.
gboolean gnc_numeric_negative_p(gnc_numeric a)
void gnc_tree_view_account_set_filter(GncTreeViewAccount *view, gnc_tree_view_account_filter_func func, gpointer data, GSourceFunc destroy)
QofBook * qof_session_get_book(const QofSession *session)
GtkTreeView implementation for gnucash account tree.
void gnc_account_foreach_child(const Account *acc, AccountCb thunk, gpointer user_data)
GtkTreeViewColumn * gnc_tree_view_account_add_custom_column(GncTreeViewAccount *account_view, const gchar *column_title, GncTreeViewAccountColumnSource col_source_cb, GncTreeViewAccountColumnTextEdited col_edited_cb)
#define GUID_ENCODING_LENGTH
gnc_numeric gnc_numeric_error(GNCNumericErrorCode error_code)
GtkTreeView * gnc_tree_view_account_new(gboolean show_root)
void gnc_tree_view_configure_columns(GncTreeView *view)
gboolean gnc_plugin_page_account_tree_filter_accounts(Account *account, gpointer user_data)
Account * gnc_tree_view_account_get_account_from_path(GncTreeViewAccount *view, GtkTreePath *s_path)
Gnome specific utility functions.
gint gnc_account_n_children(const Account *account)
int xaccSPrintAmount(char *bufp, gnc_numeric val, GNCPrintAmountInfo info)
GtkTreeModel implementation to display account types in a GtkTreeView.
gnc_numeric gnc_numeric_sub(gnc_numeric a, gnc_numeric b, gint64 denom, gint how)
#define LEAVE(format, args...)
Account * gnc_account_nth_child(const Account *parent, gint num)
GNCNumericErrorCode gnc_numeric_check(gnc_numeric a)
size_t qof_print_gdate(char *buf, size_t bufflen, const GDate *gd)
const gchar * QofLogModule