X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpage-sheet-spec.c;h=5a760bd53d1822c24e1a661498feea20323d405e;hb=404bd133ab1d8d446564100debb606fd2786371f;hp=a23ac40dd62cf95b97318289d05cf4a0828e174b;hpb=b241f1232945bfc913633c3ecec68e997500e065;p=pspp diff --git a/src/ui/gui/page-sheet-spec.c b/src/ui/gui/page-sheet-spec.c index a23ac40dd6..5a760bd53d 100644 --- a/src/ui/gui/page-sheet-spec.c +++ b/src/ui/gui/page-sheet-spec.c @@ -53,6 +53,8 @@ #include "ui/gui/psppire-scanf.h" #include "ui/syntax-gen.h" +#include "ui/gui/psppire-spreadsheet-model.h" + #include #include "gl/error.h" @@ -65,8 +67,6 @@ struct import_assistant; - - /* The "sheet-spec" page of the assistant. */ /* The sheet_spec page of the assistant (only relevant for spreadsheet imports). */ @@ -80,6 +80,20 @@ struct sheet_spec_page struct spreadsheet_read_options opts; }; +static void +on_sheet_combo_changed (GtkComboBox *cb, struct import_assistant *ia) +{ + GtkTreeIter iter; + gchar *range = NULL; + GtkTreeModel *model = gtk_combo_box_get_model (cb); + GtkBuilder *builder = ia->asst.builder; + GtkWidget *range_entry = get_widget_assert (builder, "cell-range-entry"); + + gtk_combo_box_get_active_iter (cb, &iter); + gtk_tree_model_get (model, &iter, PSPPIRE_SPREADSHEET_MODEL_COL_RANGE, &range, -1); + gtk_entry_set_text (GTK_ENTRY (range_entry), range); + g_free (range); +} /* Initializes IA's sheet_spec substructure. */ struct sheet_spec_page * @@ -95,6 +109,8 @@ sheet_spec_page_create (struct import_assistant *ia) "text", 0, NULL); + g_signal_connect (combo_box, "changed", G_CALLBACK (on_sheet_combo_changed), ia); + return p; }