X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-data-window.c;h=9b90930edd6cf149bf822e3fa4477d4689afc4d3;hb=17339b8ef2b6c9c403ceccb9f0ab534a943f92e1;hp=bdbdd085ef3de95537bd84b0ddf1682645f5059a;hpb=6e097c89af440da90b43ce90864394c4d0c843d5;p=pspp diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index bdbdd085ef..9b90930edd 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -47,7 +47,7 @@ #include "gl/c-strcasestr.h" #include "gl/xvasprintf.h" -#include "ui/gui/efficient-sheet/jmd-sheet.h" +#include #include "find-dialog.h" #include "options-dialog.h" @@ -69,6 +69,7 @@ #include "psppire-dialog-action-frequencies.h" #include "psppire-dialog-action-histogram.h" #include "psppire-dialog-action-indep-samps.h" +#include "psppire-dialog-action-k-independent.h" #include "psppire-dialog-action-k-related.h" #include "psppire-dialog-action-kmeans.h" #include "psppire-dialog-action-logistic.h" @@ -970,16 +971,9 @@ file_import (PsppireDataWindow *dw) PsppireImportAssistant *asst = PSPPIRE_IMPORT_ASSISTANT (w); gtk_widget_show_all (w); - asst->main_loop = g_main_loop_new (NULL, TRUE); - g_main_loop_run (asst->main_loop); - g_main_loop_unref (asst->main_loop); + int response = psppire_import_assistant_run (asst); -#if TEXT_FILE - if (!asst->file_name) - goto end; - - - switch (asst->response) + switch (response) { case GTK_RESPONSE_APPLY: { @@ -994,8 +988,7 @@ file_import (PsppireDataWindow *dw) default: break; } -#endif - end: + gtk_widget_destroy (GTK_WIDGET (asst)); } @@ -1060,10 +1053,9 @@ connect_action_to_menuitem (GActionMap *map, const gchar *action_name, GtkWidget static void -set_data_page (PsppireDataWindow *dw) +on_realize (PsppireDataWindow *dw) { gtk_notebook_set_current_page (GTK_NOTEBOOK (dw->data_editor), 1); - gtk_notebook_set_current_page (GTK_NOTEBOOK (dw->data_editor), 0); } @@ -1077,8 +1069,8 @@ on_cut (PsppireDataWindow *dw) g_object_get (dw->data_editor, "dictionary", &dict, NULL); gint x, y; - JmdSheet *sheet = JMD_SHEET (dw->data_editor->data_sheet); - JmdRange sel = *sheet->selection; + SswSheet *sheet = SSW_SHEET (dw->data_editor->data_sheet); + SswRange sel = *sheet->selection; GtkClipboard *clip = gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (dw)), @@ -1130,7 +1122,7 @@ on_copy (PsppireDataWindow *dw) gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (dw)), GDK_SELECTION_CLIPBOARD); - jmd_sheet_set_clip (JMD_SHEET (dw->data_editor->data_sheet), clip); + ssw_sheet_set_clip (SSW_SHEET (dw->data_editor->data_sheet), clip); } } @@ -1151,7 +1143,7 @@ on_clear_cases (PsppireDataWindow *dw) int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (de)); if (p == PSPPIRE_DATA_EDITOR_DATA_VIEW) { - JmdRange *range = JMD_SHEET(de->data_sheet)->selection; + SswRange *range = SSW_SHEET(de->data_sheet)->selection; psppire_data_store_delete_cases (de->data_store, range->start_y, range->end_y - range->start_y + 1); gtk_widget_queue_draw (GTK_WIDGET (de->data_sheet)); @@ -1181,12 +1173,12 @@ insert_variable (PsppireDataWindow *dw) if (p == PSPPIRE_DATA_EDITOR_DATA_VIEW) { - JmdRange *range = JMD_SHEET(de->data_sheet)->selection; + SswRange *range = SSW_SHEET(de->data_sheet)->selection; psppire_data_editor_insert_new_variable_at_posn (de, range->start_x); } else { - JmdRange *range = JMD_SHEET(de->var_sheet)->selection; + SswRange *range = SSW_SHEET(de->var_sheet)->selection; psppire_data_editor_insert_new_variable_at_posn (de, range->start_y); } } @@ -1195,7 +1187,7 @@ static void insert_case_at_row (PsppireDataWindow *dw) { PsppireDataEditor *de = dw->data_editor; - JmdRange *range = JMD_SHEET(de->data_sheet)->selection; + SswRange *range = SSW_SHEET(de->data_sheet)->selection; psppire_data_editor_insert_new_case_at_posn (de, range->start_y); } @@ -1206,7 +1198,7 @@ goto_case (PsppireDataWindow *dw) int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (de)); if (p == PSPPIRE_DATA_EDITOR_DATA_VIEW) { - goto_case_dialog (JMD_SHEET (de->data_sheet)); + goto_case_dialog (PSPPIRE_DATA_SHEET (de->data_sheet)); } } @@ -1460,7 +1452,7 @@ psppire_data_window_finish_init (PsppireDataWindow *de, PSPPIRE_DATA_EDITOR (psppire_data_editor_new (de->dict, de->data_store)); g_signal_connect (de, "realize", - G_CALLBACK (set_data_page), de); + G_CALLBACK (on_realize), de); g_signal_connect_swapped (de->data_store, "case-changed", G_CALLBACK (set_unsaved), de); @@ -1545,6 +1537,7 @@ psppire_data_window_finish_init (PsppireDataWindow *de, connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_1SKS, de); connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_TWO_SAMPLE, de); connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_K_RELATED, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_K_INDEPENDENT, de); { GSimpleAction *file_import_action = g_simple_action_new ("file-import", NULL);