pspp-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pspp-cvs] pspp lib/gtksheet/gtksheet.c po/de.po po/pspp.p...


From: John Darrington
Subject: [Pspp-cvs] pspp lib/gtksheet/gtksheet.c po/de.po po/pspp.p...
Date: Sat, 18 Aug 2007 02:52:36 +0000

CVSROOT:        /sources/pspp
Module name:    pspp
Changes by:     John Darrington <jmd>   07/08/18 02:52:36

Modified files:
        lib/gtksheet   : gtksheet.c 
        po             : de.po pspp.pot 
        src/ui/gui     : ChangeLog clipboard.c clipboard.h data-editor.c 

Log message:
        Added the ability to paste from the clipboard to the data sheet.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pspp/lib/gtksheet/gtksheet.c?cvsroot=pspp&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/pspp/po/de.po?cvsroot=pspp&r1=1.59&r2=1.60
http://cvs.savannah.gnu.org/viewcvs/pspp/po/pspp.pot?cvsroot=pspp&r1=1.144&r2=1.145
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/ChangeLog?cvsroot=pspp&r1=1.81&r2=1.82
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/clipboard.c?cvsroot=pspp&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/clipboard.h?cvsroot=pspp&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/pspp/src/ui/gui/data-editor.c?cvsroot=pspp&r1=1.46&r2=1.47

Patches:
Index: lib/gtksheet/gtksheet.c
===================================================================
RCS file: /sources/pspp/pspp/lib/gtksheet/gtksheet.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- lib/gtksheet/gtksheet.c     7 Aug 2007 06:21:21 -0000       1.29
+++ lib/gtksheet/gtksheet.c     18 Aug 2007 02:52:35 -0000      1.30
@@ -3896,10 +3896,6 @@
   if (row >= yyy_row_count (sheet) || col >= xxx_column_count (sheet))
     return FALSE;
 
-  /* _gtkextra_signal_emit (GTK_OBJECT (sheet), sheet_signals[ACTIVATE], row, 
col, &veto);
-     if (!GTK_WIDGET_REALIZED (GTK_WIDGET (sheet))) return veto;
-  */
-
   if (!veto) return FALSE;
   if (sheet->state != GTK_SHEET_NORMAL)
     {
@@ -3926,7 +3922,7 @@
                    G_CALLBACK (gtk_sheet_entry_changed),
                    sheet);
 
-  _gtkextra_signal_emit (GTK_OBJECT (sheet), sheet_signals[ACTIVATE], row, 
col, &veto);
+  _gtkextra_signal_emit (GTK_OBJECT (sheet), sheet_signals [ACTIVATE], row, 
col, &veto);
 
   return TRUE;
 }
@@ -5014,6 +5010,7 @@
              *veto = FALSE;
              return;
            }
+         gtk_sheet_activate_cell (sheet, row, column);
        }
 
       if (gtk_sheet_autoscroll (sheet))

Index: po/de.po
===================================================================
RCS file: /sources/pspp/pspp/po/de.po,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -b -r1.59 -r1.60
--- po/de.po    16 Aug 2007 06:30:22 -0000      1.59
+++ po/de.po    18 Aug 2007 02:52:35 -0000      1.60
@@ -10,7 +10,7 @@
 msgstr ""
 "Project-Id-Version: PSPP 0.4.3\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2007-08-16 14:11+0800\n"
+"POT-Creation-Date: 2007-08-18 08:25+0800\n"
 "PO-Revision-Date: 2006-07-28 19:32+0800\n"
 "Last-Translator: John Darrington <address@hidden>\n"
 "Language-Team: German <address@hidden>\n"
@@ -3078,11 +3078,11 @@
 msgid "Multivariate GLM not yet supported"
 msgstr ""
 
-#: src/language/stats/glm.q:268 src/language/stats/regression.q:1153
+#: src/language/stats/glm.q:268 src/language/stats/regression.q:1155
 msgid "Dependent variable must be numeric."
 msgstr ""
 
-#: src/language/stats/glm.q:343 src/language/stats/regression.q:1252
+#: src/language/stats/glm.q:343 src/language/stats/regression.q:1254
 msgid "No valid data found. This command was skipped."
 msgstr ""
 
@@ -3336,9 +3336,9 @@
 
 #: src/language/stats/regression.q:1031
 msgid ""
-"The dependent variable is equal to the independent variable. The least "
-"sequares line is therefore Y=X. Standard errors and related statistics may "
-"be meaningless."
+"The dependent variable is equal to the independent variable.The least "
+"squares line is therefore Y=X.Standard errors and related statistics may be "
+"meaningless."
 msgstr ""
 
 #: src/language/stats/sort-cases.c:63
@@ -4239,223 +4239,223 @@
 msgid "Style of bevel around the custom entry button"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:151
+#: src/ui/gui/data-editor.c:154
 msgid "Transformations Pending"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:290
+#: src/ui/gui/data-editor.c:349
 #, fuzzy
 msgid "Labels"
 msgstr "Kennsatz"
 
-#: src/ui/gui/data-editor.c:291
+#: src/ui/gui/data-editor.c:350
 msgid "Show/hide value labels"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:309 src/ui/gui/data-editor.c:324
-#: src/ui/gui/data-editor.c:1603 src/ui/gui/data-editor.c:1656
+#: src/ui/gui/data-editor.c:368 src/ui/gui/data-editor.c:385
+#: src/ui/gui/data-editor.c:1660 src/ui/gui/data-editor.c:1713
 msgid "Clear"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:310
+#: src/ui/gui/data-editor.c:369
 msgid "Delete the cases at the selected position(s)"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:325
+#: src/ui/gui/data-editor.c:386
 msgid "Delete the variables at the selected position(s)"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:339 src/ui/gui/data-editor.c:1600
+#: src/ui/gui/data-editor.c:400 src/ui/gui/data-editor.c:1657
 #: src/ui/gui/data-editor.glade:286 src/ui/gui/data-editor.glade:654
 #, fuzzy
 msgid "Insert Variable"
 msgstr "Variableansicht"
 
-#: src/ui/gui/data-editor.c:340
+#: src/ui/gui/data-editor.c:401
 msgid "Create a new variable at the current position"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:358 src/ui/gui/data-editor.c:1653
+#: src/ui/gui/data-editor.c:419 src/ui/gui/data-editor.c:1710
 #: src/ui/gui/data-editor.glade:642
 #, fuzzy
 msgid "Insert Case"
 msgstr "_Stecken"
 
-#: src/ui/gui/data-editor.c:359
+#: src/ui/gui/data-editor.c:420
 msgid "Create a new case at the current position"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:379
+#: src/ui/gui/data-editor.c:440
 #, fuzzy
 msgid "Goto Case"
 msgstr "_Stecken"
 
-#: src/ui/gui/data-editor.c:380
+#: src/ui/gui/data-editor.c:441
 msgid "Jump to a Case in the Data Sheet"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:399
+#: src/ui/gui/data-editor.c:460
 #, fuzzy
 msgid "Weights"
 msgstr "Rechts"
 
-#: src/ui/gui/data-editor.c:400
+#: src/ui/gui/data-editor.c:461
 msgid "Weight cases by variable"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:409 src/ui/gui/data-editor.glade:323
+#: src/ui/gui/data-editor.c:470 src/ui/gui/data-editor.glade:323
 msgid "Transpose"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:410
+#: src/ui/gui/data-editor.c:471
 msgid "Transpose the cases with the variables"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:421
+#: src/ui/gui/data-editor.c:482
 #, fuzzy
 msgid "Split"
 msgstr "Alle Datei"
 
-#: src/ui/gui/data-editor.c:422
+#: src/ui/gui/data-editor.c:483
 msgid "Split the active file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:432
+#: src/ui/gui/data-editor.c:493
 msgid "Sort"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:433
+#: src/ui/gui/data-editor.c:494
 msgid "Sort cases in the active file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:441 src/ui/gui/data-editor.glade:360
+#: src/ui/gui/data-editor.c:502 src/ui/gui/data-editor.glade:360
 #: src/ui/gui/data-editor.glade:697
 msgid "Select Cases"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:442
+#: src/ui/gui/data-editor.c:503
 msgid "Select cases from the active file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:451
+#: src/ui/gui/data-editor.c:512
 msgid "Compute"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:452
+#: src/ui/gui/data-editor.c:513
 #, fuzzy
 msgid "Compute new values for a variable"
 msgstr "Unpassend Wert für Variable"
 
-#: src/ui/gui/data-editor.c:460
+#: src/ui/gui/data-editor.c:521
 #, fuzzy
 msgid "Data File Comments"
 msgstr "Datei Fehler"
 
-#: src/ui/gui/data-editor.c:461
+#: src/ui/gui/data-editor.c:522
 msgid "Commentary text for the data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:469 src/ui/gui/data-editor.glade:267
+#: src/ui/gui/data-editor.c:530 src/ui/gui/data-editor.glade:267
 #: src/ui/gui/data-editor.glade:601
 msgid "Variables"
 msgstr "Variableansicht"
 
-#: src/ui/gui/data-editor.c:470
+#: src/ui/gui/data-editor.c:531
 #, fuzzy
 msgid "Jump to Variable"
 msgstr "Variableansicht"
 
-#: src/ui/gui/data-editor.c:871
+#: src/ui/gui/data-editor.c:928
 msgid "Font Selection"
 msgstr "Schriftwahlung"
 
-#: src/ui/gui/data-editor.c:1078
+#: src/ui/gui/data-editor.c:1135
 msgid "No Split"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1087
+#: src/ui/gui/data-editor.c:1144
 #, fuzzy
 msgid "Split by "
 msgstr "Alle Datei"
 
-#: src/ui/gui/data-editor.c:1112
+#: src/ui/gui/data-editor.c:1169
 msgid "Filter off"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1125
+#: src/ui/gui/data-editor.c:1182
 #, c-format
 msgid "Filter by %s"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1143
+#: src/ui/gui/data-editor.c:1200
 msgid "Weights off"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1156
+#: src/ui/gui/data-editor.c:1213
 #, c-format
 msgid "Weight by %s"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1179 src/ui/gui/data-editor.c:1410
+#: src/ui/gui/data-editor.c:1236 src/ui/gui/data-editor.c:1467
 #: src/ui/gui/data-editor.glade:512
 msgid "Open"
 msgstr "Öffen"
 
-#: src/ui/gui/data-editor.c:1180
+#: src/ui/gui/data-editor.c:1237
 msgid "Open a data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1188 src/ui/gui/data-editor.c:1295
+#: src/ui/gui/data-editor.c:1245 src/ui/gui/data-editor.c:1352
 #: src/ui/gui/data-editor.glade:522
 msgid "Save"
 msgstr "Speichen"
 
-#: src/ui/gui/data-editor.c:1189 src/ui/gui/data-editor.c:1199
+#: src/ui/gui/data-editor.c:1246 src/ui/gui/data-editor.c:1256
 #, fuzzy
 msgid "Save data to file"
 msgstr "Speichern unter"
 
-#: src/ui/gui/data-editor.c:1198
+#: src/ui/gui/data-editor.c:1255
 #, fuzzy
 msgid "Save As"
 msgstr "Speichern unter"
 
-#: src/ui/gui/data-editor.c:1207
+#: src/ui/gui/data-editor.c:1264
 msgid "New"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1208
+#: src/ui/gui/data-editor.c:1265
 msgid "New data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1303 src/ui/gui/data-editor.c:1418
+#: src/ui/gui/data-editor.c:1360 src/ui/gui/data-editor.c:1475
 msgid "System Files (*.sav)"
 msgstr "Systemedatein (*.sav)"
 
-#: src/ui/gui/data-editor.c:1309 src/ui/gui/data-editor.c:1424
+#: src/ui/gui/data-editor.c:1366 src/ui/gui/data-editor.c:1481
 msgid "Portable Files (*.por) "
 msgstr "Tragbardatein (*.por)"
 
-#: src/ui/gui/data-editor.c:1315 src/ui/gui/data-editor.c:1430
+#: src/ui/gui/data-editor.c:1372 src/ui/gui/data-editor.c:1487
 #: src/ui/gui/syntax-editor.c:138 src/ui/gui/syntax-editor.c:524
 msgid "All Files"
 msgstr "Alle Datei"
 
-#: src/ui/gui/data-editor.c:1323
+#: src/ui/gui/data-editor.c:1380
 #, fuzzy
 msgid "System File"
 msgstr "Systemedatein (*.sav)"
 
-#: src/ui/gui/data-editor.c:1328
+#: src/ui/gui/data-editor.c:1385
 #, fuzzy
 msgid "Portable File"
 msgstr "Tragbardatein (*.por)"
 
-#: src/ui/gui/data-editor.c:1593
+#: src/ui/gui/data-editor.c:1650
 msgid "Sort Ascending"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1596
+#: src/ui/gui/data-editor.c:1653
 msgid "Sort Descending"
 msgstr ""
 

Index: po/pspp.pot
===================================================================
RCS file: /sources/pspp/pspp/po/pspp.pot,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -b -r1.144 -r1.145
--- po/pspp.pot 16 Aug 2007 06:30:22 -0000      1.144
+++ po/pspp.pot 18 Aug 2007 02:52:35 -0000      1.145
@@ -8,7 +8,7 @@
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: address@hidden"
-"POT-Creation-Date: 2007-08-16 14:11+0800\n"
+"POT-Creation-Date: 2007-08-18 08:25+0800\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <address@hidden>\n"
 "Language-Team: LANGUAGE <address@hidden>\n"
@@ -3071,11 +3071,11 @@
 msgid "Multivariate GLM not yet supported"
 msgstr ""
 
-#: src/language/stats/glm.q:268 src/language/stats/regression.q:1153
+#: src/language/stats/glm.q:268 src/language/stats/regression.q:1155
 msgid "Dependent variable must be numeric."
 msgstr ""
 
-#: src/language/stats/glm.q:343 src/language/stats/regression.q:1252
+#: src/language/stats/glm.q:343 src/language/stats/regression.q:1254
 msgid "No valid data found. This command was skipped."
 msgstr ""
 
@@ -3329,9 +3329,9 @@
 
 #: src/language/stats/regression.q:1031
 msgid ""
-"The dependent variable is equal to the independent variable. The least "
-"sequares line is therefore Y=X. Standard errors and related statistics may "
-"be meaningless."
+"The dependent variable is equal to the independent variable.The least "
+"squares line is therefore Y=X.Standard errors and related statistics may be "
+"meaningless."
 msgstr ""
 
 #: src/language/stats/sort-cases.c:63
@@ -4232,209 +4232,209 @@
 msgid "Style of bevel around the custom entry button"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:151
+#: src/ui/gui/data-editor.c:154
 msgid "Transformations Pending"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:290
+#: src/ui/gui/data-editor.c:349
 msgid "Labels"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:291
+#: src/ui/gui/data-editor.c:350
 msgid "Show/hide value labels"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:309 src/ui/gui/data-editor.c:324
-#: src/ui/gui/data-editor.c:1603 src/ui/gui/data-editor.c:1656
+#: src/ui/gui/data-editor.c:368 src/ui/gui/data-editor.c:385
+#: src/ui/gui/data-editor.c:1660 src/ui/gui/data-editor.c:1713
 msgid "Clear"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:310
+#: src/ui/gui/data-editor.c:369
 msgid "Delete the cases at the selected position(s)"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:325
+#: src/ui/gui/data-editor.c:386
 msgid "Delete the variables at the selected position(s)"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:339 src/ui/gui/data-editor.c:1600
+#: src/ui/gui/data-editor.c:400 src/ui/gui/data-editor.c:1657
 #: src/ui/gui/data-editor.glade:286 src/ui/gui/data-editor.glade:654
 msgid "Insert Variable"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:340
+#: src/ui/gui/data-editor.c:401
 msgid "Create a new variable at the current position"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:358 src/ui/gui/data-editor.c:1653
+#: src/ui/gui/data-editor.c:419 src/ui/gui/data-editor.c:1710
 #: src/ui/gui/data-editor.glade:642
 msgid "Insert Case"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:359
+#: src/ui/gui/data-editor.c:420
 msgid "Create a new case at the current position"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:379
+#: src/ui/gui/data-editor.c:440
 msgid "Goto Case"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:380
+#: src/ui/gui/data-editor.c:441
 msgid "Jump to a Case in the Data Sheet"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:399
+#: src/ui/gui/data-editor.c:460
 msgid "Weights"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:400
+#: src/ui/gui/data-editor.c:461
 msgid "Weight cases by variable"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:409 src/ui/gui/data-editor.glade:323
+#: src/ui/gui/data-editor.c:470 src/ui/gui/data-editor.glade:323
 msgid "Transpose"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:410
+#: src/ui/gui/data-editor.c:471
 msgid "Transpose the cases with the variables"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:421
+#: src/ui/gui/data-editor.c:482
 msgid "Split"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:422
+#: src/ui/gui/data-editor.c:483
 msgid "Split the active file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:432
+#: src/ui/gui/data-editor.c:493
 msgid "Sort"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:433
+#: src/ui/gui/data-editor.c:494
 msgid "Sort cases in the active file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:441 src/ui/gui/data-editor.glade:360
+#: src/ui/gui/data-editor.c:502 src/ui/gui/data-editor.glade:360
 #: src/ui/gui/data-editor.glade:697
 msgid "Select Cases"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:442
+#: src/ui/gui/data-editor.c:503
 msgid "Select cases from the active file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:451
+#: src/ui/gui/data-editor.c:512
 msgid "Compute"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:452
+#: src/ui/gui/data-editor.c:513
 msgid "Compute new values for a variable"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:460
+#: src/ui/gui/data-editor.c:521
 msgid "Data File Comments"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:461
+#: src/ui/gui/data-editor.c:522
 msgid "Commentary text for the data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:469 src/ui/gui/data-editor.glade:267
+#: src/ui/gui/data-editor.c:530 src/ui/gui/data-editor.glade:267
 #: src/ui/gui/data-editor.glade:601
 msgid "Variables"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:470
+#: src/ui/gui/data-editor.c:531
 msgid "Jump to Variable"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:871
+#: src/ui/gui/data-editor.c:928
 msgid "Font Selection"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1078
+#: src/ui/gui/data-editor.c:1135
 msgid "No Split"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1087
+#: src/ui/gui/data-editor.c:1144
 msgid "Split by "
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1112
+#: src/ui/gui/data-editor.c:1169
 msgid "Filter off"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1125
+#: src/ui/gui/data-editor.c:1182
 #, c-format
 msgid "Filter by %s"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1143
+#: src/ui/gui/data-editor.c:1200
 msgid "Weights off"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1156
+#: src/ui/gui/data-editor.c:1213
 #, c-format
 msgid "Weight by %s"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1179 src/ui/gui/data-editor.c:1410
+#: src/ui/gui/data-editor.c:1236 src/ui/gui/data-editor.c:1467
 #: src/ui/gui/data-editor.glade:512
 msgid "Open"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1180
+#: src/ui/gui/data-editor.c:1237
 msgid "Open a data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1188 src/ui/gui/data-editor.c:1295
+#: src/ui/gui/data-editor.c:1245 src/ui/gui/data-editor.c:1352
 #: src/ui/gui/data-editor.glade:522
 msgid "Save"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1189 src/ui/gui/data-editor.c:1199
+#: src/ui/gui/data-editor.c:1246 src/ui/gui/data-editor.c:1256
 msgid "Save data to file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1198
+#: src/ui/gui/data-editor.c:1255
 msgid "Save As"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1207
+#: src/ui/gui/data-editor.c:1264
 msgid "New"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1208
+#: src/ui/gui/data-editor.c:1265
 msgid "New data file"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1303 src/ui/gui/data-editor.c:1418
+#: src/ui/gui/data-editor.c:1360 src/ui/gui/data-editor.c:1475
 msgid "System Files (*.sav)"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1309 src/ui/gui/data-editor.c:1424
+#: src/ui/gui/data-editor.c:1366 src/ui/gui/data-editor.c:1481
 msgid "Portable Files (*.por) "
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1315 src/ui/gui/data-editor.c:1430
+#: src/ui/gui/data-editor.c:1372 src/ui/gui/data-editor.c:1487
 #: src/ui/gui/syntax-editor.c:138 src/ui/gui/syntax-editor.c:524
 msgid "All Files"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1323
+#: src/ui/gui/data-editor.c:1380
 msgid "System File"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1328
+#: src/ui/gui/data-editor.c:1385
 msgid "Portable File"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1593
+#: src/ui/gui/data-editor.c:1650
 msgid "Sort Ascending"
 msgstr ""
 
-#: src/ui/gui/data-editor.c:1596
+#: src/ui/gui/data-editor.c:1653
 msgid "Sort Descending"
 msgstr ""
 

Index: src/ui/gui/ChangeLog
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/ChangeLog,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- src/ui/gui/ChangeLog        16 Aug 2007 06:30:23 -0000      1.81
+++ src/ui/gui/ChangeLog        18 Aug 2007 02:52:36 -0000      1.82
@@ -1,3 +1,8 @@
+2007-08-18  John Darrington <address@hidden>
+
+       * clipboard.c clipboard.h data-editor.c: Added the ability to paste 
from 
+       the clipboard into the data sheet.
+
 2007-08-16  John Darrington <address@hidden>
 
         * output-viewer.c output-viewer.h output-viewer.glade (new files)

Index: src/ui/gui/clipboard.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/clipboard.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- src/ui/gui/clipboard.c      13 Aug 2007 06:34:25 -0000      1.2
+++ src/ui/gui/clipboard.c      18 Aug 2007 02:52:36 -0000      1.3
@@ -26,7 +26,9 @@
 #include <data/casewriter.h>
 #include <data/format.h>
 #include <data/data-out.h>
+#include "helper.h"
 #include <stdlib.h>
+#include "data-editor.h"
 
 
 /* A casereader and dictionary holding the data currently in the clip */
@@ -307,3 +309,72 @@
     clipboard_clear_cb (clipboard, sheet);
 }
 
+
+
+/* A callback for when  clipboard contents have been received */
+void
+data_sheet_contents_received_callback (GtkClipboard *clipboard,
+                                     GtkSelectionData *sd,
+                                     gpointer data)
+{
+  struct data_editor *de = data;
+
+  gint count = 0;
+  gint row, column;
+  gint next_row, next_column;
+  gint first_column;
+  char *c;
+  GtkSheet *data_sheet ;
+  PsppireDataStore *data_store;
+
+  if ( sd->length < 0 )
+    return;
+
+  if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE))
+    return;
+
+  c = (char *) sd->data;
+
+  /* Paste text to selected position */
+  data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
+  data_store = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet));
+
+  gtk_sheet_get_active_cell (data_sheet, &row, &column);
+
+  g_return_if_fail (row >= 0);
+  g_return_if_fail (column >= 0);
+
+  first_column = column;
+  next_row = row;
+  next_column = column;
+  while (count < sd->length)
+    {
+      char *s = c;
+
+      row = next_row;
+      column = next_column;
+      while (*c != '\t' && *c != '\n' && count < sd->length)
+       {
+         c++;
+         count++;
+       }
+      if ( *c == '\t')
+       {
+         next_row = row ;
+         next_column = column + 1;
+       }
+      else if ( *c == '\n')
+       {
+         next_row = row + 1;
+         next_column = first_column;
+       }
+      *c++ = '\0';
+      count++;
+
+      /* Append some new cases if pasting beyond the last row */
+      if ( row >= psppire_data_store_get_case_count (data_store))
+       psppire_data_store_insert_new_case (data_store, row);
+
+      gtk_sheet_set_cell_text (data_sheet, row, column, s);
+    }
+}

Index: src/ui/gui/clipboard.h
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/clipboard.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- src/ui/gui/clipboard.h      13 Aug 2007 04:31:43 -0000      1.1
+++ src/ui/gui/clipboard.h      18 Aug 2007 02:52:36 -0000      1.2
@@ -23,6 +23,10 @@
 
 void data_sheet_set_clip (GtkSheet *data_sheet);
 
+void data_sheet_contents_received_callback (GtkClipboard *clipboard,
+                                           GtkSelectionData *sd,
+                                           gpointer data);
+
 
 #endif /* CLIPBOARD_H */
 

Index: src/ui/gui/data-editor.c
===================================================================
RCS file: /sources/pspp/pspp/src/ui/gui/data-editor.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -b -r1.46 -r1.47
--- src/ui/gui/data-editor.c    13 Aug 2007 04:31:44 -0000      1.46
+++ src/ui/gui/data-editor.c    18 Aug 2007 02:52:36 -0000      1.47
@@ -54,6 +54,9 @@
 #include "psppire-var-store.h"
 
 static void on_edit_copy (GtkMenuItem *, gpointer);
+static void on_edit_cut (GtkMenuItem *, gpointer);
+static void on_edit_paste (GtkAction *a, gpointer data);
+
 
 static void create_data_sheet_variable_popup_menu (struct data_editor *);
 static void create_data_sheet_cases_popup_menu (struct data_editor *);
@@ -88,7 +91,7 @@
 static void on_filter_change (GObject *, gint, gpointer);
 static void on_split_change (PsppireDict *, gpointer);
 
-static void data_var_select (GtkNotebook *notebook,
+static void on_switch_sheet (GtkNotebook *notebook,
                            GtkNotebookPage *page,
                            guint page_num,
                            gpointer user_data);
@@ -219,6 +222,96 @@
   psppire_data_store_set_string (store, text, row, column);
 }
 
+
+/* Update the Edit->Paste menuitem
+   If PAGE is not -1 , then it should be set to the current page of
+   the data editors notebook widget.
+   If -1, then it'll be queried.
+*/
+static void
+update_paste_menuitem (struct data_editor *de, gint page)
+{
+  GtkWidget * edit_paste = get_widget_assert (de->xml, "edit_paste");
+  GtkWidget *notebook = get_widget_assert (de->xml, "notebook");
+  GtkSheet * data_sheet ;
+  gint row, column;
+
+  if ( page < 0 )
+    page = gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook));
+
+
+  if ( PAGE_VAR_SHEET == page )
+    {
+      /* We don't yet support pasting to the var sheet */
+      gtk_widget_set_sensitive (edit_paste, FALSE);
+      return;
+    }
+
+  data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
+
+  gtk_sheet_get_active_cell (data_sheet, &row, &column);
+
+  if ( row < 0 || column < 0 )
+      gtk_widget_set_sensitive (edit_paste, FALSE);
+  else
+      gtk_widget_set_sensitive (edit_paste, TRUE);
+}
+
+/* Update the Edit->Cut and Edit->Copy menuitems
+   If PAGE is not -1 , then it should be set to the current page of
+   the data editors notebook widget.
+   If -1, then it'll be queried.
+*/
+static void
+update_cut_copy_menuitem (struct data_editor *de, gint page)
+{
+  GtkWidget * edit_copy = get_widget_assert (de->xml, "edit_copy");
+  GtkWidget * edit_cut = get_widget_assert (de->xml, "edit_cut");
+  GtkWidget *notebook = get_widget_assert (de->xml, "notebook");
+  GtkSheet * data_sheet ;
+  gint row, column;
+
+  if ( page < 0 )
+    page = gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook));
+
+
+  if ( PAGE_VAR_SHEET == page )
+    {
+      /* We don't yet support copying from the var sheet */
+      gtk_widget_set_sensitive (edit_copy, FALSE);
+      gtk_widget_set_sensitive (edit_cut, FALSE);
+      return;
+    }
+
+  data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
+
+  gtk_sheet_get_active_cell (data_sheet, &row, &column);
+
+  if ( row < 0 || column < 0 )
+    {
+      gtk_widget_set_sensitive (edit_copy, FALSE);
+      gtk_widget_set_sensitive (edit_cut, FALSE);
+      return;
+    }
+
+  gtk_widget_set_sensitive (edit_copy, TRUE);
+  gtk_widget_set_sensitive (edit_cut, TRUE);
+}
+
+
+/* Callback for when the datasheet's active cell becomes active/inactive */
+static gboolean
+on_data_sheet_activate_change (GtkSheet *sheet,
+                              gint row, gint column, gpointer data)
+{
+  struct data_editor *de = data;
+
+  update_paste_menuitem (de, -1);
+  update_cut_copy_menuitem (de, -1);
+
+  return TRUE;
+}
+
 extern struct dataset *the_dataset;
 
 /*
@@ -248,6 +341,14 @@
   var_sheet = GTK_SHEET (get_widget_assert (de->xml, "variable_sheet"));
   data_sheet = GTK_SHEET (get_widget_assert (de->xml, "data_sheet"));
 
+
+  g_signal_connect (G_OBJECT (data_sheet), "activate",
+                   G_CALLBACK (on_data_sheet_activate_change), de);
+
+  g_signal_connect (G_OBJECT (data_sheet), "deactivate",
+                   G_CALLBACK (on_data_sheet_activate_change), de);
+
+
   vs = PSPPIRE_VAR_STORE (gtk_sheet_get_model (var_sheet));
 
   g_assert(vs); /* Traps a possible bug in win32 build */
@@ -282,6 +383,10 @@
                    "activate",
                    G_CALLBACK (on_edit_copy), de);
 
+  g_signal_connect (get_widget_assert (de->xml, "edit_cut"),
+                   "activate",
+                   G_CALLBACK (on_edit_cut), de);
+
 
   register_data_editor_actions (de);
 
@@ -316,6 +421,8 @@
   gtk_action_connect_proxy (de->delete_cases,
                            get_widget_assert (de->xml, "edit_clear-cases"));
 
+  g_signal_connect (get_widget_assert (de->xml, "edit_paste"), "activate",
+                   G_CALLBACK (on_edit_paste), de);
 
   gtk_action_set_visible (de->delete_cases, FALSE);
 
@@ -620,7 +727,7 @@
 
   g_signal_connect (get_widget_assert (de->xml, "notebook"),
                    "switch-page",
-                   G_CALLBACK (data_var_select), de);
+                   G_CALLBACK (on_switch_sheet), de);
 
 
   g_signal_connect (get_widget_assert (de->xml, "view_statusbar"),
@@ -699,12 +806,6 @@
   g_signal_connect (G_OBJECT (data_sheet), "button-event-row",
                    G_CALLBACK (popup_cases_menu), de);
 
-     /* The "switch-page" signal does get emitted unless the page actually 
-       changes.  But the state is indeterminate at startup.  Therefore we 
-       must explicitly change it to one state, then the other */
-  data_editor_select_sheet (de, PAGE_VAR_SHEET);
-  data_editor_select_sheet (de, PAGE_DATA_SHEET);
-
   return de;
 }
 
@@ -768,9 +869,9 @@
   window_create (WINDOW_DATA, NULL);
 }
 
-
+/* Callback for when the datasheet/varsheet is selected */
 static void
-data_var_select (GtkNotebook *notebook,
+on_switch_sheet (GtkNotebook *notebook,
                GtkNotebookPage *page,
                guint page_num,
                gpointer user_data)
@@ -779,14 +880,12 @@
 
   GtkWidget *view_data = get_widget_assert (de->xml, "view_data");
   GtkWidget *view_variables = get_widget_assert (de->xml, "view_variables");
-  GtkWidget *edit_copy = get_widget_assert (de->xml, "edit_copy");
 
   switch (page_num)
     {
     case PAGE_VAR_SHEET:
       gtk_widget_hide (view_variables);
       gtk_widget_show (view_data);
-      gtk_widget_set_sensitive (edit_copy, FALSE);
       gtk_action_set_sensitive (de->insert_variable, TRUE);
       gtk_action_set_sensitive (de->insert_case, FALSE);
       gtk_action_set_sensitive (de->invoke_goto_dialog, FALSE);
@@ -796,12 +895,14 @@
       gtk_widget_show (view_data);
       gtk_action_set_sensitive (de->invoke_goto_dialog, TRUE);
       gtk_action_set_sensitive (de->insert_case, TRUE);
-      gtk_widget_set_sensitive (edit_copy, TRUE);
       break;
     default:
       g_assert_not_reached ();
       break;
     }
+
+  update_paste_menuitem (de, page_num);
+  update_cut_copy_menuitem (de, page_num);
 }
 
 
@@ -1726,6 +1827,17 @@
 }
 
 
+static void
+on_edit_paste (GtkAction *a, gpointer data)
+{
+  GtkClipboard *clipboard = gtk_clipboard_get (GDK_SELECTION_CLIPBOARD);
+
+  gtk_clipboard_request_contents (clipboard,
+                                 gdk_atom_intern ("UTF8_STRING", TRUE),
+                                 data_sheet_contents_received_callback,
+                                 data);
+}
+
 
 static void
 on_edit_copy (GtkMenuItem *m, gpointer data)
@@ -1739,3 +1851,73 @@
 }
 
 
+
+static void
+on_edit_cut (GtkMenuItem *m, gpointer data)
+{
+  struct data_editor *de = data;
+  gint max_rows, max_columns;
+  gint r;
+  GtkSheetRange range;
+  PsppireDataStore *ds;
+  GtkSheet *data_sheet = GTK_SHEET (get_widget_assert (de->xml,
+                                                      "data_sheet"));
+
+  data_sheet_set_clip (data_sheet);
+
+
+  /* Now blank all the cells */
+  gtk_sheet_get_selected_range (data_sheet, &range);
+
+  ds = PSPPIRE_DATA_STORE (gtk_sheet_get_model (data_sheet));
+
+
+   /* If nothing selected, then use active cell */
+  if ( range.row0 < 0 || range.col0 < 0 )
+    {
+      gint row, col;
+      gtk_sheet_get_active_cell (data_sheet, &row, &col);
+
+      range.row0 = range.rowi = row;
+      range.col0 = range.coli = col;
+    }
+
+  /* The sheet range can include cells that do not include data.
+     Exclude them from the range. */
+  max_rows = psppire_data_store_get_case_count (ds);
+  if (range.rowi >= max_rows)
+    {
+      if (max_rows == 0)
+        return;
+      range.rowi = max_rows - 1;
+    }
+
+  max_columns = dict_get_var_cnt (ds->dict->dict);
+  if (range.coli >= max_columns)
+    {
+      if (max_columns == 0)
+        return;
+      range.coli = max_columns - 1;
+    }
+
+  g_return_if_fail (range.rowi >= range.row0);
+  g_return_if_fail (range.row0 >= 0);
+  g_return_if_fail (range.coli >= range.col0);
+  g_return_if_fail (range.col0 >= 0);
+
+
+  for (r = range.row0; r <= range.rowi ; ++r )
+    {
+      gint c;
+
+      for (c = range.col0 ; c <= range.coli; ++c)
+       {
+         psppire_data_store_set_string (ds, "", r, c);
+       }
+    }
+
+  /* and remove the selection */
+  gtk_sheet_unselect_range (data_sheet);
+}
+
+




reply via email to

[Prev in Thread] Current Thread [Next in Thread]