31 #include <glib/gi18n.h> 35 #include "gnc-component-manager.h" 36 #include "gnc-date-edit.h" 39 #include "dialog-utils.h" 47 #define GNC_PREFS_GROUP "dialogs.export.csv" 48 #define GNC_PREF_PANED_POS "paned-position" 49 #define ASSISTANT_CSV_EXPORT_CM_CLASS "assistant-csv-export" 52 static QofLogModule log_module = GNC_MOD_ASSISTANT;
56 void csv_export_assistant_prepare (GtkAssistant *assistant, GtkWidget *page, gpointer user_data);
57 void csv_export_assistant_finish (GtkAssistant *gtkassistant, gpointer user_data);
58 void csv_export_assistant_cancel (GtkAssistant *gtkassistant, gpointer user_data);
59 void csv_export_assistant_close (GtkAssistant *gtkassistant, gpointer user_data);
61 void csv_export_assistant_start_page_prepare (GtkAssistant *assistant, gpointer user_data);
62 void csv_export_assistant_account_page_prepare (GtkAssistant *gtkassistant, gpointer user_data);
63 void csv_export_assistant_file_page_prepare (GtkAssistant *assistant, gpointer user_data);
64 void csv_export_assistant_finish_page_prepare (GtkAssistant *assistant, gpointer user_data);
65 void csv_export_assistant_summary_page_prepare (GtkAssistant *assistant, gpointer user_data);
67 void csv_export_quote_cb (GtkToggleButton *button, gpointer user_data);
68 void csv_export_simple_cb (GtkToggleButton *button, gpointer user_data);
69 void csv_export_sep_cb (GtkWidget *radio, gpointer user_data);
70 void csv_export_custom_entry_cb (GtkWidget *widget, gpointer user_data);
72 void csv_export_show_range_cb (GtkRadioButton *button, gpointer user_data);
73 void csv_export_start_date_cb (GtkWidget *radio, gpointer user_data);
74 void csv_export_end_date_cb (GtkWidget *radio, gpointer user_data);
76 void csv_export_file_chooser_file_activated_cb (GtkFileChooser *chooser,
CsvExportInfo *info);
77 void csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser,
CsvExportInfo *info);
79 static const gchar *start_tree_string = N_(
80 "This assistant will help you export the Account Tree to a file " 81 "with the separator specified below.\n\n" 82 "Select the settings you require for the file and then click \"Next\" " 83 "to proceed or \"Cancel\" to abort the export.\n");
85 static const gchar *start_trans_common_string = N_(
87 "This assistant will help you export the Transactions to a file " 88 "with the separator specified below.\n\n" 90 "While a transaction may have splits in several of the selected accounts " 91 "it will only be exported once. It will appear under the first processed " 92 "account it has a split in.\n\n" 93 "The Price/Rate output format is controlled by the preference\n" 94 "\"Numbers, Date, Time\"->\"Force Prices to display as decimals\".\n\n" 95 "Select the settings you require for the file and then click \"Next\" " 96 "to proceed or \"Cancel\" to abort the export.\n");
98 static const gchar *start_trans_multi_string = N_(
99 "There will be multiple rows for each transaction with each row " 100 "representing one split.");
102 static const gchar *start_trans_simple_string = N_(
103 "There will be one row for each transaction, equivalent to a single row " 104 "in a register in 'Basic Ledger' mode. As such some transfer detail " 107 static const gchar *finish_tree_string = N_(
109 "The account tree will be exported to the file '%s' when you click \"Apply\".\n\n" 110 "You can also verify your selections by clicking on \"Back\" or \"Cancel\" to abort the export.\n");
112 static const gchar *finish_trans_string = N_(
114 "When you click \"Apply\", the transactions will be exported to the file '%s' " 115 "and the number of accounts exported will be %u.\n\n" 116 "You can also verify your selections by clicking on \"Back\" or \"Cancel\" to abort the export.\n");
118 static const gchar *finish_trans_search_gl_string = N_(
120 "When you click \"Apply\", the transactions will be exported to the file '%s'.\n\n" 121 "You can also verify your selections by clicking on \"Back\" or \"Cancel\" to abort the export.\n");
130 csv_export_assistant_check_filename (GtkFileChooser *chooser,
133 gchar *file_name = gtk_file_chooser_get_filename (chooser);
136 if (file_name && !g_file_test (file_name, G_FILE_TEST_IS_DIR))
139 gchar *filedir = g_path_get_dirname (filepath);
141 g_free (info->file_name);
142 info->file_name = g_strdup (file_name);
144 g_free (info->starting_dir);
145 info->starting_dir = g_strdup (filedir);
151 DEBUG(
"file_name selected is %s", info->file_name);
152 DEBUG(
"starting directory is %s", info->starting_dir);
166 csv_export_file_chooser_file_activated_cb (GtkFileChooser *chooser,
169 GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
170 gtk_assistant_set_page_complete (assistant, info->file_page, FALSE);
173 if (csv_export_assistant_check_filename (chooser, info))
175 gtk_assistant_set_page_complete (assistant, info->file_page, TRUE);
176 gtk_assistant_next_page (assistant);
187 csv_export_file_chooser_selection_changed_cb (GtkFileChooser *chooser,
190 GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
193 gtk_assistant_set_page_complete (assistant, info->file_page,
194 csv_export_assistant_check_filename (chooser, info));
204 csv_export_sep_cb (GtkWidget *radio, gpointer user_data)
207 GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
210 if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
212 LEAVE(
"1st callback of pair. Defer to 2nd callback.");
216 name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
218 gtk_widget_set_sensitive (info->custom_entry, FALSE);
219 info->use_custom = FALSE;
220 gtk_assistant_set_page_complete (assistant, info->start_page, TRUE);
222 if (g_strcmp0 (name,
"comma_radio") == 0)
223 info->separator_str =
",";
224 if (g_strcmp0 (name,
"colon_radio") == 0)
225 info->separator_str =
":";
226 if (g_strcmp0 (name,
"semicolon_radio") == 0)
227 info->separator_str =
";";
229 if (g_strcmp0 (name,
"custom_radio") == 0)
231 gtk_widget_set_sensitive (info->custom_entry, TRUE);
232 info->use_custom = TRUE;
233 if (gtk_entry_get_text_length (GTK_ENTRY(info->custom_entry)) == 0)
234 gtk_assistant_set_page_complete (assistant, info->start_page, FALSE);
245 csv_export_quote_cb (GtkToggleButton *button, gpointer user_data)
249 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button)))
250 info->use_quotes = TRUE;
252 info->use_quotes = FALSE;
261 csv_export_simple_cb (GtkToggleButton *button, gpointer user_data)
265 info->simple_layout = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button));
268 if (info->simple_layout)
269 msg = g_strdup_printf (_(start_trans_common_string), _(start_trans_simple_string));
271 msg = g_strdup_printf (_(start_trans_common_string), _(start_trans_multi_string));
273 gtk_label_set_text (GTK_LABEL(info->start_label), msg);
283 csv_export_custom_entry_cb (GtkWidget *widget, gpointer user_data)
286 GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
287 const gchar *custom_str;
289 custom_str = gtk_entry_get_text (GTK_ENTRY(info->custom_entry));
290 info->separator_str = strdup (custom_str);
292 if (info->use_custom == TRUE && gtk_entry_get_text_length (GTK_ENTRY(info->custom_entry)) == 0)
293 gtk_assistant_set_page_complete (assistant, info->start_page, FALSE);
295 gtk_assistant_set_page_complete (assistant, info->start_page, TRUE);
307 info->use_quotes = FALSE;
308 info->simple_layout = FALSE;
309 info->separator_str =
",";
310 info->file_name = NULL;
311 info->starting_dir = NULL;
314 info->starting_dir = gnc_get_default_directory (GNC_PREFS_GROUP);
325 csv_export_cursor_changed_cb (GtkWidget *widget, gpointer user_data)
328 GncTreeViewAccount *account_tree;
332 account_tree = GNC_TREE_VIEW_ACCOUNT (info->csva.account_treeview);
336 gtk_widget_set_sensitive (info->csva.select_button, FALSE);
340 gtk_widget_set_sensitive (info->csva.select_button, num_children > 0);
352 GncTreeViewAccount *tree;
353 AccountViewInfo Viewinfo;
356 tree = GNC_TREE_VIEW_ACCOUNT (info->csva.account_treeview);
378 csv_export_cursor_changed_cb (GTK_WIDGET(tree), info);
390 GncTreeViewAccount *tree;
391 GtkTreeSelection* selection;
396 tree = GNC_TREE_VIEW_ACCOUNT(info->csva.account_treeview);
397 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(tree));
398 num_accounts = gtk_tree_selection_count_selected_rows (selection);
400 label = info->csva.num_acct_label;
401 string = g_strdup_printf (_(
"Accounts Selected: %d"), num_accounts);
402 gtk_label_set_text (GTK_LABEL (label),
string);
413 csv_export_account_changed_cb (GtkTreeSelection *selection,
417 g_return_if_fail(GTK_IS_TREE_SELECTION(selection));
421 GncTreeViewAccount *view = GNC_TREE_VIEW_ACCOUNT(info->csva.account_treeview);
425 GtkAssistant *assistant = GTK_ASSISTANT(info->assistant);
426 if (g_list_length (info->csva.account_list) > 0)
427 gtk_assistant_set_page_complete (assistant, info->account_page, TRUE);
429 gtk_assistant_set_page_complete (assistant, info->account_page, FALSE);
431 update_accounts_tree (info);
441 csv_export_select_all_clicked_cb (GtkWidget *widget, gpointer user_data)
444 GtkTreeSelection *selection = gtk_tree_view_get_selection
445 (GTK_TREE_VIEW (info->csva.account_treeview));
447 gtk_tree_view_expand_all (GTK_TREE_VIEW (info->csva.account_treeview));
448 gtk_tree_selection_select_all (selection);
450 gtk_widget_grab_focus (info->csva.account_treeview);
460 csv_export_select_subaccounts_clicked_cb (GtkWidget *widget, gpointer user_data)
463 GncTreeViewAccount *account_tree;
466 account_tree = GNC_TREE_VIEW_ACCOUNT (info->csva.account_treeview);
473 gtk_widget_grab_focus (info->csva.account_treeview);
488 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(info->csvd.start_date_choose)))
490 time_val = gnc_date_edit_get_date (GNC_DATE_EDIT(info->csvd.start_date));
492 info->csvd.start_time = time_val;
496 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(info->csvd.start_date_today)))
499 info->csvd.start_time = info->csvd.earliest_time;
502 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(info->csvd.end_date_choose)))
504 time_val = gnc_date_edit_get_date (GNC_DATE_EDIT(info->csvd.end_date));
506 info->csvd.end_time = time_val;
510 if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(info->csvd.end_date_today)))
513 info->csvd.end_time = info->csvd.latest_time;
524 csv_export_show_range_cb (GtkRadioButton *button, gpointer user_data)
529 g_return_if_fail (GTK_IS_RADIO_BUTTON(button));
531 active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(button));
535 info->csvd.start_time = info->csvd.earliest_time;
536 info->csvd.end_time = info->csvd.latest_time;
539 get_filter_times (info);
541 gtk_widget_set_sensitive (info->csvd.table, active);
551 csv_export_date_changed_cb (GtkWidget *w, gpointer user_data)
555 get_filter_times (info);
565 csv_export_start_date_cb (GtkWidget *radio, gpointer user_data)
571 g_return_if_fail (GTK_IS_RADIO_BUTTON(radio));
573 if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
575 LEAVE(
"1st callback of pair. Defer to 2nd callback.");
579 name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
580 active = (g_strcmp0 (name,
"start_date_choose") == 0 ? 1 : 0 );
581 gtk_widget_set_sensitive (info->csvd.start_date, active);
582 get_filter_times (info);
592 csv_export_end_date_cb (GtkWidget *radio, gpointer user_data)
598 g_return_if_fail (GTK_IS_RADIO_BUTTON(radio));
600 if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(radio)))
602 LEAVE(
"1st callback of pair. Defer to 2nd callback.");
606 name = gtk_buildable_get_name (GTK_BUILDABLE(radio));
607 active = (g_strcmp0 (name,
"end_date_choose") == 0 ? 1 : 0 );
608 gtk_widget_set_sensitive (info->csvd.end_date, active);
609 get_filter_times (info);
619 get_earliest_and_latest_in_book (
CsvExportInfo *info, QofBook *book)
626 q = qof_query_create_for (GNC_ID_SPLIT);
630 p1 = g_slist_prepend (NULL, TRANS_DATE_POSTED);
631 p1 = g_slist_prepend (p1, SPLIT_TRANS);
640 etime = xaccQueryGetEarliestDateFound (q);
641 ltime = xaccQueryGetLatestDateFound (q);
663 csv_export_assistant_start_page_prepare (GtkAssistant *assistant,
669 if (info->export_type == XML_EXPORT_TREE)
670 msg = g_strdup (_(start_tree_string));
672 msg = g_strdup_printf (_(start_trans_common_string), _(start_trans_multi_string));
674 gtk_label_set_text (GTK_LABEL(info->start_label), msg);
678 gtk_assistant_set_page_complete (assistant, info->start_page, TRUE);
683 csv_export_assistant_account_page_prepare (GtkAssistant *assistant,
689 if (g_list_length(info->csva.account_list) > 0)
690 gtk_assistant_set_page_complete (assistant, info->account_page, TRUE);
692 gtk_assistant_set_page_complete (assistant, info->account_page, FALSE);
697 csv_export_assistant_file_page_prepare (GtkAssistant *assistant,
703 if (info->starting_dir)
704 gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER(info->file_chooser), info->starting_dir);
705 gtk_file_chooser_set_current_name (GTK_FILE_CHOOSER(info->file_chooser),
"");
708 gtk_assistant_set_page_complete (assistant, info->file_page, FALSE);
713 csv_export_assistant_finish_page_prepare (GtkAssistant *assistant,
720 if (info->export_type == XML_EXPORT_TREE)
721 text = g_strdup_printf (gettext (finish_tree_string), info->file_name);
724 if ((info->export_type == XML_EXPORT_REGISTER) &&
725 (g_list_length (info->csva.account_list) == 0))
726 text = g_strdup_printf (gettext (finish_trans_search_gl_string), info->file_name);
728 text = g_strdup_printf (gettext (finish_trans_string),
730 g_list_length (info->csva.account_list));
732 gtk_label_set_text (GTK_LABEL(info->finish_label), text);
736 if (g_file_test (info->file_name, G_FILE_TEST_EXISTS))
738 const char *format = _(
"The file %s already exists. " 739 "Are you sure you want to overwrite it?");
742 if (!gnc_verify_dialog (GTK_WINDOW (assistant), FALSE, format, info->file_name))
743 gtk_assistant_previous_page (assistant);
746 gtk_assistant_set_page_complete (assistant, info->finish_label, TRUE);
751 csv_export_assistant_summary_page_prepare (GtkAssistant *assistant,
756 gnc_set_default_directory (GNC_PREFS_GROUP, info->starting_dir);
759 text = _(
"There was a problem with the export, this could be due to lack of space, " 760 "permissions or unable to access folder. Check the trace file for further logging!\n" 761 "You may need to enable debugging.\n");
763 text = _(
"File exported successfully!\n");
765 mtext = g_strdup_printf (
"<span size=\"medium\"><b>%s</b></span>", text);
767 gtk_label_set_markup (GTK_LABEL(info->summary_label), mtext);
774 csv_export_assistant_prepare (GtkAssistant *assistant, GtkWidget *page,
779 if (page == info->start_page)
780 csv_export_assistant_start_page_prepare (assistant, user_data);
781 else if (page == info->account_page)
782 csv_export_assistant_account_page_prepare (assistant, user_data);
783 else if (page == info->file_page)
784 csv_export_assistant_file_page_prepare (assistant, user_data);
785 else if (page == info->finish_label)
786 csv_export_assistant_finish_page_prepare (assistant, user_data);
787 else if (page == info->summary_label)
788 csv_export_assistant_summary_page_prepare (assistant, user_data);
790 g_assert_not_reached();
798 csv_export_assistant_destroy_cb (GtkWidget *
object, gpointer user_data)
801 gnc_unregister_gui_component_by_data (ASSISTANT_CSV_EXPORT_CM_CLASS, info);
802 g_list_free (info->csva.account_list);
807 csv_export_assistant_cancel (GtkAssistant *assistant, gpointer user_data)
810 gnc_close_gui_component_by_data (ASSISTANT_CSV_EXPORT_CM_CLASS, info);
814 csv_export_assistant_close (GtkAssistant *assistant, gpointer user_data)
817 gnc_close_gui_component_by_data (ASSISTANT_CSV_EXPORT_CM_CLASS, info);
821 csv_export_assistant_finish (GtkAssistant *assistant, gpointer user_data)
825 if (info->export_type == XML_EXPORT_TREE)
832 csv_export_close_handler (gpointer user_data)
836 g_free (info->file_name);
837 g_free (info->starting_dir);
839 g_free (info->mid_sep);
841 gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(info->assistant));
842 gtk_widget_destroy (info->assistant);
853 GtkWidget *
table, *hbox;
855 builder = gtk_builder_new();
856 gnc_builder_add_from_file (builder ,
"assistant-csv-export.glade",
"csv_export_assistant");
857 info->assistant = GTK_WIDGET(gtk_builder_get_object (builder,
"csv_export_assistant"));
860 gtk_widget_set_name (GTK_WIDGET(info->assistant),
"gnc-id-assistant-csv-export");
861 gnc_widget_style_context_add_class (GTK_WIDGET(info->assistant),
"gnc-class-exports");
864 load_settings (info);
867 info->start_page = GTK_WIDGET(gtk_builder_get_object(builder,
"start_page"));
868 info->start_label = GTK_WIDGET(gtk_builder_get_object(builder,
"start_label"));
869 info->custom_entry = GTK_WIDGET(gtk_builder_get_object(builder,
"custom_entry"));
870 gtk_widget_set_sensitive (info->custom_entry, FALSE);
873 info->account_page = GTK_WIDGET(gtk_builder_get_object(builder,
"account_page"));
875 if ((info->export_type == XML_EXPORT_TREE) || (info->export_type == XML_EXPORT_REGISTER))
877 GtkWidget *chkbox = GTK_WIDGET(gtk_builder_get_object(builder,
"simple_layout"));
880 if ((info->export_type == XML_EXPORT_TREE) ||
881 (g_list_length (info->csva.account_list) == 0))
882 gtk_widget_destroy (chkbox);
883 gtk_assistant_remove_page (GTK_ASSISTANT(info->assistant), 1);
887 GtkTreeView *tree_view;
888 GtkTreeSelection *selection;
889 GtkWidget *box, *label;
891 info->csva.acct_info = GTK_WIDGET(gtk_builder_get_object (builder,
"acct_info_vbox"));
892 info->csva.num_acct_label = GTK_WIDGET(gtk_builder_get_object (builder,
"num_accounts_label"));
895 info->csva.account_treeview = GTK_WIDGET(tree_view);
897 selection = gtk_tree_view_get_selection (tree_view);
898 gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
899 g_signal_connect (G_OBJECT(selection),
"changed",
900 G_CALLBACK(csv_export_account_changed_cb), info);
902 gtk_widget_show (info->csva.account_treeview);
903 box = GTK_WIDGET(gtk_builder_get_object (builder,
"account_scroll"));
904 gtk_container_add (GTK_CONTAINER(box), info->csva.account_treeview);
906 label = GTK_WIDGET(gtk_builder_get_object (builder,
"accounts_label"));
907 gtk_label_set_mnemonic_widget (GTK_LABEL(label), GTK_WIDGET(tree_view));
910 button = GTK_WIDGET(gtk_builder_get_object (builder,
"select_subaccounts_button"));
911 info->csva.select_button = button;
912 g_signal_connect (G_OBJECT(button),
"clicked",
913 G_CALLBACK(csv_export_select_subaccounts_clicked_cb), info);
915 button = GTK_WIDGET(gtk_builder_get_object (builder,
"select_all_button"));
916 info->csva.select_button = button;
917 g_signal_connect (G_OBJECT(button),
"clicked",
918 G_CALLBACK(csv_export_select_all_clicked_cb), info);
920 g_signal_connect (G_OBJECT(info->csva.account_treeview),
"cursor_changed",
921 G_CALLBACK(csv_export_cursor_changed_cb), info);
924 button = GTK_WIDGET(gtk_builder_get_object (builder,
"show_range"));
927 get_earliest_and_latest_in_book (info, gnc_get_current_book());
929 info->csvd.start_time = info->csvd.earliest_time;
930 info->csvd.end_time = info->csvd.latest_time;
931 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(button), FALSE);
933 table = GTK_WIDGET(gtk_builder_get_object (builder,
"select_range_table"));
934 info->csvd.table =
table;
935 gtk_widget_set_sensitive (GTK_WIDGET(
table), FALSE);
937 info->csvd.start_date_choose = GTK_WIDGET(gtk_builder_get_object (builder,
"start_date_choose"));
938 info->csvd.start_date_today = GTK_WIDGET(gtk_builder_get_object (builder,
"start_date_today"));
939 info->csvd.end_date_choose = GTK_WIDGET(gtk_builder_get_object (builder,
"end_date_choose"));
940 info->csvd.end_date_today = GTK_WIDGET(gtk_builder_get_object (builder,
"end_date_today"));
943 info->csvd.start_date = gnc_date_edit_new (
gnc_time (NULL), FALSE, FALSE);
944 gtk_widget_set_sensitive (info->csvd.start_date, FALSE);
945 hbox = GTK_WIDGET(gtk_builder_get_object (builder,
"start_date_hbox"));
946 gtk_box_pack_start (GTK_BOX(hbox), info->csvd.start_date, TRUE, TRUE, 0);
947 gtk_widget_show (info->csvd.start_date);
948 gnc_date_edit_set_time (GNC_DATE_EDIT(info->csvd.start_date), info->csvd.start_time);
949 g_signal_connect (G_OBJECT(info->csvd.start_date),
"date-changed",
950 G_CALLBACK(csv_export_date_changed_cb), info);
953 info->csvd.end_date = gnc_date_edit_new (
gnc_time (NULL), FALSE, FALSE);
954 gtk_widget_set_sensitive (info->csvd.end_date, FALSE);
955 hbox = GTK_WIDGET(gtk_builder_get_object (builder,
"end_date_hbox"));
956 gtk_box_pack_start (GTK_BOX(hbox), info->csvd.end_date, TRUE, TRUE, 0);
957 gtk_widget_show (info->csvd.end_date);
958 gnc_date_edit_set_time (GNC_DATE_EDIT(info->csvd.end_date), info->csvd.end_time);
959 g_signal_connect (G_OBJECT (info->csvd.end_date),
"date-changed",
960 G_CALLBACK (csv_export_date_changed_cb), info);
963 show_acct_type_accounts (info);
964 update_accounts_tree (info);
968 info->file_page = GTK_WIDGET(gtk_builder_get_object(builder,
"file_page"));
969 info->file_chooser = gtk_file_chooser_widget_new (GTK_FILE_CHOOSER_ACTION_SAVE);
971 g_signal_connect (G_OBJECT(info->file_chooser),
"selection-changed",
972 G_CALLBACK(csv_export_file_chooser_selection_changed_cb), info);
974 g_signal_connect (G_OBJECT(info->file_chooser),
"file-activated",
975 G_CALLBACK(csv_export_file_chooser_file_activated_cb), info);
977 gtk_box_pack_start (GTK_BOX (info->file_page), info->file_chooser, TRUE, TRUE, 6);
978 gtk_widget_show (info->file_chooser);
981 info->finish_label = GTK_WIDGET(gtk_builder_get_object (builder,
"end_page"));
984 info->summary_label = GTK_WIDGET(gtk_builder_get_object (builder,
"summary_page"));
986 g_signal_connect (G_OBJECT(info->assistant),
"destroy",
987 G_CALLBACK(csv_export_assistant_destroy_cb), info);
989 gnc_restore_window_size (GNC_PREFS_GROUP,
993 GObject *
object = gtk_builder_get_object (builder,
"paned");
994 gnc_prefs_bind (GNC_PREFS_GROUP, GNC_PREF_PANED_POS,
object,
"position");
997 gtk_builder_connect_signals (builder, info);
998 g_object_unref (G_OBJECT(builder));
999 return info->assistant;
1003 gnc_file_csv_export_internal (CsvExportType export_type,
Query *q,
Account *acc)
1008 info->export_type = export_type;
1013 info->csva.account_list = g_list_prepend(info->csva.account_list, acc);
1015 csv_export_assistant_create (info);
1016 gnc_register_gui_component (ASSISTANT_CSV_EXPORT_CM_CLASS,
1017 NULL, csv_export_close_handler,
1019 gtk_widget_show_all (info->assistant);
1020 gnc_window_adjust_for_screen (GTK_WINDOW(info->assistant));
1034 gnc_file_csv_export_internal (export_type, NULL, NULL);
1049 gnc_file_csv_export_internal (export_type, q, acc);
void gnc_tree_view_account_get_view_info(GncTreeViewAccount *view, AccountViewInfo *avi)
Given pointers to an account tree and old style filter block, this function will copy the current con...
GList * gnc_tree_view_account_get_selected_accounts(GncTreeViewAccount *view)
This function returns a list of the accounts associated with the selected items in the account tree v...
Account * gnc_tree_view_account_get_cursor_account(GncTreeViewAccount *view)
This function returns the account in the account tree view at the current location of the cursor...
GtkWindow * gnc_ui_get_main_window(GtkWidget *widget)
Get a pointer to the final GncMainWindow widget is rooted in.
Expense accounts are used to denote expenses.
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.
#define DEBUG(format, args...)
Print a debugging message.
Mutual Fund accounts will typically be shown in registers which show three columns: price...
gchar * gnc_uri_get_path(const gchar *uri)
Extracts the path part from a uri.
stop here; the following types just aren't ready for prime time
void gnc_tree_view_account_set_view_info(GncTreeViewAccount *view, AccountViewInfo *avi)
Given pointers to an account tree and old style filter block, this function will applies the settings...
The cash account type is used to denote a shoe-box or pillowcase stuffed with * cash.
Account used to record multiple commodity transactions.
Stock accounts will typically be shown in registers which show three columns: price, number of shares, and value.
void gnc_tree_view_account_select_subaccounts(GncTreeViewAccount *view, Account *account)
This function selects all sub-accounts of an account in the account tree view.
void qof_query_destroy(QofQuery *query)
Frees the resources associate with a Query object.
void gnc_prefs_bind(const gchar *group, const gchar *pref_name, gpointer object, const gchar *property)
Bind a setting to a g_object property.
GtkTreeView implementation for gnucash account tree.
Income accounts are used to denote income.
GtkTreeView * gnc_tree_view_account_new(gboolean show_root)
Create a new account tree view.
void qof_query_set_book(QofQuery *query, QofBook *book)
Set the book to be searched.
time64 gnc_time64_get_day_start(time64 time_val)
The gnc_time64_get_day_start() routine will take the given time in seconds and adjust it to the first...
The bank account type denotes a savings or checking account held at a bank.
void csv_tree_export(CsvExportInfo *info)
The csv_tree_export() will let the user export the account tree to a delimited file.
time64 gnc_time64_get_today_start(void)
The gnc_time64_get_today_start() routine returns a time64 value corresponding to the first second of ...
void gnc_file_csv_export_register(CsvExportType export_type, Query *q, Account *acc)
The gnc_file_csv_export_register() will let the user export the active register transactions to a del...
void gnc_file_csv_export(CsvExportType export_type)
The gnc_file_csv_export() will let the user export the account tree or transactions to a delimited fi...
asset (and liability) accounts indicate generic, generalized accounts that are none of the above...
GNCAccountType
The account types are used to determine how the transaction data in the account is displayed...
Generic api to store and retrieve preferences.
GList * qof_query_run(QofQuery *query)
Perform the query, return the results.
liability (and asset) accounts indicate generic, generalized accounts that are none of the above...
gint gnc_tree_view_account_count_children(GncTreeViewAccount *view, Account *account)
This function determines if an account in the account tree view has any visible children.
time64 gnc_time64_get_today_end(void)
The gnc_time64_get_today_end() routine returns a time64 value corresponding to the last second of tod...
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.
#define QUERY_DEFAULT_SORT
Default sort object type.
time64 gnc_time(time64 *tbuf)
get the current time
void csv_transactions_export(CsvExportInfo *info)
The csv_transactions_export() will let the user export the transactions to a delimited file...
Utility functions for convert uri in separate components and back.
gint64 time64
Most systems that are currently maintained, including Microsoft Windows, BSD-derived Unixes and Linux...
time64 gnc_time64_get_day_end(time64 time_val)
The gnc_time64_get_day_end() routine will take the given time in seconds and adjust it to the last se...
Equity account is used to balance the balance sheet.
API for Transactions and Splits (journal entries)
The hidden root account of an account tree.
The Credit card account is used to denote credit (e.g.