From: John Darrington Date: Fri, 23 Nov 2007 10:34:53 +0000 (+0000) Subject: Implemented the recode dialogs. X-Git-Tag: v0.6.0~182 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp-builds.git;a=commitdiff_plain;h=c65449a628d13f4683e7dc7125874608c7152017 Implemented the recode dialogs. --- diff --git a/po/de.po b/po/de.po index 757763b5..ced867fc 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: 2007-11-21 20:50+0900\n" +"POT-Creation-Date: 2007-11-21 21:01+0900\n" "PO-Revision-Date: 2006-07-28 19:32+0800\n" "Last-Translator: John Darrington \n" "Language-Team: German \n" @@ -320,13 +320,13 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:318 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1285 src/ui/gui/psppire.glade:2176 +#: src/ui/gui/data-editor.glade:1304 src/ui/gui/psppire.glade:2176 #: src/ui/gui/psppire-var-store.c:493 msgid "String" msgstr "Zeichenkette" #: src/data/format.c:318 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1174 src/ui/gui/psppire.glade:2131 +#: src/ui/gui/data-editor.glade:1193 src/ui/gui/psppire.glade:2131 #: src/ui/gui/psppire-var-store.c:486 msgid "Numeric" msgstr "Nummer" @@ -1765,6 +1765,7 @@ msgid "File:" msgstr "Datei:" #: src/language/dictionary/sys-file-info.c:112 src/ui/gui/psppire.glade:2052 +#: src/ui/gui/recode.glade:841 msgid "Label:" msgstr "Kennsatz:" @@ -1818,7 +1819,7 @@ msgid "IBM 390 Hex Long." msgstr "" #: src/language/dictionary/sys-file-info.c:135 -#: src/ui/gui/descriptives-dialog.glade:79 +#: src/ui/gui/descriptives-dialog.glade:79 src/ui/gui/recode.glade:940 msgid "Variables:" msgstr "" @@ -4396,267 +4397,286 @@ msgstr "Spalten" msgid "Style of bevel around the custom entry button" msgstr "" -#: src/ui/gui/data-editor.c:162 +#: src/ui/gui/data-editor.c:163 msgid "Transformations Pending" msgstr "" -#: src/ui/gui/data-editor.c:424 +#: src/ui/gui/data-editor.c:425 #, fuzzy msgid "Labels" msgstr "Kennsatz" -#: src/ui/gui/data-editor.c:425 +#: src/ui/gui/data-editor.c:426 msgid "Show/hide value labels" msgstr "" -#: src/ui/gui/data-editor.c:443 src/ui/gui/data-editor.c:460 -#: src/ui/gui/data-editor.c:1799 src/ui/gui/data-editor.c:1852 +#: src/ui/gui/data-editor.c:444 src/ui/gui/data-editor.c:461 +#: src/ui/gui/data-editor.c:1830 src/ui/gui/data-editor.c:1883 msgid "Clear" msgstr "" -#: src/ui/gui/data-editor.c:444 +#: src/ui/gui/data-editor.c:445 msgid "Delete the cases at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:461 +#: src/ui/gui/data-editor.c:462 msgid "Delete the variables at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:475 src/ui/gui/data-editor.c:1796 -#: src/ui/gui/data-editor.glade:137 src/ui/gui/data-editor.glade:789 +#: src/ui/gui/data-editor.c:476 src/ui/gui/data-editor.c:1827 +#: 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:476 +#: src/ui/gui/data-editor.c:477 msgid "Create a new variable at the current position" msgstr "" -#: src/ui/gui/data-editor.c:494 src/ui/gui/data-editor.c:1849 -#: src/ui/gui/data-editor.glade:777 +#: src/ui/gui/data-editor.c:495 src/ui/gui/data-editor.c:1880 +#: src/ui/gui/data-editor.glade:796 #, fuzzy msgid "Insert Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:495 +#: src/ui/gui/data-editor.c:496 msgid "Create a new case at the current position" msgstr "" -#: src/ui/gui/data-editor.c:515 +#: src/ui/gui/data-editor.c:516 #, fuzzy msgid "Goto Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:516 +#: src/ui/gui/data-editor.c:517 msgid "Jump to a Case in the Data Sheet" msgstr "" -#: src/ui/gui/data-editor.c:535 +#: src/ui/gui/data-editor.c:536 #, fuzzy msgid "Weights" msgstr "Rechts" -#: src/ui/gui/data-editor.c:536 +#: src/ui/gui/data-editor.c:537 msgid "Weight cases by variable" msgstr "" -#: src/ui/gui/data-editor.c:545 src/ui/gui/data-editor.glade:312 +#: src/ui/gui/data-editor.c:546 src/ui/gui/data-editor.glade:312 msgid "Transpose" msgstr "" -#: src/ui/gui/data-editor.c:546 +#: src/ui/gui/data-editor.c:547 msgid "Transpose the cases with the variables" msgstr "" -#: src/ui/gui/data-editor.c:557 +#: src/ui/gui/data-editor.c:558 #, fuzzy msgid "Split" msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:558 +#: src/ui/gui/data-editor.c:559 msgid "Split the active file" msgstr "" -#: src/ui/gui/data-editor.c:568 +#: src/ui/gui/data-editor.c:569 msgid "Sort" msgstr "" -#: src/ui/gui/data-editor.c:569 +#: src/ui/gui/data-editor.c:570 msgid "Sort cases in the active file" msgstr "" -#: src/ui/gui/data-editor.c:577 src/ui/gui/data-editor.glade:347 -#: src/ui/gui/data-editor.glade:832 +#: src/ui/gui/data-editor.c:578 src/ui/gui/data-editor.glade:347 +#: src/ui/gui/data-editor.glade:851 msgid "Select Cases" msgstr "" -#: src/ui/gui/data-editor.c:578 +#: src/ui/gui/data-editor.c:579 msgid "Select cases from the active file" msgstr "" -#: src/ui/gui/data-editor.c:587 +#: src/ui/gui/data-editor.c:588 msgid "Compute" msgstr "" -#: src/ui/gui/data-editor.c:588 +#: src/ui/gui/data-editor.c:589 #, fuzzy msgid "Compute new values for a variable" msgstr "Unpassend Wert für Variable" -#: src/ui/gui/data-editor.c:596 +#: src/ui/gui/data-editor.c:597 msgid "Oneway _ANOVA" msgstr "" -#: src/ui/gui/data-editor.c:597 +#: src/ui/gui/data-editor.c:598 msgid "Perform one way analysis of variance" msgstr "" -#: src/ui/gui/data-editor.c:605 src/ui/gui/data-editor.glade:484 +#: src/ui/gui/data-editor.c:606 src/ui/gui/data-editor.glade:503 msgid "_Independent Samples T Test" msgstr "" -#: src/ui/gui/data-editor.c:606 +#: src/ui/gui/data-editor.c:607 msgid "Calculate T Test for samples from independent groups" msgstr "" -#: src/ui/gui/data-editor.c:615 +#: src/ui/gui/data-editor.c:616 #, fuzzy msgid "Data File Comments" msgstr "Datei Fehler" -#: src/ui/gui/data-editor.c:616 +#: src/ui/gui/data-editor.c:617 msgid "Commentary text for the data file" msgstr "" -#: src/ui/gui/data-editor.c:624 src/ui/gui/data-editor.glade:757 +#: src/ui/gui/data-editor.c:625 src/ui/gui/data-editor.glade:776 msgid "Find" msgstr "" -#: src/ui/gui/data-editor.c:625 +#: src/ui/gui/data-editor.c:626 #, fuzzy msgid "Find Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:634 src/ui/gui/data-editor.glade:384 +#: src/ui/gui/data-editor.c:635 src/ui/gui/data-editor.glade:384 #, fuzzy msgid "Ran_k Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:635 +#: src/ui/gui/data-editor.c:636 #, fuzzy msgid "Rank Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.c:644 src/ui/gui/data-editor.glade:286 -#: src/ui/gui/data-editor.glade:736 +#: src/ui/gui/data-editor.c:645 src/ui/gui/data-editor.glade:396 +#, fuzzy +msgid "Recode into _Same Variables" +msgstr "Variableansicht" + +#: src/ui/gui/data-editor.c:646 +#, fuzzy +msgid "Recode values into the same Variables" +msgstr "Unpassend Wert für Variable" + +#: src/ui/gui/data-editor.c:655 src/ui/gui/data-editor.glade:403 +msgid "Recode into _Different Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:656 +msgid "Recode values into different Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:665 src/ui/gui/data-editor.glade:286 +#: src/ui/gui/data-editor.glade:755 msgid "Variables" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:645 +#: src/ui/gui/data-editor.c:666 #, fuzzy msgid "Jump to Variable" msgstr "Variableansicht" -#: src/ui/gui/data-editor.c:653 src/ui/gui/data-editor.glade:438 +#: src/ui/gui/data-editor.c:674 src/ui/gui/data-editor.glade:457 #: src/ui/gui/oneway.glade:179 msgid "_Descriptives" msgstr "" -#: src/ui/gui/data-editor.c:654 +#: src/ui/gui/data-editor.c:675 msgid "Calculate descriptive statistics (mean, variance, ...)" msgstr "" -#: src/ui/gui/data-editor.c:1077 +#: src/ui/gui/data-editor.c:1108 msgid "Font Selection" msgstr "Schriftwahlung" -#: src/ui/gui/data-editor.c:1284 +#: src/ui/gui/data-editor.c:1315 msgid "No Split" msgstr "" -#: src/ui/gui/data-editor.c:1293 +#: src/ui/gui/data-editor.c:1324 #, fuzzy msgid "Split by " msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:1318 +#: src/ui/gui/data-editor.c:1349 msgid "Filter off" msgstr "" -#: src/ui/gui/data-editor.c:1331 +#: src/ui/gui/data-editor.c:1362 #, c-format msgid "Filter by %s" msgstr "" -#: src/ui/gui/data-editor.c:1349 +#: src/ui/gui/data-editor.c:1380 msgid "Weights off" msgstr "" -#: src/ui/gui/data-editor.c:1362 +#: src/ui/gui/data-editor.c:1393 #, c-format msgid "Weight by %s" msgstr "" -#: src/ui/gui/data-editor.c:1385 src/ui/gui/data-editor.c:1619 -#: src/ui/gui/data-editor.glade:648 +#: src/ui/gui/data-editor.c:1416 src/ui/gui/data-editor.c:1650 +#: src/ui/gui/data-editor.glade:667 msgid "Open" msgstr "Öffen" -#: src/ui/gui/data-editor.c:1386 +#: src/ui/gui/data-editor.c:1417 msgid "Open a data file" msgstr "" -#: src/ui/gui/data-editor.c:1394 src/ui/gui/data-editor.c:1501 -#: src/ui/gui/data-editor.glade:658 +#: src/ui/gui/data-editor.c:1425 src/ui/gui/data-editor.c:1532 +#: src/ui/gui/data-editor.glade:677 msgid "Save" msgstr "Speichen" -#: src/ui/gui/data-editor.c:1395 src/ui/gui/data-editor.c:1405 +#: src/ui/gui/data-editor.c:1426 src/ui/gui/data-editor.c:1436 #, fuzzy msgid "Save data to file" msgstr "Speichern unter" -#: src/ui/gui/data-editor.c:1404 +#: src/ui/gui/data-editor.c:1435 #, fuzzy msgid "Save As" msgstr "Speichern unter" -#: src/ui/gui/data-editor.c:1413 +#: src/ui/gui/data-editor.c:1444 src/ui/gui/recode-dialog.c:906 +#: src/ui/gui/recode-dialog.c:997 msgid "New" msgstr "" -#: src/ui/gui/data-editor.c:1414 +#: src/ui/gui/data-editor.c:1445 msgid "New data file" msgstr "" -#: src/ui/gui/data-editor.c:1509 src/ui/gui/data-editor.c:1627 +#: src/ui/gui/data-editor.c:1540 src/ui/gui/data-editor.c:1658 msgid "System Files (*.sav)" msgstr "Systemedatein (*.sav)" -#: src/ui/gui/data-editor.c:1515 src/ui/gui/data-editor.c:1633 +#: src/ui/gui/data-editor.c:1546 src/ui/gui/data-editor.c:1664 msgid "Portable Files (*.por) " msgstr "Tragbardatein (*.por)" -#: src/ui/gui/data-editor.c:1521 src/ui/gui/data-editor.c:1639 +#: src/ui/gui/data-editor.c:1552 src/ui/gui/data-editor.c:1670 #: 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:1529 +#: src/ui/gui/data-editor.c:1560 #, fuzzy msgid "System File" msgstr "Systemedatein (*.sav)" -#: src/ui/gui/data-editor.c:1534 +#: src/ui/gui/data-editor.c:1565 #, fuzzy msgid "Portable File" msgstr "Tragbardatein (*.por)" -#: src/ui/gui/data-editor.c:1789 +#: src/ui/gui/data-editor.c:1820 msgid "Sort Ascending" msgstr "" -#: src/ui/gui/data-editor.c:1792 +#: src/ui/gui/data-editor.c:1823 msgid "Sort Descending" msgstr "" @@ -4695,7 +4715,7 @@ msgstr "_Bearbeiten" msgid "Insert Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.glade:153 src/ui/gui/data-editor.glade:726 +#: src/ui/gui/data-editor.glade:153 src/ui/gui/data-editor.glade:745 msgid "Go To Case" msgstr "" @@ -4734,8 +4754,8 @@ msgstr "Schrift" msgid "Grid Lines" msgstr "Glitten" -#: src/ui/gui/data-editor.glade:267 src/ui/gui/data-editor.glade:852 -#: src/ui/gui/data-editor.glade:1547 src/ui/gui/data-editor.glade:1728 +#: 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 msgid "Value Labels" msgstr "Werten" @@ -4756,12 +4776,12 @@ msgstr "Alle Datei" msgid "Aggregate" msgstr "" -#: src/ui/gui/data-editor.glade:339 src/ui/gui/data-editor.glade:809 +#: src/ui/gui/data-editor.glade:339 src/ui/gui/data-editor.glade:828 #, fuzzy msgid "Split File" msgstr "Alle Datei" -#: src/ui/gui/data-editor.glade:354 src/ui/gui/data-editor.glade:820 +#: src/ui/gui/data-editor.glade:354 src/ui/gui/data-editor.glade:839 msgid "Weight Cases" msgstr "" @@ -4773,245 +4793,246 @@ msgstr "" msgid "_Compute" msgstr "" -#: src/ui/gui/data-editor.glade:397 +#: src/ui/gui/data-editor.glade:416 msgid "_Run Pending Transforms" msgstr "" -#: src/ui/gui/data-editor.glade:410 +#: src/ui/gui/data-editor.glade:429 msgid "_Analyze" msgstr "" -#: src/ui/gui/data-editor.glade:420 +#: src/ui/gui/data-editor.glade:439 msgid "_Descriptive Statistics" msgstr "" -#: src/ui/gui/data-editor.glade:430 +#: src/ui/gui/data-editor.glade:449 #, fuzzy msgid "_Frequencies" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:446 +#: src/ui/gui/data-editor.glade:465 msgid "_Explore" msgstr "" -#: src/ui/gui/data-editor.glade:454 +#: src/ui/gui/data-editor.glade:473 msgid "_Crosstabs" msgstr "" -#: src/ui/gui/data-editor.glade:466 +#: src/ui/gui/data-editor.glade:485 msgid "Compare _Means" msgstr "" -#: src/ui/gui/data-editor.glade:476 +#: src/ui/gui/data-editor.glade:495 msgid "_One Sample T Test" msgstr "" -#: src/ui/gui/data-editor.glade:492 +#: src/ui/gui/data-editor.glade:511 msgid "_Paired Samples T Test" msgstr "" -#: src/ui/gui/data-editor.glade:500 +#: src/ui/gui/data-editor.glade:519 msgid "One Way _ANOVA" msgstr "" -#: src/ui/gui/data-editor.glade:512 +#: src/ui/gui/data-editor.glade:531 msgid "Bivariate _Correlation" msgstr "" -#: src/ui/gui/data-editor.glade:520 +#: src/ui/gui/data-editor.glade:539 msgid "Linear _Regression" msgstr "" -#: src/ui/gui/data-editor.glade:528 +#: src/ui/gui/data-editor.glade:547 msgid "_Non-Parametric Statistics" msgstr "" -#: src/ui/gui/data-editor.glade:538 +#: src/ui/gui/data-editor.glade:557 msgid "_Chi-Square" msgstr "" -#: src/ui/gui/data-editor.glade:546 +#: src/ui/gui/data-editor.glade:565 #, fuzzy msgid "_Binomial" msgstr "Nominalwert" -#: src/ui/gui/data-editor.glade:562 +#: src/ui/gui/data-editor.glade:581 msgid "_Utilities" msgstr "" -#: src/ui/gui/data-editor.glade:572 +#: src/ui/gui/data-editor.glade:591 #, fuzzy msgid "_Variables" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:581 +#: src/ui/gui/data-editor.glade:600 #, fuzzy msgid "Data File _Comments" msgstr "Datei Fehler" -#: src/ui/gui/data-editor.glade:592 src/ui/gui/output-viewer.glade:78 +#: src/ui/gui/data-editor.glade:611 src/ui/gui/output-viewer.glade:78 #: src/ui/gui/syntax-editor.glade:234 #, fuzzy msgid "_Windows" msgstr "_Datei" -#: src/ui/gui/data-editor.glade:599 src/ui/gui/output-viewer.glade:88 +#: src/ui/gui/data-editor.glade:618 src/ui/gui/output-viewer.glade:88 #: src/ui/gui/syntax-editor.glade:243 msgid "_Minimize All Windows" msgstr "" -#: src/ui/gui/data-editor.glade:610 src/ui/gui/output-viewer.glade:99 +#: src/ui/gui/data-editor.glade:629 src/ui/gui/output-viewer.glade:99 #: src/ui/gui/syntax-editor.glade:254 msgid "_Help" msgstr "_Hilfe" -#: src/ui/gui/data-editor.glade:617 src/ui/gui/output-viewer.glade:106 +#: src/ui/gui/data-editor.glade:636 src/ui/gui/output-viewer.glade:106 #: src/ui/gui/syntax-editor.glade:262 msgid "_Reference Manual" msgstr "" -#: src/ui/gui/data-editor.glade:624 src/ui/gui/output-viewer.glade:113 +#: src/ui/gui/data-editor.glade:643 src/ui/gui/output-viewer.glade:113 #: src/ui/gui/syntax-editor.glade:269 msgid "_About" msgstr "_Info" -#: src/ui/gui/data-editor.glade:668 +#: src/ui/gui/data-editor.glade:687 msgid "Print" msgstr "Drucken" -#: src/ui/gui/data-editor.glade:678 +#: src/ui/gui/data-editor.glade:697 msgid "Recall" msgstr "" -#: src/ui/gui/data-editor.glade:696 +#: src/ui/gui/data-editor.glade:715 msgid "Undo" msgstr "" -#: src/ui/gui/data-editor.glade:706 +#: src/ui/gui/data-editor.glade:725 msgid "Redo" msgstr "" -#: src/ui/gui/data-editor.glade:863 +#: src/ui/gui/data-editor.glade:882 msgid "Use Sets" msgstr "" -#: src/ui/gui/data-editor.glade:945 +#: src/ui/gui/data-editor.glade:964 msgid "Data View" msgstr "Datenansicht" -#: src/ui/gui/data-editor.glade:972 +#: src/ui/gui/data-editor.glade:991 msgid "Variable View" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:1002 +#: src/ui/gui/data-editor.glade:1021 msgid "Information Area" msgstr "" -#: src/ui/gui/data-editor.glade:1021 +#: src/ui/gui/data-editor.glade:1040 msgid "Processor Area" msgstr "" -#: src/ui/gui/data-editor.glade:1046 +#: src/ui/gui/data-editor.glade:1065 msgid "Case Counter Area" msgstr "" -#: src/ui/gui/data-editor.glade:1071 +#: src/ui/gui/data-editor.glade:1090 msgid "Filter Use Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1097 +#: src/ui/gui/data-editor.glade:1116 msgid "Weight Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1123 +#: src/ui/gui/data-editor.glade:1142 #, fuzzy msgid "Split File Status Area" msgstr "Alle Datei" -#: src/ui/gui/data-editor.glade:1153 +#: src/ui/gui/data-editor.glade:1172 msgid "Variable Type" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:1189 src/ui/gui/psppire-var-store.c:487 +#: src/ui/gui/data-editor.glade:1208 src/ui/gui/psppire-var-store.c:487 msgid "Comma" msgstr "Komma" -#: src/ui/gui/data-editor.glade:1205 src/ui/gui/psppire-var-store.c:488 +#: src/ui/gui/data-editor.glade:1224 src/ui/gui/psppire-var-store.c:488 msgid "Dot" msgstr "Punkt" -#: src/ui/gui/data-editor.glade:1221 +#: src/ui/gui/data-editor.glade:1240 msgid "Scientific notation" msgstr "Wissenschaftlichnotation" -#: src/ui/gui/data-editor.glade:1237 src/ui/gui/psppire-var-store.c:490 +#: src/ui/gui/data-editor.glade:1256 src/ui/gui/psppire-var-store.c:490 msgid "Date" msgstr "Datum" -#: src/ui/gui/data-editor.glade:1253 src/ui/gui/psppire-var-store.c:491 +#: src/ui/gui/data-editor.glade:1272 src/ui/gui/psppire-var-store.c:491 msgid "Dollar" msgstr "Euro" -#: src/ui/gui/data-editor.glade:1269 +#: src/ui/gui/data-editor.glade:1288 msgid "Custom currency" msgstr "Spezialwährung" -#: src/ui/gui/data-editor.glade:1363 +#: src/ui/gui/data-editor.glade:1382 msgid "positive" msgstr "positiv" -#: src/ui/gui/data-editor.glade:1369 +#: src/ui/gui/data-editor.glade:1388 msgid "negative" msgstr "negativ" -#: src/ui/gui/data-editor.glade:1382 +#: src/ui/gui/data-editor.glade:1401 msgid "Sample" msgstr "Muster" -#: src/ui/gui/data-editor.glade:1430 -msgid "Decimal Places:" -msgstr "Dezimalstellen:" - -#: src/ui/gui/data-editor.glade:1471 +#: src/ui/gui/data-editor.glade:1451 msgid "Width:" msgstr "Große:" -#: src/ui/gui/data-editor.glade:1634 src/ui/gui/psppire.glade:2544 -msgid "Value:" -msgstr "Werte:" +#: src/ui/gui/data-editor.glade:1495 +msgid "Decimal Places:" +msgstr "Dezimalstellen:" -#: src/ui/gui/data-editor.glade:1645 +#: src/ui/gui/data-editor.glade:1664 msgid "Value Label:" msgstr "Kennsatz:" -#: src/ui/gui/data-editor.glade:1795 src/ui/gui/t-test.glade:370 +#: src/ui/gui/data-editor.glade:1677 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/t-test.glade:370 msgid "Missing Values" msgstr "Lösewerten" -#: src/ui/gui/data-editor.glade:1862 -msgid "_No missing values" -msgstr "_Kein Lösewerten" - -#: src/ui/gui/data-editor.glade:1880 -msgid "_Discrete missing values" -msgstr "_Diskret Lösewerten" - -#: src/ui/gui/data-editor.glade:1965 +#: src/ui/gui/data-editor.glade:1832 msgid "_Range plus one optional discrete missing value" msgstr "Wertebereich und ein optional Lösewert" -#: src/ui/gui/data-editor.glade:1990 +#: src/ui/gui/data-editor.glade:1857 msgid "_Low:" msgstr "_Tief:" -#: src/ui/gui/data-editor.glade:2019 +#: src/ui/gui/data-editor.glade:1886 msgid "_High:" msgstr "_Hoch:" -#: src/ui/gui/data-editor.glade:2060 +#: src/ui/gui/data-editor.glade:1927 msgid "Di_screte value:" msgstr "Di_skretwerte" +#: src/ui/gui/data-editor.glade:1974 +msgid "_No missing values" +msgstr "_Kein Lösewerten" + +#: src/ui/gui/data-editor.glade:1992 +msgid "_Discrete missing values" +msgstr "_Diskret Lösewerten" + #: src/ui/gui/descriptives-dialog.c:53 msgid "Standard deviation" msgstr "" @@ -5332,6 +5353,7 @@ msgid "Functions:" msgstr "" #: src/ui/gui/psppire.glade:1107 src/ui/gui/psppire.glade:1253 +#: src/ui/gui/recode.glade:731 msgid "If..." msgstr "" @@ -5595,6 +5617,115 @@ msgstr "" msgid "Rank Assigned to Ties" msgstr "" +#: src/ui/gui/recode-dialog.c:857 +msgid "Recode into Different Variables" +msgstr "" + +#: src/ui/gui/recode-dialog.c:860 +#, fuzzy +msgid "Recode into Same Variables" +msgstr "Variableansicht" + +#: src/ui/gui/recode-dialog.c:891 src/ui/gui/recode-dialog.c:989 +msgid "Old" +msgstr "" + +#: src/ui/gui/recode-dialog.c:1246 +msgid "Recode into Different Variables: Old and New Values " +msgstr "" + +#: src/ui/gui/recode-dialog.c:1247 +msgid "Recode into Same Variables: Old and New Values" +msgstr "" + +#: src/ui/gui/recode.glade:197 +#, fuzzy +msgid "System-Missing" +msgstr "Löse" + +#: src/ui/gui/recode.glade:211 +msgid "System-or user-missing" +msgstr "" + +#: src/ui/gui/recode.glade:245 +msgid "through" +msgstr "" + +#: src/ui/gui/recode.glade:283 +msgid "Range, LOWEST thru value" +msgstr "" + +#: src/ui/gui/recode.glade:297 +msgid "Range, value thru HIGHEST" +msgstr "" + +#: src/ui/gui/recode.glade:327 +msgid "All other values" +msgstr "" + +#: src/ui/gui/recode.glade:363 +msgid "Range:" +msgstr "" + +#: src/ui/gui/recode.glade:380 +#, fuzzy +msgid "Old Value" +msgstr "Werte:" + +#: src/ui/gui/recode.glade:462 +#, fuzzy +msgid "System Missing" +msgstr "Löse" + +#: src/ui/gui/recode.glade:476 +msgid "Copy old values" +msgstr "" + +#: src/ui/gui/recode.glade:500 +#, fuzzy +msgid "Value: " +msgstr "Werte:" + +#: src/ui/gui/recode.glade:530 +#, fuzzy +msgid "New Value" +msgstr "Werte:" + +#: src/ui/gui/recode.glade:590 +msgid "Convert numeric strings to numbers ('5' -> 5)" +msgstr "" + +#: src/ui/gui/recode.glade:608 +msgid "Output variables are strings" +msgstr "" + +#: src/ui/gui/recode.glade:620 +#, fuzzy +msgid "Width: " +msgstr "Große:" + +#: src/ui/gui/recode.glade:743 +msgid "(optional case selection condition)" +msgstr "" + +#: src/ui/gui/recode.glade:823 +#, fuzzy +msgid "Name:" +msgstr "Name" + +#: src/ui/gui/recode.glade:867 +msgid "Change" +msgstr "" + +#: src/ui/gui/recode.glade:885 +#, fuzzy +msgid "Output Variable" +msgstr "Variableansicht" + +#: src/ui/gui/recode.glade:965 +msgid "Old and New Values" +msgstr "" + #: src/ui/gui/select-cases-dialog.c:85 #, c-format msgid "Approximately %3d%% of all cases." diff --git a/po/en_GB.po b/po/en_GB.po index d5ce8006..75c363dc 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: 2007-11-21 20:50+0900\n" +"POT-Creation-Date: 2007-11-21 21:01+0900\n" "PO-Revision-Date: 2007-09-15 08:29+0800\n" "Last-Translator: John Darrington \n" "Language-Team: John Darrington \n" @@ -315,13 +315,13 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:318 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1285 src/ui/gui/psppire.glade:2176 +#: src/ui/gui/data-editor.glade:1304 src/ui/gui/psppire.glade:2176 #: src/ui/gui/psppire-var-store.c:493 msgid "String" msgstr "" #: src/data/format.c:318 src/data/sys-file-reader.c:639 -#: src/ui/gui/data-editor.glade:1174 src/ui/gui/psppire.glade:2131 +#: src/ui/gui/data-editor.glade:1193 src/ui/gui/psppire.glade:2131 #: src/ui/gui/psppire-var-store.c:486 msgid "Numeric" msgstr "" @@ -1756,6 +1756,7 @@ msgid "File:" msgstr "" #: src/language/dictionary/sys-file-info.c:112 src/ui/gui/psppire.glade:2052 +#: src/ui/gui/recode.glade:841 msgid "Label:" msgstr "" @@ -1809,7 +1810,7 @@ msgid "IBM 390 Hex Long." msgstr "" #: src/language/dictionary/sys-file-info.c:135 -#: src/ui/gui/descriptives-dialog.glade:79 +#: src/ui/gui/descriptives-dialog.glade:79 src/ui/gui/recode.glade:940 msgid "Variables:" msgstr "" @@ -4387,250 +4388,267 @@ msgstr "" msgid "Style of bevel around the custom entry button" msgstr "" -#: src/ui/gui/data-editor.c:162 +#: src/ui/gui/data-editor.c:163 msgid "Transformations Pending" msgstr "" -#: src/ui/gui/data-editor.c:424 +#: src/ui/gui/data-editor.c:425 msgid "Labels" msgstr "" -#: src/ui/gui/data-editor.c:425 +#: src/ui/gui/data-editor.c:426 msgid "Show/hide value labels" msgstr "" -#: src/ui/gui/data-editor.c:443 src/ui/gui/data-editor.c:460 -#: src/ui/gui/data-editor.c:1799 src/ui/gui/data-editor.c:1852 +#: src/ui/gui/data-editor.c:444 src/ui/gui/data-editor.c:461 +#: src/ui/gui/data-editor.c:1830 src/ui/gui/data-editor.c:1883 msgid "Clear" msgstr "" -#: src/ui/gui/data-editor.c:444 +#: src/ui/gui/data-editor.c:445 msgid "Delete the cases at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:461 +#: src/ui/gui/data-editor.c:462 msgid "Delete the variables at the selected position(s)" msgstr "" -#: src/ui/gui/data-editor.c:475 src/ui/gui/data-editor.c:1796 -#: src/ui/gui/data-editor.glade:137 src/ui/gui/data-editor.glade:789 +#: src/ui/gui/data-editor.c:476 src/ui/gui/data-editor.c:1827 +#: src/ui/gui/data-editor.glade:137 src/ui/gui/data-editor.glade:808 msgid "Insert Variable" msgstr "" -#: src/ui/gui/data-editor.c:476 +#: src/ui/gui/data-editor.c:477 msgid "Create a new variable at the current position" msgstr "" -#: src/ui/gui/data-editor.c:494 src/ui/gui/data-editor.c:1849 -#: src/ui/gui/data-editor.glade:777 +#: src/ui/gui/data-editor.c:495 src/ui/gui/data-editor.c:1880 +#: src/ui/gui/data-editor.glade:796 msgid "Insert Case" msgstr "" -#: src/ui/gui/data-editor.c:495 +#: src/ui/gui/data-editor.c:496 msgid "Create a new case at the current position" msgstr "" -#: src/ui/gui/data-editor.c:515 +#: src/ui/gui/data-editor.c:516 msgid "Goto Case" msgstr "" -#: src/ui/gui/data-editor.c:516 +#: src/ui/gui/data-editor.c:517 msgid "Jump to a Case in the Data Sheet" msgstr "" -#: src/ui/gui/data-editor.c:535 +#: src/ui/gui/data-editor.c:536 msgid "Weights" msgstr "" -#: src/ui/gui/data-editor.c:536 +#: src/ui/gui/data-editor.c:537 msgid "Weight cases by variable" msgstr "" -#: src/ui/gui/data-editor.c:545 src/ui/gui/data-editor.glade:312 +#: src/ui/gui/data-editor.c:546 src/ui/gui/data-editor.glade:312 msgid "Transpose" msgstr "" -#: src/ui/gui/data-editor.c:546 +#: src/ui/gui/data-editor.c:547 msgid "Transpose the cases with the variables" msgstr "" -#: src/ui/gui/data-editor.c:557 +#: src/ui/gui/data-editor.c:558 msgid "Split" msgstr "" -#: src/ui/gui/data-editor.c:558 +#: src/ui/gui/data-editor.c:559 msgid "Split the active file" msgstr "" -#: src/ui/gui/data-editor.c:568 +#: src/ui/gui/data-editor.c:569 msgid "Sort" msgstr "" -#: src/ui/gui/data-editor.c:569 +#: src/ui/gui/data-editor.c:570 msgid "Sort cases in the active file" msgstr "" -#: src/ui/gui/data-editor.c:577 src/ui/gui/data-editor.glade:347 -#: src/ui/gui/data-editor.glade:832 +#: src/ui/gui/data-editor.c:578 src/ui/gui/data-editor.glade:347 +#: src/ui/gui/data-editor.glade:851 msgid "Select Cases" msgstr "" -#: src/ui/gui/data-editor.c:578 +#: src/ui/gui/data-editor.c:579 msgid "Select cases from the active file" msgstr "" -#: src/ui/gui/data-editor.c:587 +#: src/ui/gui/data-editor.c:588 msgid "Compute" msgstr "" -#: src/ui/gui/data-editor.c:588 +#: src/ui/gui/data-editor.c:589 msgid "Compute new values for a variable" msgstr "" -#: src/ui/gui/data-editor.c:596 +#: src/ui/gui/data-editor.c:597 msgid "Oneway _ANOVA" msgstr "" -#: src/ui/gui/data-editor.c:597 +#: src/ui/gui/data-editor.c:598 msgid "Perform one way analysis of variance" msgstr "" -#: src/ui/gui/data-editor.c:605 src/ui/gui/data-editor.glade:484 +#: src/ui/gui/data-editor.c:606 src/ui/gui/data-editor.glade:503 msgid "_Independent Samples T Test" msgstr "" -#: src/ui/gui/data-editor.c:606 +#: src/ui/gui/data-editor.c:607 msgid "Calculate T Test for samples from independent groups" msgstr "" -#: src/ui/gui/data-editor.c:615 +#: src/ui/gui/data-editor.c:616 msgid "Data File Comments" msgstr "" -#: src/ui/gui/data-editor.c:616 +#: src/ui/gui/data-editor.c:617 msgid "Commentary text for the data file" msgstr "" -#: src/ui/gui/data-editor.c:624 src/ui/gui/data-editor.glade:757 +#: src/ui/gui/data-editor.c:625 src/ui/gui/data-editor.glade:776 msgid "Find" msgstr "" -#: src/ui/gui/data-editor.c:625 +#: src/ui/gui/data-editor.c:626 msgid "Find Case" msgstr "" -#: src/ui/gui/data-editor.c:634 src/ui/gui/data-editor.glade:384 +#: src/ui/gui/data-editor.c:635 src/ui/gui/data-editor.glade:384 msgid "Ran_k Cases" msgstr "" -#: src/ui/gui/data-editor.c:635 +#: src/ui/gui/data-editor.c:636 msgid "Rank Cases" msgstr "" -#: src/ui/gui/data-editor.c:644 src/ui/gui/data-editor.glade:286 -#: src/ui/gui/data-editor.glade:736 +#: src/ui/gui/data-editor.c:645 src/ui/gui/data-editor.glade:396 +msgid "Recode into _Same Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:646 +msgid "Recode values into the same Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:655 src/ui/gui/data-editor.glade:403 +msgid "Recode into _Different Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:656 +msgid "Recode values into different Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:665 src/ui/gui/data-editor.glade:286 +#: src/ui/gui/data-editor.glade:755 msgid "Variables" msgstr "" -#: src/ui/gui/data-editor.c:645 +#: src/ui/gui/data-editor.c:666 msgid "Jump to Variable" msgstr "" -#: src/ui/gui/data-editor.c:653 src/ui/gui/data-editor.glade:438 +#: src/ui/gui/data-editor.c:674 src/ui/gui/data-editor.glade:457 #: src/ui/gui/oneway.glade:179 msgid "_Descriptives" msgstr "" -#: src/ui/gui/data-editor.c:654 +#: src/ui/gui/data-editor.c:675 msgid "Calculate descriptive statistics (mean, variance, ...)" msgstr "" -#: src/ui/gui/data-editor.c:1077 +#: src/ui/gui/data-editor.c:1108 msgid "Font Selection" msgstr "" -#: src/ui/gui/data-editor.c:1284 +#: src/ui/gui/data-editor.c:1315 msgid "No Split" msgstr "" -#: src/ui/gui/data-editor.c:1293 +#: src/ui/gui/data-editor.c:1324 msgid "Split by " msgstr "" -#: src/ui/gui/data-editor.c:1318 +#: src/ui/gui/data-editor.c:1349 msgid "Filter off" msgstr "" -#: src/ui/gui/data-editor.c:1331 +#: src/ui/gui/data-editor.c:1362 #, c-format msgid "Filter by %s" msgstr "" -#: src/ui/gui/data-editor.c:1349 +#: src/ui/gui/data-editor.c:1380 msgid "Weights off" msgstr "" -#: src/ui/gui/data-editor.c:1362 +#: src/ui/gui/data-editor.c:1393 #, c-format msgid "Weight by %s" msgstr "" -#: src/ui/gui/data-editor.c:1385 src/ui/gui/data-editor.c:1619 -#: src/ui/gui/data-editor.glade:648 +#: src/ui/gui/data-editor.c:1416 src/ui/gui/data-editor.c:1650 +#: src/ui/gui/data-editor.glade:667 msgid "Open" msgstr "" -#: src/ui/gui/data-editor.c:1386 +#: src/ui/gui/data-editor.c:1417 msgid "Open a data file" msgstr "" -#: src/ui/gui/data-editor.c:1394 src/ui/gui/data-editor.c:1501 -#: src/ui/gui/data-editor.glade:658 +#: src/ui/gui/data-editor.c:1425 src/ui/gui/data-editor.c:1532 +#: src/ui/gui/data-editor.glade:677 msgid "Save" msgstr "" -#: src/ui/gui/data-editor.c:1395 src/ui/gui/data-editor.c:1405 +#: src/ui/gui/data-editor.c:1426 src/ui/gui/data-editor.c:1436 msgid "Save data to file" msgstr "" -#: src/ui/gui/data-editor.c:1404 +#: src/ui/gui/data-editor.c:1435 msgid "Save As" msgstr "" -#: src/ui/gui/data-editor.c:1413 +#: src/ui/gui/data-editor.c:1444 src/ui/gui/recode-dialog.c:906 +#: src/ui/gui/recode-dialog.c:997 msgid "New" msgstr "" -#: src/ui/gui/data-editor.c:1414 +#: src/ui/gui/data-editor.c:1445 msgid "New data file" msgstr "" -#: src/ui/gui/data-editor.c:1509 src/ui/gui/data-editor.c:1627 +#: src/ui/gui/data-editor.c:1540 src/ui/gui/data-editor.c:1658 msgid "System Files (*.sav)" msgstr "" -#: src/ui/gui/data-editor.c:1515 src/ui/gui/data-editor.c:1633 +#: src/ui/gui/data-editor.c:1546 src/ui/gui/data-editor.c:1664 msgid "Portable Files (*.por) " msgstr "" -#: src/ui/gui/data-editor.c:1521 src/ui/gui/data-editor.c:1639 +#: src/ui/gui/data-editor.c:1552 src/ui/gui/data-editor.c:1670 #: src/ui/gui/syntax-editor.c:138 src/ui/gui/syntax-editor.c:522 msgid "All Files" msgstr "" -#: src/ui/gui/data-editor.c:1529 +#: src/ui/gui/data-editor.c:1560 msgid "System File" msgstr "" -#: src/ui/gui/data-editor.c:1534 +#: src/ui/gui/data-editor.c:1565 msgid "Portable File" msgstr "" -#: src/ui/gui/data-editor.c:1789 +#: src/ui/gui/data-editor.c:1820 msgid "Sort Ascending" msgstr "" -#: src/ui/gui/data-editor.c:1792 +#: src/ui/gui/data-editor.c:1823 msgid "Sort Descending" msgstr "" @@ -4667,7 +4685,7 @@ msgstr "" msgid "Insert Cases" msgstr "" -#: src/ui/gui/data-editor.glade:153 src/ui/gui/data-editor.glade:726 +#: src/ui/gui/data-editor.glade:153 src/ui/gui/data-editor.glade:745 msgid "Go To Case" msgstr "" @@ -4703,8 +4721,8 @@ msgstr "" msgid "Grid Lines" msgstr "" -#: src/ui/gui/data-editor.glade:267 src/ui/gui/data-editor.glade:852 -#: src/ui/gui/data-editor.glade:1547 src/ui/gui/data-editor.glade:1728 +#: 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 msgid "Value Labels" msgstr "" @@ -4724,11 +4742,11 @@ msgstr "" msgid "Aggregate" msgstr "" -#: src/ui/gui/data-editor.glade:339 src/ui/gui/data-editor.glade:809 +#: src/ui/gui/data-editor.glade:339 src/ui/gui/data-editor.glade:828 msgid "Split File" msgstr "" -#: src/ui/gui/data-editor.glade:354 src/ui/gui/data-editor.glade:820 +#: src/ui/gui/data-editor.glade:354 src/ui/gui/data-editor.glade:839 msgid "Weight Cases" msgstr "" @@ -4740,239 +4758,240 @@ msgstr "" msgid "_Compute" msgstr "" -#: src/ui/gui/data-editor.glade:397 +#: src/ui/gui/data-editor.glade:416 msgid "_Run Pending Transforms" msgstr "" -#: src/ui/gui/data-editor.glade:410 +#: src/ui/gui/data-editor.glade:429 msgid "_Analyze" msgstr "" -#: src/ui/gui/data-editor.glade:420 +#: src/ui/gui/data-editor.glade:439 msgid "_Descriptive Statistics" msgstr "" -#: src/ui/gui/data-editor.glade:430 +#: src/ui/gui/data-editor.glade:449 msgid "_Frequencies" msgstr "" -#: src/ui/gui/data-editor.glade:446 +#: src/ui/gui/data-editor.glade:465 msgid "_Explore" msgstr "" -#: src/ui/gui/data-editor.glade:454 +#: src/ui/gui/data-editor.glade:473 msgid "_Crosstabs" msgstr "" -#: src/ui/gui/data-editor.glade:466 +#: src/ui/gui/data-editor.glade:485 msgid "Compare _Means" msgstr "" -#: src/ui/gui/data-editor.glade:476 +#: src/ui/gui/data-editor.glade:495 msgid "_One Sample T Test" msgstr "" -#: src/ui/gui/data-editor.glade:492 +#: src/ui/gui/data-editor.glade:511 msgid "_Paired Samples T Test" msgstr "" -#: src/ui/gui/data-editor.glade:500 +#: src/ui/gui/data-editor.glade:519 msgid "One Way _ANOVA" msgstr "" -#: src/ui/gui/data-editor.glade:512 +#: src/ui/gui/data-editor.glade:531 msgid "Bivariate _Correlation" msgstr "" -#: src/ui/gui/data-editor.glade:520 +#: src/ui/gui/data-editor.glade:539 msgid "Linear _Regression" msgstr "" -#: src/ui/gui/data-editor.glade:528 +#: src/ui/gui/data-editor.glade:547 msgid "_Non-Parametric Statistics" msgstr "" -#: src/ui/gui/data-editor.glade:538 +#: src/ui/gui/data-editor.glade:557 msgid "_Chi-Square" msgstr "" -#: src/ui/gui/data-editor.glade:546 +#: src/ui/gui/data-editor.glade:565 msgid "_Binomial" msgstr "" -#: src/ui/gui/data-editor.glade:562 +#: src/ui/gui/data-editor.glade:581 msgid "_Utilities" msgstr "" -#: src/ui/gui/data-editor.glade:572 +#: src/ui/gui/data-editor.glade:591 msgid "_Variables" msgstr "" -#: src/ui/gui/data-editor.glade:581 +#: src/ui/gui/data-editor.glade:600 msgid "Data File _Comments" msgstr "" -#: src/ui/gui/data-editor.glade:592 src/ui/gui/output-viewer.glade:78 +#: src/ui/gui/data-editor.glade:611 src/ui/gui/output-viewer.glade:78 #: src/ui/gui/syntax-editor.glade:234 msgid "_Windows" msgstr "" -#: src/ui/gui/data-editor.glade:599 src/ui/gui/output-viewer.glade:88 +#: src/ui/gui/data-editor.glade:618 src/ui/gui/output-viewer.glade:88 #: src/ui/gui/syntax-editor.glade:243 msgid "_Minimize All Windows" msgstr "" -#: src/ui/gui/data-editor.glade:610 src/ui/gui/output-viewer.glade:99 +#: src/ui/gui/data-editor.glade:629 src/ui/gui/output-viewer.glade:99 #: src/ui/gui/syntax-editor.glade:254 msgid "_Help" msgstr "" -#: src/ui/gui/data-editor.glade:617 src/ui/gui/output-viewer.glade:106 +#: src/ui/gui/data-editor.glade:636 src/ui/gui/output-viewer.glade:106 #: src/ui/gui/syntax-editor.glade:262 msgid "_Reference Manual" msgstr "" -#: src/ui/gui/data-editor.glade:624 src/ui/gui/output-viewer.glade:113 +#: src/ui/gui/data-editor.glade:643 src/ui/gui/output-viewer.glade:113 #: src/ui/gui/syntax-editor.glade:269 msgid "_About" msgstr "" -#: src/ui/gui/data-editor.glade:668 +#: src/ui/gui/data-editor.glade:687 msgid "Print" msgstr "" -#: src/ui/gui/data-editor.glade:678 +#: src/ui/gui/data-editor.glade:697 msgid "Recall" msgstr "" -#: src/ui/gui/data-editor.glade:696 +#: src/ui/gui/data-editor.glade:715 msgid "Undo" msgstr "" -#: src/ui/gui/data-editor.glade:706 +#: src/ui/gui/data-editor.glade:725 msgid "Redo" msgstr "" -#: src/ui/gui/data-editor.glade:863 +#: src/ui/gui/data-editor.glade:882 msgid "Use Sets" msgstr "" -#: src/ui/gui/data-editor.glade:945 +#: src/ui/gui/data-editor.glade:964 msgid "Data View" msgstr "" -#: src/ui/gui/data-editor.glade:972 +#: src/ui/gui/data-editor.glade:991 msgid "Variable View" msgstr "" -#: src/ui/gui/data-editor.glade:1002 +#: src/ui/gui/data-editor.glade:1021 msgid "Information Area" msgstr "" -#: src/ui/gui/data-editor.glade:1021 +#: src/ui/gui/data-editor.glade:1040 msgid "Processor Area" msgstr "" -#: src/ui/gui/data-editor.glade:1046 +#: src/ui/gui/data-editor.glade:1065 msgid "Case Counter Area" msgstr "" -#: src/ui/gui/data-editor.glade:1071 +#: src/ui/gui/data-editor.glade:1090 msgid "Filter Use Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1097 +#: src/ui/gui/data-editor.glade:1116 msgid "Weight Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1123 +#: src/ui/gui/data-editor.glade:1142 msgid "Split File Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1153 +#: src/ui/gui/data-editor.glade:1172 msgid "Variable Type" msgstr "" -#: src/ui/gui/data-editor.glade:1189 src/ui/gui/psppire-var-store.c:487 +#: src/ui/gui/data-editor.glade:1208 src/ui/gui/psppire-var-store.c:487 msgid "Comma" msgstr "" -#: src/ui/gui/data-editor.glade:1205 src/ui/gui/psppire-var-store.c:488 +#: src/ui/gui/data-editor.glade:1224 src/ui/gui/psppire-var-store.c:488 msgid "Dot" msgstr "" -#: src/ui/gui/data-editor.glade:1221 +#: src/ui/gui/data-editor.glade:1240 msgid "Scientific notation" msgstr "" -#: src/ui/gui/data-editor.glade:1237 src/ui/gui/psppire-var-store.c:490 +#: src/ui/gui/data-editor.glade:1256 src/ui/gui/psppire-var-store.c:490 msgid "Date" msgstr "" -#: src/ui/gui/data-editor.glade:1253 src/ui/gui/psppire-var-store.c:491 +#: src/ui/gui/data-editor.glade:1272 src/ui/gui/psppire-var-store.c:491 msgid "Dollar" msgstr "" -#: src/ui/gui/data-editor.glade:1269 +#: src/ui/gui/data-editor.glade:1288 msgid "Custom currency" msgstr "" -#: src/ui/gui/data-editor.glade:1363 +#: src/ui/gui/data-editor.glade:1382 msgid "positive" msgstr "" -#: src/ui/gui/data-editor.glade:1369 +#: src/ui/gui/data-editor.glade:1388 msgid "negative" msgstr "" -#: src/ui/gui/data-editor.glade:1382 +#: src/ui/gui/data-editor.glade:1401 msgid "Sample" msgstr "" -#: src/ui/gui/data-editor.glade:1430 -msgid "Decimal Places:" -msgstr "" - -#: src/ui/gui/data-editor.glade:1471 +#: src/ui/gui/data-editor.glade:1451 msgid "Width:" msgstr "" -#: src/ui/gui/data-editor.glade:1634 src/ui/gui/psppire.glade:2544 -msgid "Value:" +#: src/ui/gui/data-editor.glade:1495 +msgid "Decimal Places:" msgstr "" -#: src/ui/gui/data-editor.glade:1645 +#: src/ui/gui/data-editor.glade:1664 msgid "Value Label:" msgstr "" -#: src/ui/gui/data-editor.glade:1795 src/ui/gui/t-test.glade:370 -msgid "Missing Values" -msgstr "" - -#: src/ui/gui/data-editor.glade:1862 -msgid "_No missing values" +#: src/ui/gui/data-editor.glade:1677 src/ui/gui/psppire.glade:2544 +#: src/ui/gui/recode.glade:185 +msgid "Value:" msgstr "" -#: src/ui/gui/data-editor.glade:1880 -msgid "_Discrete missing values" +#: src/ui/gui/data-editor.glade:1814 src/ui/gui/t-test.glade:370 +msgid "Missing Values" msgstr "" -#: src/ui/gui/data-editor.glade:1965 +#: src/ui/gui/data-editor.glade:1832 msgid "_Range plus one optional discrete missing value" msgstr "" -#: src/ui/gui/data-editor.glade:1990 +#: src/ui/gui/data-editor.glade:1857 msgid "_Low:" msgstr "" -#: src/ui/gui/data-editor.glade:2019 +#: src/ui/gui/data-editor.glade:1886 msgid "_High:" msgstr "" -#: src/ui/gui/data-editor.glade:2060 +#: src/ui/gui/data-editor.glade:1927 msgid "Di_screte value:" msgstr "" +#: src/ui/gui/data-editor.glade:1974 +msgid "_No missing values" +msgstr "" + +#: src/ui/gui/data-editor.glade:1992 +msgid "_Discrete missing values" +msgstr "" + #: src/ui/gui/descriptives-dialog.c:53 msgid "Standard deviation" msgstr "" @@ -5278,6 +5297,7 @@ msgid "Functions:" msgstr "" #: src/ui/gui/psppire.glade:1107 src/ui/gui/psppire.glade:1253 +#: src/ui/gui/recode.glade:731 msgid "If..." msgstr "" @@ -5525,6 +5545,106 @@ msgstr "" msgid "Rank Assigned to Ties" msgstr "" +#: src/ui/gui/recode-dialog.c:857 +msgid "Recode into Different Variables" +msgstr "" + +#: src/ui/gui/recode-dialog.c:860 +msgid "Recode into Same Variables" +msgstr "" + +#: src/ui/gui/recode-dialog.c:891 src/ui/gui/recode-dialog.c:989 +msgid "Old" +msgstr "" + +#: src/ui/gui/recode-dialog.c:1246 +msgid "Recode into Different Variables: Old and New Values " +msgstr "" + +#: src/ui/gui/recode-dialog.c:1247 +msgid "Recode into Same Variables: Old and New Values" +msgstr "" + +#: src/ui/gui/recode.glade:197 +msgid "System-Missing" +msgstr "" + +#: src/ui/gui/recode.glade:211 +msgid "System-or user-missing" +msgstr "" + +#: src/ui/gui/recode.glade:245 +msgid "through" +msgstr "" + +#: src/ui/gui/recode.glade:283 +msgid "Range, LOWEST thru value" +msgstr "" + +#: src/ui/gui/recode.glade:297 +msgid "Range, value thru HIGHEST" +msgstr "" + +#: src/ui/gui/recode.glade:327 +msgid "All other values" +msgstr "" + +#: src/ui/gui/recode.glade:363 +msgid "Range:" +msgstr "" + +#: src/ui/gui/recode.glade:380 +msgid "Old Value" +msgstr "" + +#: src/ui/gui/recode.glade:462 +msgid "System Missing" +msgstr "" + +#: src/ui/gui/recode.glade:476 +msgid "Copy old values" +msgstr "" + +#: src/ui/gui/recode.glade:500 +msgid "Value: " +msgstr "" + +#: src/ui/gui/recode.glade:530 +msgid "New Value" +msgstr "" + +#: src/ui/gui/recode.glade:590 +msgid "Convert numeric strings to numbers ('5' -> 5)" +msgstr "" + +#: src/ui/gui/recode.glade:608 +msgid "Output variables are strings" +msgstr "" + +#: src/ui/gui/recode.glade:620 +msgid "Width: " +msgstr "" + +#: src/ui/gui/recode.glade:743 +msgid "(optional case selection condition)" +msgstr "" + +#: src/ui/gui/recode.glade:823 +msgid "Name:" +msgstr "" + +#: src/ui/gui/recode.glade:867 +msgid "Change" +msgstr "" + +#: src/ui/gui/recode.glade:885 +msgid "Output Variable" +msgstr "" + +#: src/ui/gui/recode.glade:965 +msgid "Old and New Values" +msgstr "" + #: src/ui/gui/select-cases-dialog.c:85 #, c-format msgid "Approximately %3d%% of all cases." diff --git a/src/ui/gui/ChangeLog b/src/ui/gui/ChangeLog index 62b8d162..45058669 100644 --- a/src/ui/gui/ChangeLog +++ b/src/ui/gui/ChangeLog @@ -1,3 +1,27 @@ +2007-11-23 John Darrington + + * psppire-acr.c psppire-acr.h: Generalised the external widget + somewhat. It can now be anything, not necessarily a GTK_ENTRY. + + * helper.c helper.h (clone_list_store): New function. + + * oneway-anova-dialog.c : Used the clone_list_store function + instead of writing it ourselves. + + * psppire-dialog.c psppire-dialog.h: Added a tabular orientation + in addition to the horizontal/vertical options. + + * recode-dialog.c recode-dialog.h recode.glade (new files). + + * psppire-selector.c psppire-selector.h: Added a function to + allow the prohibition of items based on a predicate. + + * dialog-common.h dialog-common.c (homogeneous_types): New function. + + * data-editor.c data-editor.glade data-editor.h: Enabled the + recode dialog options. + + 2007-11-23 John Darrington * compute-dialog.c (generate_syntax): Append "EXECUTE." to the diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 5fbc8564..ee2b5c82 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -53,6 +53,7 @@ dist_src_ui_gui_psppire_DATA = \ $(top_srcdir)/src/ui/gui/output-viewer.glade \ $(top_srcdir)/src/ui/gui/psppire.glade \ $(top_srcdir)/src/ui/gui/rank.glade \ + $(top_srcdir)/src/ui/gui/recode.glade \ $(top_srcdir)/src/ui/gui/syntax-editor.glade \ $(top_srcdir)/src/ui/gui/t-test.glade \ $(top_srcdir)/src/ui/gui/psppicon.png \ @@ -135,6 +136,8 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/psppire-var-store.h \ src/ui/gui/rank-dialog.c \ src/ui/gui/rank-dialog.h \ + src/ui/gui/recode-dialog.c \ + src/ui/gui/recode-dialog.h \ src/ui/gui/select-cases-dialog.c \ src/ui/gui/select-cases-dialog.h \ src/ui/gui/sort-cases-dialog.c \ diff --git a/src/ui/gui/data-editor.c b/src/ui/gui/data-editor.c index 818cbd07..f1848621 100644 --- a/src/ui/gui/data-editor.c +++ b/src/ui/gui/data-editor.c @@ -38,6 +38,7 @@ #include "goto-case-dialog.h" #include "find-dialog.h" #include "rank-dialog.h" +#include "recode-dialog.h" #include "comments-dialog.h" #include "variable-info-dialog.h" #include "descriptives-dialog.h" @@ -639,6 +640,26 @@ new_data_editor (void) G_CALLBACK (rank_dialog), de); + de->invoke_recode_same_dialog = + gtk_action_new ("recode-same-dialog", + _("Recode into _Same Variables"), + _("Recode values into the same Variables"), + "pspp-recode-same"); + + g_signal_connect (de->invoke_recode_same_dialog, "activate", + G_CALLBACK (recode_same_dialog), de); + + + de->invoke_recode_different_dialog = + gtk_action_new ("recode-different-dialog", + _("Recode into _Different Variables"), + _("Recode values into different Variables"), + "pspp-recode-different"); + + g_signal_connect (de->invoke_recode_different_dialog, "activate", + G_CALLBACK (recode_different_dialog), de); + + de->invoke_variable_info_dialog = gtk_action_new ("variable-info-dialog", _("Variables"), @@ -745,6 +766,16 @@ new_data_editor (void) get_widget_assert (de->xml, "transform_rank") ); + gtk_action_connect_proxy (de->invoke_recode_same_dialog, + get_widget_assert (de->xml, + "transform_recode-same") + ); + + gtk_action_connect_proxy (de->invoke_recode_different_dialog, + get_widget_assert (de->xml, + "transform_recode-different") + ); + gtk_action_connect_proxy (de->invoke_weight_cases_dialog, get_widget_assert (de->xml, "data_weight-cases") ); diff --git a/src/ui/gui/data-editor.glade b/src/ui/gui/data-editor.glade index 7779a060..7a34a31f 100644 --- a/src/ui/gui/data-editor.glade +++ b/src/ui/gui/data-editor.glade @@ -385,6 +385,25 @@ True + + + True + + + + + True + Recode into _Same Variables + True + + + + + True + Recode into _Different Variables + True + + True @@ -676,7 +695,7 @@ False Recall - pspp-recent-dialogs + gtk-missing-image False @@ -735,7 +754,7 @@ True Variables True - pspp-goto-variable + gtk-missing-image False @@ -776,7 +795,7 @@ False Insert Case True - pspp-insert-case + gtk-missing-image False @@ -788,7 +807,7 @@ False Insert Variable True - pspp-insert-variable + gtk-missing-image False @@ -808,7 +827,7 @@ True Split File True - pspp-split-file + gtk-missing-image False @@ -819,7 +838,7 @@ True Weight Cases True - pspp-weight-cases + gtk-missing-image False @@ -831,7 +850,7 @@ False Select Cases True - pspp-select-cases + gtk-missing-image False @@ -851,7 +870,7 @@ True Value Labels True - pspp-value-labels + gtk-missing-image False @@ -891,25 +910,25 @@ 1 2 - + True - False - False - 25 + True - GTK_FILL + 1 + 2 - + True - True + False + False + 25 - 1 - 2 + GTK_FILL @@ -1424,63 +1443,63 @@ 2 1 - + True - 0 - Decimal Places: - GTK_JUSTIFY_RIGHT + + + True + Width: + GTK_JUSTIFY_RIGHT + + + False + False + GTK_PACK_END + + - 1 - 2 GTK_FILL - + GTK_FILL - + 25 + True True 1 2 + 1 + 2 - + 25 - True True 1 2 - 1 - 2 - + True - - - True - Width: - GTK_JUSTIFY_RIGHT - - - False - False - GTK_PACK_END - - + 0 + Decimal Places: + GTK_JUSTIFY_RIGHT + 1 + 2 GTK_FILL - GTK_FILL + @@ -1570,53 +1589,28 @@ 2 5 - + True - 5 - - - True - False - True - True - gtk-add - True - 0 - - - - - True - False - True - True - gtk-apply - True - 0 - - - 1 - - + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN - + True - False True - True - gtk-remove - True - 0 + False + False - - 2 - + 1 + 2 1 2 GTK_FILL + GTK_FILL @@ -1628,63 +1622,63 @@ 5 4 - + True - 0 - Value: + + + 85 + True + True + + + False + False + 1 + + + 1 + 2 GTK_FILL - + GTK_FILL - + True - 0 - Value Label: + True + 1 + 2 1 2 - GTK_FILL - + True - True + 0 + Value Label: - 1 - 2 1 2 + GTK_FILL - + True - - - 85 - True - True - - - False - False - 1 - - + 0 + Value: - 1 - 2 GTK_FILL - GTK_FILL + @@ -1694,28 +1688,53 @@ - + True - True - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - GTK_SHADOW_ETCHED_IN + 5 - + True + False True - False - False + True + gtk-add + True + 0 + + + + + True + False + True + True + gtk-apply + True + 0 + + + 1 + + + + + True + False + True + True + gtk-remove + True + 0 + + 2 + - 1 - 2 1 2 GTK_FILL - GTK_FILL @@ -1804,51 +1823,144 @@ 2 2 - + True - 5 - 5 - GTK_BUTTONBOX_START - + True True - True - gtk-ok - True + _Range plus one optional discrete missing value + True + False 0 + True + no_missing + + False + False + - + True - True - True - gtk-cancel - True - 0 + 5 + + + True + + + True + + + True + _Low: + True + mv-low + + + False + False + 20 + + + + + 75 + True + True + + + False + 1 + + + + + + + True + + + True + _High: + True + mv-high + + + False + False + + + + + 75 + True + True + + + 5 + 1 + + + + + False + 20 + 1 + + + + + + + + + + + + + True + + + True + Di_screte value: + True + mv-discrete + + + False + False + 20 + + + + + 75 + True + True + + + False + 1 + + + + + 1 + + 1 - - - True - True - True - gtk-help - True - 0 - - - 2 - - - 1 2 + 1 + 2 + GTK_FILL @@ -1956,144 +2068,51 @@ - + True + 5 + 5 + GTK_BUTTONBOX_START - + True True - _Range plus one optional discrete missing value - True - False + True + gtk-ok + True + 0 + + + + + True + True + True + gtk-cancel + True 0 - True - no_missing - False - False + 1 - + True - 5 - - - True - - - True - - - True - _Low: - True - mv-low - - - False - False - 20 - - - - - 75 - True - True - - - False - 1 - - - - - - - True - - - True - _High: - True - mv-high - - - False - False - - - - - 75 - True - True - - - 5 - 1 - - - - - False - 20 - 1 - - - - - - - - - - - - - True - - - True - Di_screte value: - True - mv-discrete - - - False - False - 20 - - - - - 75 - True - True - - - False - 1 - - - - - 1 - - + True + True + gtk-help + True + 0 - 1 + 2 + 1 2 - 1 - 2 - GTK_FILL diff --git a/src/ui/gui/data-editor.h b/src/ui/gui/data-editor.h index 9af3d737..a49d2c5b 100644 --- a/src/ui/gui/data-editor.h +++ b/src/ui/gui/data-editor.h @@ -43,6 +43,8 @@ struct data_editor GtkAction *invoke_variable_info_dialog; GtkAction *invoke_find_dialog; GtkAction *invoke_rank_dialog; + GtkAction *invoke_recode_same_dialog; + GtkAction *invoke_recode_different_dialog; GtkAction *invoke_descriptives_dialog; diff --git a/src/ui/gui/dialog-common.c b/src/ui/gui/dialog-common.c index 3f725221..723a65e4 100644 --- a/src/ui/gui/dialog-common.c +++ b/src/ui/gui/dialog-common.c @@ -136,6 +136,103 @@ set_dest_model (GtkTreeView *dest, PsppireDict *dict) gtk_tree_view_column_set_sizing (col, GTK_TREE_VIEW_COLUMN_FIXED); - gtk_tree_view_append_column (GTK_TREE_VIEW(dest), col); + gtk_tree_view_append_column (GTK_TREE_VIEW (dest), col); +} + + + +/* Returns FALSE if the variables represented by the union of the rows + currently selected by SOURCE widget, and contents of the DEST + widget, are of different types. + + In other words, this function when passed as the argument to + psppire_selector_set_allow, ensures that the selector selects only + string variables, or only numeric variables, not a mixture. +*/ +gboolean +homogeneous_types (GtkWidget *source, GtkWidget *dest) +{ + gboolean ok; + GtkTreeIter iter; + gboolean retval = TRUE; + + GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (source)); + + PsppireDict *dict; + GtkTreeSelection *selection; + enum val_type type = -1; + GList *list, *l; + + while (GTK_IS_TREE_MODEL_FILTER (model)) + { + model = gtk_tree_model_filter_get_model (GTK_TREE_MODEL_FILTER (model)); + } + + dict = PSPPIRE_DICT (model); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (source)); + + list = gtk_tree_selection_get_selected_rows (selection, &model); + + /* Iterate through the selection of the source treeview */ + for (l = list; l ; l = l->next) + { + GtkTreePath *path = l->data; + GtkTreePath *fpath; + gint *idx; + + const struct variable *v; + + fpath = gtk_tree_model_filter_convert_path_to_child_path (GTK_TREE_MODEL_FILTER (model), path); + + idx = gtk_tree_path_get_indices (fpath); + + v = psppire_dict_get_variable (dict, idx[0]); + + if ( type != -1 ) + { + if ( var_get_type (v) != type ) + { + retval = FALSE; + break; + } + } + + type = var_get_type (v); + } + + g_list_foreach (list, (GFunc) gtk_tree_path_free, NULL); + g_list_free (list); + + if ( retval == FALSE ) + return FALSE; + + /* now deal with the dest widget */ + model = gtk_tree_view_get_model (GTK_TREE_VIEW (dest)); + + for (ok = gtk_tree_model_get_iter_first (model, &iter); + ok; + ok = gtk_tree_model_iter_next (model, &iter)) + { + gint idx; + const struct variable *v; + gtk_tree_model_get (model, &iter, 0, &idx, -1); + + v = psppire_dict_get_variable (dict, idx); + + if ( type != -1 ) + { + if ( var_get_type (v) != type ) + { + retval = FALSE; + break; + } + } + + type = var_get_type (v); + } + + + return retval; } diff --git a/src/ui/gui/dialog-common.h b/src/ui/gui/dialog-common.h index b952e9cb..4dd11cb7 100644 --- a/src/ui/gui/dialog-common.h +++ b/src/ui/gui/dialog-common.h @@ -55,4 +55,15 @@ void cell_var_name (GtkTreeViewColumn *tree_column, void set_dest_model (GtkTreeView *dest, PsppireDict *dict); +/* Returns FALSE if the variables represented by the union of the rows + currently selected by SOURCE widget, and contents of the DEST + widget, are of different types. + + In other words, this function when passed as the argument to + psppire_selector_set_allow, ensures that the selector selects only + string variables, or only numeric variables, not a mixture. +*/ +gboolean homogeneous_types (GtkWidget *source, GtkWidget *dest); + + #endif diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index 5ed0e988..9cbd6f0f 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -297,3 +297,46 @@ marshaller_VOID__INT_INT_INT (GClosure *closure, g_marshal_value_peek_int (param_values + 3), data2); } + +/* Create a deep copy of SRC */ +GtkListStore * +clone_list_store (const GtkListStore *src) +{ + GtkTreeIter src_iter; + gboolean ok; + gint i; + const gint n_cols = gtk_tree_model_get_n_columns (GTK_TREE_MODEL (src)); + GType *types = g_malloc (sizeof (*types) * n_cols); + + int row = 0; + GtkListStore *dest; + + for (i = 0 ; i < n_cols; ++i ) + types[i] = gtk_tree_model_get_column_type (GTK_TREE_MODEL (src), i); + + dest = gtk_list_store_newv (n_cols, types); + + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (src), + &src_iter); + ok; + ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (src), &src_iter)) + { + GtkTreeIter dest_iter; + gtk_list_store_append (dest, &dest_iter); + + for (i = 0 ; i < n_cols; ++i ) + { + GValue val = {0}; + + gtk_tree_model_get_value (GTK_TREE_MODEL (src), &src_iter, i, &val); + gtk_list_store_set_value (dest, &dest_iter, i, &val); + + g_value_unset (&val); + } + row++; + } + + return dest; +} + + diff --git a/src/ui/gui/helper.h b/src/ui/gui/helper.h index eb50bdd2..37706617 100644 --- a/src/ui/gui/helper.h +++ b/src/ui/gui/helper.h @@ -67,4 +67,8 @@ void marshaller_VOID__INT_INT_INT (GClosure *closure, gpointer marshal_data); +/* Create a deep copy of SRC */ +GtkListStore * clone_list_store (const GtkListStore *src); + + #endif diff --git a/src/ui/gui/oneway-anova-dialog.c b/src/ui/gui/oneway-anova-dialog.c index f94756ec..b3cff6be 100644 --- a/src/ui/gui/oneway-anova-dialog.c +++ b/src/ui/gui/oneway-anova-dialog.c @@ -371,6 +371,7 @@ list_store_changed (struct contrasts_subdialog *csd) } + /* Copy the contrasts array into the local array */ static GArray * clone_contrasts_array (GArray *src_array) @@ -383,7 +384,7 @@ clone_contrasts_array (GArray *src_array) for (i = 0 ; i < src_array->len ; ++i ) { - gboolean ok; + GtkTreeIter src_iter; GtkListStore *src = g_array_index (src_array, GtkListStore*, i); GtkListStore *dest; @@ -393,21 +394,7 @@ clone_contrasts_array (GArray *src_array) &src_iter)) continue; - dest = gtk_list_store_new (1, G_TYPE_DOUBLE); - - for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(src), - &src_iter); - ok; - ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (src), &src_iter)) - { - gdouble v; - GtkTreeIter dest_iter; - - gtk_tree_model_get (GTK_TREE_MODEL (src), &src_iter, 0, &v, -1); - - gtk_list_store_append (dest, &dest_iter); - gtk_list_store_set (dest, &dest_iter, 0, v, -1); - } + dest = clone_list_store (src); g_array_append_val (dest_array, dest); } diff --git a/src/ui/gui/psppire-acr.c b/src/ui/gui/psppire-acr.c index 0de169c2..b85229d2 100644 --- a/src/ui/gui/psppire-acr.c +++ b/src/ui/gui/psppire-acr.c @@ -14,18 +14,32 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + +/* + This widget is a GtkBox which looks roughly like: + + +-----------------------------+ + |+------------+ +----------+ | + || Add | | | | + |+------------+ | | | + | | | | + |+------------+ | | | + || Edit | | | | + |+------------+ | | | + | | | | + |+------------+ | | | + || Remove | | | | + |+------------+ +----------+ | + +-----------------------------+ + +*/ + #include #include "psppire-acr.h" static void psppire_acr_init (PsppireAcr *); -enum { - COLUMN_DOUBLE, - n_COLUMNS -}; - - GType psppire_acr_get_type (void) { @@ -53,29 +67,99 @@ psppire_acr_get_type (void) return acr_type; } + +static gboolean row_is_selected (const PsppireAcr *acr); + + +static gboolean +value_from_entry (gint col, GValue *val, gpointer data) +{ + GtkEntry *entry = data; + const gchar *text = gtk_entry_get_text (entry); + gdouble x = g_strtod (text, 0); + + g_value_init (val, G_TYPE_DOUBLE); + g_value_set_double (val, x); + + return TRUE; +} + + +/* Returns true, if there's text in the entry */ +static gboolean +entry_not_empty (gpointer data) +{ + GtkEntry *entry = data; + + const char *text = gtk_entry_get_text (entry); + + return !g_str_equal (text, ""); +} + + static void -on_add_button_clicked (PsppireAcr *acr) +clear_entry (gpointer data) { - GtkTreeIter iter; - gdouble x; + GtkEntry *entry = data; + gtk_entry_set_text (entry, ""); +} + + +static void +on_entry_change (GtkEntry *entry, PsppireAcr *acr) +{ + gtk_widget_set_sensitive (acr->add_button, acr->enabled (entry)); + + gtk_widget_set_sensitive (acr->change_button, acr->enabled (entry) + && row_is_selected (acr)); +} + +void +psppire_acr_set_entry (PsppireAcr *acr, GtkEntry *entry) +{ + acr->get_value = value_from_entry; + acr->get_value_data = entry; + acr->enabled = entry_not_empty; + acr->enabled_data = entry; + acr->update = clear_entry; + acr->update_data = entry; + + g_signal_connect (entry, "changed", G_CALLBACK (on_entry_change), acr); +} - const gchar *text = gtk_entry_get_text (acr->entry); - x = g_strtod (text, 0); +/* Callback for when the Add button is clicked. + It appends an item to the list. */ +static void +on_add_button_clicked (PsppireAcr *acr) +{ + gint i; + GtkTreeIter iter; gtk_list_store_append (acr->list_store, &iter); - gtk_list_store_set (acr->list_store, &iter, - COLUMN_DOUBLE, x, - -1); + for (i = 0 ; + i < gtk_tree_model_get_n_columns (GTK_TREE_MODEL (acr->list_store)); + ++i) + { + static GValue value; + if ( ! acr->get_value (i, &value, acr->get_value_data) ) + continue; - gtk_entry_set_text (acr->entry, ""); + gtk_list_store_set_value (acr->list_store, &iter, + i, &value); + g_value_unset (&value); + } + + if (acr->update) acr->update (acr->update_data); } + +/* Callback for when the Changed button is clicked. + It replaces the currently selected entry. */ static void on_change_button_clicked (PsppireAcr *acr) { - const gchar *text; - GValue value = {0}; + gint i; GtkTreeModel *model = GTK_TREE_MODEL (acr->list_store); GList *l= @@ -88,16 +172,28 @@ on_change_button_clicked (PsppireAcr *acr) gtk_tree_model_get_iter (model, &iter, path); - text = gtk_entry_get_text (acr->entry); + for (i = 0 ; + i < gtk_tree_model_get_n_columns (GTK_TREE_MODEL (acr->list_store)); + ++i) + { + static GValue value; + if ( ! acr->get_value (i, &value, acr->get_value_data) ) + continue; - g_value_init (&value, G_TYPE_DOUBLE); - g_value_set_double (&value, g_strtod (text, NULL)); - gtk_list_store_set_value (acr->list_store, &iter, 0, &value); + gtk_list_store_set_value (acr->list_store, &iter, + i, &value); + g_value_unset (&value); + } g_list_foreach (l, (GFunc) gtk_tree_path_free, NULL); g_list_free (l); + + if ( acr->update) acr->update (acr->update_data); } + +/* Callback for when the remove button is clicked. + It deletes the currently selected entry. */ static void on_remove_button_clicked (PsppireAcr *acr) { @@ -119,15 +215,10 @@ on_remove_button_clicked (PsppireAcr *acr) g_list_free (l); } +/* Returns true if there is a row currently selected. + False otherwise. */ static gboolean -value_present (const PsppireAcr *acr) -{ - const char *text = gtk_entry_get_text (acr->entry); - return !g_str_equal (text, ""); -} - -static gboolean -row_is_selected (PsppireAcr *acr) +row_is_selected (const PsppireAcr *acr) { gboolean result; GtkTreeModel *model = GTK_TREE_MODEL (acr->list_store); @@ -143,6 +234,8 @@ row_is_selected (PsppireAcr *acr) } +/* Callback which occurs when an item in the treeview + is selected */ static void on_select (GtkTreeSelection *selection, gpointer data) { @@ -151,10 +244,21 @@ on_select (GtkTreeSelection *selection, gpointer data) gtk_widget_set_sensitive (acr->remove_button, row_is_selected (acr)); gtk_widget_set_sensitive (acr->change_button, - row_is_selected (acr) && value_present (acr)); + row_is_selected (acr) + ); } +void +psppire_acr_set_enabled (PsppireAcr *acr, gboolean status) +{ + + gtk_widget_set_sensitive (acr->add_button, status); + + gtk_widget_set_sensitive (acr->change_button, status + && row_is_selected (acr)); +} + static void psppire_acr_init (PsppireAcr *acr) @@ -169,6 +273,11 @@ psppire_acr_init (PsppireAcr *acr) acr->change_button = gtk_button_new_from_stock (GTK_STOCK_EDIT); acr->remove_button = gtk_button_new_from_stock (GTK_STOCK_REMOVE); + acr->get_value = NULL; + acr->get_value_data = NULL; + acr->enabled = NULL; + acr->update = NULL; + gtk_widget_set_sensitive (acr->change_button, FALSE); gtk_widget_set_sensitive (acr->remove_button, FALSE); gtk_widget_set_sensitive (acr->add_button, FALSE); @@ -215,19 +324,16 @@ psppire_acr_init (PsppireAcr *acr) gtk_widget_show_all (sw); { - GtkCellRenderer *renderer; - GtkTreeViewColumn *column; - - renderer = gtk_cell_renderer_text_new (); - column = gtk_tree_view_column_new_with_attributes ("header", - renderer, - "text", COLUMN_DOUBLE, - NULL); + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + GtkTreeViewColumn *column = + gtk_tree_view_column_new_with_attributes ("value", + renderer, + "text", 0, + NULL); gtk_tree_view_append_column (acr->tv, column); } - acr->entry = NULL; } @@ -237,23 +343,6 @@ psppire_acr_new (void) return GTK_WIDGET (g_object_new (psppire_acr_get_type (), NULL)); } -static void -on_entry_change (GtkEntry *entry, PsppireAcr *acr) -{ - gtk_widget_set_sensitive (acr->add_button, value_present (acr)); - - gtk_widget_set_sensitive (acr->change_button, value_present (acr) - && row_is_selected (acr)); -} - -void -psppire_acr_set_entry (PsppireAcr *acr, GtkEntry *entry) -{ - acr->entry = entry; - - g_signal_connect (entry, "changed", G_CALLBACK (on_entry_change), acr); -} - /* Set the widget's treemodel */ @@ -267,3 +356,19 @@ psppire_acr_set_model (PsppireAcr *acr, GtkListStore *liststore) gtk_widget_set_sensitive (GTK_WIDGET (acr), liststore != NULL); } + + +void +psppire_acr_set_enable_func (PsppireAcr *acr, EnabledFunc func, gpointer p) +{ + acr->enabled = func; + acr->enabled_data = p; +} + +void +psppire_acr_set_get_value_func (PsppireAcr *acr, + GetValueFunc getvalue, gpointer data) +{ + acr->get_value_data = data; + acr->get_value = getvalue; +} diff --git a/src/ui/gui/psppire-acr.h b/src/ui/gui/psppire-acr.h index 9983a9ef..ba38631d 100644 --- a/src/ui/gui/psppire-acr.h +++ b/src/ui/gui/psppire-acr.h @@ -35,7 +35,8 @@ |+------------+ +----------+ | +-----------------------------+ - It interacts with a GtkEntry, which allows items to be added to its internal list. + It interacts with an external widget, such as a GtkEntry. + It maintains a list of items controlled by the three buttons. This implementation deals only with g_double values. */ @@ -59,20 +60,33 @@ G_BEGIN_DECLS typedef struct _PsppireAcr PsppireAcr; typedef struct _PsppireAcrClass PsppireAcrClass; -/* All members are private. */ +typedef gboolean (*GetValueFunc) (gint, GValue *, gpointer); +typedef gboolean (*EnabledFunc) (gpointer); +typedef void (*UpdateCallbackFunc) (gpointer); + struct _PsppireAcr { GtkHBox parent; - /* */ - GtkEntry *entry; + GtkListStore *list_store; GtkTreeView *tv; GtkTreeSelection *selection; + + /* The buttons */ GtkWidget *add_button; GtkWidget *change_button; GtkWidget *remove_button; + + GetValueFunc get_value; + gpointer get_value_data; + + EnabledFunc enabled; + gpointer enabled_data; + + UpdateCallbackFunc update; + gpointer update_data; }; @@ -82,11 +96,20 @@ struct _PsppireAcrClass }; -GType psppire_acr_get_type (void); -GtkWidget* psppire_acr_new (void); -void psppire_acr_set_entry (PsppireAcr *, GtkEntry *); -void psppire_acr_set_model (PsppireAcr *, GtkListStore *); +GType psppire_acr_get_type (void); +GtkWidget* psppire_acr_new (void); + +void psppire_acr_set_model (PsppireAcr *, GtkListStore *); +void psppire_acr_set_get_value_func (PsppireAcr *, GetValueFunc, + gpointer); + +void psppire_acr_set_enable_func (PsppireAcr *, EnabledFunc, gpointer); + +void psppire_acr_set_enabled (PsppireAcr *, gboolean); +void psppire_acr_set_entry (PsppireAcr *, GtkEntry *); + + G_END_DECLS diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index 90080094..b0d8a7a3 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -106,6 +106,8 @@ psppire_dialog_get_property (GObject *object, g_value_set_enum (value, PSPPIRE_VERTICAL); else if ( GTK_IS_HBOX (dialog->box)) g_value_set_enum (value, PSPPIRE_HORIZONTAL); + else if ( GTK_IS_TABLE (dialog->box)) + g_value_set_enum (value, PSPPIRE_TABULAR); } break; default: @@ -125,13 +127,21 @@ dialog_set_orientation (PsppireDialog *dialog, const GValue *orval) gtk_container_remove (GTK_CONTAINER (dialog), dialog->box); } - if ( orientation == PSPPIRE_HORIZONTAL) + switch ( orientation ) { + case PSPPIRE_HORIZONTAL: dialog->box = gtk_hbox_new (FALSE, 5); - } - else - { + break; + case PSPPIRE_VERTICAL: dialog->box = gtk_vbox_new (FALSE, 5); + break; + case PSPPIRE_TABULAR: + dialog->box = gtk_table_new (2, 3, FALSE); + g_object_set (dialog->box, + "row-spacing", 5, + "column-spacing", 5, + NULL); + break; } gtk_container_add (GTK_CONTAINER (dialog), dialog->box); @@ -277,8 +287,8 @@ psppire_dialog_new (void) } -static void -notify_change (PsppireDialog *dialog) +void +psppire_dialog_notify_change (PsppireDialog *dialog) { if ( dialog->contents_are_valid ) { @@ -290,7 +300,7 @@ notify_change (PsppireDialog *dialog) /* Descend the widget tree, connecting appropriate signals to the - notify_change callback */ + psppire_dialog_notify_change callback */ static void connect_notify_signal (GtkWidget *w, gpointer data) { @@ -315,28 +325,33 @@ connect_notify_signal (GtkWidget *w, gpointer data) if ( GTK_IS_TOGGLE_BUTTON (w)) { - g_signal_connect_swapped (w, "toggled", G_CALLBACK (notify_change), + g_signal_connect_swapped (w, "toggled", + G_CALLBACK (psppire_dialog_notify_change), dialog); } if ( PSPPIRE_IS_SELECTOR (w)) { - g_signal_connect_swapped (w, "selected", G_CALLBACK (notify_change), + g_signal_connect_swapped (w, "selected", + G_CALLBACK (psppire_dialog_notify_change), dialog); - g_signal_connect_swapped (w, "de-selected", G_CALLBACK (notify_change), + g_signal_connect_swapped (w, "de-selected", + G_CALLBACK (psppire_dialog_notify_change), dialog); } if ( GTK_IS_EDITABLE (w)) { - g_signal_connect_swapped (w, "changed", G_CALLBACK (notify_change), + g_signal_connect_swapped (w, "changed", + G_CALLBACK (psppire_dialog_notify_change), dialog); } if ( GTK_IS_CELL_EDITABLE (w)) { - g_signal_connect_swapped (w, "editing-done", G_CALLBACK (notify_change), + g_signal_connect_swapped (w, "editing-done", + G_CALLBACK (psppire_dialog_notify_change), dialog); } @@ -344,7 +359,8 @@ connect_notify_signal (GtkWidget *w, gpointer data) { GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (w)); - g_signal_connect_swapped (buffer, "changed", G_CALLBACK (notify_change), + g_signal_connect_swapped (buffer, "changed", + G_CALLBACK (psppire_dialog_notify_change), dialog); } @@ -355,9 +371,23 @@ connect_notify_signal (GtkWidget *w, gpointer data) GtkTreeSelection *selection = gtk_tree_view_get_selection (tv); GtkTreeViewColumn *col; + GtkTreeModel *model = gtk_tree_view_get_model (tv); + + g_signal_connect_swapped (model, "row-changed", + G_CALLBACK (psppire_dialog_notify_change), + dialog); + + g_signal_connect_swapped (model, "row-deleted", + G_CALLBACK (psppire_dialog_notify_change), + dialog); + + g_signal_connect_swapped (model, "row-inserted", + G_CALLBACK (psppire_dialog_notify_change), + dialog); g_signal_connect_swapped (selection, "changed", - G_CALLBACK (notify_change), dialog); + G_CALLBACK (psppire_dialog_notify_change), + dialog); while ((col = gtk_tree_view_get_column (tv, i++))) { @@ -367,7 +397,7 @@ connect_notify_signal (GtkWidget *w, gpointer data) { if ( GTK_IS_CELL_RENDERER_TOGGLE (renderers->data)) g_signal_connect_swapped (renderers->data, "toggled", - G_CALLBACK (notify_change), dialog); + G_CALLBACK (psppire_dialog_notify_change), dialog); renderers = renderers->next; } g_list_free (start); @@ -418,6 +448,7 @@ psppire_orientation_get_type (void) { { PSPPIRE_HORIZONTAL, "PSPPIRE_HORIZONTAL", "Horizontal" }, { PSPPIRE_VERTICAL, "PSPPIRE_VERTICAL", "Vertical" }, + { PSPPIRE_TABULAR, "PSPPIRE_TABULAR", "Tabular" }, { 0, NULL, NULL } }; diff --git a/src/ui/gui/psppire-dialog.h b/src/ui/gui/psppire-dialog.h index bd51a4c4..05215ce9 100644 --- a/src/ui/gui/psppire-dialog.h +++ b/src/ui/gui/psppire-dialog.h @@ -70,6 +70,8 @@ gint psppire_dialog_run (PsppireDialog *); void psppire_dialog_set_valid_predicate (PsppireDialog *, ContentsAreValid, gpointer ); +void psppire_dialog_notify_change (PsppireDialog *); + GType psppire_orientation_get_type (void); @@ -78,7 +80,8 @@ GType psppire_orientation_get_type (void); typedef enum { PSPPIRE_HORIZONTAL, - PSPPIRE_VERTICAL + PSPPIRE_VERTICAL, + PSPPIRE_TABULAR } PsppireOrientation; #define G_TYPE_PSPPIRE_ORIENTATION (psppire_orientation_get_type ()) diff --git a/src/ui/gui/psppire-selector.c b/src/ui/gui/psppire-selector.c index 5ec051bb..bd990de8 100644 --- a/src/ui/gui/psppire-selector.c +++ b/src/ui/gui/psppire-selector.c @@ -126,6 +126,9 @@ enum }; +static void on_activate (PsppireSelector *selector, gpointer data); + + static void psppire_selector_set_property (GObject *object, guint prop_id, @@ -230,16 +233,23 @@ psppire_selector_base_finalize(PsppireSelectorClass *class, } + static void psppire_selector_init (PsppireSelector *selector) { selector->arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); selector->filtered_source = NULL; + selector->action = gtk_action_new ("select", NULL, NULL, NULL); + + gtk_action_connect_proxy (selector->action, GTK_WIDGET (selector)); + gtk_container_add (GTK_CONTAINER (selector), selector->arrow); gtk_widget_show (selector->arrow); + g_signal_connect_swapped (selector->action, "activate", G_CALLBACK (on_activate), selector); + selector->selecting = FALSE; } @@ -311,9 +321,14 @@ on_source_select (GtkTreeSelection *treeselection, gpointer data) set_direction (selector, PSPPIRE_SELECTOR_SOURCE_TO_DEST); - if ( GTK_IS_ENTRY (selector->dest) ) + if ( selector->allow_selection ) + { + gtk_action_set_sensitive (selector->action, + selector->allow_selection (selector->source, selector->dest)); + } + else if ( GTK_IS_ENTRY (selector->dest) ) { - gtk_widget_set_sensitive (GTK_WIDGET (selector), + gtk_action_set_sensitive (selector->action, gtk_tree_selection_count_selected_rows (treeselection) <= 1 ); } @@ -325,6 +340,8 @@ on_dest_treeview_select (GtkTreeSelection *treeselection, gpointer data) { PsppireSelector *selector = data; + gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source))); + set_direction (selector, PSPPIRE_SELECTOR_DEST_TO_SOURCE); } @@ -470,12 +487,14 @@ on_row_activate (GtkTreeView *tree_view, { PsppireSelector *selector = data; - select_selection (selector); + gtk_action_activate (selector->action); } -/* Callback for when the selector button is clicked */ +/* Callback for when the selector button is clicked, + or other event which causes the selector's action to occur. + */ static void -on_click (PsppireSelector *selector, gpointer data) +on_activate (PsppireSelector *selector, gpointer data) { switch (selector->direction) { @@ -690,6 +709,7 @@ on_entry_dest_select (GtkWidget *widget, GdkEventFocus *event, gpointer data) { PsppireSelector * selector = data; + gtk_tree_selection_unselect_all (gtk_tree_view_get_selection (GTK_TREE_VIEW (selector->source))); set_direction (selector, PSPPIRE_SELECTOR_DEST_TO_SOURCE); return FALSE; @@ -767,8 +787,6 @@ psppire_selector_set_subjects (PsppireSelector *selector, selector->filter = is_item_in_dest; } - g_signal_connect (selector, "clicked", G_CALLBACK (on_click), NULL); - if ( GTK_IS_TREE_VIEW (source)) set_tree_view_source (selector, GTK_TREE_VIEW (source) ); else @@ -795,6 +813,14 @@ psppire_selector_set_subjects (PsppireSelector *selector, +void +psppire_selector_set_allow (PsppireSelector *selector , AllowSelectionFunc *allow) +{ + selector->allow_selection = allow; +} + + + GType psppire_selector_orientation_get_type (void) { diff --git a/src/ui/gui/psppire-selector.h b/src/ui/gui/psppire-selector.h index f5ca4e9a..6385c14c 100644 --- a/src/ui/gui/psppire-selector.h +++ b/src/ui/gui/psppire-selector.h @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -47,6 +48,9 @@ typedef void SelectItemsFunc (GtkTreeIter iter, GtkWidget *dest, GtkTreeModel *source_model); +/* Function to determine if items may be selected */ +typedef gboolean AllowSelectionFunc (GtkWidget *src, GtkWidget *dest); + /* Function to determine whether an item in MODEL, pointed to by ITER is currently selected. @@ -70,6 +74,7 @@ struct _PsppireSelector /* */ GtkWidget *arrow; + GtkAction *action; enum psppire_selector_dir direction; GtkWidget *source; @@ -87,6 +92,8 @@ struct _PsppireSelector SelectItemsFunc *select_items; FilterItemsFunc *filter; + + AllowSelectionFunc *allow_selection; }; struct _PsppireSelectorClass @@ -106,6 +113,9 @@ void psppire_selector_set_subjects (PsppireSelector *, SelectItemsFunc *, FilterItemsFunc * ); +void psppire_selector_set_allow (PsppireSelector *, AllowSelectionFunc *); + + GType psppire_selector_orientation_get_type (void) G_GNUC_CONST; diff --git a/src/ui/gui/recode-dialog.c b/src/ui/gui/recode-dialog.c new file mode 100644 index 00000000..103c85c3 --- /dev/null +++ b/src/ui/gui/recode-dialog.c @@ -0,0 +1,1556 @@ +/* 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 . */ + +/* This module implements the RECODE dialog. + + It has two forms. One for recoding values into the same variable. + The second for recoding into different variables. +*/ + +#include + +#include "recode-dialog.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "psppire-acr.h" + +#include "gettext.h" +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + + +/* Define a boxed type to represent a value which is a candidate + to replace an existing value */ + +enum new_value_type + { + NV_NUMERIC, + NV_STRING, + NV_SYSMIS, + NV_COPY + }; + + +struct new_value +{ + enum new_value_type type; + union { + double v; + gchar *s; + } v; +}; + + +static struct new_value * +new_value_copy (struct new_value *nv) +{ + struct new_value *copy = g_memdup (nv, sizeof (*copy)); + + if ( nv->type == NV_STRING ) + copy->v.s = strdup (nv->v.s); + + return copy; +} + + +static void +new_value_free (struct new_value *nv) +{ + if ( nv->type == NV_STRING ) + g_free (nv->v.s); + + g_free (nv); +} + + +static void +new_value_to_string (const GValue *src, GValue *dest) +{ + const struct new_value *nv = g_value_get_boxed (src); + + g_assert (nv); + + switch (nv->type) + { + case NV_NUMERIC: + { + gchar *text = g_strdup_printf ("%g", nv->v.v); + g_value_set_string (dest, text); + g_free (text); + } + break; + case NV_STRING: + g_value_set_string (dest, nv->v.s); + break; + case NV_COPY: + g_value_set_string (dest, "COPY"); + break; + case NV_SYSMIS: + g_value_set_string (dest, "SYSMIS"); + break; + default: + /* Shouldn't ever happen */ + g_warning ("Invalid type in new recode value"); + g_value_set_string (dest, "???"); + break; + } +} + +static GType +new_value_get_type (void) +{ + static GType t = 0; + + if (t == 0 ) + { + t = g_boxed_type_register_static ("psppire-recode-new-values", + (GBoxedCopyFunc) new_value_copy, + (GBoxedFreeFunc) new_value_free); + + g_value_register_transform_func (t, G_TYPE_STRING, + new_value_to_string); + } + + return t; +} + + + + + +/* A boxed type representing a value, or a range of values which may + potentially be replaced by something */ + +enum old_value_type + { + OV_NUMERIC, + OV_STRING, + OV_SYSMIS, + OV_MISSING, + OV_RANGE, + OV_LOW_UP, + OV_HIGH_DOWN, + OV_ELSE + }; + +struct old_value + { + enum old_value_type type; + union { + double v; + gchar *s; + double range[2]; + } v; + }; + + +static struct old_value * +old_value_copy (struct old_value *ov) +{ + struct old_value *copy = g_memdup (ov, sizeof (*copy)); + + if ( ov->type == OV_STRING ) + copy->v.s = g_strdup (ov->v.s); + + return copy; +} + + +static void +old_value_free (struct old_value *ov) +{ + if (ov->type == OV_STRING) + g_free (ov->v.s); + g_free (ov); +} + +static void +old_value_to_string (const GValue *src, GValue *dest) +{ + const struct old_value *ov = g_value_get_boxed (src); + + switch (ov->type) + { + case OV_NUMERIC: + { + gchar *text = g_strdup_printf ("%g", ov->v.v); + g_value_set_string (dest, text); + g_free (text); + } + break; + case OV_STRING: + g_value_set_string (dest, ov->v.s); + break; + case OV_MISSING: + g_value_set_string (dest, "MISSING"); + break; + case OV_SYSMIS: + g_value_set_string (dest, "SYSMIS"); + break; + case OV_ELSE: + g_value_set_string (dest, "ELSE"); + break; + case OV_RANGE: + { + gchar *text; + char en_dash[6] = {0,0,0,0,0,0}; + + g_unichar_to_utf8 (0x2013, en_dash); + + text = g_strdup_printf ("%g %s %g", + ov->v.range[0], + en_dash, + ov->v.range[1]); + g_value_set_string (dest, text); + g_free (text); + } + break; + case OV_LOW_UP: + { + gchar *text; + char en_dash[6] = {0,0,0,0,0,0}; + + g_unichar_to_utf8 (0x2013, en_dash); + + text = g_strdup_printf ("LOWEST %s %g", + en_dash, + ov->v.range[1]); + + g_value_set_string (dest, text); + g_free (text); + } + break; + case OV_HIGH_DOWN: + { + gchar *text; + char en_dash[6] = {0,0,0,0,0,0}; + + g_unichar_to_utf8 (0x2013, en_dash); + + text = g_strdup_printf ("%g %s HIGHEST", + ov->v.range[0], + en_dash); + + g_value_set_string (dest, text); + g_free (text); + } + break; + default: + g_warning ("Invalid type in old recode value"); + g_value_set_string (dest, "???"); + break; + }; +} + +static GType +old_value_get_type (void) +{ + static GType t = 0; + + if (t == 0 ) + { + t = g_boxed_type_register_static ("psppire-recode-old-values", + (GBoxedCopyFunc) old_value_copy, + (GBoxedFreeFunc) old_value_free); + + g_value_register_transform_func (t, G_TYPE_STRING, + old_value_to_string); + } + + return t; +} + + + +enum + { + BUTTON_NEW_VALUE, + BUTTON_NEW_COPY, + BUTTON_NEW_SYSMIS, + BUTTON_OLD_VALUE, + BUTTON_OLD_SYSMIS, + BUTTON_OLD_MISSING, + BUTTON_OLD_RANGE, + BUTTON_OLD_LOW_UP, + BUTTON_OLD_HIGH_DOWN, + BUTTON_OLD_ELSE, + n_BUTTONS + }; + +struct recode_dialog +{ + PsppireDict *dict; + + GtkWidget *dialog; + PsppireDialog *old_and_new_dialog; + + GtkWidget *dict_treeview; + GtkWidget *variable_treeview; + GtkWidget *toggle[n_BUTTONS]; + + GtkWidget *strings_box; + GtkWidget *convert_button; + GtkWidget *new_copy_label; + + GtkWidget *ov_value_entry; + GtkWidget *new_value_entry; + + GtkWidget *ov_range_lower_entry; + GtkWidget *ov_range_upper_entry; + GtkWidget *ov_low_up_entry; + GtkWidget *ov_high_down_entry; + + GtkListStore *value_map; + GtkListStore *local_store; + + /* Indicates that the INTO {new variables} form of the dialog + is being used */ + gboolean different; + + PsppireAcr *acr; + + gboolean input_var_is_string; + + GtkListStore *var_map; + GtkWidget *new_name_entry; + GtkWidget *new_label_entry; + GtkWidget *change_button; + + GtkWidget *string_button; + GtkWidget *width_entry; +}; + + +static void run_old_and_new_dialog (struct recode_dialog *rd); + +static void +refresh (PsppireDialog *dialog, struct recode_dialog *rd) +{ + gtk_widget_set_sensitive (rd->change_button, FALSE); + gtk_widget_set_sensitive (rd->new_name_entry, FALSE); + gtk_widget_set_sensitive (rd->new_label_entry, FALSE); + + + if ( rd->different ) + gtk_list_store_clear (GTK_LIST_STORE (rd->var_map)); + else + { + GtkTreeModel *vars = + gtk_tree_view_get_model (GTK_TREE_VIEW (rd->variable_treeview)); + + gtk_list_store_clear (GTK_LIST_STORE (vars)); + } + + gtk_list_store_clear (GTK_LIST_STORE (rd->value_map)); +} + +static char * generate_syntax (const struct recode_dialog *rd); + +enum { + COL_OLD, + COL_NEW_NAME, + COL_NEW_LABEL, + n_COLS +}; + +enum { + COL_VALUE_OLD, + COL_VALUE_NEW, + n_COL_VALUES +}; + +/* Dialog is valid iff at least one variable has been selected, + AND the list of mappings is not empty. + */ +static gboolean +dialog_state_valid (gpointer data) +{ + GtkTreeIter not_used; + struct recode_dialog *rd = data; + + if ( ! rd->value_map ) + return FALSE; + + if ( ! gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->value_map), + ¬_used) ) + return FALSE; + + if ( rd->different ) + { + GtkTreeIter iter; + + gboolean ok; + + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->var_map), + &iter); + ok; + ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (rd->var_map), + &iter)) + { + gchar *name = NULL; + + gtk_tree_model_get (GTK_TREE_MODEL (rd->var_map), &iter, + COL_NEW_NAME, &name, -1); + + if ( name == NULL ) + return FALSE; + + g_free (name); + } + } + else + { + GtkTreeModel *vars = + gtk_tree_view_get_model (GTK_TREE_VIEW (rd->variable_treeview)); + + if ( !gtk_tree_model_get_iter_first (vars, ¬_used)) + return FALSE; + + } + + return TRUE; +} + +static void +on_old_new_show (struct recode_dialog *rd) +{ + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle[BUTTON_OLD_VALUE]), TRUE); + + g_signal_emit_by_name (rd->toggle[BUTTON_OLD_VALUE], "toggled"); + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle[BUTTON_NEW_VALUE]), TRUE); + + g_signal_emit_by_name (rd->toggle[BUTTON_NEW_VALUE], "toggled"); + + g_object_set (rd->toggle[BUTTON_NEW_COPY], + "visible", rd->different, NULL); + + g_object_set (rd->new_copy_label, + "visible", rd->different, NULL); + + g_object_set (rd->strings_box, + "visible", rd->different, NULL); +} + +/* Sets the sensitivity of TARGET dependent upon the active status + of BUTTON */ +static void +toggle_sensitivity (GtkToggleButton *button, GtkWidget *target) +{ + gboolean state = gtk_toggle_button_get_active (button); + + /* g_print ("%s Setting %p (%s) to %d because of %p\n", + __FUNCTION__, target, gtk_widget_get_name (target), state, button); */ + + gtk_widget_set_sensitive (target, state); +} + +static void recode_dialog (struct data_editor *de, gboolean diff); + + +/* Pops up the Recode Same version of the dialog box */ +void +recode_same_dialog (GObject *o, gpointer data) +{ + struct data_editor *de = data; + + recode_dialog (de, FALSE); +} + +/* Pops up the Recode Different version of the dialog box */ +void +recode_different_dialog (GObject *o, gpointer data) +{ + struct data_editor *de = data; + + recode_dialog (de, TRUE); +} + +static void +render_new_var_name (GtkTreeViewColumn *tree_column, + GtkCellRenderer *cell, + GtkTreeModel *tree_model, + GtkTreeIter *iter, + gpointer data) +{ + gchar *new_var_name = NULL; + + gtk_tree_model_get (tree_model, iter, COL_NEW_NAME, &new_var_name, -1); + + g_object_set (cell, "text", new_var_name, NULL); + + g_free (new_var_name); +} + + +/* This might need to be changed to something less naive. + In particular, what happends with dates, etc? + */ +static gchar * +num_to_string (gdouble x) +{ + return g_strdup_printf ("%g", x); +} + +/* Callback which gets called when a new row is selected + in the acr's variable treeview. + We use if to set the togglebuttons and entries to correspond to the + selected row. +*/ +static void +on_acr_selection_change (GtkTreeSelection *selection, gpointer data) +{ + struct recode_dialog *rd = data; + GtkTreeModel *model = NULL; + GtkTreeIter iter; + + GValue ov_value = {0}; + GValue nv_value = {0}; + struct old_value *ov = NULL; + struct new_value *nv = NULL; + + if ( ! gtk_tree_selection_get_selected (selection, &model, &iter) ) + return; + + + gtk_tree_model_get_value (GTK_TREE_MODEL (model), &iter, + COL_VALUE_OLD, &ov_value); + + gtk_tree_model_get_value (GTK_TREE_MODEL (model), &iter, + COL_VALUE_NEW, &nv_value); + + ov = g_value_get_boxed (&ov_value); + nv = g_value_get_boxed (&nv_value); + + if (nv) + { + switch (nv->type) + { + case NV_NUMERIC: + { + gchar *str = num_to_string (nv->v.v); + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_VALUE]), TRUE); + + gtk_entry_set_text (GTK_ENTRY (rd->new_value_entry), str); + g_free (str); + } + break; + case NV_STRING: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_VALUE]), TRUE); + + gtk_entry_set_text (GTK_ENTRY (rd->new_value_entry), nv->v.s); + break; + case NV_SYSMIS: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_SYSMIS]), TRUE); + + break; + case NV_COPY: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_COPY]), TRUE); + + break; + default: + g_warning ("Invalid new value type"); + break; + } + + g_value_unset (&nv_value); + } + + if ( ov ) + { + switch (ov->type) + { + case OV_STRING: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_VALUE]), TRUE); + + gtk_entry_set_text (GTK_ENTRY (rd->ov_value_entry), ov->v.s); + break; + + case OV_NUMERIC: + { + gchar *str; + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_VALUE]), TRUE); + + str = num_to_string (ov->v.v); + + gtk_entry_set_text (GTK_ENTRY (rd->ov_value_entry), str); + + g_free (str); + } + break; + + case OV_SYSMIS: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_SYSMIS]), TRUE); + break; + + case OV_MISSING: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_MISSING]), TRUE); + break; + + case OV_RANGE: + { + gchar *str; + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_RANGE]), TRUE); + + str = num_to_string (ov->v.range[0]); + + gtk_entry_set_text (GTK_ENTRY (rd->ov_range_lower_entry), str); + + g_free (str); + + + str = num_to_string (ov->v.range[1]); + + gtk_entry_set_text (GTK_ENTRY (rd->ov_range_upper_entry), str); + + g_free (str); + } + break; + + case OV_LOW_UP: + { + gchar *str = num_to_string (ov->v.range[1]); + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_LOW_UP]), TRUE); + + gtk_entry_set_text (GTK_ENTRY (rd->ov_low_up_entry), str); + + g_free (str); + } + break; + + case OV_HIGH_DOWN: + { + gchar *str = num_to_string (ov->v.range[0]); + + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_HIGH_DOWN]), TRUE); + + gtk_entry_set_text (GTK_ENTRY (rd->ov_high_down_entry), str); + + g_free (str); + } + break; + + case OV_ELSE: + gtk_toggle_button_set_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_OLD_ELSE]), TRUE); + break; + + default: + g_warning ("Unknown old value type"); + break; + }; + g_value_unset (&ov_value); + } +} + +/* Callback which gets called when a new row is selected + in the variable treeview. + It sets the name and label entry widgets to reflect the + currently selected row. + */ +static void +on_selection_change (GtkTreeSelection *selection, gpointer data) +{ + struct recode_dialog *rd = data; + GtkTreeModel *model = GTK_TREE_MODEL (rd->var_map); + + GList *rows = gtk_tree_selection_get_selected_rows (selection, &model); + + if ( rows && !rows->next) + { + /* Exactly one row is selected */ + + gboolean ok; + GtkTreeIter iter; + gchar *name = NULL; + gchar *label = NULL; + + gtk_widget_set_sensitive (rd->change_button, TRUE); + gtk_widget_set_sensitive (rd->new_name_entry, TRUE); + gtk_widget_set_sensitive (rd->new_label_entry, TRUE); + + ok = gtk_tree_model_get_iter (model, &iter, (GtkTreePath*) rows->data); + + gtk_tree_model_get (GTK_TREE_MODEL (rd->var_map), &iter, + COL_NEW_NAME, &name, + COL_NEW_LABEL, &label, + -1); + + gtk_entry_set_text (GTK_ENTRY (rd->new_name_entry), name ? name : ""); + gtk_entry_set_text (GTK_ENTRY (rd->new_label_entry), label ? label : ""); + + g_free (name); + g_free (label); + } + else + { + gtk_widget_set_sensitive (rd->change_button, FALSE); + gtk_widget_set_sensitive (rd->new_name_entry, FALSE); + gtk_widget_set_sensitive (rd->new_label_entry, FALSE); + + gtk_entry_set_text (GTK_ENTRY (rd->new_name_entry), ""); + gtk_entry_set_text (GTK_ENTRY (rd->new_label_entry), ""); + } + + g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_free (rows); +} + +static void +on_string_toggled (GtkToggleButton *b, struct recode_dialog *rd) +{ + gboolean active; + if (! rd->input_var_is_string ) + return ; + + active = gtk_toggle_button_get_active (b); + gtk_widget_set_sensitive (rd->convert_button, !active); +} + + +static void +on_convert_toggled (GtkToggleButton *b, struct recode_dialog *rd) +{ + gboolean active; + + g_return_if_fail (rd->input_var_is_string); + + active = gtk_toggle_button_get_active (b); + gtk_widget_set_sensitive (rd->string_button, !active); +} + + +static void +on_change_clicked (GObject *obj, gpointer data) +{ + struct recode_dialog *rd = data; + GtkTreeModel *model = GTK_TREE_MODEL (rd->var_map); + GtkTreeIter iter; + GtkTreeSelection *selection = + gtk_tree_view_get_selection (GTK_TREE_VIEW (rd->variable_treeview)); + + GList *rows = gtk_tree_selection_get_selected_rows (selection, &model); + + const gchar *dest_var_name = + gtk_entry_get_text (GTK_ENTRY (rd->new_name_entry)); + + const gchar *dest_var_label = + gtk_entry_get_text (GTK_ENTRY (rd->new_label_entry)); + + if ( NULL == rows ) + return; + + gtk_tree_model_get_iter (model, &iter, rows->data); + + gtk_list_store_set (rd->var_map, &iter, + COL_NEW_NAME, dest_var_name, + COL_NEW_LABEL, dest_var_label, + -1); + + g_list_foreach (rows, (GFunc) gtk_tree_path_free, NULL); + g_list_free (rows); +} + + +/* If there's nothing selected in the variable treeview, + then automatically select the first item */ +static void +select_something (GtkTreeModel *treemodel, + GtkTreePath *arg1, + GtkTreeIter *arg2, + gpointer data) +{ + struct recode_dialog *rd = data; + GtkTreeSelection *sel; + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (rd->variable_treeview)); + + if ( gtk_tree_selection_count_selected_rows (sel) < 1) + { + GtkTreeIter iter; + + gtk_tree_model_get_iter_first (treemodel, &iter); + + gtk_tree_selection_select_iter (sel, &iter); + } +} + + +/* Callback for the new_value_entry and new_value_togglebutton widgets. + It's used to enable/disable the acr. */ +static void +set_acr (struct recode_dialog *rd) +{ + const gchar *text; + + if ( !gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (rd->toggle[BUTTON_NEW_VALUE]))) + { + psppire_acr_set_enabled (rd->acr, TRUE); + return; + } + + text = gtk_entry_get_text (GTK_ENTRY (rd->new_value_entry)); + + psppire_acr_set_enabled (rd->acr, !g_str_equal (text, "")); +} + +static void +recode_dialog (struct data_editor *de, gboolean diff) +{ + gint response; + + struct recode_dialog rd; + + GladeXML *xml = XML_NEW ("recode.glade"); + + + GtkWidget *selector = get_widget_assert (xml, "psppire-selector1"); + + GtkWidget *oldandnew = get_widget_assert (xml, "button1"); + + + GtkWidget *output_variable_box = get_widget_assert (xml,"frame4"); + + GtkSheet *var_sheet = + GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + + + PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + + rd.change_button = get_widget_assert (xml, "change-button"); + + rd.dialog = get_widget_assert (xml, "recode-dialog"); + rd.dict_treeview = get_widget_assert (xml, "treeview1"); + rd.variable_treeview = get_widget_assert (xml, "treeview2"); + rd.new_name_entry = get_widget_assert (xml, "dest-name-entry"); + rd.new_label_entry = get_widget_assert (xml, "dest-label-entry"); + + rd.dict = vs->dict; + + rd.value_map = gtk_list_store_new (2, + old_value_get_type (), + new_value_get_type () + ); + + g_object_set (output_variable_box, "visible", diff, NULL); + + if ( diff ) + gtk_window_set_title (GTK_WINDOW (rd.dialog), + _("Recode into Different Variables")); + else + gtk_window_set_title (GTK_WINDOW (rd.dialog), + _("Recode into Same Variables")); + + rd.different = diff; + + gtk_window_set_transient_for (GTK_WINDOW (rd.dialog), de->parent.window); + + + attach_dictionary_to_treeview (GTK_TREE_VIEW (rd.dict_treeview), + vs->dict, + GTK_SELECTION_MULTIPLE, NULL); + + + if ( ! rd.different ) + { + set_dest_model (GTK_TREE_VIEW (rd.variable_treeview), vs->dict); + } + else + { + GtkTreeSelection *sel; + GtkTreeViewColumn *col; + GtkCellRenderer *renderer = gtk_cell_renderer_text_new (); + + rd.var_map = gtk_list_store_new (n_COLS, G_TYPE_INT, + G_TYPE_STRING, + G_TYPE_STRING); + + + + gtk_tree_view_set_model (GTK_TREE_VIEW (rd.variable_treeview), + GTK_TREE_MODEL (rd.var_map)); + + col = gtk_tree_view_column_new_with_attributes (_("Old"), + renderer, + "text", NULL, + NULL); + + gtk_tree_view_column_set_cell_data_func (col, renderer, + cell_var_name, + vs->dict, 0); + + + gtk_tree_view_append_column (GTK_TREE_VIEW (rd.variable_treeview), col); + + + renderer = gtk_cell_renderer_text_new (); + + col = gtk_tree_view_column_new_with_attributes (_("New"), + renderer, + "text", NULL, + NULL); + + gtk_tree_view_column_set_cell_data_func (col, renderer, + render_new_var_name, + NULL, NULL); + + + gtk_tree_view_append_column (GTK_TREE_VIEW (rd.variable_treeview), col); + + g_object_set (rd.variable_treeview, "headers-visible", TRUE, NULL); + + g_signal_connect (rd.change_button, "clicked", + G_CALLBACK (on_change_clicked), &rd); + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (rd.variable_treeview)); + g_signal_connect (sel, "changed", + G_CALLBACK (on_selection_change), &rd); + + g_signal_connect (rd.var_map, "row-inserted", + G_CALLBACK (select_something), &rd); + } + + + + psppire_selector_set_subjects (PSPPIRE_SELECTOR (selector), + rd.dict_treeview, + rd.variable_treeview, + insert_source_row_into_tree_view, + NULL); + + psppire_selector_set_allow (PSPPIRE_SELECTOR (selector), homogeneous_types); + + /* Set up the Old & New Values subdialog */ + { + rd.string_button = get_widget_assert (xml, "checkbutton1"); + rd.width_entry = get_widget_assert (xml, "spinbutton1"); + + rd.convert_button = get_widget_assert (xml, "checkbutton2"); + + rd.ov_range_lower_entry = get_widget_assert (xml, "entry5"); + rd.ov_range_upper_entry = get_widget_assert (xml, "entry3"); + rd.ov_low_up_entry = get_widget_assert (xml, "entry6"); + rd.ov_high_down_entry = get_widget_assert (xml, "entry7"); + + rd.new_value_entry = get_widget_assert (xml, "entry1"); + rd.ov_value_entry = get_widget_assert (xml, "entry2"); + + rd.toggle[BUTTON_NEW_VALUE] = get_widget_assert (xml, "radiobutton1"); + rd.toggle[BUTTON_NEW_SYSMIS] = get_widget_assert (xml, "radiobutton2"); + rd.toggle[BUTTON_NEW_COPY] = get_widget_assert (xml, "radiobutton3"); + rd.toggle[BUTTON_OLD_VALUE] = get_widget_assert (xml, "radiobutton4"); + rd.toggle[BUTTON_OLD_SYSMIS] = get_widget_assert (xml, "radiobutton6"); + rd.toggle[BUTTON_OLD_MISSING]= get_widget_assert (xml, "radiobutton7"); + rd.toggle[BUTTON_OLD_RANGE] = get_widget_assert (xml, "radiobutton8"); + rd.toggle[BUTTON_OLD_LOW_UP] = get_widget_assert (xml, "radiobutton10"); + rd.toggle[BUTTON_OLD_HIGH_DOWN] = get_widget_assert (xml, "radiobutton5"); + rd.toggle[BUTTON_OLD_ELSE] = get_widget_assert (xml, "radiobutton11"); + + rd.new_copy_label = get_widget_assert (xml, "label3"); + rd.strings_box = get_widget_assert (xml, "table3"); + + rd.old_and_new_dialog = + PSPPIRE_DIALOG (get_widget_assert (xml, "old-new-values-dialog")); + + gtk_window_set_transient_for (GTK_WINDOW (rd.old_and_new_dialog), + de->parent.window); + + rd.acr = PSPPIRE_ACR (get_widget_assert (xml, "psppire-acr1")); + + g_signal_connect_swapped (rd.toggle[BUTTON_NEW_VALUE], "toggled", + G_CALLBACK (set_acr), &rd); + + g_signal_connect_swapped (rd.new_value_entry, "changed", + G_CALLBACK (set_acr), &rd); + + { + GtkTreeSelection *sel; + /* Remove the ACR's default column. We don't like it */ + GtkTreeViewColumn *column = gtk_tree_view_get_column (rd.acr->tv, 0); + gtk_tree_view_remove_column (rd.acr->tv, column); + + + column = + gtk_tree_view_column_new_with_attributes (_("Old"), + gtk_cell_renderer_text_new (), + "text", 0, + NULL); + + gtk_tree_view_append_column (rd.acr->tv, column); + + column = + gtk_tree_view_column_new_with_attributes (_("New"), + gtk_cell_renderer_text_new (), + "text", 1, + NULL); + + gtk_tree_view_append_column (rd.acr->tv, column); + g_object_set (rd.acr->tv, "headers-visible", TRUE, NULL); + + + sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (rd.acr->tv)); + g_signal_connect (sel, "changed", + G_CALLBACK (on_acr_selection_change), &rd); + } + + + g_signal_connect_swapped (oldandnew, "clicked", + G_CALLBACK (run_old_and_new_dialog), &rd); + + + g_signal_connect (rd.toggle[BUTTON_NEW_VALUE], "toggled", + G_CALLBACK (toggle_sensitivity), rd.new_value_entry); + + g_signal_connect (rd.toggle[BUTTON_OLD_VALUE], "toggled", + G_CALLBACK (toggle_sensitivity), rd.ov_value_entry); + + g_signal_connect (rd.toggle[BUTTON_OLD_RANGE], "toggled", + G_CALLBACK (toggle_sensitivity), + get_widget_assert (xml, "entry3")); + + g_signal_connect (rd.toggle[BUTTON_OLD_RANGE], "toggled", + G_CALLBACK (toggle_sensitivity), + get_widget_assert (xml, "entry5")); + + g_signal_connect (rd.toggle[BUTTON_OLD_LOW_UP], "toggled", + G_CALLBACK (toggle_sensitivity), rd.ov_low_up_entry); + + g_signal_connect (rd.toggle[BUTTON_OLD_HIGH_DOWN], "toggled", + G_CALLBACK (toggle_sensitivity), rd.ov_high_down_entry); + + g_signal_connect (rd.string_button, "toggled", + G_CALLBACK (toggle_sensitivity), rd.width_entry); + + g_signal_connect (rd.string_button, "toggled", + G_CALLBACK (on_string_toggled), &rd); + + g_signal_connect (rd.convert_button, "toggled", + G_CALLBACK (on_convert_toggled), &rd); + + g_signal_connect_swapped (rd.old_and_new_dialog, "show", + G_CALLBACK (on_old_new_show), &rd); + } + + g_signal_connect (rd.dialog, "refresh", G_CALLBACK (refresh), &rd); + + + psppire_dialog_set_valid_predicate (PSPPIRE_DIALOG (rd.dialog), + dialog_state_valid, &rd); + + response = psppire_dialog_run (PSPPIRE_DIALOG (rd.dialog)); + + switch (response) + { + case GTK_RESPONSE_OK: + { + gchar *syntax = generate_syntax (&rd); + struct getl_interface *sss = create_syntax_string_source (syntax); + execute_syntax (sss); + + g_free (syntax); + } + break; + case PSPPIRE_RESPONSE_PASTE: + { + gchar *syntax = generate_syntax (&rd); + + struct syntax_editor *se = + (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL); + + gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1); + + g_free (syntax); + } + break; + default: + break; + } + + g_object_unref (xml); +} + +/* Initialise VAL to reflect the current status of RD */ +static gboolean +set_old_value (GValue *val, const struct recode_dialog *rd) +{ + const gchar *text = NULL; + struct old_value ov; + if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_VALUE]))) + { + text = gtk_entry_get_text (GTK_ENTRY (rd->ov_value_entry)); + if ( rd->input_var_is_string ) + { + ov.type = OV_STRING; + ov.v.s = g_strdup (text); + } + else + { + ov.type = OV_NUMERIC; + ov.v.v = g_strtod (text, 0); + } + } + else if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_MISSING]))) + { + ov.type = OV_MISSING; + } + else if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_SYSMIS]))) + { + ov.type = OV_SYSMIS; + } + else if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_ELSE]))) + { + ov.type = OV_ELSE; + } + else if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_RANGE]))) + { + const gchar *text; + text = gtk_entry_get_text (GTK_ENTRY (rd->ov_range_lower_entry)); + + ov.type = OV_RANGE; + ov.v.range[0] = g_strtod (text, 0); + + text = gtk_entry_get_text (GTK_ENTRY (rd->ov_range_upper_entry)); + ov.v.range[1] = g_strtod (text, 0); + } + else if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_LOW_UP]))) + { + const gchar *text = + gtk_entry_get_text (GTK_ENTRY (rd->ov_low_up_entry)); + + ov.type = OV_LOW_UP; + ov.v.range[1] = g_strtod (text, 0); + } + else if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON + (rd->toggle [BUTTON_OLD_HIGH_DOWN]))) + { + const gchar *text = + gtk_entry_get_text (GTK_ENTRY (rd->ov_high_down_entry)); + + ov.type = OV_HIGH_DOWN; + ov.v.range[0] = g_strtod (text, 0); + } + else + return FALSE; + + g_value_init (val, old_value_get_type ()); + g_value_set_boxed (val, &ov); + + return TRUE; +} + + +/* Initialse VAL to reflect the current status of RD */ +static gboolean +set_new_value (GValue *val, const struct recode_dialog *rd) +{ + const gchar *text = NULL; + struct new_value nv; + + if ( gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_VALUE]))) + { + text = gtk_entry_get_text (GTK_ENTRY (rd->new_value_entry)); + + nv.type = NV_NUMERIC; + if ( + (! rd->different && rd->input_var_is_string) || + ( rd->different && + gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (rd->string_button))) + ) + { + nv.type = NV_STRING; + } + + if ( nv.type == NV_STRING ) + nv.v.s = g_strdup (text); + else + nv.v.v = g_strtod (text, 0); + } + else if ( gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_COPY]))) + { + nv.type = NV_COPY; + } + + else if ( gtk_toggle_button_get_active + (GTK_TOGGLE_BUTTON (rd->toggle [BUTTON_NEW_SYSMIS]))) + { + nv.type = NV_SYSMIS; + } + else + return FALSE; + + g_value_init (val, new_value_get_type ()); + g_value_set_boxed (val, &nv); + + return TRUE; +} + + +/* A function to set a value in a column in the ACR */ +gboolean +set_value (gint col, GValue *val, gpointer data) +{ + struct recode_dialog *rd = data; + + switch ( col ) + { + case COL_VALUE_OLD: + set_old_value (val, rd); + break; + case COL_VALUE_NEW: + set_new_value (val, rd); + break; + default: + return FALSE; + } + + return TRUE; +} + +static void +run_old_and_new_dialog (struct recode_dialog *rd) +{ + gint response; + rd->local_store = clone_list_store (rd->value_map); + + g_object_ref (rd->local_store); + + psppire_acr_set_model (rd->acr, rd->local_store); + psppire_acr_set_get_value_func (rd->acr, set_value, rd); + + gtk_window_set_title (GTK_WINDOW (rd->old_and_new_dialog), + rd->different + ? _("Recode into Different Variables: Old and New Values ") + : _("Recode into Same Variables: Old and New Values") + ); + + + { + /* Find the type of the first variable (it's invariant that + all variables are of the same type) */ + const struct variable *v; + gint idx; + GtkTreeIter iter; + GtkTreeModel *model = + gtk_tree_view_get_model (GTK_TREE_VIEW (rd->variable_treeview)); + + gboolean not_empty = gtk_tree_model_get_iter_first (model, &iter); + + g_return_if_fail (not_empty); + + gtk_tree_model_get (model, &iter, 0, &idx, -1); + + v = psppire_dict_get_variable (rd->dict, idx); + + rd->input_var_is_string = var_is_alpha (v); + + gtk_widget_set_sensitive (rd->toggle [BUTTON_OLD_SYSMIS], + var_is_numeric (v)); + gtk_widget_set_sensitive (rd->toggle [BUTTON_OLD_RANGE], + var_is_numeric (v)); + gtk_widget_set_sensitive (rd->toggle [BUTTON_OLD_LOW_UP], + var_is_numeric (v)); + gtk_widget_set_sensitive (rd->toggle [BUTTON_OLD_HIGH_DOWN], + var_is_numeric (v)); + gtk_widget_set_sensitive (rd->toggle [BUTTON_NEW_SYSMIS], + var_is_numeric (v)); + + gtk_widget_set_sensitive (rd->convert_button, var_is_alpha (v)); + } + + + response = psppire_dialog_run (rd->old_and_new_dialog); + psppire_acr_set_model (rd->acr, NULL); + + + if ( response == PSPPIRE_RESPONSE_CONTINUE ) + rd->value_map = clone_list_store (rd->local_store); + + + psppire_dialog_notify_change (PSPPIRE_DIALOG (rd->dialog)); +} + + +/* Generate a syntax fragment for NV and append it to STR */ +static void +new_value_append_syntax (GString *str, const struct new_value *nv) +{ + switch (nv->type) + { + case NV_NUMERIC: + g_string_append_printf (str, "%g", nv->v.v); + break; + case NV_STRING: + { + struct string ds; + ds_init_cstr (&ds, nv->v.s); + gen_quoted_string (&ds); + g_string_append (str, ds_cstr (&ds)); + ds_destroy (&ds); + } + break; + case NV_COPY: + g_string_append (str, "COPY"); + break; + case NV_SYSMIS: + g_string_append (str, "SYSMIS"); + break; + default: + /* Shouldn't ever happen */ + g_warning ("Invalid type in new recode value"); + g_string_append (str, "???"); + break; + } +} + + +/* Generate a syntax fragment for NV and append it to STR */ +static void +old_value_append_syntax (GString *str, const struct old_value *ov) +{ + switch (ov->type) + { + case OV_NUMERIC: + g_string_append_printf (str, "%g", ov->v.v); + break; + case OV_STRING: + { + struct string ds; + ds_init_cstr (&ds, ov->v.s); + gen_quoted_string (&ds); + g_string_append (str, ds_cstr (&ds)); + ds_destroy (&ds); + } + break; + case OV_MISSING: + g_string_append (str, "MISSING"); + break; + case OV_SYSMIS: + g_string_append (str, "SYSMIS"); + break; + case OV_ELSE: + g_string_append (str, "ELSE"); + break; + case OV_RANGE: + g_string_append_printf (str, "%g THRU %g", + ov->v.range[0], + ov->v.range[1]); + break; + case OV_LOW_UP: + g_string_append_printf (str, "LOWEST THRU %g", + ov->v.range[1]); + break; + case OV_HIGH_DOWN: + g_string_append_printf (str, "%g THRU HIGHEST", + ov->v.range[0]); + break; + default: + g_warning ("Invalid type in old recode value"); + g_string_append (str, "???"); + break; + }; +} + + + +static char * +generate_syntax (const struct recode_dialog *rd) +{ + gboolean ok; + GtkTreeIter iter; + gchar *text; + + GString *str = g_string_sized_new (100); + + /* Declare new string variables if applicable */ + if ( rd->different && + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->string_button))) + { + GtkTreeIter iter; + + + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->var_map), + &iter); + ok; + ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (rd->var_map), &iter)) + { + gchar *name = NULL; + + gtk_tree_model_get (GTK_TREE_MODEL (rd->var_map), &iter, + COL_NEW_NAME, &name, -1); + + g_string_append (str, "\nSTRING "); + g_string_append (str, name); + g_string_append_printf (str, " (A%d).", + (int) + gtk_spin_button_get_value (GTK_SPIN_BUTTON (rd->width_entry) ) + ); + + g_free (name); + } + } + + g_string_append (str, "\nRECODE "); + + append_variable_names (str, rd->dict, GTK_TREE_VIEW (rd->variable_treeview)); + + g_string_append (str, "\n\t"); + + if ( gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (rd->convert_button))) + { + g_string_append (str, "(CONVERT) "); + } + + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->value_map), + &iter); + ok; + ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (rd->value_map), &iter)) + { + GValue ov_value = {0}; + GValue nv_value = {0}; + struct old_value *ov; + struct new_value *nv; + gtk_tree_model_get_value (GTK_TREE_MODEL (rd->value_map), &iter, + COL_VALUE_OLD, &ov_value); + + gtk_tree_model_get_value (GTK_TREE_MODEL (rd->value_map), &iter, + COL_VALUE_NEW, &nv_value); + + ov = g_value_get_boxed (&ov_value); + nv = g_value_get_boxed (&nv_value); + + g_string_append (str, "("); + + old_value_append_syntax (str, ov); + g_string_append (str, " = "); + new_value_append_syntax (str, nv); + + g_string_append (str, ") "); + g_value_unset (&ov_value); + g_value_unset (&nv_value); + } + + + if ( rd->different ) + { + GtkTreeIter iter; + g_string_append (str, "\n\tINTO "); + + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->var_map), + &iter); + ok; + ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (rd->var_map), &iter)) + { + gchar *name = NULL; + + gtk_tree_model_get (GTK_TREE_MODEL (rd->var_map), &iter, + COL_NEW_NAME, &name, -1); + + g_string_append (str, name); + g_string_append (str, " "); + + g_free (name); + } + } + + g_string_append (str, "."); + + + /* If applicable, set labels for the new variables. */ + if ( rd->different ) + { + GtkTreeIter iter; + + for (ok = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (rd->var_map), + &iter); + ok; + ok = gtk_tree_model_iter_next (GTK_TREE_MODEL (rd->var_map), &iter)) + { + struct string ls; + gchar *label = NULL; + gchar *name = NULL; + + gtk_tree_model_get (GTK_TREE_MODEL (rd->var_map), &iter, + COL_NEW_NAME, &name, + COL_NEW_LABEL, &label, -1); + + if ( 0 == strcmp (label, "") ) + { + g_free (name); + g_free (label); + continue; + } + + ds_init_cstr (&ls, label); + g_free (label); + gen_quoted_string (&ls); + + g_string_append_printf (str, "\nVARIABLE LABELS %s %s.", + name, ds_cstr (&ls)); + + g_free (name); + ds_destroy (&ls); + } + } + + + g_string_append (str, "\nEXECUTE.\n"); + + + text = str->str; + + g_string_free (str, FALSE); + + return text; +} diff --git a/src/ui/gui/recode-dialog.h b/src/ui/gui/recode-dialog.h new file mode 100644 index 00000000..8f251e1e --- /dev/null +++ b/src/ui/gui/recode-dialog.h @@ -0,0 +1,26 @@ +/* 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 . */ + +#ifndef __RECODE_DIALOG_H +#define __RECODE_DIALOG_H + + +#include + +void recode_same_dialog (GObject *o, gpointer data); +void recode_different_dialog (GObject *o, gpointer data); + +#endif diff --git a/src/ui/gui/recode.glade b/src/ui/gui/recode.glade new file mode 100644 index 00000000..38fe21c0 --- /dev/null +++ b/src/ui/gui/recode.glade @@ -0,0 +1,988 @@ + + + + + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 11 + 2 + + + + + + + + + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + + 1 + 2 + 9 + 10 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + + 1 + 2 + 7 + 8 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + + + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton4 + + + 2 + 3 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton4 + + + 3 + 4 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton4 + + + 4 + 5 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton4 + + + 6 + 7 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton4 + + + 8 + 9 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Value: + + + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + System-Missing + + + 1 + 2 + 2 + 3 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + System-or user-missing + + + 1 + 2 + 3 + 4 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + through + + + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + + 2 + + + + + 1 + 2 + 5 + 6 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Range, LOWEST thru value + + + 1 + 2 + 6 + 7 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Range, value thru HIGHEST + + + 1 + 2 + 8 + 9 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton4 + + + 10 + 11 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + All other values + + + 1 + 2 + 10 + 11 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + + + 1 + 2 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Range: + + + 1 + 2 + 4 + 5 + + + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Old Value + True + + + label_item + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 3 + 2 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + + + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton1 + + + 1 + 2 + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + True + radiobutton1 + + + + + + 2 + 3 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + System Missing + + + 1 + 2 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Copy old values + + + 1 + 2 + 2 + 3 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + Value: + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + + + 1 + 2 + + + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + New Value + True + + + label_item + + + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + 2 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + + + + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + True + + + 1 + 2 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Convert numeric strings to numbers ('5' -> 5) + + + 1 + 2 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Output variables are strings + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 + Width: + + + + + True + False + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 8 1 255 1 8 0 + True + GTK_UPDATE_IF_VALID + + + 1 + + + + + False + 1 + + + + + 1 + 2 + + + + + False + False + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 10 + PSPPIRE_BUTTON_CONTINUE_MASK | PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK + + + False + False + GTK_PACK_END + 3 + + + + + 1 + + + + + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Recode into Same Variables + True + PSPPIRE_TABULAR + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 3 + 4 + 5 + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 2 + 2 + 3 + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + 1 + 2 + + + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + If... + 0 + + + False + False + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + (optional case selection condition) + + + 1 + + + + + 2 + 4 + 2 + 3 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + 3 + 4 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + + + 3 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 2 + 1 + 2 + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Name: + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + Label: + + + 2 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 3 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Change + 0 + + + + + 5 + 4 + + + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Output Variable + True + + + label_item + + + + + 3 + 4 + 1 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + GTK_SHADOW_NONE + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 12 + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_ETCHED_IN + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + + + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Variables: + True + + + label_item + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0 + 0 + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Old and New Values + 0 + + + + + + + False + False + 1 + + + + + 2 + 3 + 2 + + + + + +