+void
+psppire_data_store_set_case_file (PsppireDataStore *ds,
+ PsppireCaseFile *cf)
+{
+ gint i;
+ if ( ds->case_file) g_object_unref (ds->case_file);
+
+
+ ds->case_file = cf;
+
+ g_sheet_model_range_changed (G_SHEET_MODEL (ds),
+ -1, -1, -1, -1);
+
+ for (i = 0 ; i < n_cf_signals ; ++i )
+ {
+ if ( ds->cf_handler_id [i] > 0 )
+ g_signal_handler_disconnect (ds->case_file,
+ ds->cf_handler_id[i]);
+ }
+
+
+ if ( ds->dict )
+ for (i = 0 ; i < n_dict_signals; ++i )
+ {
+ if ( ds->dict_handler_id [i] > 0)
+ {
+ g_signal_handler_unblock (ds->dict,
+ ds->dict_handler_id[i]);
+ }
+ }
+
+ ds->cf_handler_id [CASES_DELETED] =
+ g_signal_connect (ds->case_file, "cases-deleted",
+ G_CALLBACK (delete_cases_callback),
+ ds);
+
+ ds->cf_handler_id [CASE_INSERTED] =
+ g_signal_connect (ds->case_file, "case-inserted",
+ G_CALLBACK (insert_case_callback),
+ ds);
+
+ ds->cf_handler_id [CASE_CHANGED] =
+ g_signal_connect (ds->case_file, "case-changed",
+ G_CALLBACK (changed_case_callback),
+ ds);
+}
+