X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fui%2Fgui%2Fdata-editor.c;h=b4da5b9f49bc2a8e94ad14bb702baaecac2fdc09;hb=5b5f08a99c564c2f3e981ae0efe21ffc3c578ac4;hp=0af3c8ffda74b12954d8df45d792fe9b71c64716;hpb=00f87914f662b50bcb9eaf432e10ef5c3f486086;p=pspp-builds.git diff --git a/src/ui/gui/data-editor.c b/src/ui/gui/data-editor.c index 0af3c8ff..b4da5b9f 100644 --- a/src/ui/gui/data-editor.c +++ b/src/ui/gui/data-editor.c @@ -48,6 +48,7 @@ #include "examine-dialog.h" #include "dict-display.h" #include "regression-dialog.h" +#include "text-data-import-dialog.h" #include "oneway-anova-dialog.h" #include "t-test-independent-samples-dialog.h" @@ -61,7 +62,7 @@ #include "syntax-editor.h" #include #include -#include +#include #include "window-manager.h" #include "psppire-data-store.h" @@ -319,7 +320,7 @@ new_data_editor (void) de->toggle_value_labels = gtk_toggle_action_new ("toggle-value-labels", - _("Labels"), + _("_Labels"), _("Show/hide value labels"), "pspp-value-labels"); @@ -373,7 +374,7 @@ new_data_editor (void) de->insert_variable = gtk_action_new ("insert-variable", - _("Insert Variable"), + _("Insert _Variable"), _("Create a new variable at the current position"), "pspp-insert-variable"); @@ -392,7 +393,7 @@ new_data_editor (void) de->insert_case = gtk_action_new ("insert-case", - _("Insert Case"), + _("Insert Ca_se"), _("Create a new case at the current position"), "pspp-insert-case"); @@ -413,7 +414,7 @@ new_data_editor (void) de->invoke_goto_dialog = gtk_action_new ("goto-case-dialog", - _("Goto Case"), + _("_Goto Case"), _("Jump to a Case in the Data Sheet"), "gtk-jump-to"); @@ -433,7 +434,7 @@ new_data_editor (void) de->invoke_weight_cases_dialog = gtk_action_new ("weight-cases-dialog", - _("Weights"), + _("_Weights"), _("Weight cases by variable"), "pspp-weight-cases"); @@ -443,7 +444,7 @@ new_data_editor (void) de->invoke_transpose_dialog = gtk_action_new ("transpose-dialog", - _("Transpose"), + _("_Transpose"), _("Transpose the cases with the variables"), NULL); @@ -455,7 +456,7 @@ new_data_editor (void) de->invoke_split_file_dialog = gtk_action_new ("split-file-dialog", - _("Split"), + _("S_plit"), _("Split the active file"), "pspp-split-file"); @@ -466,7 +467,7 @@ new_data_editor (void) de->invoke_sort_cases_dialog = gtk_action_new ("sort-cases-dialog", - _("Sort"), + _("_Sort"), _("Sort cases in the active file"), "pspp-sort-cases"); @@ -475,7 +476,7 @@ new_data_editor (void) de->invoke_select_cases_dialog = gtk_action_new ("select-cases-dialog", - _("Select Cases"), + _("Select _Cases"), _("Select cases from the active file"), "pspp-select-cases"); @@ -485,7 +486,7 @@ new_data_editor (void) de->invoke_compute_dialog = gtk_action_new ("compute-dialog", - _("Compute"), + _("_Compute"), _("Compute new values for a variable"), "pspp-compute"); @@ -533,7 +534,7 @@ new_data_editor (void) de->invoke_comments_dialog = gtk_action_new ("commments-dialog", - _("Data File Comments"), + _("Data File _Comments"), _("Commentary text for the data file"), NULL); @@ -542,7 +543,7 @@ new_data_editor (void) de->invoke_find_dialog = gtk_action_new ("find-dialog", - _("Find"), + _("_Find"), _("Find Case"), "gtk-find"); @@ -582,7 +583,7 @@ new_data_editor (void) de->invoke_variable_info_dialog = gtk_action_new ("variable-info-dialog", - _("Variables"), + _("_Variables"), _("Jump to Variable"), "pspp-goto-variable"); @@ -702,6 +703,11 @@ new_data_editor (void) G_CALLBACK (open_syntax_window), e->window); + g_signal_connect_swapped (get_widget_assert (de->xml,"file_import-text"), + "activate", + G_CALLBACK (gtk_action_activate), + de->invoke_text_import_assistant); + g_signal_connect_swapped (get_widget_assert (de->xml,"file_save"), "activate", G_CALLBACK (gtk_action_activate), @@ -1223,6 +1229,15 @@ register_data_editor_actions (struct data_editor *de) g_signal_connect (de->action_data_new, "activate", G_CALLBACK (new_file), de); + + de->invoke_text_import_assistant = + gtk_action_new ("file_import-text", + _("_Import Text Data"), + _("Import text data file"), + ""); + + g_signal_connect (de->invoke_text_import_assistant, "activate", + G_CALLBACK (text_data_import_assistant), de); } /* Returns true if NAME has a suffix which might denote a PSPP file */ @@ -1262,8 +1277,8 @@ save_file (struct data_editor *de) g_assert (de->file_name); - ds_init_cstr (&file_name, de->file_name); - gen_quoted_string (&file_name); + ds_init_empty (&file_name); + syntax_gen_string (&file_name, ss_cstr (de->file_name)); if ( de->save_as_portable ) { @@ -1398,9 +1413,8 @@ open_data_file (const gchar *file_name, struct data_editor *de) struct getl_interface *sss; struct string filename; - ds_init_cstr (&filename, file_name); - - gen_quoted_string (&filename); + ds_init_empty (&filename); + syntax_gen_string (&filename, ss_cstr (file_name)); sss = create_syntax_string_source ("GET FILE=%s.", ds_cstr (&filename));