From: John Darrington Date: Sun, 12 Jul 2020 09:43:39 +0000 (+0200) Subject: Import Assistant Sheet Page: Set the sheet selector sentitivity X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0c393e8cefaa44bf1703e931830205335e26c13;p=pspp Import Assistant Sheet Page: Set the sheet selector sentitivity --- diff --git a/src/ui/gui/psppire-import-assistant.c b/src/ui/gui/psppire-import-assistant.c index e8b64d8c58..84de028c25 100644 --- a/src/ui/gui/psppire-import-assistant.c +++ b/src/ui/gui/psppire-import-assistant.c @@ -527,8 +527,11 @@ prepare_sheet_spec_page (PsppireImportAssistant *ia) GtkWidget *sheet_entry = get_widget_assert (builder, "sheet-entry"); GtkWidget *readnames_checkbox = get_widget_assert (builder, "readnames-checkbox"); - gtk_combo_box_set_model (GTK_COMBO_BOX (sheet_entry), - psppire_spreadsheet_model_new (ia->spreadsheet)); + GtkTreeModel *model = psppire_spreadsheet_model_new (ia->spreadsheet); + gtk_combo_box_set_model (GTK_COMBO_BOX (sheet_entry), model); + + gint items = gtk_tree_model_iter_n_children (model, NULL); + gtk_widget_set_sensitive (sheet_entry, items > 1); gtk_combo_box_set_active (GTK_COMBO_BOX (sheet_entry), 0);