r22271 - gnucash/trunk/src/import-export - Add ability to import a csv column to 'notes' field; fix 'OK' and 'New Account' button widths

J. Alex Aycinena alex.aycinena at code.gnucash.org
Wed Jul 25 18:28:54 EDT 2012


Author: alex.aycinena
Date: 2012-07-25 18:28:53 -0400 (Wed, 25 Jul 2012)
New Revision: 22271
Trac: http://svn.gnucash.org/trac/changeset/22271

Modified:
   gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c
   gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c
   gnucash/trunk/src/import-export/csv-import/gnc-csv-model.h
   gnucash/trunk/src/import-export/import-account-matcher.c
Log:
Add ability to import a csv column to 'notes' field; fix 'OK' and 'New Account' button widths

Modified: gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c	2012-07-22 10:21:38 UTC (rev 22270)
+++ gnucash/trunk/src/import-export/csv-import/assistant-csv-trans-import.c	2012-07-25 22:28:53 UTC (rev 22271)
@@ -1007,6 +1007,7 @@
                     break;
 
                 case GNC_CSV_DESCRIPTION:
+                case GNC_CSV_NOTES:
                     weight = weight + 100;
                     break;
 
@@ -1623,7 +1624,7 @@
     GtkBuilder *builder;
     GtkWidget *window;
     GtkWidget *box;
-    GtkWidget *button, *csv_button;
+    GtkWidget *button, *csv_button, *h_box;
 
     builder = gtk_builder_new();
     gnc_builder_add_from_file  (builder , "assistant-csv-trans-import.glade", "start_row_adj");
@@ -1667,7 +1668,9 @@
     info->file_chooser = gtk_file_chooser_widget_new (GTK_FILE_CHOOSER_ACTION_OPEN);
     button = gtk_button_new_from_stock(GTK_STOCK_OK);
     gtk_widget_show (button);
-    gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(info->file_chooser), button);
+    h_box = gtk_hbox_new(TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(h_box), button, FALSE, FALSE, 0);
+    gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER(info->file_chooser), h_box);
     g_signal_connect (G_OBJECT (button), "clicked",
                       G_CALLBACK (csv_import_trans_file_chooser_confirm_cb), info);
 

Modified: gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c
===================================================================
--- gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c	2012-07-22 10:21:38 UTC (rev 22270)
+++ gnucash/trunk/src/import-export/csv-import/gnc-csv-model.c	2012-07-25 22:28:53 UTC (rev 22271)
@@ -47,12 +47,13 @@
 /* This array contains all of the different strings for different column types. */
 gchar* gnc_csv_column_type_strs[GNC_CSV_NUM_COL_TYPES] = {N_("None"),
         N_("Date"),
+        N_("Num"),
         N_("Description"),
+        N_("Notes"),
         N_("Account"),
-        N_("Balance"),
         N_("Deposit"),
         N_("Withdrawal"),
-        N_("Num")
+        N_("Balance")
                                                          };
 
 /** A set of sensible defaults for parsing CSV files.
@@ -657,6 +658,7 @@
         return *((time_t*)(prop->value)) != -1;
 
     case GNC_CSV_DESCRIPTION:
+    case GNC_CSV_NOTES:
     case GNC_CSV_NUM:
         prop->value = g_strdup(str);
         return TRUE;
@@ -929,6 +931,10 @@
             xaccTransSetDescription(trans_line->trans, (char*)(prop->value));
             break;
 
+        case GNC_CSV_NOTES:
+            xaccTransSetNotes(trans_line->trans, (char*)(prop->value));
+            break;
+
         case GNC_CSV_NUM:
             xaccTransSetNum(trans_line->trans, (char*)(prop->value));
             break;

Modified: gnucash/trunk/src/import-export/csv-import/gnc-csv-model.h
===================================================================
--- gnucash/trunk/src/import-export/csv-import/gnc-csv-model.h	2012-07-22 10:21:38 UTC (rev 22270)
+++ gnucash/trunk/src/import-export/csv-import/gnc-csv-model.h	2012-07-25 22:28:53 UTC (rev 22271)
@@ -40,12 +40,13 @@
  * type. */
 enum GncCsvColumnType {GNC_CSV_NONE,
                        GNC_CSV_DATE,
+                       GNC_CSV_NUM,
                        GNC_CSV_DESCRIPTION,
+                       GNC_CSV_NOTES,
                        GNC_CSV_ACCOUNT,
-                       GNC_CSV_BALANCE,
                        GNC_CSV_DEPOSIT,
                        GNC_CSV_WITHDRAWAL,
-                       GNC_CSV_NUM,
+                       GNC_CSV_BALANCE,
                        GNC_CSV_NUM_COL_TYPES
                       };
 

Modified: gnucash/trunk/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-account-matcher.c	2012-07-22 10:21:38 UTC (rev 22270)
+++ gnucash/trunk/src/import-export/import-account-matcher.c	2012-07-25 22:28:53 UTC (rev 22271)
@@ -384,7 +384,7 @@
 {
     AccountPickerDialog * picker;
     GtkBuilder *builder;
-    GtkWidget  *button, *box;
+    GtkWidget  *button, *box, *h_box;
 
     /* Init the account picker structure */
     picker = gnc_import_new_account_picker();
@@ -408,7 +408,9 @@
 
     /* Add the New Account Button */
     button = gtk_button_new_with_mnemonic ("_New Account");
-    gtk_box_pack_start( GTK_BOX(box), button, FALSE, FALSE, 6);
+    h_box = gtk_hbox_new(TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(h_box), button, FALSE, FALSE, 0);
+    gtk_box_pack_start( GTK_BOX(box), h_box, FALSE, FALSE, 6);
     gtk_button_set_use_stock (GTK_BUTTON(button), TRUE);
     gtk_widget_show (button);
     g_signal_connect(button, "clicked",



More information about the gnucash-changes mailing list