Added a bit more to the gui
authorJohn Darrington <john@darrington.wattle.id.au>
Tue, 8 Jan 2013 21:13:05 +0000 (22:13 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 16 Feb 2013 14:02:54 +0000 (15:02 +0100)
src/ui/gui/page-sheet-spec.c
src/ui/gui/text-data-import-dialog.c
src/ui/gui/text-data-import.ui

index 249084150c3cdcb4aff6ae6c29e56e3f63d7f955..91ab6e23b2a5beddc82121b509385dc1c298f95c 100644 (file)
@@ -101,6 +101,7 @@ post_sheet_spec_page (struct import_assistant *ia)
   struct dictionary *dict;
 
   GtkWidget *sheet_entry = get_widget_assert (builder, "sheet-entry");
+  GtkWidget *readnames_checkbox = get_widget_assert (builder, "readnames-checkbox");
 
   gint num = atoi (gtk_entry_get_text (sheet_entry));
   
@@ -111,7 +112,7 @@ post_sheet_spec_page (struct import_assistant *ia)
   ssp->opts.sheet_index = num;
 
   ssp->sri.file_name = file->file_name;
-  ssp->sri.read_names = true;
+  ssp->sri.read_names = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (readnames_checkbox));
   ssp->sri.asw = -1;
 
   switch (ia->file.type)
index 7aeee411a3106aba58a25728d8bd25500591866c..cda83ebb65caedf2e60f7b6aa7ac05411ca478a8 100644 (file)
@@ -289,10 +289,12 @@ generate_syntax (const struct import_assistant *ia)
                         "\n  /TYPE=%ss"
                         "\n  /FILE=%sq"
                         "\n  /SHEET=index %d"
+                        "\n  /READNAMES=%ss"
                         ".",
                         (ia->file.type == FTYPE_GNUMERIC) ? "GNM" : "ODS",
                         ia->file.file_name,                     
-                        ssp->opts.sheet_index);
+                        ssp->opts.sheet_index,
+                        ssp->sri.read_names ? "ON" : "OFF");
       }
       break;
     
index 080ee5e2c338d42348ffd0293b8479ad59dfb25d..d05296a7d739eb1ec25b6a47ac58feaad143734e 100644 (file)
@@ -763,7 +763,7 @@ The selected file contains N lines of text.  Only the first M of these will be s
                           </packing>
                         </child>
                         <child>
-                          <object class="GtkCheckButton" id="checkbutton1">
+                          <object class="GtkCheckButton" id="readnames-checkbox">
                             <property name="label" translatable="yes">Use first row as _variable names</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>