From: John Darrington Date: Mon, 30 Apr 2007 08:58:14 +0000 (+0000) Subject: Added the Variable Information dialog. X-Git-Tag: v0.6.0~475 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b06c888cf2e8c126b04d4678120439533a5086e5;p=pspp-builds.git Added the Variable Information dialog. --- diff --git a/glade.patch b/glade.patch index 80a5aa01..66b8cd8a 100644 --- a/glade.patch +++ b/glade.patch @@ -1,7 +1,16 @@ ---- /Scratch/john/tmp.vKHTg31290/share/pspp/data-editor.glade 2007-03-31 12:55:02.000000000 +0800 -+++ src/ui/gui/data-editor.glade 2007-03-31 13:04:27.000000000 +0800 -@@ -494,7 +494,7 @@ +--- xxx 2007-04-29 11:57:19.000000000 +0800 ++++ src/ui/gui/data-editor.glade 2007-04-29 11:57:37.000000000 +0800 +@@ -526,7 +526,7 @@ + True False + Recall +- gtk-missing-image ++ pspp-recent-dialogs + + + False +@@ -588,7 +588,7 @@ + True Variables True - gtk-missing-image @@ -9,7 +18,7 @@ False -@@ -535,7 +535,7 @@ +@@ -629,7 +629,7 @@ False Insert Case True @@ -18,7 +27,7 @@ False -@@ -547,7 +547,7 @@ +@@ -641,7 +641,7 @@ False Insert Variable True @@ -27,7 +36,7 @@ False -@@ -567,7 +567,7 @@ +@@ -661,7 +661,7 @@ True Split File True @@ -36,7 +45,7 @@ False -@@ -578,7 +578,7 @@ +@@ -672,7 +672,7 @@ True Weight Cases True @@ -45,7 +54,7 @@ False -@@ -590,7 +590,7 @@ +@@ -684,7 +684,7 @@ False Select Cases True @@ -54,7 +63,7 @@ False -@@ -610,7 +610,7 @@ +@@ -704,7 +704,7 @@ True Value Labels True diff --git a/glade/bbox.c b/glade/bbox.c index 9ce8c34d..f8a80c6b 100644 --- a/glade/bbox.c +++ b/glade/bbox.c @@ -37,7 +37,7 @@ glade_psppire_button_box_get_internal_child (GladeWidgetAdaptor *adaptor, g_print ("%s\n", __FUNCTION__); #endif - return bbox; + return GTK_WIDGET (bbox); } diff --git a/glade/dialog.c b/glade/dialog.c index ac6f2a22..2d67443c 100644 --- a/glade/dialog.c +++ b/glade/dialog.c @@ -2,7 +2,7 @@ #include #include "psppire-dialog.h" - +#include #include #include diff --git a/glade/psppire.xml b/glade/psppire.xml index 847afb26..7feb1313 100644 --- a/glade/psppire.xml +++ b/glade/psppire.xml @@ -65,6 +65,17 @@ + + + + + + + + + + + diff --git a/po/de.po b/po/de.po index 15363df4..8c48fdb6 100644 --- a/po/de.po +++ b/po/de.po @@ -10,7 +10,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.4.2\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2007-04-28 11:18+0800\n" +"POT-Creation-Date: 2007-04-29 12:09+0800\n" "PO-Revision-Date: 2006-05-26 17:49+0800\n" "Last-Translator: John Darrington \n" "Language-Team: German \n" @@ -309,14 +309,14 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:310 src/data/por-file-reader.c:489 -#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1127 -#: src/ui/gui/psppire-var-store.c:481 +#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1157 +#: src/ui/gui/psppire-var-store.c:486 msgid "String" msgstr "Zeichenkette" #: src/data/format.c:310 src/data/por-file-reader.c:489 -#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1023 -#: src/ui/gui/psppire-var-store.c:474 +#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1053 +#: src/ui/gui/psppire-var-store.c:479 msgid "Numeric" msgstr "Nummer" @@ -3415,24 +3415,6 @@ msgstr "" msgid "Closing `%s': %s." msgstr "" -#: src/language/tests/check-model.q:139 -msgid "PATH and SEARCH subcommands are mutually exclusive. Ignoring PATH." -msgstr "" - -#: src/language/tests/check-model.q:157 -msgid "At least one value must be specified on PATH." -msgstr "" - -#: src/language/tests/check-model.q:168 -#, c-format -msgid "Hash bits adjusted to %d." -msgstr "" - -#: src/language/tests/check-model.q:209 -#, c-format -msgid "error opening \"%s\" for writing" -msgstr "" - #: src/language/tests/float-format.c:126 #, c-format msgid "%d-byte string needed but %d-byte string supplied." @@ -4199,88 +4181,98 @@ msgstr "" msgid "Compute new values for a variable" msgstr "Unpassend Wert für Variable" -#: src/ui/gui/data-editor.c:636 +#: src/ui/gui/data-editor.c:265 src/ui/gui/data-editor.glade:259 +#: src/ui/gui/data-editor.glade:589 +msgid "Variables" +msgstr "Variableansicht" + +#: src/ui/gui/data-editor.c:266 +#, fuzzy +msgid "Jump to Variable" +msgstr "Variableansicht" + +#: src/ui/gui/data-editor.c:655 msgid "Font Selection" msgstr "Schriftwahlung" -#: src/ui/gui/data-editor.c:814 +#: src/ui/gui/data-editor.c:833 msgid "No Split" msgstr "" -#: src/ui/gui/data-editor.c:822 +#: src/ui/gui/data-editor.c:841 #, fuzzy msgid "Split by " msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:847 +#: src/ui/gui/data-editor.c:866 msgid "Filter off" msgstr "" -#: src/ui/gui/data-editor.c:860 +#: src/ui/gui/data-editor.c:879 #, c-format msgid "Filter by %s" msgstr "" -#: src/ui/gui/data-editor.c:878 +#: src/ui/gui/data-editor.c:897 msgid "Weights off" msgstr "" -#: src/ui/gui/data-editor.c:891 +#: src/ui/gui/data-editor.c:910 #, c-format msgid "Weight by %s" msgstr "" -#: src/ui/gui/data-editor.c:914 src/ui/gui/data-editor.c:1145 -#: src/ui/gui/data-editor.glade:465 +#: src/ui/gui/data-editor.c:933 src/ui/gui/data-editor.c:1164 +#: src/ui/gui/data-editor.glade:496 msgid "Open" msgstr "Öffen" -#: src/ui/gui/data-editor.c:915 +#: src/ui/gui/data-editor.c:934 msgid "Open a data file" msgstr "" -#: src/ui/gui/data-editor.c:923 src/ui/gui/data-editor.c:1030 -#: src/ui/gui/data-editor.glade:475 +#: src/ui/gui/data-editor.c:942 src/ui/gui/data-editor.c:1049 +#: src/ui/gui/data-editor.glade:506 msgid "Save" msgstr "Speichen" -#: src/ui/gui/data-editor.c:924 src/ui/gui/data-editor.c:934 +#: src/ui/gui/data-editor.c:943 src/ui/gui/data-editor.c:953 #, fuzzy msgid "Save data to file" msgstr "Speichern unter" -#: src/ui/gui/data-editor.c:933 +#: src/ui/gui/data-editor.c:952 #, fuzzy msgid "Save As" msgstr "Speichern unter" -#: src/ui/gui/data-editor.c:942 +#: src/ui/gui/data-editor.c:961 msgid "New" msgstr "" -#: src/ui/gui/data-editor.c:943 +#: src/ui/gui/data-editor.c:962 msgid "New data file" msgstr "" -#: src/ui/gui/data-editor.c:1038 src/ui/gui/data-editor.c:1153 +#: src/ui/gui/data-editor.c:1057 src/ui/gui/data-editor.c:1172 msgid "System Files (*.sav)" msgstr "Systemedatein (*.sav)" -#: src/ui/gui/data-editor.c:1044 src/ui/gui/data-editor.c:1159 +#: src/ui/gui/data-editor.c:1063 src/ui/gui/data-editor.c:1178 msgid "Portable Files (*.por) " msgstr "Tragbardatein (*.por)" -#: src/ui/gui/data-editor.c:1050 src/ui/gui/data-editor.c:1165 +#: src/ui/gui/data-editor.c:1069 src/ui/gui/data-editor.c:1184 #: src/ui/gui/syntax-editor.c:141 src/ui/gui/syntax-editor.c:527 msgid "All Files" msgstr "Alle Datei" -#: src/ui/gui/data-editor.c:1058 +#: src/ui/gui/data-editor.c:1077 #, fuzzy msgid "System File" msgstr "Systemedatein (*.sav)" -#: src/ui/gui/data-editor.c:1063 +#: src/ui/gui/data-editor.c:1082 #, fuzzy msgid "Portable File" msgstr "Tragbardatein (*.por)" @@ -4347,8 +4339,8 @@ msgstr "Schrift" msgid "Grid Lines" msgstr "Glitten" -#: src/ui/gui/data-editor.glade:240 src/ui/gui/data-editor.glade:675 -#: src/ui/gui/data-editor.glade:1385 src/ui/gui/data-editor.glade:1563 +#: src/ui/gui/data-editor.glade:240 src/ui/gui/data-editor.glade:705 +#: src/ui/gui/data-editor.glade:1415 src/ui/gui/data-editor.glade:1593 msgid "Value Labels" msgstr "Werten" @@ -4356,11 +4348,7 @@ msgstr "Werten" msgid "Data" msgstr "Daten" -#: src/ui/gui/data-editor.glade:259 src/ui/gui/data-editor.glade:559 -msgid "Variables" -msgstr "Variableansicht" - -#: src/ui/gui/data-editor.glade:278 src/ui/gui/data-editor.glade:612 +#: src/ui/gui/data-editor.glade:278 src/ui/gui/data-editor.glade:642 #, fuzzy msgid "Insert Variable" msgstr "Variableansicht" @@ -4370,12 +4358,12 @@ msgstr "Variableansicht" msgid "Insert Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.glade:294 src/ui/gui/data-editor.glade:548 -#: src/ui/gui/data-editor.glade:1929 +#: src/ui/gui/data-editor.glade:294 src/ui/gui/data-editor.glade:579 +#: src/ui/gui/data-editor.glade:1959 msgid "Go To Case" msgstr "" -#: src/ui/gui/data-editor.glade:307 src/ui/gui/data-editor.glade:1994 +#: src/ui/gui/data-editor.glade:307 src/ui/gui/data-editor.glade:2024 msgid "Sort Cases" msgstr "" @@ -4392,16 +4380,16 @@ msgstr "Alle Datei" msgid "Aggregate" msgstr "" -#: src/ui/gui/data-editor.glade:352 src/ui/gui/data-editor.glade:632 +#: src/ui/gui/data-editor.glade:352 src/ui/gui/data-editor.glade:662 #, fuzzy msgid "Split File" msgstr "Alle Datei" -#: src/ui/gui/data-editor.glade:360 src/ui/gui/data-editor.glade:655 +#: src/ui/gui/data-editor.glade:360 src/ui/gui/data-editor.glade:685 msgid "Select Cases" msgstr "" -#: src/ui/gui/data-editor.glade:367 src/ui/gui/data-editor.glade:643 +#: src/ui/gui/data-editor.glade:367 src/ui/gui/data-editor.glade:673 msgid "Weight Cases" msgstr "" @@ -4418,194 +4406,208 @@ msgstr "" msgid "Ran_k Cases" msgstr "_Stecken" -#: src/ui/gui/data-editor.glade:409 src/ui/gui/syntax-editor.glade:233 +#: src/ui/gui/data-editor.glade:410 +msgid "_Utilities" +msgstr "" + +#: src/ui/gui/data-editor.glade:420 +#, fuzzy +msgid "_Variables" +msgstr "Variableansicht" + +#: src/ui/gui/data-editor.glade:429 +#, fuzzy +msgid "Data File _Comments" +msgstr "Datei Fehler" + +#: src/ui/gui/data-editor.glade:440 src/ui/gui/syntax-editor.glade:233 #, fuzzy msgid "_Windows" msgstr "_Datei" -#: src/ui/gui/data-editor.glade:416 src/ui/gui/syntax-editor.glade:242 +#: src/ui/gui/data-editor.glade:447 src/ui/gui/syntax-editor.glade:242 msgid "_Minimise All Windows" msgstr "" -#: src/ui/gui/data-editor.glade:427 src/ui/gui/syntax-editor.glade:254 +#: src/ui/gui/data-editor.glade:458 src/ui/gui/syntax-editor.glade:254 msgid "_Help" msgstr "_Hilfe" -#: src/ui/gui/data-editor.glade:434 src/ui/gui/syntax-editor.glade:263 +#: src/ui/gui/data-editor.glade:465 src/ui/gui/syntax-editor.glade:263 msgid "_Reference Manual" msgstr "" -#: src/ui/gui/data-editor.glade:441 src/ui/gui/syntax-editor.glade:271 +#: src/ui/gui/data-editor.glade:472 src/ui/gui/syntax-editor.glade:271 msgid "_About" msgstr "_Info" -#: src/ui/gui/data-editor.glade:486 +#: src/ui/gui/data-editor.glade:517 msgid "Print" msgstr "Drucken" -#: src/ui/gui/data-editor.glade:497 +#: src/ui/gui/data-editor.glade:528 msgid "Recall" msgstr "" -#: src/ui/gui/data-editor.glade:517 +#: src/ui/gui/data-editor.glade:548 msgid "Undo" msgstr "" -#: src/ui/gui/data-editor.glade:528 +#: src/ui/gui/data-editor.glade:559 msgid "Redo" msgstr "" -#: src/ui/gui/data-editor.glade:580 +#: src/ui/gui/data-editor.glade:610 msgid "Find" msgstr "" -#: src/ui/gui/data-editor.glade:600 +#: src/ui/gui/data-editor.glade:630 #, fuzzy msgid "Insert Case" msgstr "_Stecken" -#: src/ui/gui/data-editor.glade:687 +#: src/ui/gui/data-editor.glade:717 msgid "Use Sets" msgstr "" -#: src/ui/gui/data-editor.glade:769 +#: src/ui/gui/data-editor.glade:799 msgid "Data View" msgstr "Datenansicht" -#: src/ui/gui/data-editor.glade:796 +#: src/ui/gui/data-editor.glade:826 msgid "Variable View" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:826 +#: src/ui/gui/data-editor.glade:856 msgid "Information Area" msgstr "" -#: src/ui/gui/data-editor.glade:845 +#: src/ui/gui/data-editor.glade:875 msgid "Processor Area" msgstr "" -#: src/ui/gui/data-editor.glade:870 +#: src/ui/gui/data-editor.glade:900 msgid "OMS Area" msgstr "" -#: src/ui/gui/data-editor.glade:895 +#: src/ui/gui/data-editor.glade:925 msgid "Case Counter Area" msgstr "" -#: src/ui/gui/data-editor.glade:920 +#: src/ui/gui/data-editor.glade:950 msgid "Filter Use Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:946 +#: src/ui/gui/data-editor.glade:976 msgid "Weight Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:972 +#: src/ui/gui/data-editor.glade:1002 #, fuzzy msgid "Split File Status Area" msgstr "Alle Datei" -#: src/ui/gui/data-editor.glade:1002 +#: src/ui/gui/data-editor.glade:1032 msgid "Variable Type" msgstr "Variableansicht" -#: src/ui/gui/data-editor.glade:1037 src/ui/gui/psppire-var-store.c:475 +#: src/ui/gui/data-editor.glade:1067 src/ui/gui/psppire-var-store.c:480 msgid "Comma" msgstr "Komma" -#: src/ui/gui/data-editor.glade:1052 src/ui/gui/psppire-var-store.c:476 +#: src/ui/gui/data-editor.glade:1082 src/ui/gui/psppire-var-store.c:481 msgid "Dot" msgstr "Punkt" -#: src/ui/gui/data-editor.glade:1067 +#: src/ui/gui/data-editor.glade:1097 msgid "Scientific notation" msgstr "Wissenschaftlichnotation" -#: src/ui/gui/data-editor.glade:1082 src/ui/gui/psppire-var-store.c:478 +#: src/ui/gui/data-editor.glade:1112 src/ui/gui/psppire-var-store.c:483 msgid "Date" msgstr "Datum" -#: src/ui/gui/data-editor.glade:1097 src/ui/gui/psppire-var-store.c:479 +#: src/ui/gui/data-editor.glade:1127 src/ui/gui/psppire-var-store.c:484 msgid "Dollar" msgstr "Euro" -#: src/ui/gui/data-editor.glade:1112 +#: src/ui/gui/data-editor.glade:1142 msgid "Custom currency" msgstr "Spezialwährung" -#: src/ui/gui/data-editor.glade:1204 +#: src/ui/gui/data-editor.glade:1234 msgid "positive" msgstr "positiv" -#: src/ui/gui/data-editor.glade:1210 +#: src/ui/gui/data-editor.glade:1240 msgid "negative" msgstr "negativ" -#: src/ui/gui/data-editor.glade:1223 +#: src/ui/gui/data-editor.glade:1253 msgid "Sample" msgstr "Muster" -#: src/ui/gui/data-editor.glade:1271 +#: src/ui/gui/data-editor.glade:1301 msgid "Decimal Places:" msgstr "Dezimalstellen:" -#: src/ui/gui/data-editor.glade:1312 +#: src/ui/gui/data-editor.glade:1342 msgid "Width:" msgstr "Große:" -#: src/ui/gui/data-editor.glade:1469 +#: src/ui/gui/data-editor.glade:1499 msgid "Value:" msgstr "Werte:" -#: src/ui/gui/data-editor.glade:1480 +#: src/ui/gui/data-editor.glade:1510 msgid "Value Label:" msgstr "Kennsatz:" -#: src/ui/gui/data-editor.glade:1627 +#: src/ui/gui/data-editor.glade:1657 msgid "Missing Values" msgstr "Lösewerten" -#: src/ui/gui/data-editor.glade:1691 +#: src/ui/gui/data-editor.glade:1721 msgid "_No missing values" msgstr "_Kein Lösewerten" -#: src/ui/gui/data-editor.glade:1708 +#: src/ui/gui/data-editor.glade:1738 msgid "_Discrete missing values" msgstr "_Diskret Lösewerten" -#: src/ui/gui/data-editor.glade:1792 +#: src/ui/gui/data-editor.glade:1822 msgid "_Range plus one optional discrete missing value" msgstr "Wertebereich und ein optional Lösewert" -#: src/ui/gui/data-editor.glade:1816 +#: src/ui/gui/data-editor.glade:1846 msgid "_Low:" msgstr "_Tief:" -#: src/ui/gui/data-editor.glade:1845 +#: src/ui/gui/data-editor.glade:1875 msgid "_High:" msgstr "_Hoch:" -#: src/ui/gui/data-editor.glade:1886 +#: src/ui/gui/data-editor.glade:1916 msgid "Di_screte value:" msgstr "Di_skretwerte" -#: src/ui/gui/data-editor.glade:1946 +#: src/ui/gui/data-editor.glade:1976 msgid "Case Number:" msgstr "" -#: src/ui/gui/data-editor.glade:2055 src/ui/gui/psppire.glade:1171 +#: src/ui/gui/data-editor.glade:2085 src/ui/gui/psppire.glade:1171 msgid "Sort by:" msgstr "" -#: src/ui/gui/data-editor.glade:2104 src/ui/gui/psppire.glade:1224 +#: src/ui/gui/data-editor.glade:2134 src/ui/gui/psppire.glade:1224 msgid "Ascending" msgstr "" -#: src/ui/gui/data-editor.glade:2117 src/ui/gui/psppire.glade:1234 +#: src/ui/gui/data-editor.glade:2147 src/ui/gui/psppire.glade:1234 msgid "Descending" msgstr "" -#: src/ui/gui/data-editor.glade:2133 src/ui/gui/psppire.glade:1250 +#: src/ui/gui/data-editor.glade:2163 src/ui/gui/psppire.glade:1250 msgid "Sort Order" msgstr "" @@ -4653,18 +4655,56 @@ msgstr "Unpassend Wert für Variable" msgid "Incorrect range specification" msgstr "Falshe Spannweitebeschreibung" -#: src/ui/gui/psppire-buttonbox.c:130 +#: src/ui/gui/psppire-buttonbox.c:146 +msgid "Buttons" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:147 +msgid "The mask that decides what buttons appear in the button box" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:245 src/ui/gui/psppire-buttonbox.c:397 +msgid "Continue" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:255 #, fuzzy msgid "_Paste" msgstr "Datum" +#: src/ui/gui/psppire-buttonbox.c:395 +msgid "OK" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:396 +msgid "Go To" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:398 +msgid "Cancel" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:399 +#, fuzzy +msgid "Help" +msgstr "_Hilfe" + +#: src/ui/gui/psppire-buttonbox.c:400 +msgid "Reset" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:401 +#, fuzzy +msgid "Paste" +msgstr "Datum" + #: src/ui/gui/psppire-data-store.c:750 msgid "var" msgstr "" -#: src/ui/gui/psppire-data-store.c:831 src/ui/gui/psppire-var-store.c:551 -#: src/ui/gui/psppire-var-store.c:561 src/ui/gui/psppire-var-store.c:571 -#: src/ui/gui/psppire-var-store.c:769 +#: src/ui/gui/psppire-data-store.c:831 src/ui/gui/psppire-var-store.c:556 +#: src/ui/gui/psppire-var-store.c:566 src/ui/gui/psppire-var-store.c:576 +#: src/ui/gui/psppire-var-store.c:714 #, c-format msgid "%d" msgstr "" @@ -4843,15 +4883,33 @@ msgstr "" msgid "Functions:" msgstr "" -#: src/ui/gui/psppire-var-store.c:470 +#: src/ui/gui/psppire.glade:1643 +msgid "Variable Information:" +msgstr "" + +#: src/ui/gui/psppire.glade:1669 +msgid "" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:472 msgid "None" msgstr "Keine" -#: src/ui/gui/psppire-var-store.c:477 +#: src/ui/gui/psppire-var-store.c:482 msgid "Scientific" msgstr "Wissenschäflich" -#: src/ui/gui/psppire-var-store.c:480 +#: src/ui/gui/psppire-var-store.c:485 msgid "Custom" msgstr "Spezial" diff --git a/po/pspp.pot b/po/pspp.pot index d404c448..42bfa2af 100644 --- a/po/pspp.pot +++ b/po/pspp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2007-04-28 11:18+0800\n" +"POT-Creation-Date: 2007-04-29 12:09+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -308,14 +308,14 @@ msgid "%s variables are not compatible with %s format %s." msgstr "" #: src/data/format.c:310 src/data/por-file-reader.c:489 -#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1127 -#: src/ui/gui/psppire-var-store.c:481 +#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1157 +#: src/ui/gui/psppire-var-store.c:486 msgid "String" msgstr "" #: src/data/format.c:310 src/data/por-file-reader.c:489 -#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1023 -#: src/ui/gui/psppire-var-store.c:474 +#: src/data/sys-file-reader.c:629 src/ui/gui/data-editor.glade:1053 +#: src/ui/gui/psppire-var-store.c:479 msgid "Numeric" msgstr "" @@ -3409,24 +3409,6 @@ msgstr "" msgid "Closing `%s': %s." msgstr "" -#: src/language/tests/check-model.q:139 -msgid "PATH and SEARCH subcommands are mutually exclusive. Ignoring PATH." -msgstr "" - -#: src/language/tests/check-model.q:157 -msgid "At least one value must be specified on PATH." -msgstr "" - -#: src/language/tests/check-model.q:168 -#, c-format -msgid "Hash bits adjusted to %d." -msgstr "" - -#: src/language/tests/check-model.q:209 -#, c-format -msgid "error opening \"%s\" for writing" -msgstr "" - #: src/language/tests/float-format.c:126 #, c-format msgid "%d-byte string needed but %d-byte string supplied." @@ -4190,84 +4172,93 @@ msgstr "" msgid "Compute new values for a variable" msgstr "" -#: src/ui/gui/data-editor.c:636 +#: src/ui/gui/data-editor.c:265 src/ui/gui/data-editor.glade:259 +#: src/ui/gui/data-editor.glade:589 +msgid "Variables" +msgstr "" + +#: src/ui/gui/data-editor.c:266 +msgid "Jump to Variable" +msgstr "" + +#: src/ui/gui/data-editor.c:655 msgid "Font Selection" msgstr "" -#: src/ui/gui/data-editor.c:814 +#: src/ui/gui/data-editor.c:833 msgid "No Split" msgstr "" -#: src/ui/gui/data-editor.c:822 +#: src/ui/gui/data-editor.c:841 msgid "Split by " msgstr "" -#: src/ui/gui/data-editor.c:847 +#: src/ui/gui/data-editor.c:866 msgid "Filter off" msgstr "" -#: src/ui/gui/data-editor.c:860 +#: src/ui/gui/data-editor.c:879 #, c-format msgid "Filter by %s" msgstr "" -#: src/ui/gui/data-editor.c:878 +#: src/ui/gui/data-editor.c:897 msgid "Weights off" msgstr "" -#: src/ui/gui/data-editor.c:891 +#: src/ui/gui/data-editor.c:910 #, c-format msgid "Weight by %s" msgstr "" -#: src/ui/gui/data-editor.c:914 src/ui/gui/data-editor.c:1145 -#: src/ui/gui/data-editor.glade:465 +#: src/ui/gui/data-editor.c:933 src/ui/gui/data-editor.c:1164 +#: src/ui/gui/data-editor.glade:496 msgid "Open" msgstr "" -#: src/ui/gui/data-editor.c:915 +#: src/ui/gui/data-editor.c:934 msgid "Open a data file" msgstr "" -#: src/ui/gui/data-editor.c:923 src/ui/gui/data-editor.c:1030 -#: src/ui/gui/data-editor.glade:475 +#: src/ui/gui/data-editor.c:942 src/ui/gui/data-editor.c:1049 +#: src/ui/gui/data-editor.glade:506 msgid "Save" msgstr "" -#: src/ui/gui/data-editor.c:924 src/ui/gui/data-editor.c:934 +#: src/ui/gui/data-editor.c:943 src/ui/gui/data-editor.c:953 msgid "Save data to file" msgstr "" -#: src/ui/gui/data-editor.c:933 +#: src/ui/gui/data-editor.c:952 msgid "Save As" msgstr "" -#: src/ui/gui/data-editor.c:942 +#: src/ui/gui/data-editor.c:961 msgid "New" msgstr "" -#: src/ui/gui/data-editor.c:943 +#: src/ui/gui/data-editor.c:962 msgid "New data file" msgstr "" -#: src/ui/gui/data-editor.c:1038 src/ui/gui/data-editor.c:1153 +#: src/ui/gui/data-editor.c:1057 src/ui/gui/data-editor.c:1172 msgid "System Files (*.sav)" msgstr "" -#: src/ui/gui/data-editor.c:1044 src/ui/gui/data-editor.c:1159 +#: src/ui/gui/data-editor.c:1063 src/ui/gui/data-editor.c:1178 msgid "Portable Files (*.por) " msgstr "" -#: src/ui/gui/data-editor.c:1050 src/ui/gui/data-editor.c:1165 +#: src/ui/gui/data-editor.c:1069 src/ui/gui/data-editor.c:1184 #: src/ui/gui/syntax-editor.c:141 src/ui/gui/syntax-editor.c:527 msgid "All Files" msgstr "" -#: src/ui/gui/data-editor.c:1058 +#: src/ui/gui/data-editor.c:1077 msgid "System File" msgstr "" -#: src/ui/gui/data-editor.c:1063 +#: src/ui/gui/data-editor.c:1082 msgid "Portable File" msgstr "" @@ -4330,8 +4321,8 @@ msgstr "" msgid "Grid Lines" msgstr "" -#: src/ui/gui/data-editor.glade:240 src/ui/gui/data-editor.glade:675 -#: src/ui/gui/data-editor.glade:1385 src/ui/gui/data-editor.glade:1563 +#: src/ui/gui/data-editor.glade:240 src/ui/gui/data-editor.glade:705 +#: src/ui/gui/data-editor.glade:1415 src/ui/gui/data-editor.glade:1593 msgid "Value Labels" msgstr "" @@ -4339,11 +4330,7 @@ msgstr "" msgid "Data" msgstr "" -#: src/ui/gui/data-editor.glade:259 src/ui/gui/data-editor.glade:559 -msgid "Variables" -msgstr "" - -#: src/ui/gui/data-editor.glade:278 src/ui/gui/data-editor.glade:612 +#: src/ui/gui/data-editor.glade:278 src/ui/gui/data-editor.glade:642 msgid "Insert Variable" msgstr "" @@ -4351,12 +4338,12 @@ msgstr "" msgid "Insert Cases" msgstr "" -#: src/ui/gui/data-editor.glade:294 src/ui/gui/data-editor.glade:548 -#: src/ui/gui/data-editor.glade:1929 +#: src/ui/gui/data-editor.glade:294 src/ui/gui/data-editor.glade:579 +#: src/ui/gui/data-editor.glade:1959 msgid "Go To Case" msgstr "" -#: src/ui/gui/data-editor.glade:307 src/ui/gui/data-editor.glade:1994 +#: src/ui/gui/data-editor.glade:307 src/ui/gui/data-editor.glade:2024 msgid "Sort Cases" msgstr "" @@ -4372,15 +4359,15 @@ msgstr "" msgid "Aggregate" msgstr "" -#: src/ui/gui/data-editor.glade:352 src/ui/gui/data-editor.glade:632 +#: src/ui/gui/data-editor.glade:352 src/ui/gui/data-editor.glade:662 msgid "Split File" msgstr "" -#: src/ui/gui/data-editor.glade:360 src/ui/gui/data-editor.glade:655 +#: src/ui/gui/data-editor.glade:360 src/ui/gui/data-editor.glade:685 msgid "Select Cases" msgstr "" -#: src/ui/gui/data-editor.glade:367 src/ui/gui/data-editor.glade:643 +#: src/ui/gui/data-editor.glade:367 src/ui/gui/data-editor.glade:673 msgid "Weight Cases" msgstr "" @@ -4396,191 +4383,203 @@ msgstr "" msgid "Ran_k Cases" msgstr "" -#: src/ui/gui/data-editor.glade:409 src/ui/gui/syntax-editor.glade:233 +#: src/ui/gui/data-editor.glade:410 +msgid "_Utilities" +msgstr "" + +#: src/ui/gui/data-editor.glade:420 +msgid "_Variables" +msgstr "" + +#: src/ui/gui/data-editor.glade:429 +msgid "Data File _Comments" +msgstr "" + +#: src/ui/gui/data-editor.glade:440 src/ui/gui/syntax-editor.glade:233 msgid "_Windows" msgstr "" -#: src/ui/gui/data-editor.glade:416 src/ui/gui/syntax-editor.glade:242 +#: src/ui/gui/data-editor.glade:447 src/ui/gui/syntax-editor.glade:242 msgid "_Minimise All Windows" msgstr "" -#: src/ui/gui/data-editor.glade:427 src/ui/gui/syntax-editor.glade:254 +#: src/ui/gui/data-editor.glade:458 src/ui/gui/syntax-editor.glade:254 msgid "_Help" msgstr "" -#: src/ui/gui/data-editor.glade:434 src/ui/gui/syntax-editor.glade:263 +#: src/ui/gui/data-editor.glade:465 src/ui/gui/syntax-editor.glade:263 msgid "_Reference Manual" msgstr "" -#: src/ui/gui/data-editor.glade:441 src/ui/gui/syntax-editor.glade:271 +#: src/ui/gui/data-editor.glade:472 src/ui/gui/syntax-editor.glade:271 msgid "_About" msgstr "" -#: src/ui/gui/data-editor.glade:486 +#: src/ui/gui/data-editor.glade:517 msgid "Print" msgstr "" -#: src/ui/gui/data-editor.glade:497 +#: src/ui/gui/data-editor.glade:528 msgid "Recall" msgstr "" -#: src/ui/gui/data-editor.glade:517 +#: src/ui/gui/data-editor.glade:548 msgid "Undo" msgstr "" -#: src/ui/gui/data-editor.glade:528 +#: src/ui/gui/data-editor.glade:559 msgid "Redo" msgstr "" -#: src/ui/gui/data-editor.glade:580 +#: src/ui/gui/data-editor.glade:610 msgid "Find" msgstr "" -#: src/ui/gui/data-editor.glade:600 +#: src/ui/gui/data-editor.glade:630 msgid "Insert Case" msgstr "" -#: src/ui/gui/data-editor.glade:687 +#: src/ui/gui/data-editor.glade:717 msgid "Use Sets" msgstr "" -#: src/ui/gui/data-editor.glade:769 +#: src/ui/gui/data-editor.glade:799 msgid "Data View" msgstr "" -#: src/ui/gui/data-editor.glade:796 +#: src/ui/gui/data-editor.glade:826 msgid "Variable View" msgstr "" -#: src/ui/gui/data-editor.glade:826 +#: src/ui/gui/data-editor.glade:856 msgid "Information Area" msgstr "" -#: src/ui/gui/data-editor.glade:845 +#: src/ui/gui/data-editor.glade:875 msgid "Processor Area" msgstr "" -#: src/ui/gui/data-editor.glade:870 +#: src/ui/gui/data-editor.glade:900 msgid "OMS Area" msgstr "" -#: src/ui/gui/data-editor.glade:895 +#: src/ui/gui/data-editor.glade:925 msgid "Case Counter Area" msgstr "" -#: src/ui/gui/data-editor.glade:920 +#: src/ui/gui/data-editor.glade:950 msgid "Filter Use Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:946 +#: src/ui/gui/data-editor.glade:976 msgid "Weight Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:972 +#: src/ui/gui/data-editor.glade:1002 msgid "Split File Status Area" msgstr "" -#: src/ui/gui/data-editor.glade:1002 +#: src/ui/gui/data-editor.glade:1032 msgid "Variable Type" msgstr "" -#: src/ui/gui/data-editor.glade:1037 src/ui/gui/psppire-var-store.c:475 +#: src/ui/gui/data-editor.glade:1067 src/ui/gui/psppire-var-store.c:480 msgid "Comma" msgstr "" -#: src/ui/gui/data-editor.glade:1052 src/ui/gui/psppire-var-store.c:476 +#: src/ui/gui/data-editor.glade:1082 src/ui/gui/psppire-var-store.c:481 msgid "Dot" msgstr "" -#: src/ui/gui/data-editor.glade:1067 +#: src/ui/gui/data-editor.glade:1097 msgid "Scientific notation" msgstr "" -#: src/ui/gui/data-editor.glade:1082 src/ui/gui/psppire-var-store.c:478 +#: src/ui/gui/data-editor.glade:1112 src/ui/gui/psppire-var-store.c:483 msgid "Date" msgstr "" -#: src/ui/gui/data-editor.glade:1097 src/ui/gui/psppire-var-store.c:479 +#: src/ui/gui/data-editor.glade:1127 src/ui/gui/psppire-var-store.c:484 msgid "Dollar" msgstr "" -#: src/ui/gui/data-editor.glade:1112 +#: src/ui/gui/data-editor.glade:1142 msgid "Custom currency" msgstr "" -#: src/ui/gui/data-editor.glade:1204 +#: src/ui/gui/data-editor.glade:1234 msgid "positive" msgstr "" -#: src/ui/gui/data-editor.glade:1210 +#: src/ui/gui/data-editor.glade:1240 msgid "negative" msgstr "" -#: src/ui/gui/data-editor.glade:1223 +#: src/ui/gui/data-editor.glade:1253 msgid "Sample" msgstr "" -#: src/ui/gui/data-editor.glade:1271 +#: src/ui/gui/data-editor.glade:1301 msgid "Decimal Places:" msgstr "" -#: src/ui/gui/data-editor.glade:1312 +#: src/ui/gui/data-editor.glade:1342 msgid "Width:" msgstr "" -#: src/ui/gui/data-editor.glade:1469 +#: src/ui/gui/data-editor.glade:1499 msgid "Value:" msgstr "" -#: src/ui/gui/data-editor.glade:1480 +#: src/ui/gui/data-editor.glade:1510 msgid "Value Label:" msgstr "" -#: src/ui/gui/data-editor.glade:1627 +#: src/ui/gui/data-editor.glade:1657 msgid "Missing Values" msgstr "" -#: src/ui/gui/data-editor.glade:1691 +#: src/ui/gui/data-editor.glade:1721 msgid "_No missing values" msgstr "" -#: src/ui/gui/data-editor.glade:1708 +#: src/ui/gui/data-editor.glade:1738 msgid "_Discrete missing values" msgstr "" -#: src/ui/gui/data-editor.glade:1792 +#: src/ui/gui/data-editor.glade:1822 msgid "_Range plus one optional discrete missing value" msgstr "" -#: src/ui/gui/data-editor.glade:1816 +#: src/ui/gui/data-editor.glade:1846 msgid "_Low:" msgstr "" -#: src/ui/gui/data-editor.glade:1845 +#: src/ui/gui/data-editor.glade:1875 msgid "_High:" msgstr "" -#: src/ui/gui/data-editor.glade:1886 +#: src/ui/gui/data-editor.glade:1916 msgid "Di_screte value:" msgstr "" -#: src/ui/gui/data-editor.glade:1946 +#: src/ui/gui/data-editor.glade:1976 msgid "Case Number:" msgstr "" -#: src/ui/gui/data-editor.glade:2055 src/ui/gui/psppire.glade:1171 +#: src/ui/gui/data-editor.glade:2085 src/ui/gui/psppire.glade:1171 msgid "Sort by:" msgstr "" -#: src/ui/gui/data-editor.glade:2104 src/ui/gui/psppire.glade:1224 +#: src/ui/gui/data-editor.glade:2134 src/ui/gui/psppire.glade:1224 msgid "Ascending" msgstr "" -#: src/ui/gui/data-editor.glade:2117 src/ui/gui/psppire.glade:1234 +#: src/ui/gui/data-editor.glade:2147 src/ui/gui/psppire.glade:1234 msgid "Descending" msgstr "" -#: src/ui/gui/data-editor.glade:2133 src/ui/gui/psppire.glade:1250 +#: src/ui/gui/data-editor.glade:2163 src/ui/gui/psppire.glade:1250 msgid "Sort Order" msgstr "" @@ -4628,17 +4627,53 @@ msgstr "" msgid "Incorrect range specification" msgstr "" -#: src/ui/gui/psppire-buttonbox.c:130 +#: src/ui/gui/psppire-buttonbox.c:146 +msgid "Buttons" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:147 +msgid "The mask that decides what buttons appear in the button box" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:245 src/ui/gui/psppire-buttonbox.c:397 +msgid "Continue" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:255 msgid "_Paste" msgstr "" +#: src/ui/gui/psppire-buttonbox.c:395 +msgid "OK" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:396 +msgid "Go To" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:398 +msgid "Cancel" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:399 +msgid "Help" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:400 +msgid "Reset" +msgstr "" + +#: src/ui/gui/psppire-buttonbox.c:401 +msgid "Paste" +msgstr "" + #: src/ui/gui/psppire-data-store.c:750 msgid "var" msgstr "" -#: src/ui/gui/psppire-data-store.c:831 src/ui/gui/psppire-var-store.c:551 -#: src/ui/gui/psppire-var-store.c:561 src/ui/gui/psppire-var-store.c:571 -#: src/ui/gui/psppire-var-store.c:769 +#: src/ui/gui/psppire-data-store.c:831 src/ui/gui/psppire-var-store.c:556 +#: src/ui/gui/psppire-var-store.c:566 src/ui/gui/psppire-var-store.c:576 +#: src/ui/gui/psppire-var-store.c:714 #, c-format msgid "%d" msgstr "" @@ -4806,15 +4841,33 @@ msgstr "" msgid "Functions:" msgstr "" -#: src/ui/gui/psppire-var-store.c:470 +#: src/ui/gui/psppire.glade:1643 +msgid "Variable Information:" +msgstr "" + +#: src/ui/gui/psppire.glade:1669 +msgid "" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +"\n" +msgstr "" + +#: src/ui/gui/psppire-var-store.c:472 msgid "None" msgstr "" -#: src/ui/gui/psppire-var-store.c:477 +#: src/ui/gui/psppire-var-store.c:482 msgid "Scientific" msgstr "" -#: src/ui/gui/psppire-var-store.c:480 +#: src/ui/gui/psppire-var-store.c:485 msgid "Custom" msgstr "" diff --git a/src/ui/gui/ChangeLog b/src/ui/gui/ChangeLog index 812fdce8..fa19479d 100644 --- a/src/ui/gui/ChangeLog +++ b/src/ui/gui/ChangeLog @@ -1,3 +1,17 @@ +2007-04-30 John Darrington + + * var-display.c var-display.h variable-info-dialog.c + variable-info-dialog.h : New files. + + * data-editor.c : + + * psppire-buttonbox.c psppire-buttonbox.h : Added the "buttons" + property, and optional GOTO and CONTINUE buttons. + + * psppire-dialog.h: Added response codes for the new buttons. + + * psppire-var-store.c : Moved some code to var-display.[ch] + 2007-04-25 John Darrington * icons/scalable/splash.c icons/splash.png : More eye candy. diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 2f4d884d..314ae359 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -126,10 +126,14 @@ src_ui_gui_psppire_SOURCES = \ src/ui/gui/transpose-dialog.h \ src/ui/gui/val-labs-dialog.c \ src/ui/gui/val-labs-dialog.h \ + src/ui/gui/var-display.c \ + src/ui/gui/var-display.h \ src/ui/gui/var-sheet.c \ src/ui/gui/var-sheet.h \ src/ui/gui/var-type-dialog.c \ src/ui/gui/var-type-dialog.h \ + src/ui/gui/variable-info-dialog.c \ + src/ui/gui/variable-info-dialog.h \ src/ui/gui/weight-cases-dialog.c \ src/ui/gui/weight-cases-dialog.h \ src/ui/gui/window-manager.c \ diff --git a/src/ui/gui/data-editor.c b/src/ui/gui/data-editor.c index f733c152..5efa3ca6 100644 --- a/src/ui/gui/data-editor.c +++ b/src/ui/gui/data-editor.c @@ -36,6 +36,7 @@ #include "transpose-dialog.h" #include "sort-cases-dialog.h" #include "compute-dialog.h" +#include "variable-info-dialog.h" #include "dict-display.h" #define _(msgid) gettext (msgid) @@ -57,7 +58,6 @@ static void insert_variable (GtkCheckMenuItem *m, gpointer data); /* Switch between the VAR SHEET and the DATA SHEET */ -enum {PAGE_DATA_SHEET = 0, PAGE_VAR_SHEET}; static gboolean click2column (GtkWidget *w, gint col, gpointer data); @@ -260,6 +260,14 @@ new_data_editor (void) g_signal_connect (de->invoke_compute_dialog, "activate", G_CALLBACK (compute_dialog), de); + de->invoke_variable_info_dialog = + gtk_action_new ("variable-info-dialog", + _("Variables"), + _("Jump to Variable"), + "pspp-goto-variable"); + + g_signal_connect (de->invoke_variable_info_dialog, "activate", + G_CALLBACK (variable_info_dialog), de); e->window = GTK_WINDOW (get_widget_assert (de->xml, "data_editor")); @@ -274,6 +282,9 @@ new_data_editor (void) de->action_data_open); + + + #if RECENT_LISTS_AVAILABLE { GtkRecentManager *rm = gtk_recent_manager_get_default (); @@ -364,6 +375,10 @@ new_data_editor (void) get_widget_assert (de->xml, "transform_compute") ); + gtk_action_connect_proxy (de->invoke_variable_info_dialog, + get_widget_assert (de->xml, "utilities_variables") + ); + g_signal_connect (get_widget_assert (de->xml,"help_about"), "activate", @@ -451,6 +466,10 @@ new_data_editor (void) get_widget_assert (de->xml, "button-save") ); + gtk_action_connect_proxy (de->invoke_variable_info_dialog, + get_widget_assert (de->xml, "button-goto-variable") + ); + gtk_action_connect_proxy (de->invoke_weight_cases_dialog, get_widget_assert (de->xml, "button-weight-cases") ); diff --git a/src/ui/gui/data-editor.glade b/src/ui/gui/data-editor.glade index ddd62ba5..63ddf452 100644 --- a/src/ui/gui/data-editor.glade +++ b/src/ui/gui/data-editor.glade @@ -403,6 +403,37 @@ + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + _Utilities + True + + + 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 + _Variables + True + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Data File _Comments + True + + + + + + True @@ -555,7 +586,6 @@ True - False Variables True pspp-goto-variable diff --git a/src/ui/gui/data-editor.h b/src/ui/gui/data-editor.h index 42266408..9b8da826 100644 --- a/src/ui/gui/data-editor.h +++ b/src/ui/gui/data-editor.h @@ -40,6 +40,8 @@ struct data_editor GtkAction *invoke_sort_cases_dialog; GtkAction *invoke_compute_dialog; + GtkAction *invoke_variable_info_dialog; + GladeXML *xml; gboolean save_as_portable; @@ -57,5 +59,7 @@ void new_data_window (GtkMenuItem *, gpointer); void data_editor_select_sheet (struct data_editor *de, gint page); +enum {PAGE_DATA_SHEET = 0, PAGE_VAR_SHEET}; + #endif diff --git a/src/ui/gui/dict-display.c b/src/ui/gui/dict-display.c index 13269b63..5129f139 100644 --- a/src/ui/gui/dict-display.c +++ b/src/ui/gui/dict-display.c @@ -92,7 +92,7 @@ var_icon_cell_data_func (GtkTreeViewColumn *col, } -static void +void get_base_model (GtkTreeModel *top_model, GtkTreeIter *top_iter, GtkTreeModel **model, GtkTreeIter *iter ) diff --git a/src/ui/gui/dict-display.h b/src/ui/gui/dict-display.h index 71479ba5..22cb3816 100644 --- a/src/ui/gui/dict-display.h +++ b/src/ui/gui/dict-display.h @@ -57,3 +57,8 @@ void insert_source_row_into_entry (GtkTreeIter source_iter, /* A FilterItemsFunc function for GtkEntry widgets */ gboolean is_currently_in_entry (GtkTreeModel *model, GtkTreeIter *iter, PsppireSelector *selector); + + +void get_base_model (GtkTreeModel *top_model, GtkTreeIter *top_iter, + GtkTreeModel **model, GtkTreeIter *iter + ); diff --git a/src/ui/gui/psppire-buttonbox.c b/src/ui/gui/psppire-buttonbox.c index 400c0c1f..921375f8 100644 --- a/src/ui/gui/psppire-buttonbox.c +++ b/src/ui/gui/psppire-buttonbox.c @@ -31,6 +31,8 @@ #define _(msgid) gettext (msgid) #define N_(msgid) msgid +GType psppire_button_flags_get_type (void); + static void psppire_button_box_class_init (PsppireButtonBoxClass *); static void psppire_button_box_init (PsppireButtonBox *); @@ -63,89 +65,234 @@ psppire_button_box_get_type (void) return button_box_type; } +enum { + PROP_BUTTONS = 1 +}; + static void -psppire_button_box_class_init (PsppireButtonBoxClass *class) +psppire_buttonbox_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { + gint i; + guint flags; + PsppireButtonBox *bb = PSPPIRE_BUTTONBOX (object); + if ( prop_id != PROP_BUTTONS) + { + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + return ; + } + + flags = g_value_get_flags (value); + + for (i = 0 ; i < n_PsppireButtonBoxButtons ; ++i ) + g_object_set (bb->button[i], "visible", 0x01 & (flags >> i) , NULL); } static void -close_dialog (GtkWidget *w, gpointer data) +psppire_buttonbox_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { - PsppireDialog *dialog; + guint flags = 0; + gint i; - dialog = PSPPIRE_DIALOG (gtk_widget_get_toplevel (w)); + PsppireButtonBox *bb = PSPPIRE_BUTTONBOX (object); - dialog->response = GTK_RESPONSE_CANCEL; + if (PROP_BUTTONS != prop_id) + { + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); + return; + } + + for (i = 0 ; i < n_PsppireButtonBoxButtons ; ++i ) + { + gboolean visibility; + g_object_get (bb->button[i], "visible", &visibility, NULL); + + if ( visibility ) + flags |= (0x01 << i); + } + + g_value_set_flags (value, flags); +} + + +typedef enum + { + PSPPIRE_BUTTON_OK_MASK = (1 << PSPPIRE_BUTTON_OK), + PSPPIRE_BUTTON_GOTO_MASK = (1 << PSPPIRE_BUTTON_GOTO), + PSPPIRE_BUTTON_CONTINUE_MASK = (1 << PSPPIRE_BUTTON_CONTINUE), + PSPPIRE_BUTTON_CANCEL_MASK = (1 << PSPPIRE_BUTTON_CANCEL), + PSPPIRE_BUTTON_HELP_MASK = (1 << PSPPIRE_BUTTON_HELP), + PSPPIRE_BUTTON_RESET_MASK = (1 << PSPPIRE_BUTTON_RESET), + PSPPIRE_BUTTON_PASTE_MASK = (1 << PSPPIRE_BUTTON_PASTE) + } PsppireButtonMask; + +static GParamSpec *button_flags; + +static void +psppire_button_box_class_init (PsppireButtonBoxClass *class) +{ + GObjectClass *object_class = G_OBJECT_CLASS (class); + + object_class->set_property = psppire_buttonbox_set_property; + object_class->get_property = psppire_buttonbox_get_property; + + button_flags = + g_param_spec_flags ("buttons", + _("Buttons"), + _("The mask that decides what buttons appear in the button box"), + G_TYPE_PSPPIRE_BUTTON_MASK, + PSPPIRE_BUTTON_OK_MASK | + PSPPIRE_BUTTON_CANCEL_MASK | + PSPPIRE_BUTTON_RESET_MASK | + PSPPIRE_BUTTON_HELP_MASK | + PSPPIRE_BUTTON_PASTE_MASK, + G_PARAM_READWRITE); + + + g_object_class_install_property (object_class, + PROP_BUTTONS, + button_flags); - psppire_dialog_close (dialog); } static void -ok_button_clicked (GtkWidget *w, gpointer data) +close_and_respond (GtkWidget *w, gint response) { PsppireDialog *dialog; - dialog = PSPPIRE_DIALOG (gtk_widget_get_toplevel (w)); + GtkWidget *toplevel = gtk_widget_get_toplevel (w); + + /* If we're not in a psppire dialog (for example when in glade) + then do nothing */ + if ( ! PSPPIRE_IS_DIALOG (toplevel)) + return; + + dialog = PSPPIRE_DIALOG (toplevel); - dialog->response = GTK_RESPONSE_OK; + dialog->response = response; psppire_dialog_close (dialog); } static void -paste_button_clicked (GtkWidget *w, gpointer data) +close_dialog (GtkWidget *w, gpointer data) { - PsppireDialog *dialog; + close_and_respond (w, GTK_RESPONSE_CLOSE); +} + + +static void +ok_button_clicked (GtkWidget *w, gpointer data) +{ + close_and_respond (w, GTK_RESPONSE_OK); +} - dialog = PSPPIRE_DIALOG (gtk_widget_get_toplevel (w)); - dialog->response = PSPPIRE_RESPONSE_PASTE; +static void +paste_button_clicked (GtkWidget *w, gpointer data) +{ + close_and_respond (w, PSPPIRE_RESPONSE_PASTE); +} - psppire_dialog_close (dialog); +static void +goto_button_clicked (GtkWidget *w, gpointer data) +{ + close_and_respond (w, PSPPIRE_RESPONSE_GOTO); } static void refresh_clicked (GtkWidget *w, gpointer data) { + GtkWidget *toplevel = gtk_widget_get_toplevel (w); PsppireDialog *dialog; - dialog = PSPPIRE_DIALOG (gtk_widget_get_toplevel (w)); + if ( ! PSPPIRE_IS_DIALOG (toplevel)) + return; + + dialog = PSPPIRE_DIALOG (toplevel); psppire_dialog_reload (dialog); } static void -psppire_button_box_init (PsppireButtonBox *button_box) +psppire_button_box_init (PsppireButtonBox *bb) { - GtkWidget *button ; - button = gtk_button_new_from_stock (GTK_STOCK_OK); - gtk_box_pack_start_defaults (GTK_BOX (button_box), button); - g_signal_connect (button, "clicked", G_CALLBACK (ok_button_clicked), NULL); - gtk_widget_show (button); + bb->button[PSPPIRE_BUTTON_OK] = gtk_button_new_from_stock (GTK_STOCK_OK); + gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_OK]); + g_signal_connect (bb->button[PSPPIRE_BUTTON_OK], "clicked", + G_CALLBACK (ok_button_clicked), NULL); + g_object_set (bb->button[PSPPIRE_BUTTON_OK], "no-show-all", TRUE, NULL); + + + bb->button[PSPPIRE_BUTTON_GOTO] = + gtk_button_new_from_stock (GTK_STOCK_JUMP_TO); + gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_GOTO]); + g_signal_connect (bb->button[PSPPIRE_BUTTON_GOTO], "clicked", + G_CALLBACK (goto_button_clicked), NULL); + g_object_set (bb->button[PSPPIRE_BUTTON_GOTO], "no-show-all", TRUE, NULL); + + + bb->button[PSPPIRE_BUTTON_CONTINUE] = + gtk_button_new_with_mnemonic (_("Continue")); + + gtk_box_pack_start_defaults (GTK_BOX (bb), + bb->button[PSPPIRE_BUTTON_CONTINUE]); + + g_object_set (bb->button[PSPPIRE_BUTTON_CONTINUE], + "no-show-all", TRUE, NULL); + - button = gtk_button_new_with_mnemonic (_("_Paste")); - g_signal_connect (button, "clicked", G_CALLBACK (paste_button_clicked), - NULL); - gtk_box_pack_start_defaults (GTK_BOX (button_box), button); - gtk_widget_show (button); - button = gtk_button_new_from_stock (GTK_STOCK_CANCEL); - g_signal_connect (button, "clicked", G_CALLBACK (close_dialog), NULL); - gtk_box_pack_start_defaults (GTK_BOX (button_box), button); - gtk_widget_show (button); + bb->button[PSPPIRE_BUTTON_PASTE] = gtk_button_new_with_mnemonic (_("_Paste")); + g_signal_connect (bb->button[PSPPIRE_BUTTON_PASTE], "clicked", + G_CALLBACK (paste_button_clicked), NULL); + gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_PASTE]); + g_object_set (bb->button[PSPPIRE_BUTTON_PASTE], "no-show-all", TRUE, NULL); - button = gtk_button_new_from_stock (GTK_STOCK_REFRESH); - g_signal_connect (button, "clicked", G_CALLBACK (refresh_clicked), NULL); - gtk_box_pack_start_defaults (GTK_BOX (button_box), button); - gtk_widget_show (button); + bb->button[PSPPIRE_BUTTON_CANCEL] = gtk_button_new_from_stock (GTK_STOCK_CANCEL); + g_signal_connect (bb->button[PSPPIRE_BUTTON_CANCEL], "clicked", + G_CALLBACK (close_dialog), NULL); + gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_CANCEL]); + g_object_set (bb->button[PSPPIRE_BUTTON_CANCEL], "no-show-all", TRUE, NULL); - button = gtk_button_new_from_stock (GTK_STOCK_HELP); - gtk_box_pack_start_defaults (GTK_BOX (button_box), button); - gtk_widget_show (button); + + bb->button[PSPPIRE_BUTTON_RESET] = gtk_button_new_from_stock (GTK_STOCK_REFRESH); + g_signal_connect (bb->button[PSPPIRE_BUTTON_RESET], "clicked", + G_CALLBACK (refresh_clicked), NULL); + gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_RESET]); + g_object_set (bb->button[PSPPIRE_BUTTON_RESET], "no-show-all", TRUE, NULL); + + + bb->button[PSPPIRE_BUTTON_HELP] = gtk_button_new_from_stock (GTK_STOCK_HELP); + gtk_box_pack_start_defaults (GTK_BOX (bb), bb->button[PSPPIRE_BUTTON_HELP]); + g_object_set (bb->button[PSPPIRE_BUTTON_HELP], "no-show-all", TRUE, NULL); + + + /* Set the default visibilities */ + { + GValue value = { 0 }; + guint flags; + gint i; + g_value_init (&value, button_flags->value_type); + g_param_value_set_default(button_flags, &value); + + + flags = g_value_get_flags (&value); + + for (i = 0 ; i < n_PsppireButtonBoxButtons ; ++i ) + g_object_set (bb->button[i], "visible", 0x01 & (flags >> i) , NULL); + + g_value_unset (&value); + } } @@ -235,3 +382,30 @@ _psppire_button_box_child_requisition (GtkWidget *widget, if (height) *height = needed_height; } + + +GType +psppire_button_flags_get_type (void) +{ + static GType ftype = 0; + if (ftype == 0) + { + static const GFlagsValue values[] = + { + { PSPPIRE_BUTTON_OK_MASK, "PSPPIRE_BUTTON_OK_MASK", N_("OK") }, + { PSPPIRE_BUTTON_GOTO_MASK, "PSPPIRE_BUTTON_GOTO_MASK", N_("Go To") }, + { PSPPIRE_BUTTON_CONTINUE_MASK,"PSPPIRE_BUTTON_CONTINUE_MASK", N_("Continue") }, + { PSPPIRE_BUTTON_CANCEL_MASK, "PSPPIRE_BUTTON_CANCEL_MASK", N_("Cancel") }, + { PSPPIRE_BUTTON_HELP_MASK, "PSPPIRE_BUTTON_HELP_MASK", N_("Help") }, + { PSPPIRE_BUTTON_RESET_MASK, "PSPPIRE_BUTTON_RESET_MASK", N_("Reset") }, + { PSPPIRE_BUTTON_PASTE_MASK, "PSPPIRE_BUTTON_PASTE_MASK", N_("Paste") }, + { 0, NULL, NULL } + }; + + ftype = g_flags_register_static + (g_intern_static_string ("PsppireButtonFlags"), values); + + } + return ftype; +} + diff --git a/src/ui/gui/psppire-buttonbox.h b/src/ui/gui/psppire-buttonbox.h index 91d35551..c002fd4b 100644 --- a/src/ui/gui/psppire-buttonbox.h +++ b/src/ui/gui/psppire-buttonbox.h @@ -38,9 +38,24 @@ G_BEGIN_DECLS typedef struct _PsppireButtonBox PsppireButtonBox; typedef struct _PsppireButtonBoxClass PsppireButtonBoxClass; +enum + { + PSPPIRE_BUTTON_OK = 0, + PSPPIRE_BUTTON_GOTO, + PSPPIRE_BUTTON_CONTINUE, + PSPPIRE_BUTTON_CANCEL, + PSPPIRE_BUTTON_HELP, + PSPPIRE_BUTTON_RESET, + PSPPIRE_BUTTON_PASTE, + n_PsppireButtonBoxButtons + }; + struct _PsppireButtonBox { GtkButtonBox parent; + + /* */ + GtkWidget *button[n_PsppireButtonBoxButtons]; }; struct _PsppireButtonBoxClass @@ -57,6 +72,10 @@ _psppire_button_box_child_requisition (GtkWidget *widget, int *nvis_children, int *nvis_secondaries, int *width, + + +#define G_TYPE_PSPPIRE_BUTTON_MASK \ + (psppire_button_flags_get_type()) int *height); G_END_DECLS diff --git a/src/ui/gui/psppire-dialog.h b/src/ui/gui/psppire-dialog.h index 17d8b50f..71015f38 100644 --- a/src/ui/gui/psppire-dialog.h +++ b/src/ui/gui/psppire-dialog.h @@ -26,8 +26,10 @@ #include #include -#define PSPPIRE_RESPONSE_PASTE 1 +#define PSPPIRE_RESPONSE_PASTE 1 +#define PSPPIRE_RESPONSE_GOTO 2 +#define PSPPIRE_RESPONSE_CONTINUE 3 G_BEGIN_DECLS diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index 3b3011f0..d156e799 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -43,6 +43,7 @@ #include "missing-val-dialog.h" #include +#include "var-display.h" #define TRAILING_ROWS 40 @@ -51,6 +52,10 @@ static void psppire_var_store_class_init (PsppireVarStoreClass *cla static void psppire_var_store_sheet_model_init (GSheetModelIface *iface); static void psppire_var_store_finalize (GObject *object); + +gchar * missing_values_to_string (const struct variable *pv, GError **err); + + static gchar *psppire_var_store_get_string (const GSheetModel *sheet_model, gint row, gint column); static gboolean psppire_var_store_clear (GSheetModel *model, gint row, gint col); @@ -157,7 +162,7 @@ psppire_var_store_item_editable (PsppireVarStore *var_store, gint row, gint colu if ( VAR_STRING == var_get_type (pv) && column == COL_DECIMALS ) return FALSE; - write_spec =var_get_write_format (pv); + write_spec = var_get_print_format (pv); switch ( write_spec->type ) { @@ -464,11 +469,11 @@ psppire_var_store_set_string (GSheetModel *model, } +const static gchar none[] = N_("None"); + static gchar * text_for_column (const struct variable *pv, gint c, GError **err) { - static gchar none[] = N_("None"); - static const gchar *const type_label[] = { N_("Numeric"), @@ -580,63 +585,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) case COL_MISSING: { - gchar *s; - const struct missing_values *miss = var_get_missing_values (pv); - if ( mv_is_empty (miss)) - return g_locale_to_utf8 (gettext (none), -1, 0, 0, err); - else - { - if ( ! mv_has_range (miss)) - { - GString *gstr = g_string_sized_new (10); - const int n = mv_n_values (miss); - gchar *mv[4] = {0,0,0,0}; - gint i; - for (i = 0 ; i < n; ++i ) - { - union value v; - mv_peek_value (miss, &v, i); - mv[i] = value_to_text (v, *write_spec); - if ( i > 0 ) - g_string_append (gstr, ", "); - g_string_append (gstr, mv[i]); - g_free (mv[i]); - } - s = pspp_locale_to_utf8 (gstr->str, gstr->len, err); - g_string_free (gstr, TRUE); - } - else - { - GString *gstr = g_string_sized_new (10); - gchar *l, *h; - union value low, high; - mv_peek_range (miss, &low.f, &high.f); - - l = value_to_text (low, *write_spec); - h = value_to_text (high, *write_spec); - - g_string_printf (gstr, "%s - %s", l, h); - g_free (l); - g_free (h); - - if ( mv_has_value (miss)) - { - gchar *ss = 0; - union value v; - mv_peek_value (miss, &v, 0); - - ss = value_to_text (v, *write_spec); - - g_string_append (gstr, ", "); - g_string_append (gstr, ss); - free (ss); - } - s = pspp_locale_to_utf8 (gstr->str, gstr->len, err); - g_string_free (gstr, TRUE); - } - - return s; - } + return missing_values_to_string (pv, err); } break; case COL_VALUES: @@ -678,11 +627,7 @@ text_for_column (const struct variable *pv, gint c, GError **err) break; case COL_MEASURE: { - const gint measure = var_get_measure (pv); - - g_assert (measure < n_MEASURES); - return g_locale_to_utf8 (gettext (measures[measure]), - -1, 0, 0, err); + return measure_to_string (pv, err); } break; } @@ -783,3 +728,6 @@ psppire_var_store_sheet_row_init (GSheetRowIface *iface) iface->get_button_label = geometry_get_button_label; } + + + diff --git a/src/ui/gui/psppire.glade b/src/ui/gui/psppire.glade index a436b6c7..ef00c41e 100644 --- a/src/ui/gui/psppire.glade +++ b/src/ui/gui/psppire.glade @@ -1596,4 +1596,117 @@ + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + Variables + True + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + 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_IN + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + True + True + + + + + False + False + 5 + + + + + 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 + Variable Information: + + + False + False + 5 + + + + + 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_IN + + + 200 + True + GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + False + GTK_WRAP_WORD_CHAR + 3 + False + False + + + + + + + + + + + + + + + + 5 + 2 + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + True + PSPPIRE_BUTTON_GOTO_MASK | PSPPIRE_BUTTON_CANCEL_MASK | PSPPIRE_BUTTON_HELP_MASK | PSPPIRE_BUTTON_PASTE_MASK + + + False + False + GTK_PACK_END + 1 + + + + + 5 + 1 + + + + + diff --git a/src/ui/gui/var-display.c b/src/ui/gui/var-display.c new file mode 100644 index 00000000..3245e1a3 --- /dev/null +++ b/src/ui/gui/var-display.c @@ -0,0 +1,107 @@ +#include "var-display.h" + +#include +#include + +#include "var-sheet.h" +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + +#include "helper.h" + +const static gchar none[] = N_("None"); + +gchar * +name_to_string (const struct variable *var, GError **err) +{ + const char *name = var_get_name (var); + g_assert (name); + + return pspp_locale_to_utf8 (name, -1, err); +} + + +gchar * +label_to_string (const struct variable *var, GError **err) +{ + const char *label = var_get_label (var); + + if ( ! label ) return g_strdup (none); + + return pspp_locale_to_utf8 (label, -1, err); +} + +gchar * +measure_to_string (const struct variable *var, GError **err) +{ + const gint measure = var_get_measure (var); + + g_assert (measure < n_MEASURES); + return g_locale_to_utf8 (gettext (measures[measure]), + -1, 0, 0, err); +} + + +gchar * +missing_values_to_string (const struct variable *pv, GError **err) +{ + const struct fmt_spec *fmt = var_get_print_format (pv); + gchar *s; + const struct missing_values *miss = var_get_missing_values (pv); + if ( mv_is_empty (miss)) + return g_locale_to_utf8 (gettext (none), -1, 0, 0, err); + else + { + if ( ! mv_has_range (miss)) + { + GString *gstr = g_string_sized_new (10); + const int n = mv_n_values (miss); + gchar *mv[4] = {0,0,0,0}; + gint i; + for (i = 0 ; i < n; ++i ) + { + union value v; + mv_peek_value (miss, &v, i); + mv[i] = value_to_text (v, *fmt); + if ( i > 0 ) + g_string_append (gstr, ", "); + g_string_append (gstr, mv[i]); + g_free (mv[i]); + } + s = pspp_locale_to_utf8 (gstr->str, gstr->len, err); + g_string_free (gstr, TRUE); + } + else + { + GString *gstr = g_string_sized_new (10); + gchar *l, *h; + union value low, high; + mv_peek_range (miss, &low.f, &high.f); + + l = value_to_text (low, *fmt); + h = value_to_text (high, *fmt); + + g_string_printf (gstr, "%s - %s", l, h); + g_free (l); + g_free (h); + + if ( mv_has_value (miss)) + { + gchar *ss = 0; + union value v; + mv_peek_value (miss, &v, 0); + + ss = value_to_text (v, *fmt); + + g_string_append (gstr, ", "); + g_string_append (gstr, ss); + free (ss); + } + s = pspp_locale_to_utf8 (gstr->str, gstr->len, err); + g_string_free (gstr, TRUE); + } + + return s; + } +} diff --git a/src/ui/gui/var-display.h b/src/ui/gui/var-display.h new file mode 100644 index 00000000..a67a7cbc --- /dev/null +++ b/src/ui/gui/var-display.h @@ -0,0 +1,39 @@ +/* + 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 2 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, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + + +#ifndef VAR_DISPLAY_H +#define VAR_DISPLAY 1 + +#include + +struct variable; + + +gchar * name_to_string (const struct variable *var, GError **err); + + +gchar * missing_values_to_string (const struct variable *pv, GError **err); + +gchar * measure_to_string (const struct variable *var, GError **err); + +gchar * label_to_string (const struct variable *var, GError **err); + + +#endif diff --git a/src/ui/gui/variable-info-dialog.c b/src/ui/gui/variable-info-dialog.c new file mode 100644 index 00000000..e5d8d05b --- /dev/null +++ b/src/ui/gui/variable-info-dialog.c @@ -0,0 +1,248 @@ +/* + 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 2 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, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + + +#include +#include +#include + +#include "dict-display.h" +#include "var-display.h" +#include +#include +#include "data-editor.h" +#include "psppire-dialog.h" +#include "psppire-var-store.h" +#include "helper.h" +#include + +#include +#include "syntax-editor.h" + + +#include +#define _(msgid) gettext (msgid) +#define N_(msgid) msgid + + +static struct variable * +get_selected_variable (GtkTreeView *treeview) +{ + struct variable *var; + GtkTreeModel *top_model; + GtkTreeIter top_iter; + + GtkTreeModel *model; + GtkTreeIter iter; + + GtkTreeSelection *selection = gtk_tree_view_get_selection (treeview); + + if (! gtk_tree_selection_get_selected (selection, + &top_model, &top_iter)) + { + return NULL; + } + + get_base_model (top_model, &top_iter, &model, &iter); + + g_assert (PSPPIRE_IS_DICT (model)); + + gtk_tree_model_get (model, + &iter, DICT_TVM_COL_VAR, &var, -1); + + return var; +} + + + +static void +populate_text (GtkTreeView *treeview, gpointer data) +{ + gchar *text = 0; + GString *gstring; + + GtkTextBuffer *textbuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(data)); + const struct variable *var = get_selected_variable (treeview); + + gstring = g_string_sized_new (200); + text = name_to_string (var, NULL); + g_string_assign (gstring, text); + g_free (text); + g_string_append (gstring, "\n"); + + + text = label_to_string (var, NULL); + g_string_append_printf (gstring, _("Label: %s\n"), text); + g_free (text); + + { + const struct fmt_spec *fmt = var_get_print_format (var); + char buffer[FMT_STRING_LEN_MAX + 1]; + + fmt_to_string (fmt, buffer); + /* No conversion necessary. buffer will always be ascii */ + g_string_append_printf (gstring, _("Type: %s\n"), buffer); + } + + text = missing_values_to_string (var, NULL); + g_string_append_printf (gstring, _("Missing Values: %s\n"), + text); + g_free (text); + + text = measure_to_string (var, NULL); + g_string_append_printf (gstring, _("Measurement Level: %s\n"), + text); + g_free (text); + + + + /* Value Labels */ + if ( var_has_value_labels (var)) + { + struct val_labs_iterator *vli = 0; + struct val_lab *vl; + const struct val_labs *labs = var_get_value_labels (var); + + g_string_append (gstring, "\n"); + g_string_append (gstring, _("Value Labels:\n")); + +#if 1 + for (vl = val_labs_first_sorted (labs, &vli); + vl; + vl = val_labs_next (labs, &vli)) + { + gchar *const vstr = + value_to_text (vl->value, *var_get_print_format (var)); + + text = pspp_locale_to_utf8 (vl->label, -1, NULL); + + g_string_append_printf (gstring, _("%s %s\n"), vstr, text); + + g_free (text); + g_free (vstr); + } +#endif + } + + gtk_text_buffer_set_text (textbuffer, gstring->str, gstring->len); + + g_string_free (gstring, TRUE); +} + +static gchar * generate_syntax (GtkTreeView *treeview); + + +void +variable_info_dialog (GObject *o, gpointer data) +{ + struct data_editor *de = data; + + gint response ; + + GladeXML *xml = XML_NEW ("psppire.glade"); + + GtkWidget *dialog = get_widget_assert (xml, "variable-info-dialog"); + GtkWidget *treeview = get_widget_assert (xml, "treeview2"); + GtkWidget *textview = get_widget_assert (xml, "textview1"); + + GtkSheet *var_sheet = + GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + + + PsppireVarStore *vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet)); + + gtk_window_set_transient_for (GTK_WINDOW (dialog), de->parent.window); + + attach_dictionary_to_treeview (GTK_TREE_VIEW (treeview), + vs->dict, + GTK_SELECTION_SINGLE, + NULL ); + + + g_signal_connect (treeview, "cursor-changed", G_CALLBACK (populate_text), + textview); + + + gtk_text_view_set_indent (GTK_TEXT_VIEW (textview), -5); + + response = psppire_dialog_run (PSPPIRE_DIALOG (dialog)); + + switch (response) + { + case PSPPIRE_RESPONSE_GOTO: + { + gint row, col; + GtkNotebook *notebook = GTK_NOTEBOOK + (get_widget_assert (de->xml,"notebook")); + + const struct variable *var = + get_selected_variable (GTK_TREE_VIEW (treeview)); + + + if (PAGE_VAR_SHEET == gtk_notebook_get_current_page (notebook)) + { + GtkSheet *var_sheet = + GTK_SHEET (get_widget_assert (de->xml, "variable_sheet")); + + gtk_sheet_get_active_cell (var_sheet, &row, &col); + row = var_get_dict_index (var); + gtk_sheet_set_active_cell (var_sheet, row, col); + } + else + { + GtkSheet *data_sheet = + GTK_SHEET (get_widget_assert (de->xml, "data_sheet")); + + gtk_sheet_get_active_cell (data_sheet, &row, &col); + col = var_get_dict_index (var); + gtk_sheet_set_active_cell (data_sheet, row, col); + } + } + break; + case PSPPIRE_RESPONSE_PASTE: + { + gchar *syntax = generate_syntax (GTK_TREE_VIEW (treeview)); + + 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); + +} + +static gchar * +generate_syntax (GtkTreeView *treeview) +{ + const struct variable *var = get_selected_variable (treeview); + + if ( NULL == var) + return g_strdup (""); + + return g_strdup (var_get_name (var)); +} + diff --git a/src/ui/gui/variable-info-dialog.h b/src/ui/gui/variable-info-dialog.h new file mode 100644 index 00000000..b066c667 --- /dev/null +++ b/src/ui/gui/variable-info-dialog.h @@ -0,0 +1,29 @@ +/* + 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 2 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, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. */ + +#ifndef __VARIABLE_DIALOG_H +#define __VARIABLE_DIALOG_H + + +#include +#include + +void variable_info_dialog (GObject *o, gpointer data); + +#endif