r16262 - gnucash/branches/csv-import/src/import-export/csv - Added error message on dialog, started error handling for bad dates,

Benjamin Sperisen lasindi at cvs.gnucash.org
Sun Jul 8 05:21:49 EDT 2007


Author: lasindi
Date: 2007-07-08 05:21:48 -0400 (Sun, 08 Jul 2007)
New Revision: 16262
Trac: http://svn.gnucash.org/trac/changeset/16262

Modified:
   gnucash/branches/csv-import/src/import-export/csv/gnc-csv-import.c
   gnucash/branches/csv-import/src/import-export/csv/gnc-csv-model.c
   gnucash/branches/csv-import/src/import-export/csv/gnc-csv-preview-dialog.glade
Log:
Added error message on dialog, started error handling for bad dates, 
started putting in place framework for transaction properties in 
gnc-csv-model.c


Modified: gnucash/branches/csv-import/src/import-export/csv/gnc-csv-import.c
===================================================================
--- gnucash/branches/csv-import/src/import-export/csv/gnc-csv-import.c	2007-07-08 08:57:23 UTC (rev 16261)
+++ gnucash/branches/csv-import/src/import-export/csv/gnc-csv-import.c	2007-07-08 09:21:48 UTC (rev 16262)
@@ -377,7 +377,7 @@
   /* Load the Glade file. */
   preview->xml = gnc_glade_xml_new("gnc-csv-preview-dialog.glade", "dialog");
   /* Load the dialog. */
-  preview->dialog = (GtkDialog*)(glade_xml_get_widget(preview->xml, "dialog"));
+  preview->dialog = GTK_DIALOG(glade_xml_get_widget(preview->xml, "dialog"));
 
   /* Load the separator buttons from the glade file into the
    * preview->sep_buttons array. */
@@ -648,6 +648,17 @@
 /* TODO Let the user manually edit cells' data? */
 static int gnc_csv_preview_errors(GncCsvPreview* preview)
 {
+  GtkLabel* instructions_label = GTK_LABEL(glade_xml_get_widget(preview->xml, "instructions_label"));
+  GtkImage* instructions_image = GTK_IMAGE(glade_xml_get_widget(preview->xml, "instructions_image"));
+  gchar* name;
+  GtkIconSize size;
+  gtk_image_get_stock(instructions_image, &name, &size);
+  gtk_image_set_from_stock(instructions_image, GTK_STOCK_DIALOG_ERROR, size);
+  gtk_label_set_text(instructions_label,
+                     "The rows displayed below had errors. You can attempt to correct these errors by changing the configuration.");
+  gtk_widget_show(GTK_WIDGET(instructions_image));
+  gtk_widget_show(GTK_WIDGET(instructions_label));
+
   /* TODO Implement */
   preview->previewing_errors = TRUE;
   preview->approved = FALSE; /* This is FALSE until the user clicks "OK". */
@@ -738,10 +749,15 @@
     /* If there are errors, let the user try and eliminate them by
      * previewing them. Repeat until either there are no errors or the
      * user gives up. */
-    while((parse_data->error_lines != NULL) && !user_canceled)
+    while(!((parse_data->error_lines == NULL) || user_canceled))
     {
+      /* TODO remove printfs */
+      printf("start %d %d\n", g_list_length(parse_data->transactions),
+             g_list_length(parse_data->error_lines));
       gnc_csv_preview_errors(preview);
       user_canceled = gnc_parse_to_trans(parse_data, account, TRUE);
+      printf("end %d %d\n", g_list_length(parse_data->transactions),
+             g_list_length(parse_data->error_lines));
     }
 
     /* Create the genereic transaction importer GUI. */

Modified: gnucash/branches/csv-import/src/import-export/csv/gnc-csv-model.c
===================================================================
--- gnucash/branches/csv-import/src/import-export/csv/gnc-csv-model.c	2007-07-08 08:57:23 UTC (rev 16261)
+++ gnucash/branches/csv-import/src/import-export/csv/gnc-csv-model.c	2007-07-08 09:21:48 UTC (rev 16262)
@@ -15,6 +15,8 @@
 #include <stdlib.h>
 #include <time.h>
 
+static QofLogModule log_module = GNC_MOD_IMPORT;
+
 const int num_date_formats = 8;
 /* A set of date formats that the user sees. */
 const gchar* date_format_user[] = {"yyyy/mm/dd",
@@ -48,12 +50,16 @@
 }
 
 /* TODO This will be replaced by something more sophisticated. */
+/* TODO Comment. */
 static time_t parse_date(const char* date_str, int format)
 {
   struct tm retvalue;
-  char mstr[3], dstr[3], ystr[3];
-  strptime(date_str, date_format_internal[format], &retvalue);
-  /* TODO Handle error */
+  char mstr[3], dstr[3], ystr[3], *last_parsed_char;
+  last_parsed_char = strptime(date_str, date_format_internal[format], &retvalue);
+  if(last_parsed_char != date_str + strlen(date_str))
+  {
+    return -1;
+  }
   /* We have to set the hour, minute, second and daylight savings time
    * flags to valid values. */
   retvalue.tm_hour = 0;
@@ -61,22 +67,6 @@
   retvalue.tm_sec = 1;
   retvalue.tm_isdst = -1;
   return mktime(&retvalue);
-
-  /* TODO Get rid of the old clumsy method */
-  strncpy(mstr, date_str, 2);
-  strncpy(dstr, date_str + 3, 2);
-  strncpy(ystr, date_str + 6, 2);
-  mstr[2] = dstr[2] = ystr[2] = '\0';
-  retvalue.tm_mon = atoi(mstr) - 1;
-  retvalue.tm_mday = atoi(dstr);
-  retvalue.tm_year = atoi(ystr);
-  if(retvalue.tm_year < 10)
-    retvalue.tm_year += 100;
-  retvalue.tm_hour = 0;
-  retvalue.tm_min = 0;
-  retvalue.tm_sec = 1;
-  retvalue.tm_isdst = -1;
-  return mktime(&retvalue);
 }
 
 /** Loads a file into a string.
@@ -350,6 +340,127 @@
   return 0;
 }
 
+/** A struct encaspulating a property of a transaction. */
+/* TODO Comment */
+static typedef struct
+{
+  gboolean essential;
+  int type;
+  void* value;
+} TransProperty;
+
+static TransProperty* trans_property_new(int type)
+{
+  TransProperty* prop = g_malloc(sizeof(TransProperty));
+  prop->type = type;
+  switch(type)
+  {
+  case GNC_CSV_DATE:
+  case GNC_CSV_AMOUNT:
+    essential = TRUE
+    break;
+
+  default:
+    essential = FALSE;
+  }
+  return prop;
+}
+
+static void trans_property_free(TransProperty* prop)
+{
+  switch(prop->type)
+  {
+  case GNC_CSV_DATE:
+  case GNC_CSV_AMOUNT:
+    g_free(value);
+    break;
+  }
+  g_free(prop);
+}
+
+/** Sets the value of the property by parsing str. Note: this should
+ * only be called once on an instance of TransProperty, as calling it
+ * more than once can cause memory leaks.
+ * @param prop The property being set
+ * @param str The string to be parsed
+ * @return TRUE on success, FALSE on failure
+ */
+static gboolean trans_property_set(TransProperty* prop, char* str)
+{
+  switch(prop->type)
+  {
+  case GNC_CSV_DATE:
+    prop->value = g_malloc(sizeof(time_t));
+    *(prop->value) = parse_date(str);
+    return prop->value != -1;
+
+  case GNC_CSV_DESCRIPTION:
+    *prop->value = g_strdup(str);
+    return TRUE;
+
+  case GNC_CSV_AMOUNT:
+    prop->value = g_malloc(sizeof(gnc_numeric));
+    *(prop->value) = double_to_gnc_numeric(atof(str), 1,
+                                           GNC_RND_ROUND);
+    /* TODO error handling */
+    return TRUE;
+  }
+}
+
+/** Creates a transaction from a list of "TransProperty"s.
+ */
+static Transaction trans_from_trans_properties(GList* properties, GNCBook* book)
+{
+  Transaction* trans;
+  Split* split;
+  GList* properties_begin = properties;
+  
+  unsigned int essential_properties_left = 2;
+  while(properties != NULL)
+  {
+    if(((TransProperty*)(properties->data))->essential)
+      essential_properties_left--;
+
+    properties = g_list_next(properties);
+  }
+  if(essential_properties_left)
+    return NULL;
+
+  trans = xaccMallocTransaction(book);
+  
+  xaccTransBeginEdit(trans);
+  xaccTransSetCurrency(trans, currency);
+
+  properties = properties_begin;
+  while(properties != NULL)
+  {
+    TransProperty* prop = (TransProperty*)(properties->data);
+    switch(prop->type)
+    {
+    case GNC_CSV_DATE:
+      xaccTransSetDatePostedSecs(trans, date);
+      break;
+
+    case GNC_CSV_DESCRIPTION:
+      xaccTransSetDescription(trans, description);
+      break;
+      
+    case GNC_CSV_AMOUNT:
+      gnc_numeric amount = double_to_gnc_numeric(atof(line->pdata[j]), 1,
+                                                 GNC_RND_ROUND);
+      split = xaccMallocSplit(book);
+      xaccSplitSetAccount(split, account);
+      xaccSplitSetParent(split, trans);
+      xaccSplitSetAmount(split, amount);
+      xaccSplitSetValue(split, amount);
+      xaccSplitSetAction(split, "Deposit");
+    }
+    properties = g_list_next(properties);
+  }
+
+  return trans;
+}
+
 /** Creates a list of transactions from parsed data. Transactions that
  * could be created from rows are placed in parse_data->transactions;
  * rows that fail are placed in parse_data->error_lines. (Note: there
@@ -368,6 +479,7 @@
   GNCBook* book = gnc_account_get_book(account);
   GList *error_lines, *begin_error_lines;
   gnc_commodity* currency = xaccAccountGetCommodity(account);
+  GList* last_transaction;
 
   /* Free parse_data->error_lines and parse_data->transactions if they
    * already exist. */
@@ -396,6 +508,7 @@
 
   if(redo_errors) /* If we're looking only at error data ... */
   {
+    last_transaction = parse_data->transactions;
     /* ... we use only the lines in error_lines. */
     if(error_lines == NULL)
       i = parse_data->orig_lines->len; /* Don't go into the for loop. */
@@ -444,8 +557,13 @@
         if(column_types->data[j] == GNC_CSV_DATE)
         {
           date = parse_date(line->pdata[j], parse_data->date_format);
-          xaccTransSetDatePostedSecs(trans, date);
-          essential_properties_left--;
+          if(date != -1)
+          {
+            xaccTransSetDatePostedSecs(trans, date);
+            essential_properties_left--;
+          }
+          else
+            noErrors = FALSE;
         }
         else if(column_types->data[j] == GNC_CSV_DESCRIPTION)
         {
@@ -473,7 +591,20 @@
       GncCsvTransLine* trans_line = g_malloc(sizeof(GncCsvTransLine));
       trans_line->line_no = i;
       trans_line->trans = trans;
-      parse_data->transactions = g_list_append(parse_data->transactions, trans_line);
+      if(redo_errors)
+      {
+        while(last_transaction != NULL &&
+              ((GncCsvTransLine*)(last_transaction->data))->line_no < i)
+        {
+          last_transaction = g_list_next(last_transaction);
+        }
+        parse_data->transactions =
+          g_list_insert_before(parse_data->transactions, last_transaction, trans_line);
+      }
+      else
+      {
+        parse_data->transactions = g_list_append(parse_data->transactions, trans_line);
+      }
     }
     /* If there was no success, add this line to
      * parse_data->error_lines and free the transaction. */

Modified: gnucash/branches/csv-import/src/import-export/csv/gnc-csv-preview-dialog.glade
===================================================================
--- gnucash/branches/csv-import/src/import-export/csv/gnc-csv-preview-dialog.glade	2007-07-08 08:57:23 UTC (rev 16261)
+++ gnucash/branches/csv-import/src/import-export/csv/gnc-csv-preview-dialog.glade	2007-07-08 09:21:48 UTC (rev 16262)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.2.0 on Tue Jul  3 04:32:16 2007 by lasindi at pi-->
+<!--Generated with glade3 3.2.0 on Sun Jul  8 01:33:26 2007 by lasindi at pi-->
 <glade-interface>
   <widget class="GtkDialog" id="dialog">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -19,6 +19,9 @@
             <property name="visible">True</property>
             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
             <child>
+              <placeholder/>
+            </child>
+            <child>
               <widget class="GtkTable" id="enctable">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -28,34 +31,56 @@
                   <placeholder/>
                 </child>
                 <child>
-                  <widget class="GtkHSeparator" id="hseparator1">
+                  <widget class="GtkLabel" id="label3">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="label" translatable="yes">Encoding: </property>
                   </widget>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
-                    <property name="x_options">GTK_SHRINK | GTK_FILL</property>
+                    <property name="x_options">GTK_FILL</property>
                     <property name="y_options">GTK_FILL</property>
-                    <property name="y_padding">3</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkHSeparator" id="hseparator2">
+                  <widget class="GtkHSeparator" id="hseparator5">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                   </widget>
                   <packing>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
                     <property name="x_options">GTK_SHRINK | GTK_FILL</property>
                     <property name="y_options">GTK_FILL</property>
                     <property name="y_padding">3</property>
                   </packing>
                 </child>
                 <child>
+                  <widget class="GtkHSeparator" id="hseparator4">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                  </widget>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
+                    <property name="y_options">GTK_FILL</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="label1">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="label" translatable="yes">Data type: </property>
+                  </widget>
+                  <packing>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
+                    <property name="x_options">GTK_FILL</property>
+                    <property name="y_options">GTK_FILL</property>
+                  </packing>
+                </child>
+                <child>
                   <widget class="GtkHBox" id="hbox1">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -70,7 +95,7 @@
                       </widget>
                     </child>
                     <child>
-                      <widget class="GtkRadioButton" id="radiobutton3">
+                      <widget class="GtkRadioButton" id="radiobutton2">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -93,58 +118,37 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label1">
+                  <widget class="GtkHSeparator" id="hseparator2">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">Data type: </property>
                   </widget>
                   <packing>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
-                    <property name="x_options">GTK_FILL</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
+                    <property name="x_options">GTK_SHRINK | GTK_FILL</property>
                     <property name="y_options">GTK_FILL</property>
+                    <property name="y_padding">3</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkHSeparator" id="hseparator4">
+                  <widget class="GtkHSeparator" id="hseparator1">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
-                <child>
-                  <widget class="GtkHSeparator" id="hseparator5">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                  </widget>
-                  <packing>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
                     <property name="x_options">GTK_SHRINK | GTK_FILL</property>
                     <property name="y_options">GTK_FILL</property>
                     <property name="y_padding">3</property>
                   </packing>
                 </child>
-                <child>
-                  <widget class="GtkLabel" id="label3">
-                    <property name="visible">True</property>
-                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">Encoding: </property>
-                  </widget>
-                  <packing>
-                    <property name="x_options">GTK_FILL</property>
-                    <property name="y_options">GTK_FILL</property>
-                  </packing>
-                </child>
               </widget>
               <packing>
                 <property name="expand">False</property>
+                <property name="position">1</property>
               </packing>
             </child>
             <child>
@@ -159,7 +163,7 @@
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="left_padding">12</property>
                     <child>
-                      <widget class="GtkTable" id="table2">
+                      <widget class="GtkTable" id="table1">
                         <property name="visible">True</property>
                         <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                         <property name="n_rows">3</property>
@@ -167,55 +171,63 @@
                         <property name="column_spacing">3</property>
                         <property name="row_spacing">3</property>
                         <child>
-                          <widget class="GtkCheckButton" id="space_cbutton">
+                          <widget class="GtkEntry" id="custom_entry1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Space</property>
-                            <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">3</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="tab_cbutton">
+                          <widget class="GtkCheckButton" id="custom_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Tab</property>
+                            <property name="label" translatable="yes">Custom</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
+                            <property name="top_attach">2</property>
+                            <property name="bottom_attach">3</property>
+                            <property name="x_options">GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="comma_cbutton">
+                          <widget class="GtkCheckButton" id="hyphen_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Comma (,)</property>
-                            <property name="active">True</property>
+                            <property name="label" translatable="yes">Hyphen (-)</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
                             <property name="left_attach">2</property>
                             <property name="right_attach">3</property>
+                            <property name="top_attach">1</property>
+                            <property name="bottom_attach">2</property>
+                            <property name="x_options">GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="colon_cbutton">
+                          <widget class="GtkCheckButton" id="semicolon_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Colon (:)</property>
+                            <property name="label" translatable="yes">Semicolon (;)</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
@@ -223,16 +235,14 @@
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="semicolon_cbutton">
+                          <widget class="GtkCheckButton" id="colon_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Semicolon (;)</property>
+                            <property name="label" translatable="yes">Colon (:)</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">2</property>
                             <property name="top_attach">1</property>
                             <property name="bottom_attach">2</property>
                             <property name="x_options">GTK_FILL</property>
@@ -240,49 +250,43 @@
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="hyphen_cbutton">
+                          <widget class="GtkCheckButton" id="comma_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Hyphen (-)</property>
+                            <property name="label" translatable="yes">Comma (,)</property>
+                            <property name="active">True</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
                             <property name="left_attach">2</property>
                             <property name="right_attach">3</property>
-                            <property name="top_attach">1</property>
-                            <property name="bottom_attach">2</property>
-                            <property name="x_options">GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkCheckButton" id="custom_cbutton">
+                          <widget class="GtkCheckButton" id="tab_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                            <property name="label" translatable="yes">Custom</property>
+                            <property name="label" translatable="yes">Tab</property>
                             <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
-                            <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
-                            <property name="x_options">GTK_FILL</property>
+                            <property name="left_attach">1</property>
+                            <property name="right_attach">2</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
                         <child>
-                          <widget class="GtkEntry" id="custom_entry">
+                          <widget class="GtkCheckButton" id="space_cbutton1">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
                             <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                            <property name="label" translatable="yes">Space</property>
+                            <property name="draw_indicator">True</property>
                           </widget>
                           <packing>
-                            <property name="left_attach">1</property>
-                            <property name="right_attach">3</property>
-                            <property name="top_attach">2</property>
-                            <property name="bottom_attach">3</property>
-                            <property name="x_options">GTK_FILL</property>
                             <property name="y_options">GTK_FILL</property>
                           </packing>
                         </child>
@@ -304,28 +308,28 @@
               </widget>
               <packing>
                 <property name="expand">False</property>
-                <property name="position">1</property>
+                <property name="position">2</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkHSeparator" id="hseparator6">
+              <widget class="GtkHBox" id="hbox2">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
               </widget>
               <packing>
                 <property name="expand">False</property>
-                <property name="padding">3</property>
-                <property name="position">2</property>
+                <property name="position">3</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkHBox" id="hbox2">
+              <widget class="GtkHSeparator" id="hseparator6">
                 <property name="visible">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
               </widget>
               <packing>
                 <property name="expand">False</property>
-                <property name="position">3</property>
+                <property name="padding">3</property>
+                <property name="position">4</property>
               </packing>
             </child>
             <child>
@@ -358,7 +362,7 @@
               </widget>
               <packing>
                 <property name="expand">False</property>
-                <property name="position">4</property>
+                <property name="position">5</property>
               </packing>
             </child>
             <child>
@@ -368,11 +372,44 @@
               </widget>
               <packing>
                 <property name="expand">False</property>
-                <property name="padding">5</property>
-                <property name="position">5</property>
+                <property name="padding">3</property>
+                <property name="position">6</property>
               </packing>
             </child>
             <child>
+              <widget class="GtkHBox" id="hbox3">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <child>
+                  <widget class="GtkImage" id="instructions_image">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="stock">gtk-dialog-info</property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="padding">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkLabel" id="instructions_label">
+                    <property name="visible">True</property>
+                    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Select the type of each column below.</property>
+                    <property name="wrap">True</property>
+                  </widget>
+                  <packing>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="position">7</property>
+              </packing>
+            </child>
+            <child>
               <widget class="GtkTreeView" id="ctreeview">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
@@ -382,7 +419,7 @@
                 <property name="enable_grid_lines">GTK_TREE_VIEW_GRID_LINES_BOTH</property>
               </widget>
               <packing>
-                <property name="position">6</property>
+                <property name="position">8</property>
               </packing>
             </child>
             <child>
@@ -390,7 +427,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+                <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                 <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
                 <child>
                   <widget class="GtkViewport" id="viewport1">
@@ -410,7 +447,7 @@
                 </child>
               </widget>
               <packing>
-                <property name="position">7</property>
+                <property name="position">9</property>
               </packing>
             </child>
           </widget>
@@ -455,70 +492,4 @@
       </widget>
     </child>
   </widget>
-  <widget class="GtkDialog" id="encdialog">
-    <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-    <property name="border_width">5</property>
-    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="has_separator">False</property>
-    <child internal-child="vbox">
-      <widget class="GtkVBox" id="dialog-vbox2">
-        <property name="visible">True</property>
-        <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-        <property name="spacing">2</property>
-        <child>
-          <widget class="GtkVBox" id="encvbox">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <child>
-              <widget class="GtkLabel" id="enclabel">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-              </widget>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-          </widget>
-          <packing>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child internal-child="action_area">
-          <widget class="GtkHButtonBox" id="dialog-action_area2">
-            <property name="visible">True</property>
-            <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <widget class="GtkButton" id="enc_cancel_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label" translatable="yes">gtk-cancel</property>
-                <property name="use_stock">True</property>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkButton" id="enc_ok_button">
-                <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="receives_default">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label" translatable="yes">gtk-ok</property>
-                <property name="use_stock">True</property>
-              </widget>
-              <packing>
-                <property name="position">1</property>
-              </packing>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
 </glade-interface>



More information about the gnucash-changes mailing list