From: John Darrington Date: Fri, 29 Feb 2008 09:13:50 +0000 (+0000) Subject: Applied patch #6428 X-Git-Tag: v0.6.0~88 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=f82952d22e200e1b35cea23545857a2cf2f02c66 Applied patch #6428 --- diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index 0d4660e0..fed265eb 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -4469,6 +4469,9 @@ gtk_sheet_select_range (GtkSheet * sheet, const GtkSheetRange *range) void gtk_sheet_unselect_range (GtkSheet * sheet) { + if (! GTK_WIDGET_REALIZED (GTK_WIDGET (sheet))) + return; + gtk_sheet_real_unselect_range (sheet, NULL); sheet->state = GTK_STATE_NORMAL; diff --git a/po/de.po b/po/de.po index 30d88e06..819a5620 100644 --- a/po/de.po +++ b/po/de.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.4.3\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2008-02-20 13:21+0900\n" +"POT-Creation-Date: 2008-02-29 17:22+0900\n" "PO-Revision-Date: 2006-07-28 19:32+0800\n" "Last-Translator: John Darrington \n" "Language-Team: German \n" @@ -47,12 +47,6 @@ msgstr "Tag %d muß zwischen 0 bit 31 sein." msgid "Date %04d-%d-%d is before the earliest acceptable date of 1582-10-15." msgstr "" -#: src/data/casereader-filter.c:221 -msgid "" -"At least one case in the data read had a weight value that was user-missing, " -"system-missing, zero, or negative. These case(s) were ignored." -msgstr "" - #: src/data/case-tmpfile.c:57 msgid "failed to create temporary file" msgstr "" @@ -73,6 +67,12 @@ msgstr "plotzlich ist der Datei beendet" msgid "writing to temporary file" msgstr "" +#: src/data/casereader-filter.c:221 +msgid "" +"At least one case in the data read had a weight value that was user-missing, " +"system-missing, zero, or negative. These case(s) were ignored." +msgstr "" + #: src/data/data-in.c:257 src/data/data-in.c:447 msgid "Field contents are not numeric." msgstr "" @@ -320,14 +320,14 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:327 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1304 src/ui/gui/psppire.glade:2176 -#: src/ui/gui/psppire-var-store.c:493 +#: src/ui/gui/data-editor.glade:1197 src/ui/gui/psppire-var-store.c:604 +#: src/ui/gui/psppire.glade:2176 msgid "String" msgstr "Zeichenkette" #: src/data/format.c:327 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1193 src/ui/gui/psppire.glade:2131 -#: src/ui/gui/psppire-var-store.c:486 +#: src/ui/gui/data-editor.glade:1086 src/ui/gui/psppire-var-store.c:597 +#: src/ui/gui/psppire.glade:2131 msgid "Numeric" msgstr "Nummer" @@ -1287,7 +1287,7 @@ msgid "Record" msgstr "" #: src/language/data-io/data-parser.c:643 src/language/data-io/print.c:404 -#: src/ui/gui/crosstabs.glade:92 src/ui/gui/var-sheet.c:72 +#: src/ui/gui/crosstabs.glade:92 src/ui/gui/psppire-var-sheet.c:103 msgid "Columns" msgstr "Spalten" @@ -1427,6 +1427,67 @@ msgstr "" msgid "Handle for %s not allowed here." msgstr "" +#: src/language/data-io/get-data.c:62 +#, c-format +msgid "Unsupported TYPE %s" +msgstr "" + +#: src/language/data-io/get-data.c:258 +#, c-format +msgid "" +"%s is allowed only with %s arrangement, but %s arrangement was stated or " +"implied earlier in this command." +msgstr "" + +#: src/language/data-io/get-data.c:313 +msgid "expecting FIXED or DELIMITED" +msgstr "" + +#: src/language/data-io/get-data.c:326 +msgid "Value of FIRSTCASE must be 1 or greater." +msgstr "" + +#: src/language/data-io/get-data.c:351 +msgid "expecting LINE or VARIABLES" +msgstr "" + +#: src/language/data-io/get-data.c:364 +msgid "Value of FIXCASE must be at least 1." +msgstr "" + +#: src/language/data-io/get-data.c:384 +msgid "Value of FIRST must be at least 1." +msgstr "" + +#: src/language/data-io/get-data.c:396 +msgid "Value of PERCENT must be between 1 and 100." +msgstr "" + +#: src/language/data-io/get-data.c:445 +msgid "" +"In compatible syntax mode, the QUALIFIER string must contain exactly one " +"character." +msgstr "" + +#: src/language/data-io/get-data.c:460 +msgid "expecting VARIABLES" +msgstr "" + +#: src/language/data-io/get-data.c:482 +#: src/language/data-io/placement-parser.c:376 +#, c-format +msgid "" +"The record number specified, %ld, is at or before the previous record, %d. " +"Data fields must be listed in order of increasing record number." +msgstr "" + +#: src/language/data-io/get-data.c:491 +#, c-format +msgid "" +"The record number specified, %ld, exceeds the number of records per case " +"specified on FIXCASE, %d." +msgstr "" + #: src/language/data-io/get.c:99 msgid "expecting COMM or TAPE" msgstr "" @@ -1516,67 +1577,6 @@ msgid "" "variable in earlier file (%s)." msgstr "" -#: src/language/data-io/get-data.c:62 -#, c-format -msgid "Unsupported TYPE %s" -msgstr "" - -#: src/language/data-io/get-data.c:258 -#, c-format -msgid "" -"%s is allowed only with %s arrangement, but %s arrangement was stated or " -"implied earlier in this command." -msgstr "" - -#: src/language/data-io/get-data.c:313 -msgid "expecting FIXED or DELIMITED" -msgstr "" - -#: src/language/data-io/get-data.c:326 -msgid "Value of FIRSTCASE must be 1 or greater." -msgstr "" - -#: src/language/data-io/get-data.c:351 -msgid "expecting LINE or VARIABLES" -msgstr "" - -#: src/language/data-io/get-data.c:364 -msgid "Value of FIXCASE must be at least 1." -msgstr "" - -#: src/language/data-io/get-data.c:384 -msgid "Value of FIRST must be at least 1." -msgstr "" - -#: src/language/data-io/get-data.c:396 -msgid "Value of PERCENT must be between 1 and 100." -msgstr "" - -#: src/language/data-io/get-data.c:445 -msgid "" -"In compatible syntax mode, the QUALIFIER string must contain exactly one " -"character." -msgstr "" - -#: src/language/data-io/get-data.c:460 -msgid "expecting VARIABLES" -msgstr "" - -#: src/language/data-io/get-data.c:482 -#: src/language/data-io/placement-parser.c:376 -#, c-format -msgid "" -"The record number specified, %ld, is at or before the previous record, %d. " -"Data fields must be listed in order of increasing record number." -msgstr "" - -#: src/language/data-io/get-data.c:491 -#, c-format -msgid "" -"The record number specified, %ld, exceeds the number of records per case " -"specified on FIXCASE, %d." -msgstr "" - #: src/language/data-io/inpt-pgm.c:129 msgid "Unexpected end-of-file within INPUT PROGRAM." msgstr "" @@ -1666,6 +1666,20 @@ msgstr "" msgid "The ending column for a field must be greater than the starting column." msgstr "" +#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476 +#: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60 +msgid "expecting end of command" +msgstr "" + +#: src/language/data-io/print-space.c:116 +msgid "The expression on PRINT SPACE evaluated to the system-missing value." +msgstr "" + +#: src/language/data-io/print-space.c:119 +#, c-format +msgid "The expression on PRINT SPACE evaluated to %g." +msgstr "" + #: src/language/data-io/print.c:265 #, c-format msgid "Output calls for %d records but %zu specified on RECORDS subcommand." @@ -1685,20 +1699,6 @@ msgid_plural "Writing %d records." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476 -#: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60 -msgid "expecting end of command" -msgstr "" - -#: src/language/data-io/print-space.c:116 -msgid "The expression on PRINT SPACE evaluated to the system-missing value." -msgstr "" - -#: src/language/data-io/print-space.c:119 -#, c-format -msgid "The expression on PRINT SPACE evaluated to %g." -msgstr "" - #: src/language/dictionary/apply-dictionary.c:75 #, c-format msgid "Variable %s is %s in target file, but %s in source file." @@ -1884,7 +1884,7 @@ msgstr "" #: src/language/dictionary/split-file.c:86 #: src/language/dictionary/sys-file-info.c:397 #: src/language/dictionary/sys-file-info.c:564 src/ui/gui/crosstabs.glade:275 -#: src/ui/gui/psppire.glade:2099 src/ui/gui/var-sheet.c:69 +#: src/ui/gui/psppire-var-sheet.c:100 src/ui/gui/psppire.glade:2099 msgid "Label" msgstr "Kennsatz" @@ -2047,15 +2047,18 @@ msgstr "" msgid "Measure: %s" msgstr "Messe" -#: src/language/dictionary/sys-file-info.c:495 src/ui/gui/var-sheet.c:87 +#: src/language/dictionary/sys-file-info.c:495 +#: src/ui/gui/psppire-var-sheet.c:119 msgid "Nominal" msgstr "Nominalwert" -#: src/language/dictionary/sys-file-info.c:496 src/ui/gui/var-sheet.c:88 +#: src/language/dictionary/sys-file-info.c:496 +#: src/ui/gui/psppire-var-sheet.c:120 msgid "Ordinal" msgstr "Ordinalwert" -#: src/language/dictionary/sys-file-info.c:497 src/ui/gui/var-sheet.c:89 +#: src/language/dictionary/sys-file-info.c:497 +#: src/ui/gui/psppire-var-sheet.c:121 msgid "Scale" msgstr "Skalwert" @@ -2064,15 +2067,18 @@ msgstr "Skalwert" msgid "Display Alignment: %s" msgstr "" -#: src/language/dictionary/sys-file-info.c:501 src/ui/gui/var-sheet.c:80 +#: src/language/dictionary/sys-file-info.c:501 +#: src/ui/gui/psppire-var-sheet.c:112 msgid "Left" msgstr "Links" -#: src/language/dictionary/sys-file-info.c:502 src/ui/gui/var-sheet.c:82 +#: src/language/dictionary/sys-file-info.c:502 +#: src/ui/gui/psppire-var-sheet.c:114 msgid "Center" msgstr "Mittel" -#: src/language/dictionary/sys-file-info.c:503 src/ui/gui/var-sheet.c:81 +#: src/language/dictionary/sys-file-info.c:503 +#: src/ui/gui/psppire-var-sheet.c:113 msgid "Right" msgstr "Rechts" @@ -2745,7 +2751,7 @@ msgstr "" #: src/language/stats/crosstabs.q:859 src/language/stats/examine.q:917 #: src/language/stats/frequencies.q:1128 src/language/stats/frequencies.q:1407 -#: src/ui/gui/var-sheet.c:71 +#: src/ui/gui/psppire-var-sheet.c:102 msgid "Missing" msgstr "Löse" @@ -2848,8 +2854,8 @@ msgstr "" msgid "Directional measures." msgstr "" -#: src/language/stats/crosstabs.q:1221 src/ui/gui/psppire.glade:2223 -#: src/ui/gui/var-sheet.c:66 +#: src/language/stats/crosstabs.q:1221 src/ui/gui/psppire-var-sheet.c:97 +#: src/ui/gui/psppire.glade:2223 msgid "Type" msgstr "Typ" @@ -3380,6 +3386,22 @@ msgstr "" msgid "TABLES subcommand may not appear more than once." msgstr "" +#: src/language/stats/npar-summary.c:108 +msgid "Descriptive Statistics" +msgstr "" + +#: src/language/stats/npar-summary.c:145 +msgid "25th" +msgstr "" + +#: src/language/stats/npar-summary.c:148 +msgid "50th (Median)" +msgstr "" + +#: src/language/stats/npar-summary.c:151 +msgid "75th" +msgstr "" + #: src/language/stats/npar.q:98 msgid "NPAR subcommand not currently implemented." msgstr "" @@ -3404,22 +3426,6 @@ msgid "" "not match the number following (%zu)." msgstr "" -#: src/language/stats/npar-summary.c:108 -msgid "Descriptive Statistics" -msgstr "" - -#: src/language/stats/npar-summary.c:145 -msgid "25th" -msgstr "" - -#: src/language/stats/npar-summary.c:148 -msgid "50th (Median)" -msgstr "" - -#: src/language/stats/npar-summary.c:151 -msgid "75th" -msgstr "" - #: src/language/stats/oneway.q:169 msgid "Number of contrast coefficients must equal the number of groups" msgstr "" @@ -3568,7 +3574,7 @@ msgstr "" msgid "Too many variables in INTO clause." msgstr "" -#: src/language/stats/regression.q:167 +#: src/language/stats/regression.q:167 src/ui/gui/regression-dialog.c:42 msgid "R" msgstr "" @@ -4558,7 +4564,7 @@ msgstr "" #: src/ui/gui/crosstabs-dialog.c:54 src/ui/gui/crosstabs-dialog.c:65 #: src/ui/gui/crosstabs-dialog.c:100 src/ui/gui/crosstabs-dialog.c:108 -#: src/ui/gui/psppire-var-store.c:479 src/ui/gui/var-display.c:14 +#: src/ui/gui/psppire-var-store.c:590 src/ui/gui/var-display.c:13 msgid "None" msgstr "Keine" @@ -4597,6 +4603,7 @@ msgid "Format..." msgstr "" #: src/ui/gui/crosstabs.glade:138 src/ui/gui/examine.glade:246 +#: src/ui/gui/regression.glade:31 msgid "Statistics..." msgstr "" @@ -4638,6 +4645,7 @@ msgid "Cell Display" msgstr "" #: src/ui/gui/crosstabs.glade:439 src/ui/gui/oneway.glade:207 +#: src/ui/gui/regression.glade:324 msgid "Statistics" msgstr "" @@ -4645,327 +4653,335 @@ msgstr "" msgid "Style of bevel around the custom entry button" msgstr "" -#: src/ui/gui/data-editor.c:167 +#: src/ui/gui/data-editor.c:150 msgid "Transformations Pending" msgstr "" -#: src/ui/gui/data-editor.c:429 +#: src/ui/gui/data-editor.c:323 #, fuzzy msgid "Labels" msgstr "Kennsatz" -#: src/ui/gui/data-editor.c:430 +#: src/ui/gui/data-editor.c:324 msgid "Show/hide value labels" msgstr "" -#: src/ui/gui/data-editor.c:448 src/ui/gui/data-editor.c:465 -#: src/ui/gui/data-editor.c:1923 src/ui/gui/data-editor.c:1976 +#: src/ui/gui/data-editor.c:342 src/ui/gui/data-editor.c:361 +#: src/ui/gui/data-editor.c:1494 src/ui/gui/data-editor.c:1546 msgid "Clear" msgstr "" -#: src/ui/gui/data-editor.c:449 +#: src/ui/gui/data-editor.c:343 msgid "Delete the cases at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:466 +#: src/ui/gui/data-editor.c:362 msgid "Delete the variables at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:480 src/ui/gui/data-editor.c:1920 +#: src/ui/gui/data-editor.c:377 src/ui/gui/data-editor.c:1491 #: src/ui/gui/data-editor.glade:137 src/ui/gui/data-editor.glade:808 #, fuzzy msgid "Insert Variable" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:481 +#: src/ui/gui/data-editor.c:378 msgid "Create a new variable at the current position" msgstr "" -#: src/ui/gui/data-editor.c:499 src/ui/gui/data-editor.c:1973 +#: src/ui/gui/data-editor.c:396 src/ui/gui/data-editor.c:1543 #: src/ui/gui/data-editor.glade:796 #, fuzzy msgid "Insert Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:500 +#: src/ui/gui/data-editor.c:397 msgid "Create a new case at the current position" msgstr "" -#: src/ui/gui/data-editor.c:520 +#: src/ui/gui/data-editor.c:417 #, fuzzy msgid "Goto Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:521 +#: src/ui/gui/data-editor.c:418 msgid "Jump to a Case in the Data Sheet" msgstr "" -#: src/ui/gui/data-editor.c:540 +#: src/ui/gui/data-editor.c:437 #, fuzzy msgid "Weights" msgstr "Rechts" -#: src/ui/gui/data-editor.c:541 +#: src/ui/gui/data-editor.c:438 msgid "Weight cases by variable" msgstr "" -#: src/ui/gui/data-editor.c:550 src/ui/gui/data-editor.glade:312 +#: src/ui/gui/data-editor.c:447 src/ui/gui/data-editor.glade:312 msgid "Transpose" msgstr "" -#: src/ui/gui/data-editor.c:551 +#: src/ui/gui/data-editor.c:448 msgid "Transpose the cases with the variables" msgstr "" -#: src/ui/gui/data-editor.c:562 +#: src/ui/gui/data-editor.c:459 #, fuzzy msgid "Split" msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:563 +#: src/ui/gui/data-editor.c:460 msgid "Split the active file" msgstr "" -#: src/ui/gui/data-editor.c:573 +#: src/ui/gui/data-editor.c:470 msgid "Sort" msgstr "" -#: src/ui/gui/data-editor.c:574 +#: src/ui/gui/data-editor.c:471 msgid "Sort cases in the active file" msgstr "" -#: src/ui/gui/data-editor.c:582 src/ui/gui/data-editor.glade:347 +#: src/ui/gui/data-editor.c:479 src/ui/gui/data-editor.glade:347 #: src/ui/gui/data-editor.glade:851 msgid "Select Cases" msgstr "" -#: src/ui/gui/data-editor.c:583 +#: src/ui/gui/data-editor.c:480 msgid "Select cases from the active file" msgstr "" -#: src/ui/gui/data-editor.c:592 +#: src/ui/gui/data-editor.c:489 msgid "Compute" msgstr "" -#: src/ui/gui/data-editor.c:593 +#: src/ui/gui/data-editor.c:490 #, fuzzy msgid "Compute new values for a variable" msgstr "Unpassend Wert für Variable" -#: src/ui/gui/data-editor.c:601 +#: src/ui/gui/data-editor.c:498 msgid "Oneway _ANOVA" msgstr "" -#: src/ui/gui/data-editor.c:602 +#: src/ui/gui/data-editor.c:499 msgid "Perform one way analysis of variance" msgstr "" -#: src/ui/gui/data-editor.c:610 src/ui/gui/data-editor.glade:503 +#: src/ui/gui/data-editor.c:507 src/ui/gui/data-editor.glade:503 msgid "_Independent Samples T Test" msgstr "" -#: src/ui/gui/data-editor.c:611 +#: src/ui/gui/data-editor.c:508 msgid "Calculate T Test for samples from independent groups" msgstr "" -#: src/ui/gui/data-editor.c:620 src/ui/gui/data-editor.glade:511 +#: src/ui/gui/data-editor.c:517 src/ui/gui/data-editor.glade:511 msgid "_Paired Samples T Test" msgstr "" -#: src/ui/gui/data-editor.c:621 +#: src/ui/gui/data-editor.c:518 msgid "Calculate T Test for paired samples" msgstr "" -#: src/ui/gui/data-editor.c:630 +#: src/ui/gui/data-editor.c:527 msgid "One _Sample T Test" msgstr "" -#: src/ui/gui/data-editor.c:631 +#: src/ui/gui/data-editor.c:528 msgid "Calculate T Test for sample from a single distribution" msgstr "" -#: src/ui/gui/data-editor.c:640 +#: src/ui/gui/data-editor.c:537 #, fuzzy msgid "Data File Comments" msgstr "Datei Fehler" -#: src/ui/gui/data-editor.c:641 +#: src/ui/gui/data-editor.c:538 msgid "Commentary text for the data file" msgstr "" -#: src/ui/gui/data-editor.c:649 src/ui/gui/data-editor.glade:776 +#: src/ui/gui/data-editor.c:546 src/ui/gui/data-editor.glade:776 msgid "Find" msgstr "" -#: src/ui/gui/data-editor.c:650 +#: src/ui/gui/data-editor.c:547 #, fuzzy msgid "Find Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:659 src/ui/gui/data-editor.glade:384 +#: src/ui/gui/data-editor.c:556 src/ui/gui/data-editor.glade:384 #, fuzzy msgid "Ran_k Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:660 +#: src/ui/gui/data-editor.c:557 #, fuzzy msgid "Rank Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:669 src/ui/gui/data-editor.glade:396 +#: src/ui/gui/data-editor.c:566 src/ui/gui/data-editor.glade:396 #, fuzzy msgid "Recode into _Same Variables" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:670 +#: src/ui/gui/data-editor.c:567 #, fuzzy msgid "Recode values into the same Variables" msgstr "Unpassend Wert für Variable" -#: src/ui/gui/data-editor.c:679 src/ui/gui/data-editor.glade:403 +#: src/ui/gui/data-editor.c:576 src/ui/gui/data-editor.glade:403 msgid "Recode into _Different Variables" msgstr "" -#: src/ui/gui/data-editor.c:680 +#: src/ui/gui/data-editor.c:577 msgid "Recode values into different Variables" msgstr "" -#: src/ui/gui/data-editor.c:689 src/ui/gui/data-editor.glade:286 +#: src/ui/gui/data-editor.c:586 src/ui/gui/data-editor.glade:286 #: src/ui/gui/data-editor.glade:755 msgid "Variables" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:690 +#: src/ui/gui/data-editor.c:587 #, fuzzy msgid "Jump to Variable" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:698 src/ui/gui/data-editor.glade:457 +#: src/ui/gui/data-editor.c:595 src/ui/gui/data-editor.glade:457 #: src/ui/gui/oneway.glade:179 msgid "_Descriptives" msgstr "" -#: src/ui/gui/data-editor.c:699 +#: src/ui/gui/data-editor.c:596 msgid "Calculate descriptive statistics (mean, variance, ...)" msgstr "" -#: src/ui/gui/data-editor.c:708 src/ui/gui/data-editor.glade:449 +#: src/ui/gui/data-editor.c:605 src/ui/gui/data-editor.glade:449 #, fuzzy msgid "_Frequencies" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:709 +#: src/ui/gui/data-editor.c:606 msgid "Generate frequency statistics" msgstr "" -#: src/ui/gui/data-editor.c:717 src/ui/gui/data-editor.glade:473 +#: src/ui/gui/data-editor.c:614 src/ui/gui/data-editor.glade:473 msgid "_Crosstabs" msgstr "" -#: src/ui/gui/data-editor.c:718 +#: src/ui/gui/data-editor.c:615 msgid "Generate crosstabulations" msgstr "" -#: src/ui/gui/data-editor.c:727 src/ui/gui/data-editor.glade:465 +#: src/ui/gui/data-editor.c:624 src/ui/gui/data-editor.glade:465 msgid "_Explore" msgstr "" -#: src/ui/gui/data-editor.c:728 +#: src/ui/gui/data-editor.c:625 msgid "Examine Data by Factors" msgstr "" -#: src/ui/gui/data-editor.c:1188 +#: src/ui/gui/data-editor.c:634 src/ui/gui/data-editor.glade:539 +msgid "Linear _Regression" +msgstr "" + +#: src/ui/gui/data-editor.c:635 +msgid "Estimate parameters of the linear model" +msgstr "" + +#: src/ui/gui/data-editor.c:1022 msgid "Font Selection" msgstr "Schriftwahlung" -#: src/ui/gui/data-editor.c:1397 +#: src/ui/gui/data-editor.c:1094 msgid "No Split" msgstr "" -#: src/ui/gui/data-editor.c:1406 +#: src/ui/gui/data-editor.c:1103 #, fuzzy msgid "Split by " msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:1431 +#: src/ui/gui/data-editor.c:1128 msgid "Filter off" msgstr "" -#: src/ui/gui/data-editor.c:1444 +#: src/ui/gui/data-editor.c:1140 #, c-format msgid "Filter by %s" msgstr "" -#: src/ui/gui/data-editor.c:1462 +#: src/ui/gui/data-editor.c:1158 msgid "Weights off" msgstr "" -#: src/ui/gui/data-editor.c:1475 +#: src/ui/gui/data-editor.c:1170 #, c-format msgid "Weight by %s" msgstr "" -#: src/ui/gui/data-editor.c:1498 src/ui/gui/data-editor.c:1732 +#: src/ui/gui/data-editor.c:1193 src/ui/gui/data-editor.c:1427 #: src/ui/gui/data-editor.glade:667 msgid "Open" msgstr "Öffen" -#: src/ui/gui/data-editor.c:1499 +#: src/ui/gui/data-editor.c:1194 msgid "Open a data file" msgstr "" -#: src/ui/gui/data-editor.c:1507 src/ui/gui/data-editor.c:1614 +#: src/ui/gui/data-editor.c:1202 src/ui/gui/data-editor.c:1309 #: src/ui/gui/data-editor.glade:677 msgid "Save" msgstr "Speichen" -#: src/ui/gui/data-editor.c:1508 src/ui/gui/data-editor.c:1518 +#: src/ui/gui/data-editor.c:1203 src/ui/gui/data-editor.c:1213 #, fuzzy msgid "Save data to file" msgstr "Speichern unter" -#: src/ui/gui/data-editor.c:1517 +#: src/ui/gui/data-editor.c:1212 #, fuzzy msgid "Save As" msgstr "Speichern unter" -#: src/ui/gui/data-editor.c:1526 src/ui/gui/recode-dialog.c:930 -#: src/ui/gui/recode-dialog.c:1025 +#: src/ui/gui/data-editor.c:1221 src/ui/gui/recode-dialog.c:929 +#: src/ui/gui/recode-dialog.c:1024 msgid "New" msgstr "" -#: src/ui/gui/data-editor.c:1527 +#: src/ui/gui/data-editor.c:1222 msgid "New data file" msgstr "" -#: src/ui/gui/data-editor.c:1622 src/ui/gui/data-editor.c:1740 +#: src/ui/gui/data-editor.c:1317 src/ui/gui/data-editor.c:1435 msgid "System Files (*.sav)" msgstr "Systemedatein (*.sav)" -#: src/ui/gui/data-editor.c:1628 src/ui/gui/data-editor.c:1746 +#: src/ui/gui/data-editor.c:1323 src/ui/gui/data-editor.c:1441 msgid "Portable Files (*.por) " msgstr "Tragbardatein (*.por)" -#: src/ui/gui/data-editor.c:1634 src/ui/gui/data-editor.c:1752 +#: src/ui/gui/data-editor.c:1329 src/ui/gui/data-editor.c:1447 #: src/ui/gui/syntax-editor.c:138 src/ui/gui/syntax-editor.c:522 msgid "All Files" msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:1642 +#: src/ui/gui/data-editor.c:1337 #, fuzzy msgid "System File" msgstr "Systemedatein (*.sav)" -#: src/ui/gui/data-editor.c:1647 +#: src/ui/gui/data-editor.c:1342 #, fuzzy msgid "Portable File" msgstr "Tragbardatein (*.por)" -#: src/ui/gui/data-editor.c:1913 +#: src/ui/gui/data-editor.c:1485 msgid "Sort Ascending" msgstr "" -#: src/ui/gui/data-editor.c:1916 +#: src/ui/gui/data-editor.c:1488 msgid "Sort Descending" msgstr "" @@ -5044,7 +5060,7 @@ msgid "Grid Lines" msgstr "Glitten" #: src/ui/gui/data-editor.glade:267 src/ui/gui/data-editor.glade:871 -#: src/ui/gui/data-editor.glade:1566 src/ui/gui/data-editor.glade:1747 +#: src/ui/gui/data-editor.glade:1459 src/ui/gui/data-editor.glade:1640 msgid "Value Labels" msgstr "Werten" @@ -5110,10 +5126,6 @@ msgstr "" msgid "Bivariate _Correlation" msgstr "" -#: src/ui/gui/data-editor.glade:539 -msgid "Linear _Regression" -msgstr "" - #: src/ui/gui/data-editor.glade:547 msgid "_Non-Parametric Statistics" msgstr "" @@ -5187,122 +5199,114 @@ msgstr "" msgid "Use Sets" msgstr "" -#: src/ui/gui/data-editor.glade:964 -msgid "Data View" -msgstr "Datenansicht" - -#: src/ui/gui/data-editor.glade:991 -msgid "Variable View" -msgstr "Variableansicht" - -#: src/ui/gui/data-editor.glade:1021 +#: src/ui/gui/data-editor.glade:914 msgid "Information Area" msgstr "" -#: src/ui/gui/data-editor.glade:1040 +#: src/ui/gui/data-editor.glade:933 msgid "Processor Area" msgstr "" -#: src/ui/gui/data-editor.glade:1065 +#: src/ui/gui/data-editor.glade:958 msgid "Case Counter Area" msgstr "" -#: src/ui/gui/data-editor.glade:1090 +#: src/ui/gui/data-editor.glade:983 msgid "Filter Use Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1116 +#: src/ui/gui/data-editor.glade:1009 msgid "Weight Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1142 +#: src/ui/gui/data-editor.glade:1035 #, fuzzy msgid "Split File Status Area" msgstr "Alle Datei" -#: src/ui/gui/data-editor.glade:1172 +#: src/ui/gui/data-editor.glade:1065 msgid "Variable Type" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:1208 src/ui/gui/psppire-var-store.c:487 +#: src/ui/gui/data-editor.glade:1101 src/ui/gui/psppire-var-store.c:598 msgid "Comma" msgstr "Komma" -#: src/ui/gui/data-editor.glade:1224 src/ui/gui/psppire-var-store.c:488 +#: src/ui/gui/data-editor.glade:1117 src/ui/gui/psppire-var-store.c:599 msgid "Dot" msgstr "Punkt" -#: src/ui/gui/data-editor.glade:1240 +#: src/ui/gui/data-editor.glade:1133 msgid "Scientific notation" msgstr "Wissenschaftlichnotation" -#: src/ui/gui/data-editor.glade:1256 src/ui/gui/psppire-var-store.c:490 +#: src/ui/gui/data-editor.glade:1149 src/ui/gui/psppire-var-store.c:601 msgid "Date" msgstr "Datum" -#: src/ui/gui/data-editor.glade:1272 src/ui/gui/psppire-var-store.c:491 +#: src/ui/gui/data-editor.glade:1165 src/ui/gui/psppire-var-store.c:602 msgid "Dollar" msgstr "Euro" -#: src/ui/gui/data-editor.glade:1288 +#: src/ui/gui/data-editor.glade:1181 msgid "Custom currency" msgstr "Spezialwährung" -#: src/ui/gui/data-editor.glade:1382 +#: src/ui/gui/data-editor.glade:1275 msgid "positive" msgstr "positiv" -#: src/ui/gui/data-editor.glade:1388 +#: src/ui/gui/data-editor.glade:1281 msgid "negative" msgstr "negativ" -#: src/ui/gui/data-editor.glade:1401 +#: src/ui/gui/data-editor.glade:1294 msgid "Sample" msgstr "Muster" -#: src/ui/gui/data-editor.glade:1451 +#: src/ui/gui/data-editor.glade:1344 msgid "Width:" msgstr "Große:" -#: src/ui/gui/data-editor.glade:1495 +#: src/ui/gui/data-editor.glade:1388 msgid "Decimal Places:" msgstr "Dezimalstellen:" -#: src/ui/gui/data-editor.glade:1664 +#: src/ui/gui/data-editor.glade:1557 msgid "Value Label:" msgstr "Kennsatz:" -#: src/ui/gui/data-editor.glade:1677 src/ui/gui/psppire.glade:2544 +#: src/ui/gui/data-editor.glade:1570 src/ui/gui/psppire.glade:2544 #: src/ui/gui/recode.glade:185 msgid "Value:" msgstr "Werte:" -#: src/ui/gui/data-editor.glade:1814 src/ui/gui/examine.glade:423 +#: src/ui/gui/data-editor.glade:1707 src/ui/gui/examine.glade:423 #: src/ui/gui/t-test.glade:460 msgid "Missing Values" msgstr "Lösewerten" -#: src/ui/gui/data-editor.glade:1832 +#: src/ui/gui/data-editor.glade:1725 msgid "_Range plus one optional discrete missing value" msgstr "Wertebereich und ein optional Lösewert" -#: src/ui/gui/data-editor.glade:1857 +#: src/ui/gui/data-editor.glade:1750 msgid "_Low:" msgstr "_Tief:" -#: src/ui/gui/data-editor.glade:1886 +#: src/ui/gui/data-editor.glade:1779 msgid "_High:" msgstr "_Hoch:" -#: src/ui/gui/data-editor.glade:1927 +#: src/ui/gui/data-editor.glade:1820 msgid "Di_screte value:" msgstr "Di_skretwerte" -#: src/ui/gui/data-editor.glade:1974 +#: src/ui/gui/data-editor.glade:1867 msgid "_No missing values" msgstr "_Kein Lösewerten" -#: src/ui/gui/data-editor.glade:1992 +#: src/ui/gui/data-editor.glade:1885 msgid "_Discrete missing values" msgstr "_Diskret Lösewerten" @@ -5519,7 +5523,7 @@ msgstr "Unpassend Wert für Variable" msgid "Incorrect range specification" msgstr "Falshe Spannweitebeschreibung" -#: src/ui/gui/oneway-anova-dialog.c:339 +#: src/ui/gui/oneway-anova-dialog.c:336 #, c-format msgid "Contrast %d of %d" msgstr "" @@ -5612,24 +5616,70 @@ msgstr "xyzzy" msgid "Paste" msgstr "Datum" -#: src/ui/gui/psppire.c:197 -msgid "_Reset" -msgstr "_Zurücksetzen" +#: src/ui/gui/psppire-data-editor.c:604 +msgid "Data View" +msgstr "Datenansicht" -#: src/ui/gui/psppire.c:198 -#, fuzzy -msgid "_Select" -msgstr "Schriftwahlung" +#: src/ui/gui/psppire-data-editor.c:607 +msgid "Variable View" +msgstr "Variableansicht" #: src/ui/gui/psppire-data-store.c:827 msgid "var" msgstr "" -#: src/ui/gui/psppire-data-store.c:948 src/ui/gui/psppire-var-store.c:728 +#: src/ui/gui/psppire-data-store.c:948 src/ui/gui/psppire-var-store.c:839 #, c-format msgid "%ld" msgstr "" +#: src/ui/gui/psppire-var-sheet.c:96 +msgid "Name" +msgstr "Name" + +#: src/ui/gui/psppire-var-sheet.c:98 src/ui/gui/psppire.glade:2187 +msgid "Width" +msgstr "Große" + +#: src/ui/gui/psppire-var-sheet.c:99 +msgid "Decimals" +msgstr "Dezimalstellen" + +#: src/ui/gui/psppire-var-sheet.c:101 +msgid "Values" +msgstr "Werten" + +#: src/ui/gui/psppire-var-sheet.c:104 +msgid "Align" +msgstr "Einstellung" + +#: src/ui/gui/psppire-var-sheet.c:105 +msgid "Measure" +msgstr "Messe" + +#: src/ui/gui/psppire-var-store.c:600 +msgid "Scientific" +msgstr "Wissenschäflich" + +#: src/ui/gui/psppire-var-store.c:603 +msgid "Custom" +msgstr "Spezial" + +#: src/ui/gui/psppire-var-store.c:674 src/ui/gui/psppire-var-store.c:684 +#: src/ui/gui/psppire-var-store.c:694 +#, c-format +msgid "%d" +msgstr "" + +#: src/ui/gui/psppire.c:195 +msgid "_Reset" +msgstr "_Zurücksetzen" + +#: src/ui/gui/psppire.c:196 +#, fuzzy +msgid "_Select" +msgstr "Schriftwahlung" + #: src/ui/gui/psppire.glade:11 #, fuzzy msgid "This is pre-alpha software. Use at your own risk." @@ -5826,10 +5876,6 @@ msgstr "" msgid "Use expression as label" msgstr "" -#: src/ui/gui/psppire.glade:2187 src/ui/gui/var-sheet.c:67 -msgid "Width" -msgstr "Große" - #: src/ui/gui/psppire.glade:2274 msgid "Goto Case Number:" msgstr "" @@ -5865,20 +5911,6 @@ msgstr "" msgid "Search backward" msgstr "" -#: src/ui/gui/psppire-var-store.c:489 -msgid "Scientific" -msgstr "Wissenschäflich" - -#: src/ui/gui/psppire-var-store.c:492 -msgid "Custom" -msgstr "Spezial" - -#: src/ui/gui/psppire-var-store.c:563 src/ui/gui/psppire-var-store.c:573 -#: src/ui/gui/psppire-var-store.c:583 -#, c-format -msgid "%d" -msgstr "" - #: src/ui/gui/rank.glade:111 msgid "By:" msgstr "" @@ -5962,48 +5994,48 @@ msgstr "" msgid "Proportion Estimation Formula" msgstr "" -#: src/ui/gui/rank.glade:615 +#: src/ui/gui/rank.glade:614 msgid "_Mean" msgstr "" -#: src/ui/gui/rank.glade:627 +#: src/ui/gui/rank.glade:626 #, fuzzy msgid "_Low" msgstr "_Tief:" -#: src/ui/gui/rank.glade:643 +#: src/ui/gui/rank.glade:642 #, fuzzy msgid "_High" msgstr "_Hoch:" -#: src/ui/gui/rank.glade:661 +#: src/ui/gui/rank.glade:660 msgid "_Sequential ranks to unique values" msgstr "" -#: src/ui/gui/rank.glade:681 +#: src/ui/gui/rank.glade:680 msgid "Rank Assigned to Ties" msgstr "" -#: src/ui/gui/recode-dialog.c:881 +#: src/ui/gui/recode-dialog.c:880 #, fuzzy msgid "Recode into Different Variables" msgstr "Variableansicht" -#: src/ui/gui/recode-dialog.c:884 +#: src/ui/gui/recode-dialog.c:883 #, fuzzy msgid "Recode into Same Variables" msgstr "Variableansicht" -#: src/ui/gui/recode-dialog.c:915 src/ui/gui/recode-dialog.c:1017 +#: src/ui/gui/recode-dialog.c:914 src/ui/gui/recode-dialog.c:1016 msgid "Old" msgstr "" -#: src/ui/gui/recode-dialog.c:1276 +#: src/ui/gui/recode-dialog.c:1275 #, fuzzy msgid "Recode into Different Variables: Old and New Values " msgstr "Variableansicht" -#: src/ui/gui/recode-dialog.c:1277 +#: src/ui/gui/recode-dialog.c:1276 #, fuzzy msgid "Recode into Same Variables: Old and New Values" msgstr "Variableansicht" @@ -6099,6 +6131,42 @@ msgstr "Variableansicht" msgid "Old and New Values" msgstr "Werte:" +#: src/ui/gui/regression-dialog.c:41 +msgid "Coeff" +msgstr "" + +#: src/ui/gui/regression-dialog.c:43 +msgid "Anova" +msgstr "" + +#: src/ui/gui/regression-dialog.c:44 +msgid "Bcov" +msgstr "" + +#: src/ui/gui/regression.glade:41 +#, fuzzy +msgid "Save..." +msgstr "Muster" + +#: src/ui/gui/regression.glade:145 +#, fuzzy +msgid "Dependent" +msgstr "Variableansicht" + +#: src/ui/gui/regression.glade:193 +#, fuzzy +msgid "Independent" +msgstr "Variableansicht" + +#: src/ui/gui/regression.glade:243 +#, fuzzy +msgid "Predicted values" +msgstr "Variableansicht" + +#: src/ui/gui/regression.glade:253 +msgid "Residuals" +msgstr "" + #: src/ui/gui/select-cases-dialog.c:85 #, c-format msgid "Approximately %3d%% of all cases." @@ -6158,6 +6226,19 @@ msgstr "" msgid "To End" msgstr "" +#: src/ui/gui/t-test-options.c:60 +#, c-format +msgid "Confidence Interval: %2d %%" +msgstr "" + +#: src/ui/gui/t-test-paired-samples.c:229 +msgid "Var 1" +msgstr "" + +#: src/ui/gui/t-test-paired-samples.c:230 +msgid "Var 2" +msgstr "" + #: src/ui/gui/t-test.glade:56 src/ui/gui/t-test.glade:165 msgid "Define Groups" msgstr "" @@ -6197,19 +6278,6 @@ msgstr "" msgid "Test Value: " msgstr "Werte:" -#: src/ui/gui/t-test-options.c:60 -#, c-format -msgid "Confidence Interval: %2d %%" -msgstr "" - -#: src/ui/gui/t-test-paired-samples.c:232 -msgid "Var 1" -msgstr "" - -#: src/ui/gui/t-test-paired-samples.c:233 -msgid "Var 2" -msgstr "" - #: src/ui/gui/variable-info-dialog.c:88 #, fuzzy, c-format msgid "Label: %s\n" @@ -6240,26 +6308,6 @@ msgstr "Werten" msgid "%s %s\n" msgstr "" -#: src/ui/gui/var-sheet.c:65 -msgid "Name" -msgstr "Name" - -#: src/ui/gui/var-sheet.c:68 -msgid "Decimals" -msgstr "Dezimalstellen" - -#: src/ui/gui/var-sheet.c:70 -msgid "Values" -msgstr "Werten" - -#: src/ui/gui/var-sheet.c:73 -msgid "Align" -msgstr "Einstellung" - -#: src/ui/gui/var-sheet.c:74 -msgid "Measure" -msgstr "Messe" - #: src/ui/gui/weight-cases-dialog.c:88 #, c-format msgid "Weight cases by %s" diff --git a/po/en_GB.po b/po/en_GB.po index 3390dc64..26be11c5 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.4.3\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2008-02-20 13:21+0900\n" +"POT-Creation-Date: 2008-02-29 17:22+0900\n" "PO-Revision-Date: 2007-09-15 08:29+0800\n" "Last-Translator: John Darrington \n" "Language-Team: John Darrington \n" @@ -44,12 +44,6 @@ msgstr "" msgid "Date %04d-%d-%d is before the earliest acceptable date of 1582-10-15." msgstr "" -#: src/data/casereader-filter.c:221 -msgid "" -"At least one case in the data read had a weight value that was user-missing, " -"system-missing, zero, or negative. These case(s) were ignored." -msgstr "" - #: src/data/case-tmpfile.c:57 msgid "failed to create temporary file" msgstr "" @@ -70,6 +64,12 @@ msgstr "" msgid "writing to temporary file" msgstr "" +#: src/data/casereader-filter.c:221 +msgid "" +"At least one case in the data read had a weight value that was user-missing, " +"system-missing, zero, or negative. These case(s) were ignored." +msgstr "" + #: src/data/data-in.c:257 src/data/data-in.c:447 msgid "Field contents are not numeric." msgstr "" @@ -315,14 +315,14 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:327 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1304 src/ui/gui/psppire.glade:2176 -#: src/ui/gui/psppire-var-store.c:493 +#: src/ui/gui/data-editor.glade:1197 src/ui/gui/psppire-var-store.c:604 +#: src/ui/gui/psppire.glade:2176 msgid "String" msgstr "" #: src/data/format.c:327 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1193 src/ui/gui/psppire.glade:2131 -#: src/ui/gui/psppire-var-store.c:486 +#: src/ui/gui/data-editor.glade:1086 src/ui/gui/psppire-var-store.c:597 +#: src/ui/gui/psppire.glade:2131 msgid "Numeric" msgstr "" @@ -1279,7 +1279,7 @@ msgid "Record" msgstr "" #: src/language/data-io/data-parser.c:643 src/language/data-io/print.c:404 -#: src/ui/gui/crosstabs.glade:92 src/ui/gui/var-sheet.c:72 +#: src/ui/gui/crosstabs.glade:92 src/ui/gui/psppire-var-sheet.c:103 msgid "Columns" msgstr "" @@ -1418,6 +1418,67 @@ msgstr "" msgid "Handle for %s not allowed here." msgstr "" +#: src/language/data-io/get-data.c:62 +#, c-format +msgid "Unsupported TYPE %s" +msgstr "" + +#: src/language/data-io/get-data.c:258 +#, c-format +msgid "" +"%s is allowed only with %s arrangement, but %s arrangement was stated or " +"implied earlier in this command." +msgstr "" + +#: src/language/data-io/get-data.c:313 +msgid "expecting FIXED or DELIMITED" +msgstr "" + +#: src/language/data-io/get-data.c:326 +msgid "Value of FIRSTCASE must be 1 or greater." +msgstr "" + +#: src/language/data-io/get-data.c:351 +msgid "expecting LINE or VARIABLES" +msgstr "" + +#: src/language/data-io/get-data.c:364 +msgid "Value of FIXCASE must be at least 1." +msgstr "" + +#: src/language/data-io/get-data.c:384 +msgid "Value of FIRST must be at least 1." +msgstr "" + +#: src/language/data-io/get-data.c:396 +msgid "Value of PERCENT must be between 1 and 100." +msgstr "" + +#: src/language/data-io/get-data.c:445 +msgid "" +"In compatible syntax mode, the QUALIFIER string must contain exactly one " +"character." +msgstr "" + +#: src/language/data-io/get-data.c:460 +msgid "expecting VARIABLES" +msgstr "" + +#: src/language/data-io/get-data.c:482 +#: src/language/data-io/placement-parser.c:376 +#, c-format +msgid "" +"The record number specified, %ld, is at or before the previous record, %d. " +"Data fields must be listed in order of increasing record number." +msgstr "" + +#: src/language/data-io/get-data.c:491 +#, c-format +msgid "" +"The record number specified, %ld, exceeds the number of records per case " +"specified on FIXCASE, %d." +msgstr "" + #: src/language/data-io/get.c:99 msgid "expecting COMM or TAPE" msgstr "" @@ -1507,67 +1568,6 @@ msgid "" "variable in earlier file (%s)." msgstr "" -#: src/language/data-io/get-data.c:62 -#, c-format -msgid "Unsupported TYPE %s" -msgstr "" - -#: src/language/data-io/get-data.c:258 -#, c-format -msgid "" -"%s is allowed only with %s arrangement, but %s arrangement was stated or " -"implied earlier in this command." -msgstr "" - -#: src/language/data-io/get-data.c:313 -msgid "expecting FIXED or DELIMITED" -msgstr "" - -#: src/language/data-io/get-data.c:326 -msgid "Value of FIRSTCASE must be 1 or greater." -msgstr "" - -#: src/language/data-io/get-data.c:351 -msgid "expecting LINE or VARIABLES" -msgstr "" - -#: src/language/data-io/get-data.c:364 -msgid "Value of FIXCASE must be at least 1." -msgstr "" - -#: src/language/data-io/get-data.c:384 -msgid "Value of FIRST must be at least 1." -msgstr "" - -#: src/language/data-io/get-data.c:396 -msgid "Value of PERCENT must be between 1 and 100." -msgstr "" - -#: src/language/data-io/get-data.c:445 -msgid "" -"In compatible syntax mode, the QUALIFIER string must contain exactly one " -"character." -msgstr "" - -#: src/language/data-io/get-data.c:460 -msgid "expecting VARIABLES" -msgstr "" - -#: src/language/data-io/get-data.c:482 -#: src/language/data-io/placement-parser.c:376 -#, c-format -msgid "" -"The record number specified, %ld, is at or before the previous record, %d. " -"Data fields must be listed in order of increasing record number." -msgstr "" - -#: src/language/data-io/get-data.c:491 -#, c-format -msgid "" -"The record number specified, %ld, exceeds the number of records per case " -"specified on FIXCASE, %d." -msgstr "" - #: src/language/data-io/inpt-pgm.c:129 msgid "Unexpected end-of-file within INPUT PROGRAM." msgstr "" @@ -1657,6 +1657,20 @@ msgstr "" msgid "The ending column for a field must be greater than the starting column." msgstr "" +#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476 +#: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60 +msgid "expecting end of command" +msgstr "" + +#: src/language/data-io/print-space.c:116 +msgid "The expression on PRINT SPACE evaluated to the system-missing value." +msgstr "" + +#: src/language/data-io/print-space.c:119 +#, c-format +msgid "The expression on PRINT SPACE evaluated to %g." +msgstr "" + #: src/language/data-io/print.c:265 #, c-format msgid "Output calls for %d records but %zu specified on RECORDS subcommand." @@ -1676,20 +1690,6 @@ msgid_plural "Writing %d records." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/print-space.c:73 src/language/lexer/lexer.c:476 -#: src/language/stats/autorecode.c:154 src/language/xforms/select-if.c:60 -msgid "expecting end of command" -msgstr "" - -#: src/language/data-io/print-space.c:116 -msgid "The expression on PRINT SPACE evaluated to the system-missing value." -msgstr "" - -#: src/language/data-io/print-space.c:119 -#, c-format -msgid "The expression on PRINT SPACE evaluated to %g." -msgstr "" - #: src/language/dictionary/apply-dictionary.c:75 #, c-format msgid "Variable %s is %s in target file, but %s in source file." @@ -1875,7 +1875,7 @@ msgstr "" #: src/language/dictionary/split-file.c:86 #: src/language/dictionary/sys-file-info.c:397 #: src/language/dictionary/sys-file-info.c:564 src/ui/gui/crosstabs.glade:275 -#: src/ui/gui/psppire.glade:2099 src/ui/gui/var-sheet.c:69 +#: src/ui/gui/psppire-var-sheet.c:100 src/ui/gui/psppire.glade:2099 msgid "Label" msgstr "" @@ -2038,15 +2038,18 @@ msgstr "" msgid "Measure: %s" msgstr "" -#: src/language/dictionary/sys-file-info.c:495 src/ui/gui/var-sheet.c:87 +#: src/language/dictionary/sys-file-info.c:495 +#: src/ui/gui/psppire-var-sheet.c:119 msgid "Nominal" msgstr "" -#: src/language/dictionary/sys-file-info.c:496 src/ui/gui/var-sheet.c:88 +#: src/language/dictionary/sys-file-info.c:496 +#: src/ui/gui/psppire-var-sheet.c:120 msgid "Ordinal" msgstr "" -#: src/language/dictionary/sys-file-info.c:497 src/ui/gui/var-sheet.c:89 +#: src/language/dictionary/sys-file-info.c:497 +#: src/ui/gui/psppire-var-sheet.c:121 msgid "Scale" msgstr "" @@ -2055,15 +2058,18 @@ msgstr "" msgid "Display Alignment: %s" msgstr "" -#: src/language/dictionary/sys-file-info.c:501 src/ui/gui/var-sheet.c:80 +#: src/language/dictionary/sys-file-info.c:501 +#: src/ui/gui/psppire-var-sheet.c:112 msgid "Left" msgstr "" -#: src/language/dictionary/sys-file-info.c:502 src/ui/gui/var-sheet.c:82 +#: src/language/dictionary/sys-file-info.c:502 +#: src/ui/gui/psppire-var-sheet.c:114 msgid "Center" msgstr "Centre" -#: src/language/dictionary/sys-file-info.c:503 src/ui/gui/var-sheet.c:81 +#: src/language/dictionary/sys-file-info.c:503 +#: src/ui/gui/psppire-var-sheet.c:113 msgid "Right" msgstr "" @@ -2736,7 +2742,7 @@ msgstr "" #: src/language/stats/crosstabs.q:859 src/language/stats/examine.q:917 #: src/language/stats/frequencies.q:1128 src/language/stats/frequencies.q:1407 -#: src/ui/gui/var-sheet.c:71 +#: src/ui/gui/psppire-var-sheet.c:102 msgid "Missing" msgstr "" @@ -2839,8 +2845,8 @@ msgstr "" msgid "Directional measures." msgstr "" -#: src/language/stats/crosstabs.q:1221 src/ui/gui/psppire.glade:2223 -#: src/ui/gui/var-sheet.c:66 +#: src/language/stats/crosstabs.q:1221 src/ui/gui/psppire-var-sheet.c:97 +#: src/ui/gui/psppire.glade:2223 msgid "Type" msgstr "" @@ -3371,6 +3377,22 @@ msgstr "" msgid "TABLES subcommand may not appear more than once." msgstr "" +#: src/language/stats/npar-summary.c:108 +msgid "Descriptive Statistics" +msgstr "" + +#: src/language/stats/npar-summary.c:145 +msgid "25th" +msgstr "" + +#: src/language/stats/npar-summary.c:148 +msgid "50th (Median)" +msgstr "" + +#: src/language/stats/npar-summary.c:151 +msgid "75th" +msgstr "" + #: src/language/stats/npar.q:98 msgid "NPAR subcommand not currently implemented." msgstr "" @@ -3395,22 +3417,6 @@ msgid "" "not match the number following (%zu)." msgstr "" -#: src/language/stats/npar-summary.c:108 -msgid "Descriptive Statistics" -msgstr "" - -#: src/language/stats/npar-summary.c:145 -msgid "25th" -msgstr "" - -#: src/language/stats/npar-summary.c:148 -msgid "50th (Median)" -msgstr "" - -#: src/language/stats/npar-summary.c:151 -msgid "75th" -msgstr "" - #: src/language/stats/oneway.q:169 msgid "Number of contrast coefficients must equal the number of groups" msgstr "" @@ -3559,7 +3565,7 @@ msgstr "" msgid "Too many variables in INTO clause." msgstr "" -#: src/language/stats/regression.q:167 +#: src/language/stats/regression.q:167 src/ui/gui/regression-dialog.c:42 msgid "R" msgstr "" @@ -4549,7 +4555,7 @@ msgstr "" #: src/ui/gui/crosstabs-dialog.c:54 src/ui/gui/crosstabs-dialog.c:65 #: src/ui/gui/crosstabs-dialog.c:100 src/ui/gui/crosstabs-dialog.c:108 -#: src/ui/gui/psppire-var-store.c:479 src/ui/gui/var-display.c:14 +#: src/ui/gui/psppire-var-store.c:590 src/ui/gui/var-display.c:13 msgid "None" msgstr "" @@ -4586,6 +4592,7 @@ msgid "Format..." msgstr "" #: src/ui/gui/crosstabs.glade:138 src/ui/gui/examine.glade:246 +#: src/ui/gui/regression.glade:31 msgid "Statistics..." msgstr "" @@ -4622,6 +4629,7 @@ msgid "Cell Display" msgstr "" #: src/ui/gui/crosstabs.glade:439 src/ui/gui/oneway.glade:207 +#: src/ui/gui/regression.glade:324 msgid "Statistics" msgstr "" @@ -4629,307 +4637,315 @@ msgstr "" msgid "Style of bevel around the custom entry button" msgstr "" -#: src/ui/gui/data-editor.c:167 +#: src/ui/gui/data-editor.c:150 msgid "Transformations Pending" msgstr "" -#: src/ui/gui/data-editor.c:429 +#: src/ui/gui/data-editor.c:323 msgid "Labels" msgstr "" -#: src/ui/gui/data-editor.c:430 +#: src/ui/gui/data-editor.c:324 msgid "Show/hide value labels" msgstr "" -#: src/ui/gui/data-editor.c:448 src/ui/gui/data-editor.c:465 -#: src/ui/gui/data-editor.c:1923 src/ui/gui/data-editor.c:1976 +#: src/ui/gui/data-editor.c:342 src/ui/gui/data-editor.c:361 +#: src/ui/gui/data-editor.c:1494 src/ui/gui/data-editor.c:1546 msgid "Clear" msgstr "" -#: src/ui/gui/data-editor.c:449 +#: src/ui/gui/data-editor.c:343 msgid "Delete the cases at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:466 +#: src/ui/gui/data-editor.c:362 msgid "Delete the variables at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:480 src/ui/gui/data-editor.c:1920 +#: src/ui/gui/data-editor.c:377 src/ui/gui/data-editor.c:1491 #: src/ui/gui/data-editor.glade:137 src/ui/gui/data-editor.glade:808 msgid "Insert Variable" msgstr "" -#: src/ui/gui/data-editor.c:481 +#: src/ui/gui/data-editor.c:378 msgid "Create a new variable at the current position" msgstr "" -#: src/ui/gui/data-editor.c:499 src/ui/gui/data-editor.c:1973 +#: src/ui/gui/data-editor.c:396 src/ui/gui/data-editor.c:1543 #: src/ui/gui/data-editor.glade:796 msgid "Insert Case" msgstr "" -#: src/ui/gui/data-editor.c:500 +#: src/ui/gui/data-editor.c:397 msgid "Create a new case at the current position" msgstr "" -#: src/ui/gui/data-editor.c:520 +#: src/ui/gui/data-editor.c:417 msgid "Goto Case" msgstr "" -#: src/ui/gui/data-editor.c:521 +#: src/ui/gui/data-editor.c:418 msgid "Jump to a Case in the Data Sheet" msgstr "" -#: src/ui/gui/data-editor.c:540 +#: src/ui/gui/data-editor.c:437 msgid "Weights" msgstr "" -#: src/ui/gui/data-editor.c:541 +#: src/ui/gui/data-editor.c:438 msgid "Weight cases by variable" msgstr "" -#: src/ui/gui/data-editor.c:550 src/ui/gui/data-editor.glade:312 +#: src/ui/gui/data-editor.c:447 src/ui/gui/data-editor.glade:312 msgid "Transpose" msgstr "" -#: src/ui/gui/data-editor.c:551 +#: src/ui/gui/data-editor.c:448 msgid "Transpose the cases with the variables" msgstr "" -#: src/ui/gui/data-editor.c:562 +#: src/ui/gui/data-editor.c:459 msgid "Split" msgstr "" -#: src/ui/gui/data-editor.c:563 +#: src/ui/gui/data-editor.c:460 msgid "Split the active file" msgstr "" -#: src/ui/gui/data-editor.c:573 +#: src/ui/gui/data-editor.c:470 msgid "Sort" msgstr "" -#: src/ui/gui/data-editor.c:574 +#: src/ui/gui/data-editor.c:471 msgid "Sort cases in the active file" msgstr "" -#: src/ui/gui/data-editor.c:582 src/ui/gui/data-editor.glade:347 +#: src/ui/gui/data-editor.c:479 src/ui/gui/data-editor.glade:347 #: src/ui/gui/data-editor.glade:851 msgid "Select Cases" msgstr "" -#: src/ui/gui/data-editor.c:583 +#: src/ui/gui/data-editor.c:480 msgid "Select cases from the active file" msgstr "" -#: src/ui/gui/data-editor.c:592 +#: src/ui/gui/data-editor.c:489 msgid "Compute" msgstr "" -#: src/ui/gui/data-editor.c:593 +#: src/ui/gui/data-editor.c:490 msgid "Compute new values for a variable" msgstr "" -#: src/ui/gui/data-editor.c:601 +#: src/ui/gui/data-editor.c:498 msgid "Oneway _ANOVA" msgstr "" -#: src/ui/gui/data-editor.c:602 +#: src/ui/gui/data-editor.c:499 msgid "Perform one way analysis of variance" msgstr "" -#: src/ui/gui/data-editor.c:610 src/ui/gui/data-editor.glade:503 +#: src/ui/gui/data-editor.c:507 src/ui/gui/data-editor.glade:503 msgid "_Independent Samples T Test" msgstr "" -#: src/ui/gui/data-editor.c:611 +#: src/ui/gui/data-editor.c:508 msgid "Calculate T Test for samples from independent groups" msgstr "" -#: src/ui/gui/data-editor.c:620 src/ui/gui/data-editor.glade:511 +#: src/ui/gui/data-editor.c:517 src/ui/gui/data-editor.glade:511 msgid "_Paired Samples T Test" msgstr "" -#: src/ui/gui/data-editor.c:621 +#: src/ui/gui/data-editor.c:518 msgid "Calculate T Test for paired samples" msgstr "" -#: src/ui/gui/data-editor.c:630 +#: src/ui/gui/data-editor.c:527 msgid "One _Sample T Test" msgstr "" -#: src/ui/gui/data-editor.c:631 +#: src/ui/gui/data-editor.c:528 msgid "Calculate T Test for sample from a single distribution" msgstr "" -#: src/ui/gui/data-editor.c:640 +#: src/ui/gui/data-editor.c:537 msgid "Data File Comments" msgstr "" -#: src/ui/gui/data-editor.c:641 +#: src/ui/gui/data-editor.c:538 msgid "Commentary text for the data file" msgstr "" -#: src/ui/gui/data-editor.c:649 src/ui/gui/data-editor.glade:776 +#: src/ui/gui/data-editor.c:546 src/ui/gui/data-editor.glade:776 msgid "Find" msgstr "" -#: src/ui/gui/data-editor.c:650 +#: src/ui/gui/data-editor.c:547 msgid "Find Case" msgstr "" -#: src/ui/gui/data-editor.c:659 src/ui/gui/data-editor.glade:384 +#: src/ui/gui/data-editor.c:556 src/ui/gui/data-editor.glade:384 msgid "Ran_k Cases" msgstr "" -#: src/ui/gui/data-editor.c:660 +#: src/ui/gui/data-editor.c:557 msgid "Rank Cases" msgstr "" -#: src/ui/gui/data-editor.c:669 src/ui/gui/data-editor.glade:396 +#: src/ui/gui/data-editor.c:566 src/ui/gui/data-editor.glade:396 msgid "Recode into _Same Variables" msgstr "" -#: src/ui/gui/data-editor.c:670 +#: src/ui/gui/data-editor.c:567 msgid "Recode values into the same Variables" msgstr "" -#: src/ui/gui/data-editor.c:679 src/ui/gui/data-editor.glade:403 +#: src/ui/gui/data-editor.c:576 src/ui/gui/data-editor.glade:403 msgid "Recode into _Different Variables" msgstr "" -#: src/ui/gui/data-editor.c:680 +#: src/ui/gui/data-editor.c:577 msgid "Recode values into different Variables" msgstr "" -#: src/ui/gui/data-editor.c:689 src/ui/gui/data-editor.glade:286 +#: src/ui/gui/data-editor.c:586 src/ui/gui/data-editor.glade:286 #: src/ui/gui/data-editor.glade:755 msgid "Variables" msgstr "" -#: src/ui/gui/data-editor.c:690 +#: src/ui/gui/data-editor.c:587 msgid "Jump to Variable" msgstr "" -#: src/ui/gui/data-editor.c:698 src/ui/gui/data-editor.glade:457 +#: src/ui/gui/data-editor.c:595 src/ui/gui/data-editor.glade:457 #: src/ui/gui/oneway.glade:179 msgid "_Descriptives" msgstr "" -#: src/ui/gui/data-editor.c:699 +#: src/ui/gui/data-editor.c:596 msgid "Calculate descriptive statistics (mean, variance, ...)" msgstr "" -#: src/ui/gui/data-editor.c:708 src/ui/gui/data-editor.glade:449 +#: src/ui/gui/data-editor.c:605 src/ui/gui/data-editor.glade:449 msgid "_Frequencies" msgstr "" -#: src/ui/gui/data-editor.c:709 +#: src/ui/gui/data-editor.c:606 msgid "Generate frequency statistics" msgstr "" -#: src/ui/gui/data-editor.c:717 src/ui/gui/data-editor.glade:473 +#: src/ui/gui/data-editor.c:614 src/ui/gui/data-editor.glade:473 msgid "_Crosstabs" msgstr "" -#: src/ui/gui/data-editor.c:718 +#: src/ui/gui/data-editor.c:615 msgid "Generate crosstabulations" msgstr "" -#: src/ui/gui/data-editor.c:727 src/ui/gui/data-editor.glade:465 +#: src/ui/gui/data-editor.c:624 src/ui/gui/data-editor.glade:465 msgid "_Explore" msgstr "" -#: src/ui/gui/data-editor.c:728 +#: src/ui/gui/data-editor.c:625 msgid "Examine Data by Factors" msgstr "" -#: src/ui/gui/data-editor.c:1188 +#: src/ui/gui/data-editor.c:634 src/ui/gui/data-editor.glade:539 +msgid "Linear _Regression" +msgstr "" + +#: src/ui/gui/data-editor.c:635 +msgid "Estimate parameters of the linear model" +msgstr "" + +#: src/ui/gui/data-editor.c:1022 msgid "Font Selection" msgstr "" -#: src/ui/gui/data-editor.c:1397 +#: src/ui/gui/data-editor.c:1094 msgid "No Split" msgstr "" -#: src/ui/gui/data-editor.c:1406 +#: src/ui/gui/data-editor.c:1103 msgid "Split by " msgstr "" -#: src/ui/gui/data-editor.c:1431 +#: src/ui/gui/data-editor.c:1128 msgid "Filter off" msgstr "" -#: src/ui/gui/data-editor.c:1444 +#: src/ui/gui/data-editor.c:1140 #, c-format msgid "Filter by %s" msgstr "" -#: src/ui/gui/data-editor.c:1462 +#: src/ui/gui/data-editor.c:1158 msgid "Weights off" msgstr "" -#: src/ui/gui/data-editor.c:1475 +#: src/ui/gui/data-editor.c:1170 #, c-format msgid "Weight by %s" msgstr "" -#: src/ui/gui/data-editor.c:1498 src/ui/gui/data-editor.c:1732 +#: src/ui/gui/data-editor.c:1193 src/ui/gui/data-editor.c:1427 #: src/ui/gui/data-editor.glade:667 msgid "Open" msgstr "" -#: src/ui/gui/data-editor.c:1499 +#: src/ui/gui/data-editor.c:1194 msgid "Open a data file" msgstr "" -#: src/ui/gui/data-editor.c:1507 src/ui/gui/data-editor.c:1614 +#: src/ui/gui/data-editor.c:1202 src/ui/gui/data-editor.c:1309 #: src/ui/gui/data-editor.glade:677 msgid "Save" msgstr "" -#: src/ui/gui/data-editor.c:1508 src/ui/gui/data-editor.c:1518 +#: src/ui/gui/data-editor.c:1203 src/ui/gui/data-editor.c:1213 msgid "Save data to file" msgstr "" -#: src/ui/gui/data-editor.c:1517 +#: src/ui/gui/data-editor.c:1212 msgid "Save As" msgstr "" -#: src/ui/gui/data-editor.c:1526 src/ui/gui/recode-dialog.c:930 -#: src/ui/gui/recode-dialog.c:1025 +#: src/ui/gui/data-editor.c:1221 src/ui/gui/recode-dialog.c:929 +#: src/ui/gui/recode-dialog.c:1024 msgid "New" msgstr "" -#: src/ui/gui/data-editor.c:1527 +#: src/ui/gui/data-editor.c:1222 msgid "New data file" msgstr "" -#: src/ui/gui/data-editor.c:1622 src/ui/gui/data-editor.c:1740 +#: src/ui/gui/data-editor.c:1317 src/ui/gui/data-editor.c:1435 msgid "System Files (*.sav)" msgstr "" -#: src/ui/gui/data-editor.c:1628 src/ui/gui/data-editor.c:1746 +#: src/ui/gui/data-editor.c:1323 src/ui/gui/data-editor.c:1441 msgid "Portable Files (*.por) " msgstr "" -#: src/ui/gui/data-editor.c:1634 src/ui/gui/data-editor.c:1752 +#: src/ui/gui/data-editor.c:1329 src/ui/gui/data-editor.c:1447 #: src/ui/gui/syntax-editor.c:138 src/ui/gui/syntax-editor.c:522 msgid "All Files" msgstr "" -#: src/ui/gui/data-editor.c:1642 +#: src/ui/gui/data-editor.c:1337 msgid "System File" msgstr "" -#: src/ui/gui/data-editor.c:1647 +#: src/ui/gui/data-editor.c:1342 msgid "Portable File" msgstr "" -#: src/ui/gui/data-editor.c:1913 +#: src/ui/gui/data-editor.c:1485 msgid "Sort Ascending" msgstr "" -#: src/ui/gui/data-editor.c:1916 +#: src/ui/gui/data-editor.c:1488 msgid "Sort Descending" msgstr "" @@ -5003,7 +5019,7 @@ msgid "Grid Lines" msgstr "" #: src/ui/gui/data-editor.glade:267 src/ui/gui/data-editor.glade:871 -#: src/ui/gui/data-editor.glade:1566 src/ui/gui/data-editor.glade:1747 +#: src/ui/gui/data-editor.glade:1459 src/ui/gui/data-editor.glade:1640 msgid "Value Labels" msgstr "" @@ -5067,10 +5083,6 @@ msgstr "" msgid "Bivariate _Correlation" msgstr "" -#: src/ui/gui/data-editor.glade:539 -msgid "Linear _Regression" -msgstr "" - #: src/ui/gui/data-editor.glade:547 msgid "_Non-Parametric Statistics" msgstr "" @@ -5140,121 +5152,113 @@ msgstr "" msgid "Use Sets" msgstr "" -#: src/ui/gui/data-editor.glade:964 -msgid "Data View" -msgstr "" - -#: src/ui/gui/data-editor.glade:991 -msgid "Variable View" -msgstr "" - -#: src/ui/gui/data-editor.glade:1021 +#: src/ui/gui/data-editor.glade:914 msgid "Information Area" msgstr "" -#: src/ui/gui/data-editor.glade:1040 +#: src/ui/gui/data-editor.glade:933 msgid "Processor Area" msgstr "" -#: src/ui/gui/data-editor.glade:1065 +#: src/ui/gui/data-editor.glade:958 msgid "Case Counter Area" msgstr "" -#: src/ui/gui/data-editor.glade:1090 +#: src/ui/gui/data-editor.glade:983 msgid "Filter Use Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1116 +#: src/ui/gui/data-editor.glade:1009 msgid "Weight Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1142 +#: src/ui/gui/data-editor.glade:1035 msgid "Split File Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1172 +#: src/ui/gui/data-editor.glade:1065 msgid "Variable Type" msgstr "" -#: src/ui/gui/data-editor.glade:1208 src/ui/gui/psppire-var-store.c:487 +#: src/ui/gui/data-editor.glade:1101 src/ui/gui/psppire-var-store.c:598 msgid "Comma" msgstr "" -#: src/ui/gui/data-editor.glade:1224 src/ui/gui/psppire-var-store.c:488 +#: src/ui/gui/data-editor.glade:1117 src/ui/gui/psppire-var-store.c:599 msgid "Dot" msgstr "" -#: src/ui/gui/data-editor.glade:1240 +#: src/ui/gui/data-editor.glade:1133 msgid "Scientific notation" msgstr "" -#: src/ui/gui/data-editor.glade:1256 src/ui/gui/psppire-var-store.c:490 +#: src/ui/gui/data-editor.glade:1149 src/ui/gui/psppire-var-store.c:601 msgid "Date" msgstr "" -#: src/ui/gui/data-editor.glade:1272 src/ui/gui/psppire-var-store.c:491 +#: src/ui/gui/data-editor.glade:1165 src/ui/gui/psppire-var-store.c:602 msgid "Dollar" msgstr "" -#: src/ui/gui/data-editor.glade:1288 +#: src/ui/gui/data-editor.glade:1181 msgid "Custom currency" msgstr "" -#: src/ui/gui/data-editor.glade:1382 +#: src/ui/gui/data-editor.glade:1275 msgid "positive" msgstr "" -#: src/ui/gui/data-editor.glade:1388 +#: src/ui/gui/data-editor.glade:1281 msgid "negative" msgstr "" -#: src/ui/gui/data-editor.glade:1401 +#: src/ui/gui/data-editor.glade:1294 msgid "Sample" msgstr "" -#: src/ui/gui/data-editor.glade:1451 +#: src/ui/gui/data-editor.glade:1344 msgid "Width:" msgstr "" -#: src/ui/gui/data-editor.glade:1495 +#: src/ui/gui/data-editor.glade:1388 msgid "Decimal Places:" msgstr "" -#: src/ui/gui/data-editor.glade:1664 +#: src/ui/gui/data-editor.glade:1557 msgid "Value Label:" msgstr "" -#: src/ui/gui/data-editor.glade:1677 src/ui/gui/psppire.glade:2544 +#: src/ui/gui/data-editor.glade:1570 src/ui/gui/psppire.glade:2544 #: src/ui/gui/recode.glade:185 msgid "Value:" msgstr "" -#: src/ui/gui/data-editor.glade:1814 src/ui/gui/examine.glade:423 +#: src/ui/gui/data-editor.glade:1707 src/ui/gui/examine.glade:423 #: src/ui/gui/t-test.glade:460 msgid "Missing Values" msgstr "" -#: src/ui/gui/data-editor.glade:1832 +#: src/ui/gui/data-editor.glade:1725 msgid "_Range plus one optional discrete missing value" msgstr "" -#: src/ui/gui/data-editor.glade:1857 +#: src/ui/gui/data-editor.glade:1750 msgid "_Low:" msgstr "" -#: src/ui/gui/data-editor.glade:1886 +#: src/ui/gui/data-editor.glade:1779 msgid "_High:" msgstr "" -#: src/ui/gui/data-editor.glade:1927 +#: src/ui/gui/data-editor.glade:1820 msgid "Di_screte value:" msgstr "" -#: src/ui/gui/data-editor.glade:1974 +#: src/ui/gui/data-editor.glade:1867 msgid "_No missing values" msgstr "" -#: src/ui/gui/data-editor.glade:1992 +#: src/ui/gui/data-editor.glade:1885 msgid "_Discrete missing values" msgstr "" @@ -5456,7 +5460,7 @@ msgstr "" msgid "Incorrect range specification" msgstr "" -#: src/ui/gui/oneway-anova-dialog.c:339 +#: src/ui/gui/oneway-anova-dialog.c:336 #, c-format msgid "Contrast %d of %d" msgstr "" @@ -5545,23 +5549,69 @@ msgstr "" msgid "Paste" msgstr "" -#: src/ui/gui/psppire.c:197 -msgid "_Reset" +#: src/ui/gui/psppire-data-editor.c:604 +msgid "Data View" msgstr "" -#: src/ui/gui/psppire.c:198 -msgid "_Select" +#: src/ui/gui/psppire-data-editor.c:607 +msgid "Variable View" msgstr "" #: src/ui/gui/psppire-data-store.c:827 msgid "var" msgstr "" -#: src/ui/gui/psppire-data-store.c:948 src/ui/gui/psppire-var-store.c:728 +#: src/ui/gui/psppire-data-store.c:948 src/ui/gui/psppire-var-store.c:839 #, c-format msgid "%ld" msgstr "" +#: src/ui/gui/psppire-var-sheet.c:96 +msgid "Name" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:98 src/ui/gui/psppire.glade:2187 +msgid "Width" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:99 +msgid "Decimals" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:101 +msgid "Values" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:104 +msgid "Align" +msgstr "" + +#: src/ui/gui/psppire-var-sheet.c:105 +msgid "Measure" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:600 +msgid "Scientific" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:603 +msgid "Custom" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:674 src/ui/gui/psppire-var-store.c:684 +#: src/ui/gui/psppire-var-store.c:694 +#, c-format +msgid "%d" +msgstr "" + +#: src/ui/gui/psppire.c:195 +msgid "_Reset" +msgstr "" + +#: src/ui/gui/psppire.c:196 +msgid "_Select" +msgstr "" + #: src/ui/gui/psppire.glade:11 msgid "This is pre-alpha software. Use at your own risk." msgstr "" @@ -5746,10 +5796,6 @@ msgstr "" msgid "Use expression as label" msgstr "" -#: src/ui/gui/psppire.glade:2187 src/ui/gui/var-sheet.c:67 -msgid "Width" -msgstr "" - #: src/ui/gui/psppire.glade:2274 msgid "Goto Case Number:" msgstr "" @@ -5782,20 +5828,6 @@ msgstr "" msgid "Search backward" msgstr "" -#: src/ui/gui/psppire-var-store.c:489 -msgid "Scientific" -msgstr "" - -#: src/ui/gui/psppire-var-store.c:492 -msgid "Custom" -msgstr "" - -#: src/ui/gui/psppire-var-store.c:563 src/ui/gui/psppire-var-store.c:573 -#: src/ui/gui/psppire-var-store.c:583 -#, c-format -msgid "%d" -msgstr "" - #: src/ui/gui/rank.glade:111 msgid "By:" msgstr "" @@ -5876,43 +5908,43 @@ msgstr "" msgid "Proportion Estimation Formula" msgstr "" -#: src/ui/gui/rank.glade:615 +#: src/ui/gui/rank.glade:614 msgid "_Mean" msgstr "" -#: src/ui/gui/rank.glade:627 +#: src/ui/gui/rank.glade:626 msgid "_Low" msgstr "" -#: src/ui/gui/rank.glade:643 +#: src/ui/gui/rank.glade:642 msgid "_High" msgstr "" -#: src/ui/gui/rank.glade:661 +#: src/ui/gui/rank.glade:660 msgid "_Sequential ranks to unique values" msgstr "" -#: src/ui/gui/rank.glade:681 +#: src/ui/gui/rank.glade:680 msgid "Rank Assigned to Ties" msgstr "" -#: src/ui/gui/recode-dialog.c:881 +#: src/ui/gui/recode-dialog.c:880 msgid "Recode into Different Variables" msgstr "" -#: src/ui/gui/recode-dialog.c:884 +#: src/ui/gui/recode-dialog.c:883 msgid "Recode into Same Variables" msgstr "" -#: src/ui/gui/recode-dialog.c:915 src/ui/gui/recode-dialog.c:1017 +#: src/ui/gui/recode-dialog.c:914 src/ui/gui/recode-dialog.c:1016 msgid "Old" msgstr "" -#: src/ui/gui/recode-dialog.c:1276 +#: src/ui/gui/recode-dialog.c:1275 msgid "Recode into Different Variables: Old and New Values " msgstr "" -#: src/ui/gui/recode-dialog.c:1277 +#: src/ui/gui/recode-dialog.c:1276 msgid "Recode into Same Variables: Old and New Values" msgstr "" @@ -5996,6 +6028,38 @@ msgstr "" msgid "Old and New Values" msgstr "" +#: src/ui/gui/regression-dialog.c:41 +msgid "Coeff" +msgstr "" + +#: src/ui/gui/regression-dialog.c:43 +msgid "Anova" +msgstr "" + +#: src/ui/gui/regression-dialog.c:44 +msgid "Bcov" +msgstr "" + +#: src/ui/gui/regression.glade:41 +msgid "Save..." +msgstr "" + +#: src/ui/gui/regression.glade:145 +msgid "Dependent" +msgstr "" + +#: src/ui/gui/regression.glade:193 +msgid "Independent" +msgstr "" + +#: src/ui/gui/regression.glade:243 +msgid "Predicted values" +msgstr "" + +#: src/ui/gui/regression.glade:253 +msgid "Residuals" +msgstr "" + #: src/ui/gui/select-cases-dialog.c:85 #, c-format msgid "Approximately %3d%% of all cases." @@ -6052,6 +6116,19 @@ msgstr "" msgid "To End" msgstr "" +#: src/ui/gui/t-test-options.c:60 +#, c-format +msgid "Confidence Interval: %2d %%" +msgstr "" + +#: src/ui/gui/t-test-paired-samples.c:229 +msgid "Var 1" +msgstr "" + +#: src/ui/gui/t-test-paired-samples.c:230 +msgid "Var 2" +msgstr "" + #: src/ui/gui/t-test.glade:56 src/ui/gui/t-test.glade:165 msgid "Define Groups" msgstr "" @@ -6089,19 +6166,6 @@ msgstr "" msgid "Test Value: " msgstr "" -#: src/ui/gui/t-test-options.c:60 -#, c-format -msgid "Confidence Interval: %2d %%" -msgstr "" - -#: src/ui/gui/t-test-paired-samples.c:232 -msgid "Var 1" -msgstr "" - -#: src/ui/gui/t-test-paired-samples.c:233 -msgid "Var 2" -msgstr "" - #: src/ui/gui/variable-info-dialog.c:88 #, c-format msgid "Label: %s\n" @@ -6131,26 +6195,6 @@ msgstr "" msgid "%s %s\n" msgstr "" -#: src/ui/gui/var-sheet.c:65 -msgid "Name" -msgstr "" - -#: src/ui/gui/var-sheet.c:68 -msgid "Decimals" -msgstr "" - -#: src/ui/gui/var-sheet.c:70 -msgid "Values" -msgstr "" - -#: src/ui/gui/var-sheet.c:73 -msgid "Align" -msgstr "" - -#: src/ui/gui/var-sheet.c:74 -msgid "Measure" -msgstr "" - #: src/ui/gui/weight-cases-dialog.c:88 #, c-format msgid "Weight cases by %s" diff --git a/src/ui/gui/ChangeLog b/src/ui/gui/ChangeLog index 933bcb62..580971cb 100644 --- a/src/ui/gui/ChangeLog +++ b/src/ui/gui/ChangeLog @@ -1,3 +1,28 @@ +2008-02-29 John Darrington + + * psppire-data-editor.c psppire-data-editor.h: New files. Contains functionality + previously scattered thoughout data-editor.c and elsewhere. + + * data-editor.c data-editor.h: Abstracted the variable sheet, the data sheet and + their containing GtkNotebook into a new Object. + + * data-sheet.c data-sheet.h: Deleted. + + * var-sheet.c var-sheet.h: Deleted. Moved to psppire-var-sheet.[ch] + + * psppire-var-sheet.c psppire-var-sheet.h: New files. + + * clipboard.c clipboard.h: Deleted. Moved to psppire-data-editor.c + + * psppire-var-store.c psppire-var-store.h: Updated symbols to avoid name clashes. + + * comments-dialog.c compute-dialog.c crosstabs-dialog.c descriptives-dialog.c + examine-dialog.c find-dialog.c frequencies-dialog.c goto-case-dialog.c + oneway-anova-dialog.c rank-dialog.c recode-dialog.c select-cases-dialog.c + sort-cases-dialog.c split-file-dialog.c t-test-independent-samples-dialog.c + transpose-dialog.c variable-info-dialog.c weight-cases-dialog.c t-test-one-sample.c + t-test-paired-samples.c: Updated dialogs to match above changes. + 2008-02-27 Jason Stover * regression-dialog.c: New file. diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 7dce4ad2..b28f259b 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -10,7 +10,7 @@ src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) $(GLADE_CFLAGS) -Wall \ src_ui_gui_psppire_LDFLAGS = \ $(PG_LDFLAGS) \ - -export-dynamic + -export-dynamic if RELOCATABLE_VIA_LD @@ -84,8 +84,6 @@ dist_src_ui_gui_psppire_DATA = \ src_ui_gui_psppire_SOURCES = \ src/ui/gui/about.c \ src/ui/gui/about.h \ - src/ui/gui/clipboard.c \ - src/ui/gui/clipboard.h \ src/ui/gui/checkbox-treeview.c \ src/ui/gui/checkbox-treeview.h \ src/ui/gui/compute-dialog.c \ @@ -100,8 +98,6 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/frequencies-dialog.h \ src/ui/gui/goto-case-dialog.c \ src/ui/gui/goto-case-dialog.h \ - src/ui/gui/data-sheet.c \ - src/ui/gui/data-sheet.h \ src/ui/gui/data-editor.c \ src/ui/gui/data-editor.h \ src/ui/gui/descriptives-dialog.c \ @@ -137,6 +133,8 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/psppire-vbuttonbox.h \ src/ui/gui/psppire-case-file.c \ src/ui/gui/psppire-case-file.h \ + src/ui/gui/psppire-data-editor.c \ + src/ui/gui/psppire-data-editor.h \ src/ui/gui/psppire-data-store.c \ src/ui/gui/psppire-data-store.h \ src/ui/gui/psppire-dialog.c \ @@ -149,6 +147,8 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/psppire-selector.h \ src/ui/gui/psppire-var-ptr.c \ src/ui/gui/psppire-var-ptr.h \ + src/ui/gui/psppire-var-sheet.c \ + src/ui/gui/psppire-var-sheet.h \ src/ui/gui/psppire-var-store.c \ src/ui/gui/psppire-var-store.h \ src/ui/gui/rank-dialog.c \ @@ -181,8 +181,6 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/val-labs-dialog.h \ src/ui/gui/var-display.c \ src/ui/gui/var-display.h \ - src/ui/gui/var-sheet.c \ - src/ui/gui/var-sheet.h \ src/ui/gui/var-type-dialog.c \ src/ui/gui/var-type-dialog.h \ src/ui/gui/variable-info-dialog.c \ diff --git a/src/ui/gui/clipboard.c b/src/ui/gui/clipboard.c deleted file mode 100644 index 21438619..00000000 --- a/src/ui/gui/clipboard.c +++ /dev/null @@ -1,380 +0,0 @@ -/* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include - -#include -#include "clipboard.h" -#include -#include "psppire-data-store.h" -#include -#include -#include -#include -#include -#include "helper.h" -#include -#include "data-editor.h" - -#include "xalloc.h" - -/* A casereader and dictionary holding the data currently in the clip */ -static struct casereader *clip_datasheet = NULL; -static struct dictionary *clip_dict = NULL; - - - - -static void data_sheet_update_clipboard (GtkSheet *); - -/* Set the clip according to the currently - selected range in the data sheet */ -void -data_sheet_set_clip (GtkSheet *sheet) -{ - int i; - struct casewriter *writer ; - GtkSheetRange range; - PsppireDataStore *ds; - struct case_map *map = NULL; - casenumber max_rows; - size_t max_columns; - - ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); - - gtk_sheet_get_selected_range (sheet, &range); - - /* If nothing selected, then use active cell */ - if ( range.row0 < 0 || range.col0 < 0 ) - { - gint row, col; - gtk_sheet_get_active_cell (sheet, &row, &col); - - range.row0 = range.rowi = row; - range.col0 = range.coli = col; - } - - /* The sheet range can include cells that do not include data. - Exclude them from the range. */ - max_rows = psppire_data_store_get_case_count (ds); - if (range.rowi >= max_rows) - { - if (max_rows == 0) - return; - range.rowi = max_rows - 1; - } - max_columns = dict_get_var_cnt (ds->dict->dict); - if (range.coli >= max_columns) - { - if (max_columns == 0) - return; - range.coli = max_columns - 1; - } - - g_return_if_fail (range.rowi >= range.row0); - g_return_if_fail (range.row0 >= 0); - g_return_if_fail (range.coli >= range.col0); - g_return_if_fail (range.col0 >= 0); - - /* Destroy any existing clip */ - if ( clip_datasheet ) - { - casereader_destroy (clip_datasheet); - clip_datasheet = NULL; - } - - if ( clip_dict ) - { - dict_destroy (clip_dict); - clip_dict = NULL; - } - - /* Construct clip dictionary. */ - clip_dict = dict_create (); - for (i = range.col0; i <= range.coli; i++) - { - const struct variable *old = dict_get_var (ds->dict->dict, i); - dict_clone_var_assert (clip_dict, old, var_get_name (old)); - } - - /* Construct clip data. */ - map = case_map_by_name (ds->dict->dict, clip_dict); - writer = autopaging_writer_create (dict_get_next_value_idx (clip_dict)); - for (i = range.row0; i <= range.rowi ; ++i ) - { - struct ccase old; - - if (psppire_case_file_get_case (ds->case_file, i, &old)) - { - struct ccase new; - - case_map_execute (map, &old, &new); - case_destroy (&old); - casewriter_write (writer, &new); - } - else - casewriter_force_error (writer); - } - case_map_destroy (map); - - clip_datasheet = casewriter_make_reader (writer); - - data_sheet_update_clipboard (sheet); -} - -enum { - SELECT_FMT_NULL, - SELECT_FMT_TEXT, - SELECT_FMT_HTML -}; - - -/* Perform data_out for case CC, variable V, appending to STRING */ -static void -data_out_g_string (GString *string, const struct variable *v, - const struct ccase *cc) -{ - char *buf ; - - const struct fmt_spec *fs = var_get_print_format (v); - const union value *val = case_data (cc, v); - buf = xzalloc (fs->w); - - data_out (val, fs, buf); - - g_string_append_len (string, buf, fs->w); - - g_free (buf); -} - -static GString * -clip_to_text (void) -{ - casenumber r; - GString *string; - - const size_t val_cnt = casereader_get_value_cnt (clip_datasheet); - const casenumber case_cnt = casereader_get_case_cnt (clip_datasheet); - const size_t var_cnt = dict_get_var_cnt (clip_dict); - - string = g_string_sized_new (10 * val_cnt * case_cnt); - - for (r = 0 ; r < case_cnt ; ++r ) - { - int c; - struct ccase cc; - if ( ! casereader_peek (clip_datasheet, r, &cc)) - { - g_warning ("Clipboard seems to have inexplicably shrunk"); - break; - } - - for (c = 0 ; c < var_cnt ; ++c) - { - const struct variable *v = dict_get_var (clip_dict, c); - data_out_g_string (string, v, &cc); - if ( c < val_cnt - 1 ) - g_string_append (string, "\t"); - } - - if ( r < case_cnt) - g_string_append (string, "\n"); - - case_destroy (&cc); - } - - return string; -} - - -static GString * -clip_to_html (void) -{ - casenumber r; - GString *string; - - const size_t val_cnt = casereader_get_value_cnt (clip_datasheet); - const casenumber case_cnt = casereader_get_case_cnt (clip_datasheet); - const size_t var_cnt = dict_get_var_cnt (clip_dict); - - - /* Guestimate the size needed */ - string = g_string_sized_new (20 * val_cnt * case_cnt); - - g_string_append (string, "\n"); - for (r = 0 ; r < case_cnt ; ++r ) - { - int c; - struct ccase cc; - if ( ! casereader_peek (clip_datasheet, r, &cc)) - { - g_warning ("Clipboard seems to have inexplicably shrunk"); - break; - } - g_string_append (string, "\n"); - - for (c = 0 ; c < var_cnt ; ++c) - { - const struct variable *v = dict_get_var (clip_dict, c); - g_string_append (string, "\n"); - } - - g_string_append (string, "\n"); - - case_destroy (&cc); - } - g_string_append (string, "
"); - data_out_g_string (string, v, &cc); - g_string_append (string, "
\n"); - - return string; -} - - - -static void -clipboard_get_cb (GtkClipboard *clipboard, - GtkSelectionData *selection_data, - guint info, - gpointer data) -{ - GString *string = NULL; - - switch (info) - { - case SELECT_FMT_TEXT: - string = clip_to_text (); - break; - case SELECT_FMT_HTML: - string = clip_to_html (); - break; - default: - g_assert_not_reached (); - } - - gtk_selection_data_set (selection_data, selection_data->target, - 8, - (const guchar *) string->str, string->len); - - g_string_free (string, TRUE); -} - -static void -clipboard_clear_cb (GtkClipboard *clipboard, - gpointer data) -{ - dict_destroy (clip_dict); - clip_dict = NULL; - - casereader_destroy (clip_datasheet); - clip_datasheet = NULL; -} - - - -static void -data_sheet_update_clipboard (GtkSheet *sheet) -{ - static const GtkTargetEntry targets[] = { - { "UTF8_STRING", 0, SELECT_FMT_TEXT }, - { "STRING", 0, SELECT_FMT_TEXT }, - { "TEXT", 0, SELECT_FMT_TEXT }, - { "COMPOUND_TEXT", 0, SELECT_FMT_TEXT }, - { "text/plain;charset=utf-8", 0, SELECT_FMT_TEXT }, - { "text/plain", 0, SELECT_FMT_TEXT }, - { "text/html", 0, SELECT_FMT_HTML } - }; - - GtkClipboard *clipboard = - gtk_widget_get_clipboard (GTK_WIDGET (sheet), - GDK_SELECTION_CLIPBOARD); - - if (!gtk_clipboard_set_with_owner (clipboard, targets, - G_N_ELEMENTS (targets), - clipboard_get_cb, clipboard_clear_cb, - G_OBJECT (sheet))) - clipboard_clear_cb (clipboard, sheet); -} - - - -/* A callback for when clipboard contents have been received */ -void -data_sheet_contents_received_callback (GtkClipboard *clipboard, - GtkSelectionData *sd, - gpointer data) -{ - struct data_editor *de = data; - - gint count = 0; - gint row, column; - gint next_row, next_column; - gint first_column; - char *c; - GtkSheet *data_sheet ; - PsppireDataStore *data_store; - - if ( sd->length < 0 ) - return; - - if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE)) - return; - - c = (char *) sd->data; - - /* Paste text to selected position */ - data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); - - gtk_sheet_get_active_cell (data_sheet, &row, &column); - - g_return_if_fail (row >= 0); - g_return_if_fail (column >= 0); - - first_column = column; - next_row = row; - next_column = column; - while (count < sd->length) - { - char *s = c; - - row = next_row; - column = next_column; - while (*c != '\t' && *c != '\n' && count < sd->length) - { - c++; - count++; - } - if ( *c == '\t') - { - next_row = row ; - next_column = column + 1; - } - else if ( *c == '\n') - { - next_row = row + 1; - next_column = first_column; - } - *c++ = '\0'; - count++; - - /* Append some new cases if pasting beyond the last row */ - if ( row >= psppire_data_store_get_case_count (data_store)) - psppire_data_store_insert_new_case (data_store, row); - - gtk_sheet_set_cell_text (data_sheet, row, column, s); - } -} diff --git a/src/ui/gui/clipboard.h b/src/ui/gui/clipboard.h deleted file mode 100644 index 6f312fa7..00000000 --- a/src/ui/gui/clipboard.h +++ /dev/null @@ -1,31 +0,0 @@ -/* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007 Free Software Foundation - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - -#include - -#ifndef CLIPBOARD_H -#define CLIPBOARD_H - - -void data_sheet_set_clip (GtkSheet *data_sheet); - -void data_sheet_contents_received_callback (GtkClipboard *clipboard, - GtkSelectionData *sd, - gpointer data); - - -#endif /* CLIPBOARD_H */ - diff --git a/src/ui/gui/comments-dialog.c b/src/ui/gui/comments-dialog.c index 8e017a22..e4304db4 100644 --- a/src/ui/gui/comments-dialog.c +++ b/src/ui/gui/comments-dialog.c @@ -106,10 +106,9 @@ comments_dialog (GObject *o, gpointer data) GtkWidget *label = get_widget_assert (xml, "column-number-label"); GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); diff --git a/src/ui/gui/compute-dialog.c b/src/ui/gui/compute-dialog.c index 9eafc2c2..c8ee114e 100644 --- a/src/ui/gui/compute-dialog.c +++ b/src/ui/gui/compute-dialog.c @@ -368,7 +368,7 @@ compute_dialog (GObject *o, gpointer data) gint response; struct data_editor *de = data; - PsppireVarStore *vs; + PsppireVarStore *vs = NULL; struct compute_dialog scd; GladeXML *xml = XML_NEW ("psppire.glade"); @@ -388,12 +388,7 @@ compute_dialog (GObject *o, gpointer data) get_widget_assert (xml, "radio-button-expression-label"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); - - + g_object_get (de->data_editor, "var-store", &vs, NULL); scd.dict = vs->dict; scd.use_type = FALSE; @@ -480,9 +475,9 @@ compute_dialog (GObject *o, gpointer data) enum { - COL_NAME, - COL_USAGE, - COL_ARITY + COMPUTE_COL_NAME, + COMPUTE_COL_USAGE, + COMPUTE_COL_ARITY }; @@ -504,9 +499,9 @@ function_list_populate (GtkTreeView *tv) gtk_list_store_append (liststore, &iter); gtk_list_store_set (liststore, &iter, - COL_NAME, expr_operation_get_name (op), - COL_USAGE, expr_operation_get_prototype (op), - COL_ARITY, expr_operation_get_arg_cnt (op), + COMPUTE_COL_NAME, expr_operation_get_name (op), + COMPUTE_COL_USAGE, expr_operation_get_prototype (op), + COMPUTE_COL_ARITY, expr_operation_get_arg_cnt (op), -1); } @@ -527,7 +522,7 @@ function_list_populate (GtkTreeView *tv) gtk_tree_view_column_pack_start (col, renderer, TRUE); - gtk_tree_view_column_add_attribute (col, renderer, "text", COL_USAGE); + gtk_tree_view_column_add_attribute (col, renderer, "text", COMPUTE_COL_USAGE); } gtk_tree_view_set_model (tv, GTK_TREE_MODEL (liststore)); @@ -555,8 +550,8 @@ insert_function_into_syntax_area (GtkTreeIter iter, buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view)); - gtk_tree_model_get_value (model, &iter, COL_NAME, &name_value); - gtk_tree_model_get_value (model, &iter, COL_ARITY, &arity_value); + gtk_tree_model_get_value (model, &iter, COMPUTE_COL_NAME, &name_value); + gtk_tree_model_get_value (model, &iter, COMPUTE_COL_ARITY, &arity_value); arity = g_value_get_int (&arity_value); diff --git a/src/ui/gui/crosstabs-dialog.c b/src/ui/gui/crosstabs-dialog.c index 70538102..663599f3 100644 --- a/src/ui/gui/crosstabs-dialog.c +++ b/src/ui/gui/crosstabs-dialog.c @@ -391,8 +391,7 @@ crosstabs_dialog (GObject *o, gpointer data) struct crosstabs_dialog cd; GladeXML *xml = XML_NEW ("crosstabs.glade"); - GtkSheet *var_sheet; - PsppireVarStore *vs; + PsppireVarStore *vs = NULL; GtkWidget *dialog = get_widget_assert (xml, "crosstabs-dialog"); GtkWidget *source = get_widget_assert (xml, "dict-treeview"); @@ -408,9 +407,7 @@ crosstabs_dialog (GObject *o, gpointer data) cd.stat_view = get_widget_assert (xml, "stats-view"); cd.cell_view = get_widget_assert (xml, "cell-view"); - var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); put_checkbox_items_in_treeview (GTK_TREE_VIEW(cd.stat_view), B_CS_STATS_DEFAULT, diff --git a/src/ui/gui/data-editor.c b/src/ui/gui/data-editor.c index 96f42cc2..16967103 100644 --- a/src/ui/gui/data-editor.c +++ b/src/ui/gui/data-editor.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2006, 2007 Free Software Foundation + Copyright (C) 2006, 2007, 2008 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,6 +24,8 @@ #include "window-manager.h" #include +#include "psppire-data-editor.h" + #include "helper.h" #include "about.h" #include @@ -47,7 +49,6 @@ #include "examine-dialog.h" #include "dict-display.h" #include "regression-dialog.h" -#include "clipboard.h" #include "oneway-anova-dialog.h" #include "t-test-independent-samples-dialog.h" @@ -72,34 +73,15 @@ static void on_edit_cut (GtkMenuItem *, gpointer); static void on_edit_paste (GtkAction *a, gpointer data); -static void create_data_sheet_variable_popup_menu (struct data_editor *); -static void create_data_sheet_cases_popup_menu (struct data_editor *); - -static void popup_variable_menu (GtkSheet *, gint, - GdkEventButton *, gpointer data); - -static void popup_cases_menu (GtkSheet *, gint, - GdkEventButton *, gpointer data); - -/* Update the data_ref_entry with the reference of the active cell */ -static gint update_data_ref_entry (const GtkSheet *sheet, - gint row, gint col, gpointer data); +static GtkWidget * create_data_sheet_variable_popup_menu (struct data_editor *); +static GtkWidget * create_data_sheet_cases_popup_menu (struct data_editor *); static void register_data_editor_actions (struct data_editor *de); - -static void insert_variable (GtkAction *, gpointer data); +static void on_insert_variable (GtkAction *, gpointer data); static void insert_case (GtkAction *a, gpointer data); -static void delete_cases (GtkAction *a, gpointer data); -static void delete_variables (GtkAction *a, gpointer data); static void toggle_value_labels (GtkToggleAction *a, gpointer data); -/* Switch between the VAR SHEET and the DATA SHEET */ - -static gboolean click2column (GtkWidget *w, gint col, gpointer data); -static gboolean click2row (GtkWidget *w, gint row, gpointer data); - - /* Callback for when the dictionary changes properties*/ static void on_weight_change (GObject *, gint, gpointer); static void on_filter_change (GObject *, gint, gpointer); @@ -114,20 +96,20 @@ static void status_bar_activate (GtkCheckMenuItem *, gpointer); static void grid_lines_activate (GtkCheckMenuItem *, gpointer); -static void data_sheet_activate (GtkCheckMenuItem *, gpointer); +static void data_view_activate (GtkCheckMenuItem *, gpointer); -static void variable_sheet_activate (GtkCheckMenuItem *, gpointer ); +static void variable_view_activate (GtkCheckMenuItem *, gpointer ); static void fonts_activate (GtkMenuItem *, gpointer); static void file_quit (GtkCheckMenuItem *, gpointer ); static void -enable_delete_cases (GtkWidget *w, gint var, gpointer data) +enable_delete_cases (GtkWidget *w, gint case_num, gpointer data) { struct data_editor *de = data; - gtk_action_set_visible (de->delete_cases, var != -1); + gtk_action_set_visible (de->delete_cases, case_num != -1); } @@ -240,114 +222,33 @@ on_recent_files_select (GtkMenuShell *menushell, gpointer user_data) #endif -static void -datum_entry_activate (GtkEntry *entry, gpointer data) -{ - gint row, column; - GtkSheet *data_sheet = GTK_SHEET (data); - PsppireDataStore *store = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); - - const char *text = gtk_entry_get_text (entry); - - gtk_sheet_get_active_cell (data_sheet, &row, &column); - if ( row == -1 || column == -1) - return; - - psppire_data_store_set_string (store, text, row, column); -} - - -/* Update the Edit->Paste menuitem - If PAGE is not -1 , then it should be set to the current page of - the data editors notebook widget. - If -1, then it'll be queried. -*/ static void -update_paste_menuitem (struct data_editor *de, gint page) +update_paste_menuitems (GtkWidget *w, gboolean x, gpointer data) { - GtkWidget * edit_paste = get_widget_assert (de->xml, "edit_paste"); - GtkWidget *notebook = get_widget_assert (de->xml, "notebook"); - GtkSheet * data_sheet ; - gint row, column; - - if ( page < 0 ) - page = gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)); - - - if ( PAGE_VAR_SHEET == page ) - { - /* We don't yet support pasting to the var sheet */ - gtk_widget_set_sensitive (edit_paste, FALSE); - return; - } - - data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); + struct data_editor *de = data; - gtk_sheet_get_active_cell (data_sheet, &row, &column); + GtkWidget * edit_paste = get_widget_assert (de->xml, "edit_paste"); - if ( row < 0 || column < 0 ) - gtk_widget_set_sensitive (edit_paste, FALSE); - else - gtk_widget_set_sensitive (edit_paste, TRUE); + gtk_widget_set_sensitive (edit_paste, x); } -/* Update the Edit->Cut and Edit->Copy menuitems - If PAGE is not -1 , then it should be set to the current page of - the data editors notebook widget. - If -1, then it'll be queried. -*/ static void -update_cut_copy_menuitem (struct data_editor *de, gint page) -{ - GtkWidget * edit_copy = get_widget_assert (de->xml, "edit_copy"); - GtkWidget * edit_cut = get_widget_assert (de->xml, "edit_cut"); - GtkWidget *notebook = get_widget_assert (de->xml, "notebook"); - GtkSheet * data_sheet ; - gint row, column; - - if ( page < 0 ) - page = gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook)); - - - if ( PAGE_VAR_SHEET == page ) - { - /* We don't yet support copying from the var sheet */ - gtk_widget_set_sensitive (edit_copy, FALSE); - gtk_widget_set_sensitive (edit_cut, FALSE); - return; - } - - data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - gtk_sheet_get_active_cell (data_sheet, &row, &column); - - if ( row < 0 || column < 0 ) - { - gtk_widget_set_sensitive (edit_copy, FALSE); - gtk_widget_set_sensitive (edit_cut, FALSE); - return; - } - - gtk_widget_set_sensitive (edit_copy, TRUE); - gtk_widget_set_sensitive (edit_cut, TRUE); -} - - -/* Callback for when the datasheet's active cell becomes active/inactive */ -static gboolean -on_data_sheet_activate_change (GtkSheet *sheet, - gint row, gint column, gpointer data) +update_cut_copy_menuitems (GtkWidget *w, gboolean x, gpointer data) { struct data_editor *de = data; - update_paste_menuitem (de, -1); - update_cut_copy_menuitem (de, -1); + GtkWidget * edit_copy = get_widget_assert (de->xml, "edit_copy"); + GtkWidget * edit_cut = get_widget_assert (de->xml, "edit_cut"); - return TRUE; + gtk_widget_set_sensitive (edit_copy, x); + gtk_widget_set_sensitive (edit_cut, x); } +extern PsppireVarStore *the_var_store; extern struct dataset *the_dataset; +extern PsppireDataStore *the_data_store ; + /* Create a new data editor. @@ -357,10 +258,8 @@ new_data_editor (void) { struct data_editor *de ; struct editor_window *e; - GtkSheet *var_sheet ; - GtkSheet *data_sheet ; PsppireVarStore *vs; - GtkWidget *datum_entry; + GtkWidget *vbox ; de = g_malloc0 (sizeof (*de)); @@ -369,34 +268,28 @@ new_data_editor (void) de->xml = XML_NEW ("data-editor.glade"); - dataset_add_transform_change_callback (the_dataset, - transformation_change_callback, - de); - - var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); + vbox = get_widget_assert (de->xml, "vbox1"); + de->data_editor = PSPPIRE_DATA_EDITOR (psppire_data_editor_new (the_var_store, the_data_store)); - g_signal_connect (G_OBJECT (data_sheet), "activate", - G_CALLBACK (on_data_sheet_activate_change), de); + g_signal_connect (de->data_editor, "data-selection-changed", + G_CALLBACK (update_cut_copy_menuitems), de); - g_signal_connect (G_OBJECT (data_sheet), "deactivate", - G_CALLBACK (on_data_sheet_activate_change), de); + g_signal_connect (de->data_editor, "data-available-changed", + G_CALLBACK (update_paste_menuitems), de); - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + gtk_widget_show (GTK_WIDGET (de->data_editor)); - g_assert(vs); /* Traps a possible bug in win32 build */ - - g_signal_connect (G_OBJECT (data_sheet), "activate", - G_CALLBACK (update_data_ref_entry), - de->xml); + gtk_container_add (GTK_CONTAINER (vbox), GTK_WIDGET (de->data_editor)); + gtk_box_reorder_child (GTK_BOX (vbox) , GTK_WIDGET (de->data_editor), 2); + dataset_add_transform_change_callback (the_dataset, + transformation_change_callback, + de); - datum_entry = get_widget_assert (de->xml, "datum_entry"); + vs = the_var_store; - g_signal_connect (G_OBJECT (datum_entry), "activate", - G_CALLBACK (datum_entry_activate), - data_sheet); + g_assert(vs); /* Traps a possible bug in w32 build */ g_signal_connect (vs->dict, "weight-changed", G_CALLBACK (on_weight_change), @@ -431,7 +324,7 @@ new_data_editor (void) _("Show/hide value labels"), "pspp-value-labels"); - g_signal_connect (de->toggle_value_labels, "activate", + g_signal_connect (de->toggle_value_labels, "toggled", G_CALLBACK (toggle_value_labels), de); @@ -450,14 +343,16 @@ new_data_editor (void) _("Delete the cases at the selected position(s)"), "pspp-clear-cases"); - g_signal_connect (de->delete_cases, "activate", - G_CALLBACK (delete_cases), de); + g_signal_connect_swapped (de->delete_cases, "activate", + G_CALLBACK (psppire_data_editor_delete_cases), + de->data_editor); gtk_action_connect_proxy (de->delete_cases, get_widget_assert (de->xml, "edit_clear-cases")); g_signal_connect (get_widget_assert (de->xml, "edit_paste"), "activate", - G_CALLBACK (on_edit_paste), de); + G_CALLBACK (on_edit_paste), + de); gtk_action_set_visible (de->delete_cases, FALSE); @@ -467,8 +362,9 @@ new_data_editor (void) _("Delete the variables at the selected position(s)"), "pspp-clear-variables"); - g_signal_connect (de->delete_variables, "activate", - G_CALLBACK (delete_variables), de); + g_signal_connect_swapped (de->delete_variables, "activate", + G_CALLBACK (psppire_data_editor_delete_variables), + de->data_editor); gtk_action_connect_proxy (de->delete_variables, get_widget_assert (de->xml, "edit_clear-variables") @@ -483,7 +379,7 @@ new_data_editor (void) "pspp-insert-variable"); g_signal_connect (de->insert_variable, "activate", - G_CALLBACK (insert_variable), de); + G_CALLBACK (on_insert_variable), de->data_editor); gtk_action_connect_proxy (de->insert_variable, @@ -927,36 +823,25 @@ new_data_editor (void) G_CALLBACK (reference_manual), e->window); - g_signal_connect (data_sheet, - "double-click-column", - G_CALLBACK (click2column), - de); - - g_signal_connect (data_sheet, - "select-column", - G_CALLBACK (enable_delete_variables), - de); - g_signal_connect (data_sheet, - "select-row", + g_signal_connect (de->data_editor, + "cases-selected", G_CALLBACK (enable_delete_cases), de); - g_signal_connect (var_sheet, - "double-click-row", - GTK_SIGNAL_FUNC (click2row), - de); - - g_signal_connect_after (var_sheet, - "select-row", + g_signal_connect (de->data_editor, + "variables-selected", G_CALLBACK (enable_delete_variables), de); - g_signal_connect (get_widget_assert (de->xml, "notebook"), + + g_signal_connect (GTK_NOTEBOOK (de->data_editor), "switch-page", G_CALLBACK (on_switch_sheet), de); + gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); + gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_DATA_VIEW); g_signal_connect (get_widget_assert (de->xml, "view_statusbar"), "activate", @@ -971,11 +856,11 @@ new_data_editor (void) g_signal_connect (get_widget_assert (de->xml, "view_data"), "activate", - G_CALLBACK (data_sheet_activate), de); + G_CALLBACK (data_view_activate), de); g_signal_connect (get_widget_assert (de->xml, "view_variables"), "activate", - G_CALLBACK (variable_sheet_activate), de); + G_CALLBACK (variable_view_activate), de); @@ -1025,69 +910,21 @@ new_data_editor (void) G_CALLBACK (minimise_all_windows), NULL); - create_data_sheet_variable_popup_menu (de); - create_data_sheet_cases_popup_menu (de); - - g_signal_connect (G_OBJECT (data_sheet), "button-event-column", - G_CALLBACK (popup_variable_menu), de); - - g_signal_connect (G_OBJECT (data_sheet), "button-event-row", - G_CALLBACK (popup_cases_menu), de); - - return de; -} - - -/* Callback which occurs when the var sheet's row title - button is double clicked */ -static gboolean -click2row (GtkWidget *w, gint row, gpointer data) -{ - struct data_editor *de = data; - GtkSheetRange visible_range; - - gint current_row, current_column; - - GtkWidget *data_sheet = get_widget_assert (de->xml, "data_sheet"); - - data_editor_select_sheet (de, PAGE_DATA_SHEET); - - gtk_sheet_get_active_cell (GTK_SHEET (data_sheet), - ¤t_row, ¤t_column); - - gtk_sheet_set_active_cell (GTK_SHEET (data_sheet), current_row, row); - - gtk_sheet_get_visible_range (GTK_SHEET (data_sheet), &visible_range); - - if ( row < visible_range.col0 || row > visible_range.coli) - { - gtk_sheet_moveto (GTK_SHEET (data_sheet), - current_row, row, 0, 0); - } - - return FALSE; -} - - -/* Callback which occurs when the data sheet's column title - is double clicked */ -static gboolean -click2column (GtkWidget *w, gint col, gpointer data) -{ - struct data_editor *de = data; + de->data_sheet_variable_popup_menu = + GTK_MENU (create_data_sheet_variable_popup_menu (de)); - gint current_row, current_column; + de->data_sheet_cases_popup_menu = + GTK_MENU (create_data_sheet_cases_popup_menu (de)); - GtkWidget *var_sheet = get_widget_assert (de->xml, "variable_sheet"); - data_editor_select_sheet (de, PAGE_VAR_SHEET); + g_object_set (de->data_editor, + "column-menu", de->data_sheet_variable_popup_menu, NULL); - gtk_sheet_get_active_cell (GTK_SHEET (var_sheet), - ¤t_row, ¤t_column); - gtk_sheet_set_active_cell (GTK_SHEET (var_sheet), col, current_column); + g_object_set (de->data_editor, + "row-menu", de->data_sheet_cases_popup_menu, NULL); - return FALSE; + return de; } @@ -1111,16 +948,16 @@ on_switch_sheet (GtkNotebook *notebook, switch (page_num) { - case PAGE_VAR_SHEET: + case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW: gtk_widget_hide (view_variables); gtk_widget_show (view_data); gtk_action_set_sensitive (de->insert_variable, TRUE); gtk_action_set_sensitive (de->insert_case, FALSE); gtk_action_set_sensitive (de->invoke_goto_dialog, FALSE); break; - case PAGE_DATA_SHEET: + case PSPPIRE_DATA_EDITOR_DATA_VIEW: gtk_widget_show (view_variables); - gtk_widget_show (view_data); + gtk_widget_hide (view_data); gtk_action_set_sensitive (de->invoke_goto_dialog, TRUE); gtk_action_set_sensitive (de->insert_case, TRUE); break; @@ -1129,22 +966,12 @@ on_switch_sheet (GtkNotebook *notebook, break; } +#if 0 update_paste_menuitem (de, page_num); - update_cut_copy_menuitem (de, page_num); -} - - -void -data_editor_select_sheet (struct data_editor *de, gint page) -{ - gtk_notebook_set_current_page - ( - GTK_NOTEBOOK (get_widget_assert (de->xml,"notebook")), page - ); +#endif } - static void status_bar_activate (GtkCheckMenuItem *menuitem, gpointer data) { @@ -1162,33 +989,28 @@ static void grid_lines_activate (GtkCheckMenuItem *menuitem, gpointer data) { struct data_editor *de = data; - const bool grid_visible = gtk_check_menu_item_get_active (menuitem); + const gboolean grid_visible = gtk_check_menu_item_get_active (menuitem); - gtk_sheet_show_grid (GTK_SHEET (get_widget_assert (de->xml, - "variable_sheet")), - grid_visible); - - gtk_sheet_show_grid (GTK_SHEET (get_widget_assert (de->xml, "data_sheet")), - grid_visible); + psppire_data_editor_show_grid (de->data_editor, grid_visible); } static void -data_sheet_activate (GtkCheckMenuItem *menuitem, gpointer data) +data_view_activate (GtkCheckMenuItem *menuitem, gpointer data) { struct data_editor *de = data; - data_editor_select_sheet (de, PAGE_DATA_SHEET); + gtk_notebook_set_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_DATA_VIEW); } static void -variable_sheet_activate (GtkCheckMenuItem *menuitem, gpointer data) +variable_view_activate (GtkCheckMenuItem *menuitem, gpointer data) { struct data_editor *de = data; - data_editor_select_sheet (de, PAGE_VAR_SHEET); + gtk_notebook_set_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); } @@ -1204,23 +1026,13 @@ fonts_activate (GtkMenuItem *menuitem, gpointer data) "data_editor"))); if ( GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (dialog)) ) { - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - PsppireDataStore *ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); - const gchar *font = gtk_font_selection_dialog_get_font_name (GTK_FONT_SELECTION_DIALOG (dialog)); PangoFontDescription* font_desc = pango_font_description_from_string (font); - psppire_var_store_set_font (vs, font_desc); - psppire_data_store_set_font (ds, font_desc); + psppire_data_editor_set_font (de->data_editor, font_desc); } gtk_widget_hide (dialog); @@ -1234,16 +1046,10 @@ toggle_value_labels (GtkToggleAction *ta, gpointer data) { struct data_editor *de = data; - GtkSheet *data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - PsppireDataStore *ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); - - - psppire_data_store_show_labels (ds, - gtk_toggle_action_get_active (ta)); + g_object_set (de->data_editor, "value-labels", gtk_toggle_action_get_active (ta), NULL); } -extern PsppireDataStore *the_data_store ; + static void file_quit (GtkCheckMenuItem *menuitem, gpointer data) @@ -1255,144 +1061,23 @@ file_quit (GtkCheckMenuItem *menuitem, gpointer data) gtk_main_quit (); } -static void -delete_cases (GtkAction *action, gpointer data) -{ - struct data_editor *de = data; - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - GtkSheetRange range; - - PsppireDataStore *data_store = PSPPIRE_DATA_STORE - (gtk_sheet_get_model (data_sheet) ); - - - /* This shouldn't be able to happen, because the action - should be disabled */ - g_return_if_fail (gtk_sheet_get_state (data_sheet) - == GTK_SHEET_ROW_SELECTED ); - - gtk_sheet_get_selected_range (data_sheet, &range); - - gtk_sheet_unselect_range (data_sheet); - - psppire_data_store_delete_cases (data_store, range.row0, - 1 + range.rowi - range.row0); - -} - -static void -delete_variables (GtkAction *a, gpointer data) -{ - struct data_editor *de = data; - GtkSheetRange range; - - GtkNotebook *notebook = GTK_NOTEBOOK (get_widget_assert (de->xml, - "notebook")); - - const gint page = gtk_notebook_get_current_page (notebook); - - GtkSheet *sheet = GTK_SHEET (get_widget_assert (de->xml, - (page == PAGE_VAR_SHEET) ? - "variable_sheet" : - "data_sheet")); - - - gtk_sheet_get_selected_range (sheet, &range); - - switch ( page ) - { - case PAGE_VAR_SHEET: - { - PsppireVarStore *vs = - PSPPIRE_VAR_STORE (gtk_sheet_get_model (sheet)); - - psppire_dict_delete_variables (vs->dict, - range.row0, - 1 + - range.rowi - - range.row0 ); - } - break; - case PAGE_DATA_SHEET: - { - PsppireDataStore *ds = - PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); - - psppire_dict_delete_variables (ds->dict, - range.col0, - 1 + - range.coli - - range.col0 ); - } - break; - }; - - gtk_sheet_unselect_range (sheet); -} static void insert_case (GtkAction *action, gpointer data) { - gint current_row ; struct data_editor *de = data; - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - PsppireDataStore *ds = PSPPIRE_DATA_STORE - (gtk_sheet_get_model (data_sheet) ); - - - gtk_sheet_get_active_cell (data_sheet, ¤t_row, NULL); - - if (current_row < 0) current_row = 0; - - psppire_data_store_insert_new_case (ds, current_row); + psppire_data_editor_insert_case (de->data_editor); } -/* Insert a new variable before the current row in the variable sheet, - or before the current column in the data sheet, whichever is selected */ static void -insert_variable (GtkAction *action, gpointer data) +on_insert_variable (GtkAction *action, gpointer data) { - struct data_editor *de = data; - gint posn = -1; - - GtkWidget *notebook = get_widget_assert (de->xml, "notebook"); - - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - PsppireVarStore *vs = PSPPIRE_VAR_STORE - (gtk_sheet_get_model (var_sheet) ); - - switch ( gtk_notebook_get_current_page ( GTK_NOTEBOOK (notebook)) ) - { - case PAGE_VAR_SHEET: - posn = var_sheet->active_cell.row; - break; - case PAGE_DATA_SHEET: - { - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - if ( data_sheet->state == GTK_SHEET_COLUMN_SELECTED ) - posn = data_sheet->range.col0; - else - posn = data_sheet->active_cell.col; - } - break; - default: - g_assert_not_reached (); - } - - if ( posn == -1 ) posn = 0; - - psppire_dict_insert_variable (vs->dict, posn, NULL); + PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (data); + psppire_data_editor_insert_variable (de); } + /* Callback for when the dictionary changes its split variables */ static void on_split_change (PsppireDict *dict, gpointer data) @@ -1444,16 +1129,15 @@ on_filter_change (GObject *o, gint filter_index, gpointer data) } else { - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; + struct variable *var ; + gchar *text ; - PsppireVarStore *vs = PSPPIRE_VAR_STORE - (gtk_sheet_get_model (var_sheet) ); + g_object_get (de->data_editor, "var-store", &vs, NULL); - struct variable *var = psppire_dict_get_variable (vs->dict, - filter_index); + var = psppire_dict_get_variable (vs->dict, filter_index); - gchar *text = g_strdup_printf (_("Filter by %s"), var_get_name (var)); + text = g_strdup_printf (_("Filter by %s"), var_get_name (var)); gtk_label_set_text (GTK_LABEL (filter_status_area), text); @@ -1475,16 +1159,15 @@ on_weight_change (GObject *o, gint weight_index, gpointer data) } else { - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + struct variable *var ; + PsppireVarStore *vs = NULL; + gchar *text; - PsppireVarStore *vs = PSPPIRE_VAR_STORE - (gtk_sheet_get_model (var_sheet) ); + g_object_get (de->data_editor, "var-store", &vs, NULL); - struct variable *var = psppire_dict_get_variable (vs->dict, - weight_index); + var = psppire_dict_get_variable (vs->dict, weight_index); - gchar *text = g_strdup_printf (_("Weight by %s"), var_get_name (var)); + text = g_strdup_printf (_("Weight by %s"), var_get_name (var)); gtk_label_set_text (GTK_LABEL (weight_status_area), text); @@ -1793,132 +1476,9 @@ open_data_dialog (GtkAction *action, struct data_editor *de) } - -/* Update the data_ref_entry with the reference of the active cell */ -static gint -update_data_ref_entry (const GtkSheet *sheet, gint row, gint col, gpointer data) -{ - GtkEntry *datum_entry; - GladeXML *data_editor_xml = data; - - PsppireDataStore *data_store = - PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); - - g_return_val_if_fail (data_editor_xml, FALSE); - - - datum_entry = - GTK_ENTRY (get_widget_assert (data_editor_xml, - "datum_entry")); - - if (data_store) - { - const struct variable *var = - psppire_dict_get_variable (data_store->dict, col); - - /* The entry where the reference to the current cell is displayed */ - GtkEntry *cell_ref_entry = - GTK_ENTRY (get_widget_assert (data_editor_xml, - "cell_ref_entry")); - if ( var ) - { - gchar *text = g_strdup_printf ("%d: %s", row + FIRST_CASE_NUMBER, - var_get_name (var)); - - gchar *s = pspp_locale_to_utf8 (text, -1, 0); - - g_free (text); - - gtk_entry_set_text (cell_ref_entry, s); - - g_free (s); - } - else - goto blank_entry; - - if ( var ) - { - gchar *text = - psppire_data_store_get_string (data_store, row, - var_get_dict_index(var)); - - if ( ! text ) - goto blank_entry; - - g_strchug (text); - - gtk_entry_set_text (datum_entry, text); - - free (text); - } - else - goto blank_entry; - - } - - return FALSE; - - blank_entry: - gtk_entry_set_text (datum_entry, ""); - - return FALSE; -} - - - - - -static void -do_sort (PsppireDataStore *ds, int var, gboolean descend) -{ - GString *string = g_string_new ("SORT CASES BY "); - - const struct variable *v = - psppire_dict_get_variable (ds->dict, var); - - g_string_append_printf (string, "%s", var_get_name (v)); - - if ( descend ) - g_string_append (string, " (D)"); - - g_string_append (string, "."); - - execute_syntax (create_syntax_string_source (string->str)); - - g_string_free (string, TRUE); -} - - -static void -sort_up (GtkMenuItem *item, gpointer data) -{ - GtkSheet *sheet = data; - GtkSheetRange range; - gtk_sheet_get_selected_range (sheet, &range); - - do_sort (PSPPIRE_DATA_STORE (gtk_sheet_get_model(sheet)), - range.col0, FALSE); - -} - -static void -sort_down (GtkMenuItem *item, gpointer data) -{ - GtkSheet *sheet = data; - GtkSheetRange range; - gtk_sheet_get_selected_range (sheet, &range); - - do_sort (PSPPIRE_DATA_STORE (gtk_sheet_get_model(sheet)), - range.col0, TRUE); -} - - - - -static void +static GtkWidget * create_data_sheet_variable_popup_menu (struct data_editor *de) { - GtkSheet *sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); GtkWidget *menu = gtk_menu_new (); GtkWidget *sort_ascending = @@ -1927,14 +1487,12 @@ create_data_sheet_variable_popup_menu (struct data_editor *de) GtkWidget *sort_descending = gtk_menu_item_new_with_label (_("Sort Descending")); - GtkWidget *insert_variable = gtk_menu_item_new_with_label (_("Insert Variable")); GtkWidget *clear_variable = gtk_menu_item_new_with_label (_("Clear")); - gtk_action_connect_proxy (de->insert_variable, insert_variable ); @@ -1957,26 +1515,26 @@ create_data_sheet_variable_popup_menu (struct data_editor *de) gtk_separator_menu_item_new ()); - g_signal_connect (G_OBJECT (sort_ascending), "activate", - G_CALLBACK (sort_up), sheet); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), sort_ascending); - g_signal_connect (G_OBJECT (sort_descending), "activate", - G_CALLBACK (sort_down), sheet); + g_signal_connect_swapped (G_OBJECT (sort_ascending), "activate", + G_CALLBACK (psppire_data_editor_sort_ascending), + de->data_editor); + g_signal_connect_swapped (G_OBJECT (sort_descending), "activate", + G_CALLBACK (psppire_data_editor_sort_descending), + de->data_editor); gtk_menu_shell_append (GTK_MENU_SHELL (menu), sort_descending); gtk_widget_show_all (menu); - - de->data_sheet_variable_popup_menu = GTK_MENU(menu); + return menu; } -static void +static GtkWidget * create_data_sheet_cases_popup_menu (struct data_editor *de) { GtkWidget *menu = gtk_menu_new (); @@ -2008,77 +1566,26 @@ create_data_sheet_cases_popup_menu (struct data_editor *de) gtk_widget_show_all (menu); - - de->data_sheet_cases_popup_menu = GTK_MENU (menu); + return menu; } -static void -popup_variable_menu (GtkSheet *sheet, gint column, - GdkEventButton *event, gpointer data) -{ - struct data_editor *de = data; - - PsppireDataStore *data_store = - PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); - - const struct variable *v = - psppire_dict_get_variable (data_store->dict, column); - - if ( v && event->button == 3) - { - - gtk_sheet_select_column (sheet, column); - - gtk_menu_popup (GTK_MENU (de->data_sheet_variable_popup_menu), - NULL, NULL, NULL, NULL, - event->button, event->time); - } -} - - -static void -popup_cases_menu (GtkSheet *sheet, gint row, - GdkEventButton *event, gpointer data) -{ - struct data_editor *de = data; - - PsppireDataStore *data_store = - PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); - - if ( row <= psppire_data_store_get_case_count (data_store) && - event->button == 3) - { - gtk_sheet_select_row (sheet, row); - - gtk_menu_popup (GTK_MENU (de->data_sheet_cases_popup_menu), - NULL, NULL, NULL, NULL, - event->button, event->time); - } -} - + static void on_edit_paste (GtkAction *a, gpointer data) { - GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + struct data_editor *de = data; - gtk_clipboard_request_contents (clipboard, - gdk_atom_intern ("UTF8_STRING", TRUE), - data_sheet_contents_received_callback, - data); + psppire_data_editor_clip_paste (de->data_editor); } - static void on_edit_copy (GtkMenuItem *m, gpointer data) { struct data_editor *de = data; - GtkSheet *data_sheet = GTK_SHEET (get_widget_assert (de->xml, - "data_sheet")); - - data_sheet_set_clip (data_sheet); + psppire_data_editor_clip_copy (de->data_editor); } @@ -2087,68 +1594,6 @@ static void on_edit_cut (GtkMenuItem *m, gpointer data) { struct data_editor *de = data; - gint max_rows, max_columns; - gint r; - GtkSheetRange range; - PsppireDataStore *ds; - GtkSheet *data_sheet = GTK_SHEET (get_widget_assert (de->xml, - "data_sheet")); - - data_sheet_set_clip (data_sheet); - - - /* Now blank all the cells */ - gtk_sheet_get_selected_range (data_sheet, &range); - - ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); - - /* If nothing selected, then use active cell */ - if ( range.row0 < 0 || range.col0 < 0 ) - { - gint row, col; - gtk_sheet_get_active_cell (data_sheet, &row, &col); - - range.row0 = range.rowi = row; - range.col0 = range.coli = col; - } - - /* The sheet range can include cells that do not include data. - Exclude them from the range. */ - max_rows = psppire_data_store_get_case_count (ds); - if (range.rowi >= max_rows) - { - if (max_rows == 0) - return; - range.rowi = max_rows - 1; - } - - max_columns = dict_get_var_cnt (ds->dict->dict); - if (range.coli >= max_columns) - { - if (max_columns == 0) - return; - range.coli = max_columns - 1; - } - - g_return_if_fail (range.rowi >= range.row0); - g_return_if_fail (range.row0 >= 0); - g_return_if_fail (range.coli >= range.col0); - g_return_if_fail (range.col0 >= 0); - - - for (r = range.row0; r <= range.rowi ; ++r ) - { - gint c; - - for (c = range.col0 ; c <= range.coli; ++c) - { - psppire_data_store_set_string (ds, "", r, c); - } - } - - /* and remove the selection */ - gtk_sheet_unselect_range (data_sheet); + psppire_data_editor_clip_cut (de->data_editor); } - - diff --git a/src/ui/gui/data-editor.glade b/src/ui/gui/data-editor.glade index e3cff71c..187d9c18 100644 --- a/src/ui/gui/data-editor.glade +++ b/src/ui/gui/data-editor.glade @@ -895,113 +895,6 @@ 1 - - - True - True - GTK_POS_BOTTOM - True - - - True - - - True - 1 - 2 - - - True - True - - - 1 - 2 - - - - - - True - False - False - 25 - - - GTK_FILL - - - - - - False - False - - - - - True - False - - - True - psppire_data_sheet_create - - - - - 1 - - - - - False - - - - - True - Data View - - - tab - False - False - - - - - True - True - - - True - psppire_variable_sheet_create - - - - - 1 - False - - - - - True - Variable View - - - tab - 1 - False - False - - - - - 2 - - diff --git a/src/ui/gui/data-editor.h b/src/ui/gui/data-editor.h index 3101ee6b..6ee05f45 100644 --- a/src/ui/gui/data-editor.h +++ b/src/ui/gui/data-editor.h @@ -21,6 +21,7 @@ #include #include #include "window-manager.h" +#include "psppire-data-editor.h" struct data_editor { @@ -72,6 +73,7 @@ struct data_editor GtkMenu *data_sheet_variable_popup_menu; GtkMenu *data_sheet_cases_popup_menu; + PsppireDataEditor *data_editor; gboolean save_as_portable; @@ -88,7 +90,4 @@ void new_data_window (GtkMenuItem *, gpointer); void data_editor_select_sheet (struct data_editor *de, gint page); -enum {PAGE_DATA_SHEET = 0, PAGE_VAR_SHEET}; - - #endif diff --git a/src/ui/gui/data-sheet.h b/src/ui/gui/data-sheet.h deleted file mode 100644 index b3652dc8..00000000 --- a/src/ui/gui/data-sheet.h +++ /dev/null @@ -1,48 +0,0 @@ -/* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2004 Free Software Foundation - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ - - -#ifndef DATA_SHEET_H -#define DATA_SHEET_H - -#include -#include "psppire-dict.h" - -void psppire_data_sheet_clear (GtkSheet *sheet); - -#if 0 -void psppire_data_sheet_set_dictionary (GtkSheet *sheet, PsppireDict *d); -#endif - -GtkWidget* psppire_data_sheet_create (gchar *widget_name, - gchar *string1, - gchar *string2, - gint int1, gint int2); - - -void data_sheet_set_cell_value (GtkSheet *sheet, gint row, gint col, - const GValue *value); - - -void psppire_data_sheet_set_show_labels (GtkSheet *sheet, gboolean show_labels); - -/* Repair any damage that may have been done to the data sheet */ -void psppire_data_sheet_redisplay (GtkSheet *sheet); - -guint columnWidthToPixels (GtkSheet *sheet, gint column, guint width); - - -#endif diff --git a/src/ui/gui/descriptives-dialog.c b/src/ui/gui/descriptives-dialog.c index af55abd6..cb7320fe 100644 --- a/src/ui/gui/descriptives-dialog.c +++ b/src/ui/gui/descriptives-dialog.c @@ -218,10 +218,9 @@ descriptives_dialog (GObject *o, gpointer data) GtkWidget *stats_treeview = get_widget_assert (xml, "statistics"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); diff --git a/src/ui/gui/examine-dialog.c b/src/ui/gui/examine-dialog.c index 14679d70..4ef411fc 100644 --- a/src/ui/gui/examine-dialog.c +++ b/src/ui/gui/examine-dialog.c @@ -256,10 +256,9 @@ examine_dialog (GObject *o, gpointer data) GtkWidget *fct_selector = get_widget_assert (xml, "psppire-selector2"); GtkWidget *id_selector = get_widget_assert (xml, "psppire-selector3"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); ex_d.dep_list = get_widget_assert (xml, "treeview2"); ex_d.fct_list = get_widget_assert (xml, "treeview3"); diff --git a/src/ui/gui/find-dialog.c b/src/ui/gui/find-dialog.c index 84bfa1be..87c88bf6 100644 --- a/src/ui/gui/find-dialog.c +++ b/src/ui/gui/find-dialog.c @@ -54,7 +54,6 @@ struct find_dialog { GladeXML *xml; PsppireDict *dict; - GtkSheet *data_sheet; struct datasheet *data; struct data_editor *de; GtkWidget *variable_entry; @@ -104,22 +103,27 @@ do_find (GObject *obj, const struct find_dialog *fd) { casenumber x = -1; gint column = -1; - gint row; - gtk_sheet_get_active_cell (fd->data_sheet, &row, NULL); + glong row; + + g_object_get (fd->de->data_editor, "current-case", &row, NULL); if ( row < 0 ) row = 0; find_value (fd, row, &x, &column); + if ( x != -1) { - data_editor_select_sheet (fd->de, PAGE_DATA_SHEET); - - gtk_sheet_moveto (fd->data_sheet, x, column, 0.5, 0.5); + gtk_notebook_set_page (GTK_NOTEBOOK (fd->de->data_editor), + PSPPIRE_DATA_EDITOR_DATA_VIEW); - gtk_sheet_set_active_cell (fd->data_sheet, x, column); + g_object_set (fd->de->data_editor, + "current-case", x, + "current-variable", column, + NULL); } + } /* Callback on the selector. @@ -191,11 +195,9 @@ find_dialog (GObject *o, gpointer data) GtkWidget *selector; GtkWidget *find_button; - GtkSheet *var_sheet; - GtkSheet *data_sheet ; GtkWidget *buttonbox; - PsppireVarStore *vs ; + PsppireVarStore *vs ; PsppireDataStore *ds ; fd.xml = XML_NEW ("psppire.glade"); @@ -213,15 +215,13 @@ find_dialog (GObject *o, gpointer data) source = get_widget_assert (fd.xml, "find-variable-treeview"); selector = get_widget_assert (fd.xml, "find-selector"); - var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); - ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); + g_object_get (de->data_editor, + "var-store", &vs, + "data-store", &ds, + NULL); fd.dict = vs->dict; fd.data = ds->case_file->datasheet; - fd.data_sheet = data_sheet; fd.variable_entry = get_widget_assert (fd.xml, "find-variable-entry"); fd.value_entry = get_widget_assert (fd.xml, "find-value-entry"); diff --git a/src/ui/gui/frequencies-dialog.c b/src/ui/gui/frequencies-dialog.c index d7ce37c3..36382d60 100644 --- a/src/ui/gui/frequencies-dialog.c +++ b/src/ui/gui/frequencies-dialog.c @@ -321,10 +321,9 @@ frequencies_dialog (GObject *o, gpointer data) GtkWidget *format_button = get_widget_assert (xml, "button1"); GtkWidget *stats_treeview = get_widget_assert (xml, "stats-treeview"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); put_checkbox_items_in_treeview (GTK_TREE_VIEW(stats_treeview), B_FS_DEFAULT, @@ -333,8 +332,6 @@ frequencies_dialog (GObject *o, gpointer data) ); - - gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); attach_dictionary_to_treeview (GTK_TREE_VIEW (source), diff --git a/src/ui/gui/goto-case-dialog.c b/src/ui/gui/goto-case-dialog.c index a56af78c..c864c29a 100644 --- a/src/ui/gui/goto-case-dialog.c +++ b/src/ui/gui/goto-case-dialog.c @@ -27,17 +27,14 @@ static void refresh (const struct data_editor *de, GladeXML *xml) { - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); + PsppireDataStore *ds = NULL; + casenumber case_count ; - PsppireDataStore *ds = - PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); + GtkWidget *case_num_entry = get_widget_assert (xml, "goto-case-case-num-entry"); - GtkWidget *case_num_entry = - get_widget_assert (xml, "goto-case-case-num-entry"); + g_object_get (de->data_editor, "data-store", &ds, NULL); - casenumber case_count = - psppire_data_store_get_case_count (ds); + case_count = psppire_data_store_get_case_count (ds); gtk_spin_button_set_range (GTK_SPIN_BUTTON (case_num_entry), 1, case_count); @@ -61,24 +58,13 @@ goto_case_dialog (GObject *o, gpointer data) if ( response == PSPPIRE_RESPONSE_GOTO ) { - gint row, column; - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - + glong case_num; GtkWidget *case_num_entry = get_widget_assert (xml, "goto-case-case-num-entry"); - gtk_sheet_get_active_cell (data_sheet, &row, &column); - - row = - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (case_num_entry)) + case_num = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (case_num_entry)) - FIRST_CASE_NUMBER ; - gtk_sheet_moveto (data_sheet, - row, column, - 0.5, 0.5); - - gtk_sheet_set_active_cell (data_sheet, row, column); + g_object_set (de->data_editor, "current-case", case_num, NULL); } } diff --git a/src/ui/gui/oneway-anova-dialog.c b/src/ui/gui/oneway-anova-dialog.c index be281f7c..68205020 100644 --- a/src/ui/gui/oneway-anova-dialog.c +++ b/src/ui/gui/oneway-anova-dialog.c @@ -129,15 +129,12 @@ oneway_anova_dialog (GObject *o, gpointer data) gint response; struct data_editor *de = data; - PsppireVarStore *vs; + PsppireVarStore *vs = NULL; GladeXML *xml = XML_NEW ("oneway.glade"); struct oneway_anova_dialog ow; - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - GtkWidget *dict_view = get_widget_assert (xml, "oneway-anova-treeview1"); @@ -165,7 +162,7 @@ oneway_anova_dialog (GObject *o, gpointer data) ow.homogeneity = GTK_TOGGLE_BUTTON (get_widget_assert (xml, "checkbutton2")); - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); ow.dict = vs->dict; diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c new file mode 100644 index 00000000..4ad9ab62 --- /dev/null +++ b/src/ui/gui/psppire-data-editor.c @@ -0,0 +1,1440 @@ +/* PSPPIRE - a graphical user interface for PSPP. + Copyrigght (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include +#include +#include +#include "psppire-data-editor.h" +#include "psppire-var-sheet.h" + +#include +#include +#include "psppire-data-store.h" +#include "helper.h" + +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + + +enum { + DATA_SELECTION_CHANGED, + DATA_AVAILABLE_CHANGED, + CASES_SELECTED, + VARIABLES_SELECTED, + n_SIGNALS +}; + + +static guint data_editor_signals [n_SIGNALS] = { 0 }; + + +static gboolean data_is_selected (PsppireDataEditor *de); + +static void psppire_data_editor_class_init (PsppireDataEditorClass *klass); +static void psppire_data_editor_init (PsppireDataEditor *de); + +GType +psppire_data_editor_get_type (void) +{ + static GType de_type = 0; + + if (!de_type) + { + static const GTypeInfo de_info = + { + sizeof (PsppireDataEditorClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) psppire_data_editor_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PsppireDataEditor), + 0, + (GInstanceInitFunc) psppire_data_editor_init, + }; + + de_type = g_type_register_static (GTK_TYPE_NOTEBOOK, "PsppireDataEditor", + &de_info, 0); + } + + return de_type; +} + +static GObjectClass * parent_class = NULL; + +static void +psppire_data_editor_dispose (GObject *obj) +{ + PsppireDataEditor *de = (PsppireDataEditor *) obj; + + if (de->dispose_has_run) + return; + + g_object_unref (de->data_store); + g_object_unref (de->var_store); + + /* Make sure dispose does not run twice. */ + de->dispose_has_run = TRUE; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->dispose (obj); +} + +static void +psppire_data_editor_finalize (GObject *obj) +{ + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + + + +static void popup_variable_menu (GtkSheet *sheet, gint column, + GdkEventButton *event, gpointer data); + +static void popup_cases_menu (GtkSheet *sheet, gint row, + GdkEventButton *event, gpointer data); + + + + +/* Callback which occurs when the data sheet's column title + is double clicked */ +static gboolean +on_data_column_clicked (PsppireDataEditor *de, gint col, gpointer data) +{ + + gint current_row, current_column; + + gtk_notebook_set_current_page (GTK_NOTEBOOK (de), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); + + gtk_sheet_get_active_cell (GTK_SHEET (de->var_sheet), + ¤t_row, ¤t_column); + + gtk_sheet_set_active_cell (GTK_SHEET (de->var_sheet), col, current_column); + + return FALSE; +} + + +/* Callback which occurs when the var sheet's row title + button is double clicked */ +static gboolean +on_var_row_clicked (PsppireDataEditor *de, gint row, gpointer data) +{ + GtkSheetRange visible_range; + + gint current_row, current_column; + + gtk_notebook_set_current_page (GTK_NOTEBOOK(de), PSPPIRE_DATA_EDITOR_DATA_VIEW); + + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), + ¤t_row, ¤t_column); + + gtk_sheet_set_active_cell (GTK_SHEET (de->data_sheet), current_row, row); + + gtk_sheet_get_visible_range (GTK_SHEET (de->data_sheet), &visible_range); + + if ( row < visible_range.col0 || row > visible_range.coli) + { + gtk_sheet_moveto (GTK_SHEET (de->data_sheet), + current_row, row, 0, 0); + } + + return FALSE; +} + + + +enum + { + PROP_0, + PROP_DATA_STORE, + PROP_VAR_STORE, + PROP_COLUMN_MENU, + PROP_ROW_MENU, + PROP_VALUE_LABELS, + PROP_CURRENT_CASE, + PROP_CURRENT_VAR, + PROP_DATA_SELECTED + }; + +static void +psppire_data_editor_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) +{ + PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (object); + + switch (prop_id) + { + case PROP_DATA_STORE: + if ( de->data_store) g_object_unref (de->data_store); + de->data_store = g_value_get_pointer (value); + g_object_ref (de->data_store); + + g_object_set (de->data_sheet, + "row-geometry", de->data_store, + "column-geometry", de->data_store, + "model", de->data_store, + NULL); + break; + case PROP_VAR_STORE: + if ( de->var_store) g_object_unref (de->var_store); + de->var_store = g_value_get_pointer (value); + g_object_ref (de->var_store); + + g_object_set (de->var_sheet, + "row-geometry", de->var_store, + "model", de->var_store, + NULL); + break; + case PROP_COLUMN_MENU: + { + GObject *menu = g_value_get_object (value); + + g_signal_connect (de->data_sheet, "button-event-column", + G_CALLBACK (popup_variable_menu), menu); + } + break; + case PROP_ROW_MENU: + { + GObject *menu = g_value_get_object (value); + + g_signal_connect (de->data_sheet, "button-event-row", + G_CALLBACK (popup_cases_menu), menu); + } + break; + case PROP_CURRENT_VAR: + { + gint row, col; + gint var = g_value_get_long (value); + switch (gtk_notebook_get_current_page (GTK_NOTEBOOK (object))) + { + case PSPPIRE_DATA_EDITOR_DATA_VIEW: + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &col); + gtk_sheet_set_active_cell (GTK_SHEET (de->data_sheet), row, var); + gtk_sheet_moveto (GTK_SHEET (de->data_sheet), row, var, 0.5, 0.5); + break; + case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW: + gtk_sheet_get_active_cell (GTK_SHEET (de->var_sheet), &row, &col); + gtk_sheet_set_active_cell (GTK_SHEET (de->var_sheet), var, col); + gtk_sheet_moveto (GTK_SHEET (de->var_sheet), var, col, 0.5, 0.5); + break; + default: + g_assert_not_reached (); + break; + }; + } + break; + case PROP_CURRENT_CASE: + { + gint row, col; + gint case_num = g_value_get_long (value); + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &col); + gtk_sheet_set_active_cell (GTK_SHEET (de->data_sheet), case_num, col); + gtk_sheet_moveto (GTK_SHEET (de->data_sheet), case_num, col, 0.5, 0.5); + } + break; + case PROP_VALUE_LABELS: + { + psppire_data_store_show_labels (de->data_store, + g_value_get_boolean (value)); + } + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + }; +} + +static void +psppire_data_editor_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) +{ + PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (object); + + switch (prop_id) + { + case PROP_DATA_STORE: + g_value_set_pointer (value, de->data_store); + break; + case PROP_VAR_STORE: + g_value_set_pointer (value, de->var_store); + break; + case PROP_CURRENT_CASE: + { + gint row, column; + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &column); + g_value_set_long (value, row); + } + break; + case PROP_CURRENT_VAR: + { + gint row, column; + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &column); + g_value_set_long (value, column); + } + break; + case PROP_DATA_SELECTED: + g_value_set_boolean (value, data_is_selected (de)); + break; + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + break; + }; +} + + +static void +psppire_data_editor_class_init (PsppireDataEditorClass *klass) +{ + GParamSpec *data_store_spec ; + GParamSpec *var_store_spec ; + GParamSpec *column_menu_spec; + GParamSpec *row_menu_spec; + GParamSpec *value_labels_spec; + GParamSpec *current_case_spec; + GParamSpec *current_var_spec; + GParamSpec *data_selected_spec; + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + object_class->dispose = psppire_data_editor_dispose; + object_class->finalize = psppire_data_editor_finalize; + + object_class->set_property = psppire_data_editor_set_property; + object_class->get_property = psppire_data_editor_get_property; + + data_store_spec = + g_param_spec_pointer ("data-store", + "Data Store", + "A pointer to the data store associated with this editor", + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE ); + + g_object_class_install_property (object_class, + PROP_DATA_STORE, + data_store_spec); + + var_store_spec = + g_param_spec_pointer ("var-store", + "Variable Store", + "A pointer to the variable store associated with this editor", + G_PARAM_CONSTRUCT_ONLY | G_PARAM_WRITABLE | G_PARAM_READABLE ); + + g_object_class_install_property (object_class, + PROP_VAR_STORE, + var_store_spec); + + column_menu_spec = + g_param_spec_object ("column-menu", + "Column Menu", + "A menu to be displayed when button 3 is pressed in the column title buttons", + GTK_TYPE_MENU, + G_PARAM_WRITABLE); + + g_object_class_install_property (object_class, + PROP_COLUMN_MENU, + column_menu_spec); + + + row_menu_spec = + g_param_spec_object ("row-menu", + "Row Menu", + "A menu to be displayed when button 3 is pressed in the row title buttons", + GTK_TYPE_MENU, + G_PARAM_WRITABLE); + + g_object_class_install_property (object_class, + PROP_ROW_MENU, + row_menu_spec); + + value_labels_spec = + g_param_spec_boolean ("value-labels", + "Value Labels", + "Whether or not the data sheet should display labels instead of values", + FALSE, + G_PARAM_WRITABLE | G_PARAM_READABLE); + + g_object_class_install_property (object_class, + PROP_VALUE_LABELS, + value_labels_spec); + + + current_case_spec = + g_param_spec_long ("current-case", + "Current Case", + "Zero based number of the selected case", + 0, CASENUMBER_MAX, + 0, + G_PARAM_WRITABLE | G_PARAM_READABLE); + + g_object_class_install_property (object_class, + PROP_CURRENT_CASE, + current_case_spec); + + + current_var_spec = + g_param_spec_long ("current-variable", + "Current Variable", + "Zero based number of the selected variable", + 0, G_MAXINT, + 0, + G_PARAM_WRITABLE | G_PARAM_READABLE); + + g_object_class_install_property (object_class, + PROP_CURRENT_VAR, + current_var_spec); + + + data_selected_spec = + g_param_spec_boolean ("data-selected", + "Data Selected", + "True iff the data view is active and one or more cells of data have been selected.", + FALSE, + G_PARAM_READABLE); + + g_object_class_install_property (object_class, + PROP_DATA_SELECTED, + data_selected_spec); + + + + data_editor_signals [DATA_SELECTION_CHANGED] = + g_signal_new ("data-selection-changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, + 1, + G_TYPE_BOOLEAN); + + data_editor_signals [CASES_SELECTED] = + g_signal_new ("cases-selected", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, + G_TYPE_INT); + + + data_editor_signals [VARIABLES_SELECTED] = + g_signal_new ("variables-selected", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, + 1, + G_TYPE_INT); + + + data_editor_signals [DATA_AVAILABLE_CHANGED] = + g_signal_new ("data-available-changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + 0, + NULL, NULL, + g_cclosure_marshal_VOID__BOOLEAN, + G_TYPE_NONE, + 1, + G_TYPE_BOOLEAN); +} + +/* Update the data_ref_entry with the reference of the active cell */ +static gint +update_data_ref_entry (const GtkSheet *sheet, gint row, gint col, gpointer data) +{ + PsppireDataEditor *de = data; + + PsppireDataStore *data_store = + PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); + + if (data_store) + { + const struct variable *var = + psppire_dict_get_variable (data_store->dict, col); + + if ( var ) + { + gchar *text = g_strdup_printf ("%d: %s", row + FIRST_CASE_NUMBER, + var_get_name (var)); + + gchar *s = pspp_locale_to_utf8 (text, -1, 0); + + g_free (text); + + gtk_entry_set_text (GTK_ENTRY (de->cell_ref_entry), s); + + g_free (s); + } + else + goto blank_entry; + + if ( var ) + { + gchar *text = + psppire_data_store_get_string (data_store, row, + var_get_dict_index(var)); + + if ( ! text ) + goto blank_entry; + + g_strchug (text); + + gtk_entry_set_text (GTK_ENTRY (de->datum_entry), text); + + g_free (text); + } + else + goto blank_entry; + + } + + return FALSE; + + blank_entry: + gtk_entry_set_text (GTK_ENTRY (de->datum_entry), ""); + + return FALSE; +} + + +static void +datum_entry_activate (GtkEntry *entry, gpointer data) +{ + gint row, column; + PsppireDataEditor *de = data; + + const gchar *text = gtk_entry_get_text (entry); + + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &column); + + if ( row == -1 || column == -1) + return; + + psppire_data_store_set_string (de->data_store, text, row, column); +} + + +static void on_activate (PsppireDataEditor *de); +static void on_deactivate (PsppireDataEditor *de); +static gboolean on_switch_page (PsppireDataEditor *de, GtkNotebookPage *p, gint pagenum, gpointer data); +static void on_select_range (PsppireDataEditor *de); + +static void on_select_row (GtkSheet *, gint, PsppireDataEditor *); +static void on_select_variable (GtkSheet *, gint, PsppireDataEditor *); + + +static void on_owner_change (GtkClipboard *, + GdkEventOwnerChange *, gpointer); + +static void +on_map (GtkWidget *w) +{ + GtkClipboard *clip = gtk_widget_get_clipboard (w, GDK_SELECTION_CLIPBOARD); + + g_signal_connect (clip, "owner-change", G_CALLBACK (on_owner_change), w); +} + + +static void +psppire_data_editor_init (PsppireDataEditor *de) +{ + GtkWidget *vbox = gtk_vbox_new (FALSE, 0); + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); + GtkWidget *sw_ds = gtk_scrolled_window_new (NULL, NULL); + GtkWidget *sw_vs = gtk_scrolled_window_new (NULL, NULL); + + + de->data_sheet = gtk_sheet_new (NULL, NULL, NULL); + de->var_sheet = psppire_var_sheet_new (); + + g_object_set (de, "tab-pos", GTK_POS_BOTTOM, NULL); + + de->datum_entry = gtk_entry_new (); + de->cell_ref_entry = gtk_entry_new (); + + g_object_set (de->cell_ref_entry, + "sensitive", FALSE, + "editable", FALSE, + "width_chars", 25, + NULL); + + gtk_box_pack_start (GTK_BOX (hbox), de->cell_ref_entry, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), de->datum_entry, TRUE, TRUE, 0); + + + gtk_container_add (GTK_CONTAINER (sw_vs), de->var_sheet); + gtk_widget_show_all (sw_vs); + + + gtk_container_add (GTK_CONTAINER (sw_ds), de->data_sheet); + gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (vbox), sw_ds, TRUE, TRUE, 0); + + gtk_widget_show_all (vbox); + + gtk_notebook_append_page (GTK_NOTEBOOK (de), vbox, + gtk_label_new_with_mnemonic (_("Data View"))); + + gtk_notebook_append_page (GTK_NOTEBOOK (de), sw_vs, + gtk_label_new_with_mnemonic (_("Variable View"))); + + g_signal_connect (de->data_sheet, "activate", + G_CALLBACK (update_data_ref_entry), + de); + + g_signal_connect (de->datum_entry, "activate", + G_CALLBACK (datum_entry_activate), + de); + + + g_signal_connect_swapped (de->data_sheet, + "double-click-column", + G_CALLBACK (on_data_column_clicked), + de); + + g_signal_connect_swapped (de->var_sheet, + "double-click-row", + G_CALLBACK (on_var_row_clicked), + de); + + g_signal_connect_swapped (de->data_sheet, "activate", + G_CALLBACK (on_activate), + de); + + g_signal_connect_swapped (de->data_sheet, "deactivate", + G_CALLBACK (on_deactivate), + de); + + g_signal_connect_swapped (de->data_sheet, "select-range", + G_CALLBACK (on_select_range), + de); + + g_signal_connect (de->data_sheet, "select-row", + G_CALLBACK (on_select_row), de); + + g_signal_connect (de->data_sheet, "select-column", + G_CALLBACK (on_select_variable), de); + + + g_signal_connect (de->var_sheet, "select-row", + G_CALLBACK (on_select_variable), de); + + + g_signal_connect_after (de, "switch-page", + G_CALLBACK (on_switch_page), + NULL); + + + g_signal_connect (de, "map", G_CALLBACK (on_map), NULL); + + de->dispose_has_run = FALSE; +} + + +GtkWidget* +psppire_data_editor_new (PsppireVarStore *var_store, + PsppireDataStore *data_store) +{ + GtkWidget *widget; + + widget = g_object_new (PSPPIRE_DATA_EDITOR_TYPE, + "var-store", var_store, + "data-store", data_store, + NULL); + + return widget; +} + +static void data_sheet_set_clip (GtkSheet *sheet); +static void data_sheet_contents_received_callback (GtkClipboard *clipboard, + GtkSelectionData *sd, + gpointer data); + + +void +psppire_data_editor_clip_copy (PsppireDataEditor *de) +{ + data_sheet_set_clip (GTK_SHEET (de->data_sheet)); +} + +void +psppire_data_editor_clip_paste (PsppireDataEditor *de) +{ + GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD); + + gtk_clipboard_request_contents (clipboard, + gdk_atom_intern ("UTF8_STRING", TRUE), + data_sheet_contents_received_callback, + de); +} + + + +void +psppire_data_editor_clip_cut (PsppireDataEditor *de) +{ + gint max_rows, max_columns; + gint r; + GtkSheetRange range; + PsppireDataStore *ds = de->data_store; + + data_sheet_set_clip (GTK_SHEET (de->data_sheet)); + + /* Now blank all the cells */ + gtk_sheet_get_selected_range (GTK_SHEET (de->data_sheet), &range); + + /* If nothing selected, then use active cell */ + if ( range.row0 < 0 || range.col0 < 0 ) + { + gint row, col; + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &col); + + range.row0 = range.rowi = row; + range.col0 = range.coli = col; + } + + /* The sheet range can include cells that do not include data. + Exclude them from the range. */ + max_rows = psppire_data_store_get_case_count (ds); + if (range.rowi >= max_rows) + { + if (max_rows == 0) + return; + range.rowi = max_rows - 1; + } + + max_columns = dict_get_var_cnt (ds->dict->dict); + if (range.coli >= max_columns) + { + if (max_columns == 0) + return; + range.coli = max_columns - 1; + } + + g_return_if_fail (range.rowi >= range.row0); + g_return_if_fail (range.row0 >= 0); + g_return_if_fail (range.coli >= range.col0); + g_return_if_fail (range.col0 >= 0); + + + for (r = range.row0; r <= range.rowi ; ++r ) + { + gint c; + + for (c = range.col0 ; c <= range.coli; ++c) + { + psppire_data_store_set_string (ds, "", r, c); + } + } + + /* and remove the selection */ + gtk_sheet_unselect_range (GTK_SHEET (de->data_sheet)); +} + + + + +/* Popup menu related stuff */ + +static void +popup_variable_menu (GtkSheet *sheet, gint column, + GdkEventButton *event, gpointer data) +{ + GtkMenu *menu = GTK_MENU (data); + + PsppireDataStore *data_store = + PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); + + const struct variable *v = + psppire_dict_get_variable (data_store->dict, column); + + if ( v && event->button == 3) + { + gtk_sheet_select_column (sheet, column); + + gtk_menu_popup (menu, + NULL, NULL, NULL, NULL, + event->button, event->time); + } +} + + +static void +popup_cases_menu (GtkSheet *sheet, gint row, + GdkEventButton *event, gpointer data) +{ + GtkMenu *menu = GTK_MENU (data); + + PsppireDataStore *data_store = + PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); + + if ( row <= psppire_data_store_get_case_count (data_store) && + event->button == 3) + { + gtk_sheet_select_row (sheet, row); + + gtk_menu_popup (menu, + NULL, NULL, NULL, NULL, + event->button, event->time); + } +} + + + +/* Sorting */ + +static void +do_sort (PsppireDataStore *ds, int var, gboolean descend) +{ + GString *string = g_string_new ("SORT CASES BY "); + + const struct variable *v = + psppire_dict_get_variable (ds->dict, var); + + g_string_append_printf (string, "%s", var_get_name (v)); + + if ( descend ) + g_string_append (string, " (D)"); + + g_string_append (string, "."); + + execute_syntax (create_syntax_string_source (string->str)); + + g_string_free (string, TRUE); +} + + +/* Sort the data by the the variable which the editor has currently + selected */ +void +psppire_data_editor_sort_ascending (PsppireDataEditor *de) +{ + GtkSheetRange range; + gtk_sheet_get_selected_range (GTK_SHEET(de->data_sheet), &range); + + do_sort (de->data_store, range.col0, FALSE); +} + + +/* Sort the data by the the variable which the editor has currently + selected */ +void +psppire_data_editor_sort_descending (PsppireDataEditor *de) +{ + GtkSheetRange range; + gtk_sheet_get_selected_range (GTK_SHEET(de->data_sheet), &range); + + do_sort (de->data_store, range.col0, TRUE); +} + + + + + +/* Insert a new variable before the currently selected position */ +void +psppire_data_editor_insert_variable (PsppireDataEditor *de) +{ + glong posn = -1; + + if ( de->data_sheet->state == GTK_SHEET_COLUMN_SELECTED ) + posn = GTK_SHEET (de->data_sheet)->range.col0; + else + posn = GTK_SHEET (de->data_sheet)->active_cell.col; + + if ( posn == -1 ) posn = 0; + + psppire_dict_insert_variable (de->data_store->dict, posn, NULL); +} + +/* Insert a new case before the currently selected position */ +void +psppire_data_editor_insert_case (PsppireDataEditor *de) +{ + glong posn = -1; + + if ( de->data_sheet->state == GTK_SHEET_ROW_SELECTED ) + posn = GTK_SHEET (de->data_sheet)->range.row0; + else + posn = GTK_SHEET (de->data_sheet)->active_cell.row; + + if ( posn == -1 ) posn = 0; + + psppire_data_store_insert_new_case (de->data_store, posn); +} + +/* Delete the cases currently selected in the data sheet */ +void +psppire_data_editor_delete_cases (PsppireDataEditor *de) +{ + gint first = GTK_SHEET (de->data_sheet)->range.row0; + gint n = GTK_SHEET (de->data_sheet)->range.rowi - first + 1; + + psppire_data_store_delete_cases (de->data_store, first, n); + + gtk_sheet_unselect_range (GTK_SHEET (de->data_sheet)); +} + +/* Delete the variables currently selected in the + datasheet or variable sheet */ +void +psppire_data_editor_delete_variables (PsppireDataEditor *de) +{ + gint first, n; + + switch (gtk_notebook_get_current_page (GTK_NOTEBOOK (de))) + { + case PSPPIRE_DATA_EDITOR_DATA_VIEW: + first = GTK_SHEET (de->data_sheet)->range.col0; + n = GTK_SHEET (de->data_sheet)->range.coli - first + 1; + break; + case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW: + first = GTK_SHEET (de->var_sheet)->range.row0; + n = GTK_SHEET (de->var_sheet)->range.rowi - first + 1; + break; + default: + g_assert_not_reached (); + break; + } + + psppire_dict_delete_variables (de->var_store->dict, first, n); + + gtk_sheet_unselect_range (GTK_SHEET (de->data_sheet)); + gtk_sheet_unselect_range (GTK_SHEET (de->var_sheet)); +} + + +void +psppire_data_editor_show_grid (PsppireDataEditor *de, gboolean grid_visible) +{ + gtk_sheet_show_grid (GTK_SHEET (de->var_sheet), grid_visible); + gtk_sheet_show_grid (GTK_SHEET (de->data_sheet), grid_visible); +} + +void +psppire_data_editor_set_font (PsppireDataEditor *de, PangoFontDescription *font_desc) +{ + psppire_data_store_set_font (de->data_store, font_desc); + psppire_var_store_set_font (de->var_store, font_desc); +} + + + + + +static void +emit_selected_signal (PsppireDataEditor *de) +{ + gboolean data_selected = data_is_selected (de); + + g_signal_emit (de, data_editor_signals[DATA_SELECTION_CHANGED], 0, data_selected); +} + +static void +on_activate (PsppireDataEditor *de) +{ + gint row, col; + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &col); + + if ( row < psppire_data_store_get_case_count (de->data_store) + && + col < psppire_var_store_get_var_cnt (de->var_store)) + { + emit_selected_signal (de); + return ; + } + + emit_selected_signal (de); +} + + +static void +on_deactivate (PsppireDataEditor *de) +{ + emit_selected_signal (de); +} + +static void +on_select_range (PsppireDataEditor *de) +{ + GtkSheetRange range; + + gtk_sheet_get_selected_range (GTK_SHEET (de->data_sheet), &range); + + if ( range.rowi < psppire_data_store_get_case_count (de->data_store) + && + range.coli < psppire_var_store_get_var_cnt (de->var_store)) + { + emit_selected_signal (de); + return; + } + + emit_selected_signal (de); +} + + +static gboolean +on_switch_page (PsppireDataEditor *de, GtkNotebookPage *p, gint pagenum, gpointer data) +{ + if ( pagenum != PSPPIRE_DATA_EDITOR_DATA_VIEW ) + { + emit_selected_signal (de); + return TRUE; + } + + on_select_range (de); + + return TRUE; +} + + + +static gboolean +data_is_selected (PsppireDataEditor *de) +{ + GtkSheetRange range; + gint row, col; + + if ( gtk_notebook_current_page (GTK_NOTEBOOK (de)) != PSPPIRE_DATA_EDITOR_DATA_VIEW) + return FALSE; + + gtk_sheet_get_active_cell (GTK_SHEET (de->data_sheet), &row, &col); + + if ( row >= psppire_data_store_get_case_count (de->data_store) + || + col >= psppire_var_store_get_var_cnt (de->var_store)) + { + return FALSE; + } + + gtk_sheet_get_selected_range (GTK_SHEET (de->data_sheet), &range); + + if ( range.rowi >= psppire_data_store_get_case_count (de->data_store) + || + range.coli >= psppire_var_store_get_var_cnt (de->var_store)) + { + return FALSE; + } + + return TRUE; +} + + +static void +on_select_row (GtkSheet *sheet, gint row, PsppireDataEditor *de) +{ + g_signal_emit (de, data_editor_signals[CASES_SELECTED], 0, row); +} + + +static void +on_select_variable (GtkSheet *sheet, gint var, PsppireDataEditor *de) +{ + g_signal_emit (de, data_editor_signals[VARIABLES_SELECTED], 0, var); +} + + + + +/* Clipboard stuff */ + + +#include +#include +#include + +#include +#include "xalloc.h" + +/* A casereader and dictionary holding the data currently in the clip */ +static struct casereader *clip_datasheet = NULL; +static struct dictionary *clip_dict = NULL; + + +static void data_sheet_update_clipboard (GtkSheet *); + +/* Set the clip according to the currently + selected range in the data sheet */ +static void +data_sheet_set_clip (GtkSheet *sheet) +{ + int i; + struct casewriter *writer ; + GtkSheetRange range; + PsppireDataStore *ds; + struct case_map *map = NULL; + casenumber max_rows; + size_t max_columns; + + ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (sheet)); + + gtk_sheet_get_selected_range (sheet, &range); + + /* If nothing selected, then use active cell */ + if ( range.row0 < 0 || range.col0 < 0 ) + { + gint row, col; + gtk_sheet_get_active_cell (sheet, &row, &col); + + range.row0 = range.rowi = row; + range.col0 = range.coli = col; + } + + /* The sheet range can include cells that do not include data. + Exclude them from the range. */ + max_rows = psppire_data_store_get_case_count (ds); + if (range.rowi >= max_rows) + { + if (max_rows == 0) + return; + range.rowi = max_rows - 1; + } + max_columns = dict_get_var_cnt (ds->dict->dict); + if (range.coli >= max_columns) + { + if (max_columns == 0) + return; + range.coli = max_columns - 1; + } + + g_return_if_fail (range.rowi >= range.row0); + g_return_if_fail (range.row0 >= 0); + g_return_if_fail (range.coli >= range.col0); + g_return_if_fail (range.col0 >= 0); + + /* Destroy any existing clip */ + if ( clip_datasheet ) + { + casereader_destroy (clip_datasheet); + clip_datasheet = NULL; + } + + if ( clip_dict ) + { + dict_destroy (clip_dict); + clip_dict = NULL; + } + + /* Construct clip dictionary. */ + clip_dict = dict_create (); + for (i = range.col0; i <= range.coli; i++) + { + const struct variable *old = dict_get_var (ds->dict->dict, i); + dict_clone_var_assert (clip_dict, old, var_get_name (old)); + } + + /* Construct clip data. */ + map = case_map_by_name (ds->dict->dict, clip_dict); + writer = autopaging_writer_create (dict_get_next_value_idx (clip_dict)); + for (i = range.row0; i <= range.rowi ; ++i ) + { + struct ccase old; + + if (psppire_case_file_get_case (ds->case_file, i, &old)) + { + struct ccase new; + + case_map_execute (map, &old, &new); + case_destroy (&old); + casewriter_write (writer, &new); + } + else + casewriter_force_error (writer); + } + case_map_destroy (map); + + clip_datasheet = casewriter_make_reader (writer); + + data_sheet_update_clipboard (sheet); +} + +enum { + SELECT_FMT_NULL, + SELECT_FMT_TEXT, + SELECT_FMT_HTML +}; + + +/* Perform data_out for case CC, variable V, appending to STRING */ +static void +data_out_g_string (GString *string, const struct variable *v, + const struct ccase *cc) +{ + char *buf ; + + const struct fmt_spec *fs = var_get_print_format (v); + const union value *val = case_data (cc, v); + buf = xzalloc (fs->w); + + data_out (val, fs, buf); + + g_string_append_len (string, buf, fs->w); + + g_free (buf); +} + +static GString * +clip_to_text (void) +{ + casenumber r; + GString *string; + + const size_t val_cnt = casereader_get_value_cnt (clip_datasheet); + const casenumber case_cnt = casereader_get_case_cnt (clip_datasheet); + const size_t var_cnt = dict_get_var_cnt (clip_dict); + + string = g_string_sized_new (10 * val_cnt * case_cnt); + + for (r = 0 ; r < case_cnt ; ++r ) + { + int c; + struct ccase cc; + if ( ! casereader_peek (clip_datasheet, r, &cc)) + { + g_warning ("Clipboard seems to have inexplicably shrunk"); + break; + } + + for (c = 0 ; c < var_cnt ; ++c) + { + const struct variable *v = dict_get_var (clip_dict, c); + data_out_g_string (string, v, &cc); + if ( c < val_cnt - 1 ) + g_string_append (string, "\t"); + } + + if ( r < case_cnt) + g_string_append (string, "\n"); + + case_destroy (&cc); + } + + return string; +} + + +static GString * +clip_to_html (void) +{ + casenumber r; + GString *string; + + const size_t val_cnt = casereader_get_value_cnt (clip_datasheet); + const casenumber case_cnt = casereader_get_case_cnt (clip_datasheet); + const size_t var_cnt = dict_get_var_cnt (clip_dict); + + + /* Guestimate the size needed */ + string = g_string_sized_new (20 * val_cnt * case_cnt); + + g_string_append (string, "\n"); + for (r = 0 ; r < case_cnt ; ++r ) + { + int c; + struct ccase cc; + if ( ! casereader_peek (clip_datasheet, r, &cc)) + { + g_warning ("Clipboard seems to have inexplicably shrunk"); + break; + } + g_string_append (string, "\n"); + + for (c = 0 ; c < var_cnt ; ++c) + { + const struct variable *v = dict_get_var (clip_dict, c); + g_string_append (string, "\n"); + } + + g_string_append (string, "\n"); + + case_destroy (&cc); + } + g_string_append (string, "
"); + data_out_g_string (string, v, &cc); + g_string_append (string, "
\n"); + + return string; +} + + + +static void +clipboard_get_cb (GtkClipboard *clipboard, + GtkSelectionData *selection_data, + guint info, + gpointer data) +{ + GString *string = NULL; + + switch (info) + { + case SELECT_FMT_TEXT: + string = clip_to_text (); + break; + case SELECT_FMT_HTML: + string = clip_to_html (); + break; + default: + g_assert_not_reached (); + } + + gtk_selection_data_set (selection_data, selection_data->target, + 8, + (const guchar *) string->str, string->len); + + g_string_free (string, TRUE); +} + +static void +clipboard_clear_cb (GtkClipboard *clipboard, + gpointer data) +{ + dict_destroy (clip_dict); + clip_dict = NULL; + + casereader_destroy (clip_datasheet); + clip_datasheet = NULL; +} + + +static const GtkTargetEntry targets[] = { + { "UTF8_STRING", 0, SELECT_FMT_TEXT }, + { "STRING", 0, SELECT_FMT_TEXT }, + { "TEXT", 0, SELECT_FMT_TEXT }, + { "COMPOUND_TEXT", 0, SELECT_FMT_TEXT }, + { "text/plain;charset=utf-8", 0, SELECT_FMT_TEXT }, + { "text/plain", 0, SELECT_FMT_TEXT }, + { "text/html", 0, SELECT_FMT_HTML } +}; + + + +static void +data_sheet_update_clipboard (GtkSheet *sheet) +{ + GtkClipboard *clipboard = + gtk_widget_get_clipboard (GTK_WIDGET (sheet), + GDK_SELECTION_CLIPBOARD); + + if (!gtk_clipboard_set_with_owner (clipboard, targets, + G_N_ELEMENTS (targets), + clipboard_get_cb, clipboard_clear_cb, + G_OBJECT (sheet))) + clipboard_clear_cb (clipboard, sheet); +} + + + +/* A callback for when the clipboard contents have been received */ +static void +data_sheet_contents_received_callback (GtkClipboard *clipboard, + GtkSelectionData *sd, + gpointer data) +{ + gint count = 0; + gint row, column; + gint next_row, next_column; + gint first_column; + char *c; + PsppireDataEditor *data_editor = data; + + if ( sd->length < 0 ) + return; + + if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE)) + return; + + c = (char *) sd->data; + + /* Paste text to selected position */ + gtk_sheet_get_active_cell (GTK_SHEET (data_editor->data_sheet), + &row, &column); + + g_return_if_fail (row >= 0); + g_return_if_fail (column >= 0); + + first_column = column; + next_row = row; + next_column = column; + while (count < sd->length) + { + char *s = c; + + row = next_row; + column = next_column; + while (*c != '\t' && *c != '\n' && count < sd->length) + { + c++; + count++; + } + if ( *c == '\t') + { + next_row = row ; + next_column = column + 1; + } + else if ( *c == '\n') + { + next_row = row + 1; + next_column = first_column; + } + *c++ = '\0'; + count++; + + + /* Append some new cases if pasting beyond the last row */ + if ( row >= psppire_data_store_get_case_count (data_editor->data_store)) + psppire_data_store_insert_new_case (data_editor->data_store, row); + + psppire_data_store_set_string (data_editor->data_store, s, row, column); + } +} + + +static void +on_owner_change (GtkClipboard *clip, GdkEventOwnerChange *event, gpointer data) +{ + gint i; + gboolean compatible_target = FALSE; + PsppireDataEditor *de = PSPPIRE_DATA_EDITOR (data); + + for (i = 0 ; i < sizeof (targets) / sizeof(targets[0]) ; ++i ) + { + GdkAtom atom = gdk_atom_intern (targets[i].target, TRUE); + if ( gtk_clipboard_wait_is_target_available (clip, atom)) + { + compatible_target = TRUE; + break; + } + } + + g_signal_emit (de, data_editor_signals[DATA_AVAILABLE_CHANGED], 0, + compatible_target); +} diff --git a/src/ui/gui/psppire-data-editor.h b/src/ui/gui/psppire-data-editor.h new file mode 100644 index 00000000..b896c545 --- /dev/null +++ b/src/ui/gui/psppire-data-editor.h @@ -0,0 +1,84 @@ +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef __PSPPIRE_DATA_EDITOR_H__ +#define __PSPPIRE_DATA_EDITOR_H__ + + +#include +#include +#include + +#include "psppire-var-store.h" +#include "psppire-data-store.h" + +G_BEGIN_DECLS + +#define PSPPIRE_DATA_EDITOR_TYPE (psppire_data_editor_get_type ()) +#define PSPPIRE_DATA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditor)) +#define PSPPIRE_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_DATA_EDITOR_TYPE, PsppireDataEditorClass)) +#define PSPPIRE_IS_DATA_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_DATA_EDITOR_TYPE)) +#define PSPPIRE_IS_DATA_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_DATA_EDITOR_TYPE)) + + +typedef struct _PsppireDataEditor PsppireDataEditor; +typedef struct _PsppireDataEditorClass PsppireDataEditorClass; + +/* All members are private. */ +struct _PsppireDataEditor +{ + GtkNotebook parent; + + /* */ + gboolean dispose_has_run; + GtkWidget *cell_ref_entry; + GtkWidget *datum_entry; + GtkWidget *data_sheet; + GtkWidget *var_sheet; + PsppireDataStore *data_store; + PsppireVarStore *var_store; +}; + + +struct _PsppireDataEditorClass +{ + GtkNotebookClass parent_class; +}; + + +GType psppire_data_editor_get_type (void); +GtkWidget* psppire_data_editor_new (PsppireVarStore *, PsppireDataStore *); +void psppire_data_editor_clip_copy (PsppireDataEditor *); +void psppire_data_editor_clip_paste (PsppireDataEditor *); +void psppire_data_editor_clip_cut (PsppireDataEditor *); +void psppire_data_editor_sort_ascending (PsppireDataEditor *); +void psppire_data_editor_sort_descending (PsppireDataEditor *); +void psppire_data_editor_insert_variable (PsppireDataEditor *); +void psppire_data_editor_delete_variables (PsppireDataEditor *); +void psppire_data_editor_show_grid (PsppireDataEditor *, gboolean); +void psppire_data_editor_insert_case (PsppireDataEditor *); +void psppire_data_editor_delete_cases (PsppireDataEditor *); +void psppire_data_editor_set_font (PsppireDataEditor *, PangoFontDescription *); +void psppire_data_editor_delete_cases (PsppireDataEditor *); + + + +G_END_DECLS + +enum {PSPPIRE_DATA_EDITOR_DATA_VIEW = 0, PSPPIRE_DATA_EDITOR_VARIABLE_VIEW}; + + +#endif /* __PSPPIRE_DATA_EDITOR_H__ */ diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c new file mode 100644 index 00000000..a4260405 --- /dev/null +++ b/src/ui/gui/psppire-var-sheet.c @@ -0,0 +1,500 @@ + +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include "psppire-var-sheet.h" + +#include +#include "helper.h" +#include +#include "customentry.h" +#include +#include "psppire-var-store.h" + +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + + +static void psppire_var_sheet_class_init (PsppireVarSheetClass *klass); +static void psppire_var_sheet_init (PsppireVarSheet *vs); + + +GType +psppire_var_sheet_get_type (void) +{ + static GType vs_type = 0; + + if (!vs_type) + { + static const GTypeInfo vs_info = + { + sizeof (PsppireVarSheetClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) psppire_var_sheet_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PsppireVarSheet), + 0, + (GInstanceInitFunc) psppire_var_sheet_init, + }; + + vs_type = g_type_register_static (GTK_TYPE_SHEET, "PsppireVarSheet", + &vs_info, 0); + } + + return vs_type; +} + +static GObjectClass * parent_class = NULL; + +static void +psppire_var_sheet_dispose (GObject *obj) +{ + PsppireVarSheet *vs = (PsppireVarSheet *)obj; + + if (vs->dispose_has_run) + return; + + /* Make sure dispose does not run twice. */ + vs->dispose_has_run = TRUE; + + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->dispose (obj); +} + +static void +psppire_var_sheet_finalize (GObject *obj) +{ + /* Chain up to the parent class */ + G_OBJECT_CLASS (parent_class)->finalize (obj); +} + + +struct column_parameters +{ + gchar label[20]; + gint width ; +}; + +static const struct column_parameters column_def[] = { + { N_("Name"), 80}, + { N_("Type"), 100}, + { N_("Width"), 57}, + { N_("Decimals"),91}, + { N_("Label"), 95}, + { N_("Values"), 103}, + { N_("Missing"), 95}, + { N_("Columns"), 80}, + { N_("Align"), 69}, + { N_("Measure"), 99}, +}; + + +#define n_ALIGNMENTS 3 + +const gchar *const alignments[n_ALIGNMENTS + 1]={ + N_("Left"), + N_("Right"), + N_("Center"), + 0 +}; + +const gchar *const measures[n_MEASURES + 1]={ + N_("Nominal"), + N_("Ordinal"), + N_("Scale"), + 0 +}; + + + +/* Create a list store from an array of strings */ +static GtkListStore * +create_label_list (const gchar *const *labels) +{ + const gchar *s; + gint i = 0; + GtkTreeIter iter; + + GtkListStore *list_store; + list_store = gtk_list_store_new (1, G_TYPE_STRING); + + + while ( (s = labels[i++])) + { + gtk_list_store_append (list_store, &iter); + gtk_list_store_set (list_store, &iter, + 0, gettext (s), + -1); + } + + return list_store; +} + + + + +static void +psppire_var_sheet_class_init (PsppireVarSheetClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + parent_class = g_type_class_peek_parent (klass); + + object_class->dispose = psppire_var_sheet_dispose; + object_class->finalize = psppire_var_sheet_finalize; + + + klass->measure_list = create_label_list (measures); + klass->alignment_list = create_label_list (alignments); +} + + + +/* Callback for when the alignment combo box + item is selected */ +static void +change_alignment (GtkComboBox *cb, + struct variable *var) +{ + gint active_item = gtk_combo_box_get_active (cb); + + if ( active_item < 0 ) return ; + + var_set_alignment (var, active_item); +} + + + +/* Callback for when the measure combo box + item is selected */ +static void +change_measure (GtkComboBox *cb, + struct variable *var) +{ + gint active_item = gtk_combo_box_get_active (cb); + + if ( active_item < 0 ) return ; + + var_set_measure (var, active_item); +} + + + +static gboolean +traverse_cell_callback (GtkSheet *sheet, + gint row, gint column, + gint *new_row, gint *new_column + ) +{ + PsppireVarStore *var_store = PSPPIRE_VAR_STORE (gtk_sheet_get_model (sheet)); + + gint n_vars = psppire_var_store_get_var_cnt (var_store); + + if ( row == n_vars && *new_row >= n_vars) + { + GtkEntry *entry = GTK_ENTRY (gtk_sheet_get_entry (sheet)); + + const gchar *name = gtk_entry_get_text (entry); + + if (! psppire_dict_check_name (var_store->dict, name, TRUE)) + return FALSE; + + psppire_dict_insert_variable (var_store->dict, row, name); + + return TRUE; + } + + /* If the destination cell is outside the current variables, then + automatically create variables for the new rows. + */ + if ( (*new_row > n_vars) || + (*new_row == n_vars && *new_column != PSPPIRE_VAR_STORE_COL_NAME) ) + { + gint i; + for ( i = n_vars ; i <= *new_row; ++i ) + psppire_dict_insert_variable (var_store->dict, i, NULL); + } + + return TRUE; +} + + + + +/* + Callback whenever the pointer leaves a cell on the var sheet. +*/ +static gboolean +var_sheet_cell_entry_leave (GtkSheet * sheet, gint row, gint column, + gpointer data) +{ + gtk_sheet_change_entry (sheet, GTK_TYPE_ENTRY); + return TRUE; +} + + +/* + Callback whenever the pointer enters a cell on the var sheet. +*/ +static gboolean +var_sheet_cell_entry_enter (PsppireVarSheet *vs, gint row, gint column, + gpointer data) +{ + GtkSheetCellAttr attributes; + PsppireVarStore *var_store ; + PsppireVarSheetClass *vs_class = + PSPPIRE_VAR_SHEET_CLASS(G_OBJECT_GET_CLASS (vs)); + + struct variable *var ; + GtkSheet *sheet = GTK_SHEET (vs); + + g_return_val_if_fail (sheet != NULL, FALSE); + + var_store = PSPPIRE_VAR_STORE (gtk_sheet_get_model (sheet)); + + g_assert (var_store); + + if ( row >= psppire_var_store_get_var_cnt (var_store)) + return TRUE; + + gtk_sheet_get_attributes (sheet, row, column, &attributes); + + + var = psppire_var_store_get_var (var_store, row); + + switch (column) + { + case PSPPIRE_VAR_STORE_COL_ALIGN: + { + static GtkListStore *list_store = NULL; + GtkComboBoxEntry *cbe; + gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY); + cbe = + GTK_COMBO_BOX_ENTRY (gtk_sheet_get_entry (sheet)->parent); + + + if ( ! list_store) list_store = create_label_list (alignments); + + gtk_combo_box_set_model (GTK_COMBO_BOX (cbe), + GTK_TREE_MODEL (vs_class->alignment_list)); + + gtk_combo_box_entry_set_text_column (cbe, 0); + + g_signal_connect (G_OBJECT (cbe),"changed", + G_CALLBACK (change_alignment), var); + } + break; + + case PSPPIRE_VAR_STORE_COL_MEASURE: + { + GtkComboBoxEntry *cbe; + gtk_sheet_change_entry (sheet, GTK_TYPE_COMBO_BOX_ENTRY); + cbe = + GTK_COMBO_BOX_ENTRY (gtk_sheet_get_entry (sheet)->parent); + + + + gtk_combo_box_set_model (GTK_COMBO_BOX (cbe), + GTK_TREE_MODEL (vs_class->measure_list)); + + gtk_combo_box_entry_set_text_column (cbe, 0); + + g_signal_connect (G_OBJECT (cbe),"changed", + G_CALLBACK (change_measure), var); + } + break; + + case PSPPIRE_VAR_STORE_COL_VALUES: + { + PsppireCustomEntry *customEntry; + + gtk_sheet_change_entry (sheet, PSPPIRE_CUSTOM_ENTRY_TYPE); + + customEntry = + PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet)); + + if ( var_is_long_string (var)) + g_object_set (customEntry, + "editable", FALSE, + NULL); + + val_labs_dialog_set_target_variable (vs->val_labs_dialog, var); + + g_signal_connect_swapped (customEntry, + "clicked", + G_CALLBACK (val_labs_dialog_show), + vs->val_labs_dialog); + } + break; + + case PSPPIRE_VAR_STORE_COL_MISSING: + { + PsppireCustomEntry *customEntry; + + gtk_sheet_change_entry (sheet, PSPPIRE_CUSTOM_ENTRY_TYPE); + + customEntry = + PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet)); + + if ( var_is_long_string (var)) + g_object_set (customEntry, + "editable", FALSE, + NULL); + + + vs->missing_val_dialog->pv = + psppire_var_store_get_var (var_store, row); + + g_signal_connect_swapped (customEntry, + "clicked", + G_CALLBACK (missing_val_dialog_show), + vs->missing_val_dialog); + } + break; + + case PSPPIRE_VAR_STORE_COL_TYPE: + { + PsppireCustomEntry *customEntry; + + gtk_sheet_change_entry (sheet, PSPPIRE_CUSTOM_ENTRY_TYPE); + + customEntry = + PSPPIRE_CUSTOM_ENTRY (gtk_sheet_get_entry (sheet)); + + + /* Popup the Variable Type dialog box */ + vs->var_type_dialog->pv = var; + + g_signal_connect_swapped (customEntry, + "clicked", + G_CALLBACK (var_type_dialog_show), + vs->var_type_dialog); + } + break; + + case PSPPIRE_VAR_STORE_COL_WIDTH: + case PSPPIRE_VAR_STORE_COL_DECIMALS: + case PSPPIRE_VAR_STORE_COL_COLUMNS: + { + if ( attributes.is_editable) + { + gint r_min, r_max; + + const gchar *s = gtk_sheet_cell_get_text (sheet, row, column); + + if (s) + { + GtkSpinButton *spinButton ; + const gint current_value = g_strtod (s, NULL); + GtkObject *adj ; + + const struct fmt_spec *fmt = var_get_write_format (var); + switch (column) + { + case PSPPIRE_VAR_STORE_COL_WIDTH: + r_min = MAX (fmt->d + 1, fmt_min_output_width (fmt->type)); + r_max = fmt_max_output_width (fmt->type); + break; + case PSPPIRE_VAR_STORE_COL_DECIMALS: + r_min = 0 ; + r_max = fmt_max_output_decimals (fmt->type, fmt->w); + break; + case PSPPIRE_VAR_STORE_COL_COLUMNS: + r_min = 1; + r_max = 255 ; /* Is this a sensible value ? */ + break; + default: + g_assert_not_reached (); + } + + adj = gtk_adjustment_new (current_value, + r_min, r_max, + 1.0, 1.0, 1.0 /* steps */ + ); + + gtk_sheet_change_entry (sheet, GTK_TYPE_SPIN_BUTTON); + + spinButton = + GTK_SPIN_BUTTON (gtk_sheet_get_entry (sheet)); + + gtk_spin_button_set_adjustment (spinButton, GTK_ADJUSTMENT (adj)); + gtk_spin_button_set_digits (spinButton, 0); + } + } + } + break; + + default: + gtk_sheet_change_entry (sheet, GTK_TYPE_ENTRY); + break; + } + + + return TRUE; +} + + + + +static void +psppire_var_sheet_init (PsppireVarSheet *vs) +{ + gint i; + GObject *geo = g_sheet_hetero_column_new (75, PSPPIRE_VAR_STORE_n_COLS); + GladeXML *xml = XML_NEW ("data-editor.glade"); + + vs->val_labs_dialog = val_labs_dialog_create (xml); + vs->missing_val_dialog = missing_val_dialog_create (xml); + vs->var_type_dialog = var_type_dialog_create (xml); + + g_object_unref (xml); + + vs->dispose_has_run = FALSE; + + for (i = 0 ; i < PSPPIRE_VAR_STORE_n_COLS ; ++i ) + { + g_sheet_hetero_column_set_button_label (G_SHEET_HETERO_COLUMN (geo), i, + gettext (column_def[i].label)); + + g_sheet_hetero_column_set_width (G_SHEET_HETERO_COLUMN (geo), i, + column_def[i].width); + } + + g_object_set (vs, "column-geometry", geo, NULL); + + + g_signal_connect (vs, "activate", + G_CALLBACK (var_sheet_cell_entry_enter), + NULL); + + g_signal_connect (vs, "deactivate", + G_CALLBACK (var_sheet_cell_entry_leave), + NULL); + + g_signal_connect (vs, "traverse", + G_CALLBACK (traverse_cell_callback), NULL); +} + + +GtkWidget* +psppire_var_sheet_new (void) +{ + return GTK_WIDGET (g_object_new (psppire_var_sheet_get_type (), NULL)); +} diff --git a/src/ui/gui/psppire-var-sheet.h b/src/ui/gui/psppire-var-sheet.h new file mode 100644 index 00000000..3e94f89e --- /dev/null +++ b/src/ui/gui/psppire-var-sheet.h @@ -0,0 +1,72 @@ +/* PSPPIRE - a graphical user interface for PSPP. + Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#ifndef __PSPPIRE_VAR_SHEET_H__ +#define __PSPPIRE_VAR_SHEET_H__ + + +#include +#include +#include +#include "val-labs-dialog.h" +#include "missing-val-dialog.h" +#include "var-type-dialog.h" + + +G_BEGIN_DECLS + +#define PSPPIRE_VAR_SHEET_TYPE (psppire_var_sheet_get_type ()) +#define PSPPIRE_VAR_SHEET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), PSPPIRE_VAR_SHEET_TYPE, PsppireVarSheet)) +#define PSPPIRE_VAR_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PSPPIRE_VAR_SHEET_TYPE, PsppireVarSheetClass)) +#define PSPPIRE_IS_VAR_SHEET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PSPPIRE_VAR_SHEET_TYPE)) +#define PSPPIRE_IS_VAR_SHEET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PSPPIRE_VAR_SHEET_TYPE)) + + +typedef struct _PsppireVarSheet PsppireVarSheet; +typedef struct _PsppireVarSheetClass PsppireVarSheetClass; + +struct _PsppireVarSheet +{ + GtkSheet parent; + + gboolean dispose_has_run; + + struct val_labs_dialog *val_labs_dialog ; + struct missing_val_dialog *missing_val_dialog ; + struct var_type_dialog *var_type_dialog ; +}; + + +struct _PsppireVarSheetClass +{ + GtkSheetClass parent_class; + + GtkListStore *alignment_list; + GtkListStore *measure_list; + + void (*var_sheet)(PsppireVarSheet*); +}; + + +GType psppire_var_sheet_get_type (void); +GtkWidget* psppire_var_sheet_new (void); + +G_END_DECLS + + + + +#endif /* __PSPPIRE_VAR_SHEET_H__ */ diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index 6bf5c550..7edc665a 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -28,7 +28,7 @@ #include #include "psppire-var-store.h" -#include "var-sheet.h" +#include #include "helper.h" #include @@ -262,7 +262,7 @@ psppire_var_store_item_editable (PsppireVarStore *var_store, glong row, glong co if ( !pv ) return TRUE; - if ( var_is_alpha (pv) && column == COL_DECIMALS ) + if ( var_is_alpha (pv) && column == PSPPIRE_VAR_STORE_COL_DECIMALS ) return FALSE; write_spec = var_get_print_format (pv); @@ -282,7 +282,7 @@ psppire_var_store_item_editable (PsppireVarStore *var_store, glong row, glong co case FMT_DTIME: case FMT_WKDAY: case FMT_MONTH: - if ( column == COL_DECIMALS || column == COL_WIDTH) + if ( column == PSPPIRE_VAR_STORE_COL_DECIMALS || column == PSPPIRE_VAR_STORE_COL_WIDTH) return FALSE; break; default: @@ -375,7 +375,7 @@ var_change_callback (GtkWidget *w, gint n, gpointer data) GSheetModel *model = G_SHEET_MODEL (data); g_sheet_model_range_changed (model, - n, 0, n, n_COLS); + n, 0, n, PSPPIRE_VAR_STORE_n_COLS); } @@ -480,7 +480,7 @@ psppire_var_store_clear (GSheetModel *model, glong row, glong col) switch (col) { - case COL_LABEL: + case PSPPIRE_VAR_STORE_COL_LABEL: var_set_label (pv, 0); return TRUE; break; @@ -511,15 +511,15 @@ psppire_var_store_set_string (GSheetModel *model, switch (col) { - case COL_NAME: + case PSPPIRE_VAR_STORE_COL_NAME: return psppire_dict_rename_var (var_store->dict, pv, text); break; - case COL_COLUMNS: + case PSPPIRE_VAR_STORE_COL_COLUMNS: if ( ! text) return FALSE; var_set_display_width (pv, atoi (text)); return TRUE; break; - case COL_WIDTH: + case PSPPIRE_VAR_STORE_COL_WIDTH: { int width = atoi (text); if ( ! text) return FALSE; @@ -545,7 +545,7 @@ psppire_var_store_set_string (GSheetModel *model, return TRUE; } break; - case COL_DECIMALS: + case PSPPIRE_VAR_STORE_COL_DECIMALS: { bool for_input = var_store->format_type == PSPPIRE_VAR_STORE_INPUT_FORMATS; @@ -566,15 +566,15 @@ psppire_var_store_set_string (GSheetModel *model, return TRUE; } break; - case COL_LABEL: + case PSPPIRE_VAR_STORE_COL_LABEL: var_set_label (pv, text); return TRUE; break; - case COL_TYPE: - case COL_VALUES: - case COL_MISSING: - case COL_ALIGN: - case COL_MEASURE: + case PSPPIRE_VAR_STORE_COL_TYPE: + case PSPPIRE_VAR_STORE_COL_VALUES: + case PSPPIRE_VAR_STORE_COL_MISSING: + case PSPPIRE_VAR_STORE_COL_ALIGN: + case PSPPIRE_VAR_STORE_COL_MEASURE: /* These can be modified only by their respective dialog boxes */ return FALSE; break; @@ -610,10 +610,10 @@ text_for_column (const struct variable *pv, gint c, GError **err) switch (c) { - case COL_NAME: + case PSPPIRE_VAR_STORE_COL_NAME: return pspp_locale_to_utf8 ( var_get_name (pv), -1, err); break; - case COL_TYPE: + case PSPPIRE_VAR_STORE_COL_TYPE: { switch ( write_spec->type ) { @@ -667,7 +667,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) } } break; - case COL_WIDTH: + case PSPPIRE_VAR_STORE_COL_WIDTH: { gchar *s; GString *gstr = g_string_sized_new (10); @@ -677,7 +677,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) return s; } break; - case COL_DECIMALS: + case PSPPIRE_VAR_STORE_COL_DECIMALS: { gchar *s; GString *gstr = g_string_sized_new (10); @@ -687,7 +687,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) return s; } break; - case COL_COLUMNS: + case PSPPIRE_VAR_STORE_COL_COLUMNS: { gchar *s; GString *gstr = g_string_sized_new (10); @@ -697,16 +697,16 @@ text_for_column (const struct variable *pv, gint c, GError **err) return s; } break; - case COL_LABEL: + case PSPPIRE_VAR_STORE_COL_LABEL: return pspp_locale_to_utf8 (var_get_label (pv), -1, err); break; - case COL_MISSING: + case PSPPIRE_VAR_STORE_COL_MISSING: { return missing_values_to_string (pv, err); } break; - case COL_VALUES: + case PSPPIRE_VAR_STORE_COL_VALUES: { if ( ! var_has_value_labels (pv)) return g_locale_to_utf8 (gettext (none), -1, 0, 0, err); @@ -735,7 +735,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) } } break; - case COL_ALIGN: + case PSPPIRE_VAR_STORE_COL_ALIGN: { const gint align = var_get_alignment (pv); @@ -743,7 +743,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) return g_locale_to_utf8 (gettext (alignments[align]), -1, 0, 0, err); } break; - case COL_MEASURE: + case PSPPIRE_VAR_STORE_COL_MEASURE: { return measure_to_string (pv, err); } @@ -789,7 +789,7 @@ psppire_var_store_get_row_count (const GSheetModel * model) static glong psppire_var_store_get_column_count (const GSheetModel * model) { - return n_COLS ; + return PSPPIRE_VAR_STORE_n_COLS ; } diff --git a/src/ui/gui/psppire-var-store.h b/src/ui/gui/psppire-var-store.h index e60f9608..a4782efc 100644 --- a/src/ui/gui/psppire-var-store.h +++ b/src/ui/gui/psppire-var-store.h @@ -98,4 +98,19 @@ void psppire_var_store_set_font (PsppireVarStore *store, const PangoFontDescript G_END_DECLS + +enum { + PSPPIRE_VAR_STORE_COL_NAME, + PSPPIRE_VAR_STORE_COL_TYPE, + PSPPIRE_VAR_STORE_COL_WIDTH, + PSPPIRE_VAR_STORE_COL_DECIMALS, + PSPPIRE_VAR_STORE_COL_LABEL, + PSPPIRE_VAR_STORE_COL_VALUES, + PSPPIRE_VAR_STORE_COL_MISSING, + PSPPIRE_VAR_STORE_COL_COLUMNS, + PSPPIRE_VAR_STORE_COL_ALIGN, + PSPPIRE_VAR_STORE_COL_MEASURE, + PSPPIRE_VAR_STORE_n_COLS +}; + #endif /* __PSPPIRE_VAR_STORE_H__ */ diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 08d77f0c..ef05c6f6 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -46,8 +46,6 @@ #include "psppire-var-store.h" #include "psppire-data-store.h" #include "helper.h" -#include "data-sheet.h" -#include "var-sheet.h" #include "message-dialog.h" #include "output-viewer.h" diff --git a/src/ui/gui/rank-dialog.c b/src/ui/gui/rank-dialog.c index b463b25b..ee261865 100644 --- a/src/ui/gui/rank-dialog.c +++ b/src/ui/gui/rank-dialog.c @@ -235,11 +235,9 @@ rank_dialog (GObject *o, gpointer data) GtkWidget *types_button = get_widget_assert (xml, "button1"); GtkWidget *ties_button = get_widget_assert (xml, "button2"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + PsppireVarStore *vs = NULL; + g_object_get (de->data_editor, "var-store", &vs, NULL); rd.dict = vs->dict; rd.rank_vars = get_widget_assert (xml, "variables-treeview"); diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c index 3468e580..34145b0e 100644 --- a/src/ui/gui/recode-dialog.c +++ b/src/ui/gui/recode-dialog.c @@ -374,7 +374,7 @@ enum { COL_OLD, COL_NEW_NAME, COL_NEW_LABEL, - n_COLS + n_COL_VARS }; enum { @@ -853,11 +853,10 @@ recode_dialog (struct data_editor *de, gboolean diff) GtkWidget *output_variable_box = get_widget_assert (xml,"frame4"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); rd.change_button = get_widget_assert (xml, "change-button"); @@ -903,7 +902,7 @@ recode_dialog (struct data_editor *de, gboolean diff) GtkTreeViewColumn *col; GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); - rd.var_map = gtk_list_store_new (n_COLS, G_TYPE_INT, + rd.var_map = gtk_list_store_new (n_COL_VARS, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING); diff --git a/src/ui/gui/select-cases-dialog.c b/src/ui/gui/select-cases-dialog.c index 599b2128..1d759184 100644 --- a/src/ui/gui/select-cases-dialog.c +++ b/src/ui/gui/select-cases-dialog.c @@ -253,12 +253,7 @@ select_cases_dialog (GObject *o, gpointer data) scd.xml = XML_NEW ("psppire.glade"); - { - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - scd.data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet)); - } + g_object_get (de->data_editor, "data-store", &scd.data_store, NULL); button_range = get_widget_assert (scd.xml, "button-range"); button_sample = get_widget_assert (scd.xml, "button-sample"); diff --git a/src/ui/gui/sort-cases-dialog.c b/src/ui/gui/sort-cases-dialog.c index 62fac583..1ee59e9e 100644 --- a/src/ui/gui/sort-cases-dialog.c +++ b/src/ui/gui/sort-cases-dialog.c @@ -105,10 +105,9 @@ sort_cases_dialog (GObject *o, gpointer data) GtkWidget *selector = get_widget_assert (xml, "sort-cases-selector"); GtkWidget *dest = get_widget_assert (xml, "sort-cases-treeview2"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); diff --git a/src/ui/gui/split-file-dialog.c b/src/ui/gui/split-file-dialog.c index 1a567eaa..374e6af2 100644 --- a/src/ui/gui/split-file-dialog.c +++ b/src/ui/gui/split-file-dialog.c @@ -178,8 +178,6 @@ split_file_dialog (GObject *o, gpointer data) GtkWidget *selector ; GtkWidget *on_off ; - GtkSheet *var_sheet ; - sfd.xml = XML_NEW ("psppire.glade"); dialog = get_widget_assert (sfd.xml, "split-file-dialog"); @@ -188,9 +186,7 @@ split_file_dialog (GObject *o, gpointer data) selector = get_widget_assert (sfd.xml, "split-file-selector"); on_off = get_widget_assert (sfd.xml, "split-radiobutton0"); - var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); sfd.dict = vs->dict; sfd.tv = GTK_TREE_VIEW (dest); diff --git a/src/ui/gui/t-test-independent-samples-dialog.c b/src/ui/gui/t-test-independent-samples-dialog.c index c759edfb..e01f0029 100644 --- a/src/ui/gui/t-test-independent-samples-dialog.c +++ b/src/ui/gui/t-test-independent-samples-dialog.c @@ -397,13 +397,10 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) gint response; struct data_editor *de = data; - PsppireVarStore *vs; + PsppireVarStore *vs = NULL; GladeXML *xml = XML_NEW ("t-test.glade"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - GtkWidget *dict_view = get_widget_assert (xml, "indep-samples-t-test-treeview1"); @@ -419,7 +416,7 @@ t_test_independent_samples_dialog (GObject *o, gpointer data) GtkWidget *options_button = get_widget_assert (xml, "indep-samples-t-test-options-button"); - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); tt_d.dialog = get_widget_assert (xml, "t-test-independent-samples-dialog"); tt_d.xml = xml; diff --git a/src/ui/gui/t-test-one-sample.c b/src/ui/gui/t-test-one-sample.c index f92a32f9..f9246d6d 100644 --- a/src/ui/gui/t-test-one-sample.c +++ b/src/ui/gui/t-test-one-sample.c @@ -127,13 +127,10 @@ t_test_one_sample_dialog (GObject *o, gpointer data) gint response; struct data_editor *de = data; - PsppireVarStore *vs; + PsppireVarStore *vs = NULL; GladeXML *xml = XML_NEW ("t-test.glade"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - GtkWidget *dict_view = get_widget_assert (xml, "one-sample-t-test-treeview2"); @@ -144,7 +141,7 @@ t_test_one_sample_dialog (GObject *o, gpointer data) GtkWidget *dialog = get_widget_assert (xml, "t-test-one-sample-dialog"); - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); tt_d.dict = vs->dict; tt_d.vars_treeview = get_widget_assert (xml, "one-sample-t-test-treeview1"); diff --git a/src/ui/gui/t-test-paired-samples.c b/src/ui/gui/t-test-paired-samples.c index 7bb422ca..9dd11287 100644 --- a/src/ui/gui/t-test-paired-samples.c +++ b/src/ui/gui/t-test-paired-samples.c @@ -186,13 +186,10 @@ t_test_paired_samples_dialog (GObject *o, gpointer data) gint response; struct data_editor *de = data; - PsppireVarStore *vs; + PsppireVarStore *vs = NULL; GladeXML *xml = XML_NEW ("t-test.glade"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - GtkWidget *dict_view = get_widget_assert (xml, "paired-samples-t-test-treeview1"); @@ -202,7 +199,7 @@ t_test_paired_samples_dialog (GObject *o, gpointer data) GtkWidget *dialog = get_widget_assert (xml, "t-test-paired-samples-dialog"); - vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); tt_d.dict = vs->dict; tt_d.pairs_treeview = diff --git a/src/ui/gui/transpose-dialog.c b/src/ui/gui/transpose-dialog.c index cdd3364d..12918768 100644 --- a/src/ui/gui/transpose-dialog.c +++ b/src/ui/gui/transpose-dialog.c @@ -85,10 +85,7 @@ transpose_dialog (GObject *o, gpointer data) GladeXML *xml = XML_NEW ("psppire.glade"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + PsppireVarStore *vs = NULL; GtkWidget *dialog = get_widget_assert (xml, "transpose-dialog"); GtkWidget *source = get_widget_assert (xml, "source-treeview"); @@ -97,6 +94,8 @@ transpose_dialog (GObject *o, gpointer data) GtkWidget *selector2 = get_widget_assert (xml, "psppire-selector3"); GtkWidget *new_name_entry = get_widget_assert (xml, "new-name-entry"); + g_object_get (de->data_editor, "var-store", &vs, NULL); + attach_dictionary_to_treeview (GTK_TREE_VIEW (source), vs->dict, GTK_SELECTION_MULTIPLE, NULL); diff --git a/src/ui/gui/var-display.c b/src/ui/gui/var-display.c index 62c3eeee..0ddf7945 100644 --- a/src/ui/gui/var-display.c +++ b/src/ui/gui/var-display.c @@ -4,7 +4,6 @@ #include #include -#include "var-sheet.h" #include #define _(msgid) gettext (msgid) #define N_(msgid) msgid diff --git a/src/ui/gui/var-display.h b/src/ui/gui/var-display.h index 83b05aec..40404b89 100644 --- a/src/ui/gui/var-display.h +++ b/src/ui/gui/var-display.h @@ -19,9 +19,16 @@ #define VAR_DISPLAY 1 #include +#include struct variable; +#define n_ALIGNMENTS 3 + +extern const gchar *const alignments[n_ALIGNMENTS + 1]; + +extern const gchar *const measures[n_MEASURES + 1]; + gchar * name_to_string (const struct variable *var, GError **err); diff --git a/src/ui/gui/variable-info-dialog.c b/src/ui/gui/variable-info-dialog.c index c9c28511..d00fcd5d 100644 --- a/src/ui/gui/variable-info-dialog.c +++ b/src/ui/gui/variable-info-dialog.c @@ -173,11 +173,9 @@ variable_info_dialog (GObject *o, gpointer data) GtkWidget *treeview = get_widget_assert (xml, "treeview2"); GtkWidget *textview = get_widget_assert (xml, "textview1"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); @@ -202,36 +200,15 @@ variable_info_dialog (GObject *o, gpointer data) { case PSPPIRE_RESPONSE_GOTO: { - gint row, col; - GtkNotebook *notebook = GTK_NOTEBOOK - (get_widget_assert (de->xml,"notebook")); - const struct variable *var = get_selected_variable (GTK_TREE_VIEW (treeview)); if ( NULL == var) goto done; - - if (PAGE_VAR_SHEET == gtk_notebook_get_current_page (notebook)) - { - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); - - gtk_sheet_get_active_cell (var_sheet, &row, &col); - row = var_get_dict_index (var); - gtk_sheet_set_active_cell (var_sheet, row, col); - } - else - { - GtkSheet *data_sheet = - GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); - - gtk_sheet_get_active_cell (data_sheet, &row, &col); - col = var_get_dict_index (var); - gtk_sheet_set_active_cell (data_sheet, row, col); - } + g_object_set (de->data_editor, "current-variable", var_get_dict_index (var), NULL); } + break; case PSPPIRE_RESPONSE_PASTE: { diff --git a/src/ui/gui/weight-cases-dialog.c b/src/ui/gui/weight-cases-dialog.c index 8ad7c7d0..f921e2cc 100644 --- a/src/ui/gui/weight-cases-dialog.c +++ b/src/ui/gui/weight-cases-dialog.c @@ -120,10 +120,9 @@ weight_cases_dialog (GObject *o, gpointer data) GtkWidget *radiobutton2 = get_widget_assert (xml, "radiobutton2"); GtkWidget *status = get_widget_assert (xml, "weight-status-label"); - GtkSheet *var_sheet = - GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + PsppireVarStore *vs = NULL; - PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + g_object_get (de->data_editor, "var-store", &vs, NULL); gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window);