From 258cbd9cdf386687122b0854274923acafc786d4 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 6 Aug 2016 10:01:17 +0200 Subject: [PATCH] Remove deprecated objects GtkAction and GtkUIManager Instead use GAction and GMenuModel. A lot of other code needed to be adjusted too. --- .gitignore | 112 +- INSTALL | 2 +- NEWS | 4 +- Smake | 354 +++--- build-aux/.gitignore | 9 - build-aux/snippet/.gitignore | 5 - config/.gitignore | 2 - configure.ac | 11 +- doc/.gitignore | 23 - examples/.gitignore | 2 - lib/.gitignore | 2 - lib/linreg/.gitignore | 2 - po/.gitignore | 14 - po/automake.mk | 4 +- src/.gitignore | 2 - src/language/expressions/.gitignore | 7 - src/language/lexer/.gitignore | 1 - src/language/stats/.gitignore | 1 - src/language/tests/.gitignore | 1 - src/language/utilities/.gitignore | 1 - src/libpspp/.gitignore | 1 - src/ui/gui/.gitignore | 1 - src/ui/gui/artwork/.gitignore | 2 - .../analyze-bivariate-correlation.svg | 0 .../actions}/analyze-compare-means.svg | 0 .../analyze-descriptive-statistics.svg | 0 .../actions}/analyze-factor-analysis.svg | 0 .../actions}/analyze-kmeans-cluster.svg | 0 .../analyze-non-parametric-statistics.svg | 0 .../actions}/analyze-regression.svg | 0 .../actions/analyze-reliability.svg} | 0 .../actions}/analyze-roc-curve.svg | 0 .../actions}/analyze-univariate-analysis.svg | 0 .../actions}/data-aggregate.svg | 0 .../actions}/data-select-cases.svg | 0 .../actions}/data-sort-cases.svg | 0 .../actions}/data-split-file.svg | 0 .../actions}/data-transpose.svg | 0 .../actions}/data-weight-cases.svg | 0 .../display-information-external-file.svg | 0 .../display-information-working-file.svg | 0 .../16x16 => 16x16/actions}/edit-clear.svg | 0 .../16x16 => 16x16/actions}/edit-copy.svg | 0 .../16x16 => 16x16/actions}/edit-cut.svg | 0 .../16x16 => 16x16/actions}/edit-delete.svg | 0 .../16x16 => 16x16/actions}/edit-find.svg | 0 .../actions}/edit-go-to-case.svg | 0 .../actions}/edit-go-to-variable.svg | 0 .../actions}/edit-insert-case.svg | 0 .../actions}/edit-insert-variable.svg | 0 .../16x16 => 16x16/actions}/edit-paste.svg | 0 .../16x16 => 16x16/actions}/edit-redo.svg | 0 .../actions}/edit-select-all.svg | 0 .../16x16 => 16x16/actions}/edit-undo.svg | 0 .../actions}/file-display-information.svg | 0 .../actions}/file-export-data.svg | 0 .../actions}/file-import-data.svg | 0 .../16x16 => 16x16/actions}/file-new-data.svg | 0 .../actions}/file-open-data.svg | 0 .../16x16 => 16x16/actions}/file-print.svg | 0 .../16x16 => 16x16/actions}/file-quit.svg | 0 .../actions}/file-recently-used.svg | 0 .../actions}/file-rename-data-set.svg | 0 .../16x16 => 16x16/actions}/file-save-as.svg | 0 .../actions}/file-save-data.svg | 0 .../actions}/file-syntax-data.svg | 0 .../actions}/file-system-data.svg | 0 .../16x16 => 16x16/actions}/help-about.svg | 0 .../actions}/help-reference-manual.svg | 0 .../16x16 => 16x16/actions}/run-all.svg | 0 .../actions}/run-current-line.svg | 0 .../16x16 => 16x16/actions}/run-selection.svg | 0 .../16x16 => 16x16/actions}/run-to-end.svg | 0 .../actions}/transform-automatic-recode.svg | 0 .../actions}/transform-compute.svg | 0 .../actions}/transform-count.svg | 0 .../transform-in-to-different-variables.svg | 0 .../transform-in-to-same-variables.svg | 0 .../actions}/transform-rank-cases.svg | 0 .../actions}/transform-run-pending.svg | 0 .../actions}/utilities-data-file-comments.svg | 0 .../actions}/utilities-variables.svg | 0 .../16x16 => 16x16/actions}/view-font.svg | 0 .../actions}/view-value-labels.svg | 0 .../actions}/windows-minimize-all.svg | 0 .../16x16 => 16x16/actions}/windows-split.svg | 0 .../{apps/16x16 => 16x16/apps}/pspp.svg | 0 .../categories}/align-center.svg | 0 .../16x16 => 16x16/categories}/align-left.svg | 0 .../categories}/align-right.svg | 0 .../categories}/measure-currency-nominal.svg | 0 .../categories}/measure-currency-ordinal.svg | 0 .../categories}/measure-currency-scale.svg | 0 .../categories}/measure-date-nominal.svg | 0 .../categories}/measure-date-ordinal.svg | 0 .../categories}/measure-date-scale.svg | 0 .../categories}/measure-nominal.svg | 0 .../categories}/measure-ordinal.svg | 0 .../categories}/measure-scale.svg | 0 .../categories}/measure-string-nominal.svg | 0 .../categories}/measure-string-ordinal.svg | 0 .../categories}/measure-time-nominal.svg | 0 .../categories}/measure-time-ordinal.svg | 0 .../categories}/measure-time-scale.svg | 0 .../16x16 => 16x16/categories}/role-both.svg | 0 .../16x16 => 16x16/categories}/role-input.svg | 0 .../16x16 => 16x16/categories}/role-none.svg | 0 .../categories}/role-partition.svg | 0 .../16x16 => 16x16/categories}/role-split.svg | 0 .../categories}/role-target.svg | 0 .../mimetypes}/application-x-spss-por.svg | 0 .../mimetypes}/application-x-spss-sav.svg | 0 .../mimetypes}/application-x-spss-sps.svg | 0 .../mimetypes}/application-x-spss-zsav.svg | 0 .../{apps/22x22 => 22x22/apps}/pspp.svg | 0 .../mimetypes}/application-x-spss-por.svg | 0 .../mimetypes}/application-x-spss-sav.svg | 0 .../mimetypes}/application-x-spss-sps.svg | 0 .../mimetypes}/application-x-spss-zsav.svg | 0 .../actions}/data-select-cases.svg | 0 .../actions}/data-split-file.svg | 0 .../actions}/data-weight-cases.svg | 0 .../24x24 => 24x24/actions}/edit-copy.svg | 0 .../24x24 => 24x24/actions}/edit-cut.svg | 0 .../24x24 => 24x24/actions}/edit-find.svg | 0 .../actions}/edit-go-to-case.svg | 0 .../actions}/edit-go-to-variable.svg | 0 .../actions}/edit-insert-case.svg | 0 .../actions}/edit-insert-variable.svg | 0 .../24x24 => 24x24/actions}/edit-paste.svg | 0 .../24x24 => 24x24/actions}/edit-redo.svg | 0 .../actions}/edit-select-all.svg | 0 .../24x24 => 24x24/actions}/edit-undo.svg | 0 .../actions}/file-export-data.svg | 0 .../actions}/file-open-data.svg | 0 .../24x24 => 24x24/actions}/file-print.svg | 0 .../actions}/file-save-data.svg | 0 .../24x24 => 24x24/actions}/run-all.svg | 0 .../actions}/transform-compute.svg | 0 .../actions}/utilities-variables.svg | 0 .../actions}/view-value-labels.svg | 0 .../{apps/24x24 => 24x24/apps}/pspp.svg | 0 .../mimetypes}/application-x-spss-por.svg | 0 .../mimetypes}/application-x-spss-sav.svg | 0 .../mimetypes}/application-x-spss-sps.svg | 0 .../mimetypes}/application-x-spss-zsav.svg | 0 .../{apps/256x256 => 256x256/apps}/pspp.svg | 0 .../mimetypes}/application-x-spss-por.svg | 0 .../mimetypes}/application-x-spss-sav.svg | 0 .../mimetypes}/application-x-spss-sps.svg | 0 .../mimetypes}/application-x-spss-zsav.svg | 0 .../actions}/data-select-cases.svg | 0 .../actions}/data-split-file.svg | 0 .../actions}/data-weight-cases.svg | 0 .../32x32 => 32x32/actions}/edit-copy.svg | 0 .../32x32 => 32x32/actions}/edit-cut.svg | 0 .../32x32 => 32x32/actions}/edit-find.svg | 0 .../actions}/edit-go-to-case.svg | 0 .../actions}/edit-go-to-variable.svg | 0 .../actions}/edit-insert-case.svg | 0 .../actions}/edit-insert-variable.svg | 0 .../32x32 => 32x32/actions}/edit-paste.svg | 0 .../32x32 => 32x32/actions}/edit-redo.svg | 0 .../actions}/edit-select-all.svg | 0 .../32x32 => 32x32/actions}/edit-undo.svg | 0 .../actions}/file-export-data.svg | 0 .../actions}/file-open-data.svg | 0 .../32x32 => 32x32/actions}/file-print.svg | 0 .../actions}/file-save-data.svg | 0 .../32x32 => 32x32/actions}/run-all.svg | 0 .../actions}/transform-compute.svg | 0 .../actions}/utilities-variables.svg | 0 .../actions}/view-value-labels.svg | 0 .../{apps/32x32 => 32x32/apps}/pspp.svg | 0 .../mimetypes}/application-x-spss-por.svg | 0 .../mimetypes}/application-x-spss-sav.svg | 0 .../mimetypes}/application-x-spss-sps.svg | 0 .../mimetypes}/application-x-spss-zsav.svg | 0 .../{apps/48x48 => 48x48/apps}/pspp.svg | 0 .../mimetypes}/application-x-spss-por.svg | 0 .../mimetypes}/application-x-spss-sav.svg | 0 .../mimetypes}/application-x-spss-sps.svg | 0 .../mimetypes}/application-x-spss-zsav.svg | 0 src/ui/gui/artwork/actions/.empty | 1 - src/ui/gui/artwork/apps/scalable/.empty | 1 - .../{apps/scalable => scalable/apps}/pspp.svg | 0 src/ui/gui/automake.mk | 21 +- src/ui/gui/builder-wrapper.c | 6 - src/ui/gui/builder-wrapper.h | 1 - src/ui/gui/data-editor.ui | 914 ++++---------- src/ui/gui/data-sheet.ui | 150 --- src/ui/gui/icons/.gitignore | 10 - src/ui/gui/icons/automake.mk | 17 +- src/ui/gui/icons/icon-names.h | 17 - src/ui/gui/main.c | 494 +++----- src/ui/gui/memorandum.txt | 6 +- src/ui/gui/output-window.ui | 171 +-- src/ui/gui/psppire-data-editor.c | 88 +- src/ui/gui/psppire-data-editor.h | 3 - src/ui/gui/psppire-data-sheet.c | 394 +++--- src/ui/gui/psppire-data-sheet.h | 19 +- src/ui/gui/psppire-data-window.c | 1055 +++++++++++++---- src/ui/gui/psppire-data-window.h | 28 +- src/ui/gui/psppire-dialog-action-1sks.c | 2 - src/ui/gui/psppire-dialog-action-aggregate.c | 2 - src/ui/gui/psppire-dialog-action-autorecode.c | 2 - src/ui/gui/psppire-dialog-action-barchart.c | 2 - src/ui/gui/psppire-dialog-action-binomial.c | 2 - src/ui/gui/psppire-dialog-action-chisquare.c | 2 - src/ui/gui/psppire-dialog-action-comments.c | 2 - src/ui/gui/psppire-dialog-action-compute.c | 2 - .../gui/psppire-dialog-action-correlation.c | 2 - src/ui/gui/psppire-dialog-action-count.c | 2 - src/ui/gui/psppire-dialog-action-crosstabs.c | 3 - .../gui/psppire-dialog-action-descriptives.c | 2 - src/ui/gui/psppire-dialog-action-examine.c | 2 - src/ui/gui/psppire-dialog-action-factor.c | 1 - src/ui/gui/psppire-dialog-action-flip.c | 2 - .../gui/psppire-dialog-action-frequencies.c | 5 - src/ui/gui/psppire-dialog-action-histogram.c | 2 - .../gui/psppire-dialog-action-indep-samps.c | 3 - src/ui/gui/psppire-dialog-action-k-related.c | 2 - src/ui/gui/psppire-dialog-action-kmeans.c | 2 - src/ui/gui/psppire-dialog-action-logistic.c | 2 - src/ui/gui/psppire-dialog-action-means.c | 1 - src/ui/gui/psppire-dialog-action-oneway.c | 2 - src/ui/gui/psppire-dialog-action-paired.c | 2 - src/ui/gui/psppire-dialog-action-rank.c | 1 - .../psppire-dialog-action-recode-different.c | 3 - .../gui/psppire-dialog-action-recode-same.c | 3 - src/ui/gui/psppire-dialog-action-recode.c | 9 - src/ui/gui/psppire-dialog-action-regression.c | 2 - .../gui/psppire-dialog-action-reliability.c | 2 - src/ui/gui/psppire-dialog-action-roc.c | 2 - src/ui/gui/psppire-dialog-action-runs.c | 2 - .../gui/psppire-dialog-action-scatterplot.c | 2 - src/ui/gui/psppire-dialog-action-select.c | 2 - src/ui/gui/psppire-dialog-action-sort.c | 2 - src/ui/gui/psppire-dialog-action-split.c | 2 - src/ui/gui/psppire-dialog-action-tt1s.c | 2 - src/ui/gui/psppire-dialog-action-two-sample.c | 2 - src/ui/gui/psppire-dialog-action-univariate.c | 2 - src/ui/gui/psppire-dialog-action-var-info.c | 5 +- src/ui/gui/psppire-dialog-action-weight.c | 2 - src/ui/gui/psppire-dialog-action.c | 180 ++- src/ui/gui/psppire-dialog-action.h | 14 +- src/ui/gui/psppire-dictview.c | 7 +- src/ui/gui/psppire-output-view.c | 54 +- src/ui/gui/psppire-output-view.h | 5 +- src/ui/gui/psppire-output-window.c | 58 +- src/ui/gui/psppire-syntax-window.c | 228 ++-- src/ui/gui/psppire-syntax-window.h | 12 +- src/ui/gui/psppire-var-sheet.c | 106 +- src/ui/gui/psppire-var-sheet.h | 7 +- src/ui/gui/psppire-window-base.c | 2 +- src/ui/gui/psppire-window-base.h | 4 +- src/ui/gui/psppire.c | 222 +--- src/ui/gui/psppire.h | 8 +- src/ui/gui/syntax-editor.ui | 347 ++---- src/ui/gui/var-sheet.ui | 86 -- src/ui/terminal/.gitignore | 2 - tests/.gitignore | 4 - tests/formats/.gitignore | 2 - tests/libpspp/.gitignore | 3 - 264 files changed, 2366 insertions(+), 3040 deletions(-) delete mode 100644 build-aux/.gitignore delete mode 100644 build-aux/snippet/.gitignore delete mode 100644 config/.gitignore delete mode 100644 doc/.gitignore delete mode 100644 examples/.gitignore delete mode 100644 lib/.gitignore delete mode 100644 lib/linreg/.gitignore delete mode 100644 po/.gitignore delete mode 100644 src/.gitignore delete mode 100644 src/language/expressions/.gitignore delete mode 100644 src/language/lexer/.gitignore delete mode 100644 src/language/stats/.gitignore delete mode 100644 src/language/tests/.gitignore delete mode 100644 src/language/utilities/.gitignore delete mode 100644 src/libpspp/.gitignore delete mode 100644 src/ui/gui/.gitignore delete mode 100644 src/ui/gui/artwork/.gitignore rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-bivariate-correlation.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-compare-means.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-descriptive-statistics.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-factor-analysis.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-kmeans-cluster.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-non-parametric-statistics.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-regression.svg (100%) rename src/ui/gui/artwork/{actions/16x16/analyze-realiability.svg => 16x16/actions/analyze-reliability.svg} (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-roc-curve.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/analyze-univariate-analysis.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/data-aggregate.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/data-select-cases.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/data-sort-cases.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/data-split-file.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/data-transpose.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/data-weight-cases.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/display-information-external-file.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/display-information-working-file.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-clear.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-copy.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-cut.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-delete.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-find.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-go-to-case.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-go-to-variable.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-insert-case.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-insert-variable.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-paste.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-redo.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-select-all.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/edit-undo.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-display-information.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-export-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-import-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-new-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-open-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-print.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-quit.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-recently-used.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-rename-data-set.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-save-as.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-save-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-syntax-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/file-system-data.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/help-about.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/help-reference-manual.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/run-all.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/run-current-line.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/run-selection.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/run-to-end.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-automatic-recode.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-compute.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-count.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-in-to-different-variables.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-in-to-same-variables.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-rank-cases.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/transform-run-pending.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/utilities-data-file-comments.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/utilities-variables.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/view-font.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/view-value-labels.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/windows-minimize-all.svg (100%) rename src/ui/gui/artwork/{actions/16x16 => 16x16/actions}/windows-split.svg (100%) rename src/ui/gui/artwork/{apps/16x16 => 16x16/apps}/pspp.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/align-center.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/align-left.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/align-right.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-currency-nominal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-currency-ordinal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-currency-scale.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-date-nominal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-date-ordinal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-date-scale.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-nominal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-ordinal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-scale.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-string-nominal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-string-ordinal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-time-nominal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-time-ordinal.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/measure-time-scale.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/role-both.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/role-input.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/role-none.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/role-partition.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/role-split.svg (100%) rename src/ui/gui/artwork/{categories/16x16 => 16x16/categories}/role-target.svg (100%) rename src/ui/gui/artwork/{mimetypes/16x16 => 16x16/mimetypes}/application-x-spss-por.svg (100%) rename src/ui/gui/artwork/{mimetypes/16x16 => 16x16/mimetypes}/application-x-spss-sav.svg (100%) rename src/ui/gui/artwork/{mimetypes/16x16 => 16x16/mimetypes}/application-x-spss-sps.svg (100%) rename src/ui/gui/artwork/{mimetypes/16x16 => 16x16/mimetypes}/application-x-spss-zsav.svg (100%) rename src/ui/gui/artwork/{apps/22x22 => 22x22/apps}/pspp.svg (100%) rename src/ui/gui/artwork/{mimetypes/22x22 => 22x22/mimetypes}/application-x-spss-por.svg (100%) rename src/ui/gui/artwork/{mimetypes/22x22 => 22x22/mimetypes}/application-x-spss-sav.svg (100%) rename src/ui/gui/artwork/{mimetypes/22x22 => 22x22/mimetypes}/application-x-spss-sps.svg (100%) rename src/ui/gui/artwork/{mimetypes/22x22 => 22x22/mimetypes}/application-x-spss-zsav.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/data-select-cases.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/data-split-file.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/data-weight-cases.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-copy.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-cut.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-find.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-go-to-case.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-go-to-variable.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-insert-case.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-insert-variable.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-paste.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-redo.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-select-all.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/edit-undo.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/file-export-data.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/file-open-data.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/file-print.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/file-save-data.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/run-all.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/transform-compute.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/utilities-variables.svg (100%) rename src/ui/gui/artwork/{actions/24x24 => 24x24/actions}/view-value-labels.svg (100%) rename src/ui/gui/artwork/{apps/24x24 => 24x24/apps}/pspp.svg (100%) rename src/ui/gui/artwork/{mimetypes/24x24 => 24x24/mimetypes}/application-x-spss-por.svg (100%) rename src/ui/gui/artwork/{mimetypes/24x24 => 24x24/mimetypes}/application-x-spss-sav.svg (100%) rename src/ui/gui/artwork/{mimetypes/24x24 => 24x24/mimetypes}/application-x-spss-sps.svg (100%) rename src/ui/gui/artwork/{mimetypes/24x24 => 24x24/mimetypes}/application-x-spss-zsav.svg (100%) rename src/ui/gui/artwork/{apps/256x256 => 256x256/apps}/pspp.svg (100%) rename src/ui/gui/artwork/{mimetypes/256x256 => 256x256/mimetypes}/application-x-spss-por.svg (100%) rename src/ui/gui/artwork/{mimetypes/256x256 => 256x256/mimetypes}/application-x-spss-sav.svg (100%) rename src/ui/gui/artwork/{mimetypes/256x256 => 256x256/mimetypes}/application-x-spss-sps.svg (100%) rename src/ui/gui/artwork/{mimetypes/256x256 => 256x256/mimetypes}/application-x-spss-zsav.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/data-select-cases.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/data-split-file.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/data-weight-cases.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-copy.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-cut.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-find.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-go-to-case.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-go-to-variable.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-insert-case.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-insert-variable.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-paste.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-redo.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-select-all.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/edit-undo.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/file-export-data.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/file-open-data.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/file-print.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/file-save-data.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/run-all.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/transform-compute.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/utilities-variables.svg (100%) rename src/ui/gui/artwork/{actions/32x32 => 32x32/actions}/view-value-labels.svg (100%) rename src/ui/gui/artwork/{apps/32x32 => 32x32/apps}/pspp.svg (100%) rename src/ui/gui/artwork/{mimetypes/32x32 => 32x32/mimetypes}/application-x-spss-por.svg (100%) rename src/ui/gui/artwork/{mimetypes/32x32 => 32x32/mimetypes}/application-x-spss-sav.svg (100%) rename src/ui/gui/artwork/{mimetypes/32x32 => 32x32/mimetypes}/application-x-spss-sps.svg (100%) rename src/ui/gui/artwork/{mimetypes/32x32 => 32x32/mimetypes}/application-x-spss-zsav.svg (100%) rename src/ui/gui/artwork/{apps/48x48 => 48x48/apps}/pspp.svg (100%) rename src/ui/gui/artwork/{mimetypes/48x48 => 48x48/mimetypes}/application-x-spss-por.svg (100%) rename src/ui/gui/artwork/{mimetypes/48x48 => 48x48/mimetypes}/application-x-spss-sav.svg (100%) rename src/ui/gui/artwork/{mimetypes/48x48 => 48x48/mimetypes}/application-x-spss-sps.svg (100%) rename src/ui/gui/artwork/{mimetypes/48x48 => 48x48/mimetypes}/application-x-spss-zsav.svg (100%) delete mode 100644 src/ui/gui/artwork/actions/.empty delete mode 100644 src/ui/gui/artwork/apps/scalable/.empty rename src/ui/gui/artwork/{apps/scalable => scalable/apps}/pspp.svg (100%) delete mode 100644 src/ui/gui/data-sheet.ui delete mode 100644 src/ui/gui/icons/.gitignore delete mode 100644 src/ui/gui/icons/icon-names.h delete mode 100644 src/ui/gui/var-sheet.ui delete mode 100644 src/ui/terminal/.gitignore delete mode 100644 tests/.gitignore delete mode 100644 tests/formats/.gitignore delete mode 100644 tests/libpspp/.gitignore diff --git a/.gitignore b/.gitignore index 038b215633..1f487851c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,68 +1,52 @@ ChangeLog -/Makefile -/Makefile.in -/gl/Makefile -/gl/Makefile.in +Makefile.in aclocal.m4 -autom4te.cache -compile -config.guess -config.h +autom4te.cache/ +build-aux/ar-lib +build-aux/compile +build-aux/config.guess +build-aux/config.libpath +build-aux/config.rpath +build-aux/config.sub +build-aux/depcomp +build-aux/gitlog-to-changelog +build-aux/install-reloc +build-aux/install-sh +build-aux/ltmain.sh +build-aux/mdate-sh +build-aux/missing +build-aux/reloc-ldflags +build-aux/snippet/ config.h.in -config.libpath -config.log -config.rpath -config.status -config.sub +config.h.in~ configure -depcomp -gl -install-reloc -install-sh -intl -link-warning.h -ltmain.sh -m4 -mdate-sh -missing -mkinstalldirs -patches -potfiles.tmp -pref.h -reloc-ldflags -stamp-h1 -gitlog-to-changelog -*~ -*.o -*.lo -*.a -*.dirstamp -*.deps -*.la -*.libs -/arg-nonnull.h -/c++defs.h -/package.m4 -/unused-parameter.h -/warn-on-use.h -*-test -po/*.gmo -utilities/pspp-convert -utilities/pspp-dump-sav -perl-module/Makefile -perl-module/PSPP-Perl-*.tar.gz -perl-module/PSPP.bs -perl-module/PSPP.c -perl-module/blib/ -perl-module/const-c.inc -perl-module/const-xs.inc -perl-module/lib/PSPP.pm -perl-module/pm_to_blib -perl-module/pspp-module-config -tests/testsuite.dir/ -tests/testsuite.log -tests/atconfig -tests/atlocal -tests/data/inexactify -tests/data/sack -src/ui/gui/include/gtk/gtk.h +doc/help-pages-list +doc/ni.texi +doc/pspp-dev.info +doc/pspp.info +doc/pspp.info-1 +doc/pspp.info-2 +doc/pspp.xml +doc/stamp-1 +doc/stamp-vti +doc/tut.texi +doc/version-dev.texi +doc/version.texi +gl/ +m4/ +package.m4 +src/ui/gui/artwork/splash-r.svg +src/ui/gui/artwork/splash-t.svg +src/ui/gui/icons/16x16/ +src/ui/gui/icons/22x22/ +src/ui/gui/icons/24x24/ +src/ui/gui/icons/256x256/ +src/ui/gui/icons/32x32/ +src/ui/gui/icons/48x48/ +src/ui/gui/icons/manifest +src/ui/gui/icons/scalable/ +src/ui/gui/icons/splash-r.png +src/ui/gui/icons/splash-t.png +src/ui/gui/resources.xml +tests/testsuite +tests/testsuite.at diff --git a/INSTALL b/INSTALL index 5e486ebc87..c0a15fdff2 100644 --- a/INSTALL +++ b/INSTALL @@ -87,7 +87,7 @@ use the GUI, you must run `configure' with --without-gui. 0.18 and 0.19 have a bug that will prevent library detection, but other versions should be fine. - * GTK+ (http://www.gtk.org/), version 3.4.0 or later. + * GTK+ (http://www.gtk.org/), version 3.14.5 or later. * GtkSourceView (http://projects.gnome.org/gtksourceview/) version 3.4.0 or later. diff --git a/NEWS b/NEWS index 388d92aece..0b87edb31a 100644 --- a/NEWS +++ b/NEWS @@ -4,9 +4,9 @@ See the end for copying conditions. Please send PSPP bug reports to bug-gnu-pspp@gnu.org. -Changes from 0.10.2 to 0.10.3: +Changes from 0.10.2 to 0.10.4: - * No changes yet. + * Updated to Gtk+3.14.5 Changes from 0.10.1 to 0.10.2: diff --git a/Smake b/Smake index 5a11401aa9..99cde1e742 100644 --- a/Smake +++ b/Smake @@ -124,64 +124,64 @@ GNULIB_MODULES = \ xvasprintf APP_ICONS = \ -src/ui/gui/icons/apps/32x32/pspp.png \ -src/ui/gui/icons/apps/22x22/pspp.png \ -src/ui/gui/icons/apps/24x24/pspp.png \ -src/ui/gui/icons/apps/256x256/pspp.png \ -src/ui/gui/icons/apps/16x16/pspp.png \ -src/ui/gui/icons/apps/48x48/pspp.png \ -src/ui/gui/icons/apps/scalable/pspp.svg +src/ui/gui/icons/32x32/apps/pspp.png \ +src/ui/gui/icons/22x22/apps/pspp.png \ +src/ui/gui/icons/24x24/apps/pspp.png \ +src/ui/gui/icons/16x16/apps/pspp.png \ +src/ui/gui/icons/48x48/apps/pspp.png \ +src/ui/gui/icons/256x256/apps/pspp.png \ +src/ui/gui/icons/scalable/apps/pspp.svg CATEGORY_ICONS = \ -src/ui/gui/icons/categories/16x16/align-left.png \ -src/ui/gui/icons/categories/16x16/align-center.png \ -src/ui/gui/icons/categories/16x16/align-right.png \ -src/ui/gui/icons/categories/16x16/measure-scale.png \ -src/ui/gui/icons/categories/16x16/measure-ordinal.png \ -src/ui/gui/icons/categories/16x16/measure-nominal.png \ -src/ui/gui/icons/categories/16x16/measure-date-scale.png \ -src/ui/gui/icons/categories/16x16/measure-date-nominal.png \ -src/ui/gui/icons/categories/16x16/measure-date-ordinal.png \ -src/ui/gui/icons/categories/16x16/measure-time-scale.png \ -src/ui/gui/icons/categories/16x16/measure-time-nominal.png \ -src/ui/gui/icons/categories/16x16/measure-time-ordinal.png \ -src/ui/gui/icons/categories/16x16/measure-string-nominal.png \ -src/ui/gui/icons/categories/16x16/measure-string-ordinal.png \ -src/ui/gui/icons/categories/16x16/measure-currency-scale.png \ -src/ui/gui/icons/categories/16x16/measure-currency-nominal.png \ -src/ui/gui/icons/categories/16x16/measure-currency-ordinal.png \ -src/ui/gui/icons/categories/16x16/role-input.png \ -src/ui/gui/icons/categories/16x16/role-target.png \ -src/ui/gui/icons/categories/16x16/role-both.png \ -src/ui/gui/icons/categories/16x16/role-none.png \ -src/ui/gui/icons/categories/16x16/role-partition.png \ -src/ui/gui/icons/categories/16x16/role-split.png +src/ui/gui/icons/16x16/categories/align-left.png \ +src/ui/gui/icons/16x16/categories/align-center.png \ +src/ui/gui/icons/16x16/categories/align-right.png \ +src/ui/gui/icons/16x16/categories/measure-scale.png \ +src/ui/gui/icons/16x16/categories/measure-ordinal.png \ +src/ui/gui/icons/16x16/categories/measure-nominal.png \ +src/ui/gui/icons/16x16/categories/measure-date-scale.png \ +src/ui/gui/icons/16x16/categories/measure-date-nominal.png \ +src/ui/gui/icons/16x16/categories/measure-date-ordinal.png \ +src/ui/gui/icons/16x16/categories/measure-time-scale.png \ +src/ui/gui/icons/16x16/categories/measure-time-nominal.png \ +src/ui/gui/icons/16x16/categories/measure-time-ordinal.png \ +src/ui/gui/icons/16x16/categories/measure-string-nominal.png \ +src/ui/gui/icons/16x16/categories/measure-string-ordinal.png \ +src/ui/gui/icons/16x16/categories/measure-currency-scale.png \ +src/ui/gui/icons/16x16/categories/measure-currency-nominal.png \ +src/ui/gui/icons/16x16/categories/measure-currency-ordinal.png \ +src/ui/gui/icons/16x16/categories/role-input.png \ +src/ui/gui/icons/16x16/categories/role-target.png \ +src/ui/gui/icons/16x16/categories/role-both.png \ +src/ui/gui/icons/16x16/categories/role-none.png \ +src/ui/gui/icons/16x16/categories/role-partition.png \ +src/ui/gui/icons/16x16/categories/role-split.png MIMETYPE_ICONS = \ -src/ui/gui/icons/mimetypes/32x32/application-x-spss-por.png \ -src/ui/gui/icons/mimetypes/32x32/application-x-spss-sav.png \ -src/ui/gui/icons/mimetypes/32x32/application-x-spss-sps.png \ -src/ui/gui/icons/mimetypes/32x32/application-x-spss-zsav.png \ -src/ui/gui/icons/mimetypes/22x22/application-x-spss-por.png \ -src/ui/gui/icons/mimetypes/22x22/application-x-spss-sav.png \ -src/ui/gui/icons/mimetypes/22x22/application-x-spss-sps.png \ -src/ui/gui/icons/mimetypes/22x22/application-x-spss-zsav.png \ -src/ui/gui/icons/mimetypes/24x24/application-x-spss-por.png \ -src/ui/gui/icons/mimetypes/24x24/application-x-spss-sav.png \ -src/ui/gui/icons/mimetypes/24x24/application-x-spss-sps.png \ -src/ui/gui/icons/mimetypes/24x24/application-x-spss-zsav.png \ -src/ui/gui/icons/mimetypes/256x256/application-x-spss-por.png \ -src/ui/gui/icons/mimetypes/256x256/application-x-spss-sav.png \ -src/ui/gui/icons/mimetypes/256x256/application-x-spss-sps.png \ -src/ui/gui/icons/mimetypes/256x256/application-x-spss-zsav.png \ -src/ui/gui/icons/mimetypes/16x16/application-x-spss-por.png \ -src/ui/gui/icons/mimetypes/16x16/application-x-spss-sav.png \ -src/ui/gui/icons/mimetypes/16x16/application-x-spss-sps.png \ -src/ui/gui/icons/mimetypes/16x16/application-x-spss-zsav.png \ -src/ui/gui/icons/mimetypes/48x48/application-x-spss-por.png \ -src/ui/gui/icons/mimetypes/48x48/application-x-spss-sav.png \ -src/ui/gui/icons/mimetypes/48x48/application-x-spss-sps.png \ -src/ui/gui/icons/mimetypes/48x48/application-x-spss-zsav.png \ +src/ui/gui/icons/32x32/mimetypes/application-x-spss-por.png \ +src/ui/gui/icons/32x32/mimetypes/application-x-spss-sav.png \ +src/ui/gui/icons/32x32/mimetypes/application-x-spss-sps.png \ +src/ui/gui/icons/32x32/mimetypes/application-x-spss-zsav.png \ +src/ui/gui/icons/22x22/mimetypes/application-x-spss-por.png \ +src/ui/gui/icons/22x22/mimetypes/application-x-spss-sav.png \ +src/ui/gui/icons/22x22/mimetypes/application-x-spss-sps.png \ +src/ui/gui/icons/22x22/mimetypes/application-x-spss-zsav.png \ +src/ui/gui/icons/24x24/mimetypes/application-x-spss-por.png \ +src/ui/gui/icons/24x24/mimetypes/application-x-spss-sav.png \ +src/ui/gui/icons/24x24/mimetypes/application-x-spss-sps.png \ +src/ui/gui/icons/24x24/mimetypes/application-x-spss-zsav.png \ +src/ui/gui/icons/256x256/mimetypes/application-x-spss-por.png \ +src/ui/gui/icons/256x256/mimetypes/application-x-spss-sav.png \ +src/ui/gui/icons/256x256/mimetypes/application-x-spss-sps.png \ +src/ui/gui/icons/256x256/mimetypes/application-x-spss-zsav.png \ +src/ui/gui/icons/16x16/mimetypes/application-x-spss-por.png \ +src/ui/gui/icons/16x16/mimetypes/application-x-spss-sav.png \ +src/ui/gui/icons/16x16/mimetypes/application-x-spss-sps.png \ +src/ui/gui/icons/16x16/mimetypes/application-x-spss-zsav.png \ +src/ui/gui/icons/48x48/mimetypes/application-x-spss-por.png \ +src/ui/gui/icons/48x48/mimetypes/application-x-spss-sav.png \ +src/ui/gui/icons/48x48/mimetypes/application-x-spss-sps.png \ +src/ui/gui/icons/48x48/mimetypes/application-x-spss-zsav.png src/ui/gui/artwork/splash-t.svg: src/ui/gui/artwork/splash.svg @@ -196,114 +196,114 @@ MISC_ICONS = src/ui/gui/icons/splash-t.png \ ACTION_ICONS = \ -src/ui/gui/icons/actions/32x32/data-split-file.png \ -src/ui/gui/icons/actions/32x32/data-select-cases.png \ -src/ui/gui/icons/actions/32x32/data-weight-cases.png \ -src/ui/gui/icons/actions/32x32/transform-compute.png \ -src/ui/gui/icons/actions/32x32/edit-find.png \ -src/ui/gui/icons/actions/32x32/edit-go-to-case.png \ -src/ui/gui/icons/actions/32x32/edit-go-to-variable.png \ -src/ui/gui/icons/actions/32x32/edit-insert-case.png \ -src/ui/gui/icons/actions/32x32/edit-insert-variable.png \ -src/ui/gui/icons/actions/32x32/edit-cut.png \ -src/ui/gui/icons/actions/32x32/edit-copy.png \ -src/ui/gui/icons/actions/32x32/edit-paste.png \ -src/ui/gui/icons/actions/32x32/edit-undo.png \ -src/ui/gui/icons/actions/32x32/edit-redo.png \ -src/ui/gui/icons/actions/32x32/edit-select-all.png \ -src/ui/gui/icons/actions/32x32/file-open-data.png \ -src/ui/gui/icons/actions/32x32/file-save-data.png \ -src/ui/gui/icons/actions/32x32/file-export-data.png \ -src/ui/gui/icons/actions/32x32/file-print.png \ -src/ui/gui/icons/actions/32x32/view-value-labels.png \ -src/ui/gui/icons/actions/32x32/utilities-variables.png \ -src/ui/gui/icons/actions/32x32/run-all.png \ -src/ui/gui/icons/actions/24x24/data-split-file.png \ -src/ui/gui/icons/actions/24x24/data-select-cases.png \ -src/ui/gui/icons/actions/24x24/data-weight-cases.png \ -src/ui/gui/icons/actions/24x24/transform-compute.png \ -src/ui/gui/icons/actions/24x24/edit-find.png \ -src/ui/gui/icons/actions/24x24/edit-go-to-case.png \ -src/ui/gui/icons/actions/24x24/edit-go-to-variable.png \ -src/ui/gui/icons/actions/24x24/edit-insert-case.png \ -src/ui/gui/icons/actions/24x24/edit-insert-variable.png \ -src/ui/gui/icons/actions/24x24/edit-cut.png \ -src/ui/gui/icons/actions/24x24/edit-copy.png \ -src/ui/gui/icons/actions/24x24/edit-paste.png \ -src/ui/gui/icons/actions/24x24/edit-undo.png \ -src/ui/gui/icons/actions/24x24/edit-redo.png \ -src/ui/gui/icons/actions/24x24/edit-select-all.png \ -src/ui/gui/icons/actions/24x24/file-open-data.png \ -src/ui/gui/icons/actions/24x24/file-save-data.png \ -src/ui/gui/icons/actions/24x24/file-export-data.png \ -src/ui/gui/icons/actions/24x24/file-print.png \ -src/ui/gui/icons/actions/24x24/view-value-labels.png \ -src/ui/gui/icons/actions/24x24/utilities-variables.png \ -src/ui/gui/icons/actions/24x24/run-all.png \ -src/ui/gui/icons/actions/16x16/file-new-data.png \ -src/ui/gui/icons/actions/16x16/file-syntax-data.png \ -src/ui/gui/icons/actions/16x16/file-system-data.png \ -src/ui/gui/icons/actions/16x16/file-open-data.png \ -src/ui/gui/icons/actions/16x16/file-import-data.png \ -src/ui/gui/icons/actions/16x16/file-export-data.png \ -src/ui/gui/icons/actions/16x16/file-save-data.png \ -src/ui/gui/icons/actions/16x16/file-save-as.png \ -src/ui/gui/icons/actions/16x16/file-print.png \ -src/ui/gui/icons/actions/16x16/file-rename-data-set.png \ -src/ui/gui/icons/actions/16x16/file-display-information.png \ -src/ui/gui/icons/actions/16x16/display-information-working-file.png \ -src/ui/gui/icons/actions/16x16/display-information-external-file.png \ -src/ui/gui/icons/actions/16x16/file-recently-used.png \ -src/ui/gui/icons/actions/16x16/file-quit.png \ -src/ui/gui/icons/actions/16x16/file-display-information.png \ -src/ui/gui/icons/actions/16x16/edit-insert-variable.png \ -src/ui/gui/icons/actions/16x16/edit-insert-case.png \ -src/ui/gui/icons/actions/16x16/edit-go-to-variable.png \ -src/ui/gui/icons/actions/16x16/edit-go-to-case.png \ -src/ui/gui/icons/actions/16x16/edit-cut.png \ -src/ui/gui/icons/actions/16x16/edit-copy.png \ -src/ui/gui/icons/actions/16x16/edit-paste.png \ -src/ui/gui/icons/actions/16x16/edit-delete.png \ -src/ui/gui/icons/actions/16x16/edit-undo.png \ -src/ui/gui/icons/actions/16x16/edit-redo.png \ -src/ui/gui/icons/actions/16x16/edit-select-all.png \ -src/ui/gui/icons/actions/16x16/edit-clear.png \ -src/ui/gui/icons/actions/16x16/edit-find.png \ -src/ui/gui/icons/actions/16x16/view-font.png \ -src/ui/gui/icons/actions/16x16/view-value-labels.png \ -src/ui/gui/icons/actions/16x16/data-sort-cases.png \ -src/ui/gui/icons/actions/16x16/data-transpose.png \ -src/ui/gui/icons/actions/16x16/data-aggregate.png \ -src/ui/gui/icons/actions/16x16/data-split-file.png \ -src/ui/gui/icons/actions/16x16/data-select-cases.png \ -src/ui/gui/icons/actions/16x16/data-weight-cases.png \ -src/ui/gui/icons/actions/16x16/run-all.png \ -src/ui/gui/icons/actions/16x16/run-selection.png \ -src/ui/gui/icons/actions/16x16/run-current-line.png \ -src/ui/gui/icons/actions/16x16/run-to-end.png \ -src/ui/gui/icons/actions/16x16/transform-compute.png \ -src/ui/gui/icons/actions/16x16/transform-count.png \ -src/ui/gui/icons/actions/16x16/transform-rank-cases.png \ -src/ui/gui/icons/actions/16x16/transform-automatic-recode.png \ -src/ui/gui/icons/actions/16x16/transform-in-to-same-variables.png \ -src/ui/gui/icons/actions/16x16/transform-in-to-different-variables.png \ -src/ui/gui/icons/actions/16x16/transform-run-pending.png \ -src/ui/gui/icons/actions/16x16/analyze-descriptive-statistics.png \ -src/ui/gui/icons/actions/16x16/analyze-compare-means.png \ -src/ui/gui/icons/actions/16x16/analyze-univariate-analysis.png \ -src/ui/gui/icons/actions/16x16/analyze-bivariate-correlation.png \ -src/ui/gui/icons/actions/16x16/analyze-kmeans-cluster.png \ -src/ui/gui/icons/actions/16x16/analyze-factor-analysis.png \ -src/ui/gui/icons/actions/16x16/analyze-realiability.png \ -src/ui/gui/icons/actions/16x16/analyze-regression.png \ -src/ui/gui/icons/actions/16x16/analyze-non-parametric-statistics.png \ -src/ui/gui/icons/actions/16x16/analyze-roc-curve.png \ -src/ui/gui/icons/actions/16x16/utilities-variables.png \ -src/ui/gui/icons/actions/16x16/utilities-data-file-comments.png \ -src/ui/gui/icons/actions/16x16/windows-minimize-all.png \ -src/ui/gui/icons/actions/16x16/windows-split.png \ -src/ui/gui/icons/actions/16x16/help-reference-manual.png \ -src/ui/gui/icons/actions/16x16/help-about.png +src/ui/gui/icons/32x32/actions/data-split-file.png \ +src/ui/gui/icons/32x32/actions/data-select-cases.png \ +src/ui/gui/icons/32x32/actions/data-weight-cases.png \ +src/ui/gui/icons/32x32/actions/transform-compute.png \ +src/ui/gui/icons/32x32/actions/edit-find.png \ +src/ui/gui/icons/32x32/actions/edit-go-to-case.png \ +src/ui/gui/icons/32x32/actions/edit-go-to-variable.png \ +src/ui/gui/icons/32x32/actions/edit-insert-case.png \ +src/ui/gui/icons/32x32/actions/edit-insert-variable.png \ +src/ui/gui/icons/32x32/actions/edit-cut.png \ +src/ui/gui/icons/32x32/actions/edit-copy.png \ +src/ui/gui/icons/32x32/actions/edit-paste.png \ +src/ui/gui/icons/32x32/actions/edit-undo.png \ +src/ui/gui/icons/32x32/actions/edit-redo.png \ +src/ui/gui/icons/32x32/actions/edit-select-all.png \ +src/ui/gui/icons/32x32/actions/file-open-data.png \ +src/ui/gui/icons/32x32/actions/file-save-data.png \ +src/ui/gui/icons/32x32/actions/file-export-data.png \ +src/ui/gui/icons/32x32/actions/file-print.png \ +src/ui/gui/icons/32x32/actions/view-value-labels.png \ +src/ui/gui/icons/32x32/actions/utilities-variables.png \ +src/ui/gui/icons/32x32/actions/run-all.png \ +src/ui/gui/icons/24x24/actions/data-split-file.png \ +src/ui/gui/icons/24x24/actions/data-select-cases.png \ +src/ui/gui/icons/24x24/actions/data-weight-cases.png \ +src/ui/gui/icons/24x24/actions/transform-compute.png \ +src/ui/gui/icons/24x24/actions/edit-find.png \ +src/ui/gui/icons/24x24/actions/edit-go-to-case.png \ +src/ui/gui/icons/24x24/actions/edit-go-to-variable.png \ +src/ui/gui/icons/24x24/actions/edit-insert-case.png \ +src/ui/gui/icons/24x24/actions/edit-insert-variable.png \ +src/ui/gui/icons/24x24/actions/edit-cut.png \ +src/ui/gui/icons/24x24/actions/edit-copy.png \ +src/ui/gui/icons/24x24/actions/edit-paste.png \ +src/ui/gui/icons/24x24/actions/edit-undo.png \ +src/ui/gui/icons/24x24/actions/edit-redo.png \ +src/ui/gui/icons/24x24/actions/edit-select-all.png \ +src/ui/gui/icons/24x24/actions/file-open-data.png \ +src/ui/gui/icons/24x24/actions/file-save-data.png \ +src/ui/gui/icons/24x24/actions/file-export-data.png \ +src/ui/gui/icons/24x24/actions/file-print.png \ +src/ui/gui/icons/24x24/actions/view-value-labels.png \ +src/ui/gui/icons/24x24/actions/utilities-variables.png \ +src/ui/gui/icons/24x24/actions/run-all.png \ +src/ui/gui/icons/16x16/actions/file-new-data.png \ +src/ui/gui/icons/16x16/actions/file-syntax-data.png \ +src/ui/gui/icons/16x16/actions/file-system-data.png \ +src/ui/gui/icons/16x16/actions/file-open-data.png \ +src/ui/gui/icons/16x16/actions/file-import-data.png \ +src/ui/gui/icons/16x16/actions/file-export-data.png \ +src/ui/gui/icons/16x16/actions/file-save-data.png \ +src/ui/gui/icons/16x16/actions/file-save-as.png \ +src/ui/gui/icons/16x16/actions/file-print.png \ +src/ui/gui/icons/16x16/actions/file-rename-data-set.png \ +src/ui/gui/icons/16x16/actions/file-display-information.png \ +src/ui/gui/icons/16x16/actions/display-information-working-file.png \ +src/ui/gui/icons/16x16/actions/display-information-external-file.png \ +src/ui/gui/icons/16x16/actions/file-recently-used.png \ +src/ui/gui/icons/16x16/actions/file-quit.png \ +src/ui/gui/icons/16x16/actions/file-display-information.png \ +src/ui/gui/icons/16x16/actions/edit-insert-variable.png \ +src/ui/gui/icons/16x16/actions/edit-insert-case.png \ +src/ui/gui/icons/16x16/actions/edit-go-to-variable.png \ +src/ui/gui/icons/16x16/actions/edit-go-to-case.png \ +src/ui/gui/icons/16x16/actions/edit-cut.png \ +src/ui/gui/icons/16x16/actions/edit-copy.png \ +src/ui/gui/icons/16x16/actions/edit-paste.png \ +src/ui/gui/icons/16x16/actions/edit-delete.png \ +src/ui/gui/icons/16x16/actions/edit-undo.png \ +src/ui/gui/icons/16x16/actions/edit-redo.png \ +src/ui/gui/icons/16x16/actions/edit-select-all.png \ +src/ui/gui/icons/16x16/actions/edit-clear.png \ +src/ui/gui/icons/16x16/actions/edit-find.png \ +src/ui/gui/icons/16x16/actions/view-font.png \ +src/ui/gui/icons/16x16/actions/view-value-labels.png \ +src/ui/gui/icons/16x16/actions/data-sort-cases.png \ +src/ui/gui/icons/16x16/actions/data-transpose.png \ +src/ui/gui/icons/16x16/actions/data-aggregate.png \ +src/ui/gui/icons/16x16/actions/data-split-file.png \ +src/ui/gui/icons/16x16/actions/data-select-cases.png \ +src/ui/gui/icons/16x16/actions/data-weight-cases.png \ +src/ui/gui/icons/16x16/actions/run-all.png \ +src/ui/gui/icons/16x16/actions/run-selection.png \ +src/ui/gui/icons/16x16/actions/run-current-line.png \ +src/ui/gui/icons/16x16/actions/run-to-end.png \ +src/ui/gui/icons/16x16/actions/transform-compute.png \ +src/ui/gui/icons/16x16/actions/transform-count.png \ +src/ui/gui/icons/16x16/actions/transform-rank-cases.png \ +src/ui/gui/icons/16x16/actions/transform-automatic-recode.png \ +src/ui/gui/icons/16x16/actions/transform-in-to-same-variables.png \ +src/ui/gui/icons/16x16/actions/transform-in-to-different-variables.png \ +src/ui/gui/icons/16x16/actions/transform-run-pending.png \ +src/ui/gui/icons/16x16/actions/analyze-descriptive-statistics.png \ +src/ui/gui/icons/16x16/actions/analyze-compare-means.png \ +src/ui/gui/icons/16x16/actions/analyze-univariate-analysis.png \ +src/ui/gui/icons/16x16/actions/analyze-bivariate-correlation.png \ +src/ui/gui/icons/16x16/actions/analyze-kmeans-cluster.png \ +src/ui/gui/icons/16x16/actions/analyze-factor-analysis.png \ +src/ui/gui/icons/16x16/actions/analyze-reliability.png \ +src/ui/gui/icons/16x16/actions/analyze-regression.png \ +src/ui/gui/icons/16x16/actions/analyze-non-parametric-statistics.png \ +src/ui/gui/icons/16x16/actions/analyze-roc-curve.png \ +src/ui/gui/icons/16x16/actions/utilities-variables.png \ +src/ui/gui/icons/16x16/actions/utilities-data-file-comments.png \ +src/ui/gui/icons/16x16/actions/windows-minimize-all.png \ +src/ui/gui/icons/16x16/actions/windows-split.png \ +src/ui/gui/icons/16x16/actions/help-reference-manual.png \ +src/ui/gui/icons/16x16/actions/help-about.png ICONS=$(CATEGORY_ICONS) $(ACTION_ICONS) $(MIMETYPE_ICONS) $(APP_ICONS) $(MISC_ICONS) @@ -311,32 +311,38 @@ ICONS=$(CATEGORY_ICONS) $(ACTION_ICONS) $(MIMETYPE_ICONS) $(APP_ICONS) $(MISC_IC everything: prep_ph icons $(MAKE) -f Smake Makefile.in configure -icons: $(ICONS) src/ui/gui/icons/icon-names.c - -src/ui/gui/icons/icon-names.c: $(MAKEFILE_LIST) - $(RM) -f $@ - printf '/* This is a generated file. Do not edit. */\n' >> $@ - printf '#include "icon-names.h"\n\n' >> $@ - build-aux/icon-list action actions $(ACTION_ICONS) >> $@ - build-aux/icon-list category categories $(CATEGORY_ICONS) >> $@ +icons: $(ICONS) src/ui/gui/icons/manifest: $(MAKEFILE_LIST) $(RM) $@ printf '# This is a generated file. Do not edit.\n' >> $@ printf 'icons =' >> $@ for i in $(ICONS); do \ - printf ' \\\n\t '$$i >> $@; \ + printf ' \\\n\t '$$i >> $@; \ done echo >> $@ echo >> $@ printf 'icon_srcs = ' >> $@ for i in $(ICONS); do \ - printf ' \\\n\t ' >> $@ ;\ - printf $$i | awk '{ gsub(".png",".svg")gsub("icons","artwork");printf $$0}' >> $@ ; \ + printf ' \\\n\t ' >> $@ ;\ + printf $$i | awk '{ gsub(".png",".svg")gsub("icons","artwork");printf $$0}' >> $@ ; \ done echo ' ' >> $@ echo >> $@ + +src/ui/gui/resources.xml: $(ICONS) + printf '\n' > $@ + printf '\n' >> $@ + printf ' \n' >> $@ + for x in $^; do \ + z=`echo "$$x" | sed -e 's%src/ui/gui/%%'` ; \ + printf " $$z\n" >> $@ ; \ + done + printf ' \n' >> $@ + printf '\n' >> $@ + + .PHONY: prep_ph prep_ph: test -e ChangeLog || touch ChangeLog @@ -365,7 +371,7 @@ configure: configure.ac aclocal.m4 config.h.in: configure.ac autoheader -Makefile.in: Makefile.am config.h.in aclocal.m4 src/ui/gui/icons/manifest +Makefile.in: Makefile.am config.h.in aclocal.m4 src/ui/gui/resources.xml src/ui/gui/icons/manifest automake --add-missing --copy --no-force --include-deps diff --git a/build-aux/.gitignore b/build-aux/.gitignore deleted file mode 100644 index 5a3003390b..0000000000 --- a/build-aux/.gitignore +++ /dev/null @@ -1,9 +0,0 @@ -/arg-nonnull.h -/c++defs.h -/config.libpath -/config.rpath -/gitlog-to-changelog -/install-reloc -/reloc-ldflags -/unused-parameter.h -/warn-on-use.h diff --git a/build-aux/snippet/.gitignore b/build-aux/snippet/.gitignore deleted file mode 100644 index 88b6db4b88..0000000000 --- a/build-aux/snippet/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -_Noreturn.h -arg-nonnull.h -c++defs.h -unused-parameter.h -warn-on-use.h diff --git a/config/.gitignore b/config/.gitignore deleted file mode 100644 index 282522db03..0000000000 --- a/config/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/configure.ac b/configure.ac index 6c2c26f8bb..b2009b5a0c 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl Initialize. AC_PREREQ(2.63) -AC_INIT([GNU PSPP], [0.10.3], [bug-gnu-pspp@gnu.org], [pspp]) +AC_INIT([GNU PSPP], [0.10.4], [bug-gnu-pspp@gnu.org], [pspp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_TESTDIR([tests]) @@ -84,8 +84,8 @@ if test "$with_cairo" != no && test "$with_gui" != "no"; then PKG_CHECK_MODULES([GTHREAD], [gthread-2.0], [], [PSPP_REQUIRED_PREREQ([gthread 2.0 (or use --without-gui)])]) - PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.4.2], [], - [PSPP_REQUIRED_PREREQ([gtk+ 3.0 version 3.4.2 or later (or use --without-gui)])]) + PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= 3.14.5], [], + [PSPP_REQUIRED_PREREQ([gtk+ 3.0 version 3.14.5 or later (or use --without-gui)])]) PKG_CHECK_MODULES([GTKSOURCEVIEW], [gtksourceview-3.0 >= 3.4.2], [], [PSPP_REQUIRED_PREREQ([gtksourceview 3.0 version 3.4.2 or later (or use --without-gui)])]) @@ -99,6 +99,11 @@ if test "$with_cairo" != no && test "$with_gui" != "no"; then PSPP_REQUIRED_PREREQ([glib-genmarshal (or use --without-gui)]) fi + AC_CHECK_PROGS([GLIB_COMPILE_RESOURCES], [glib-compile-resources]) + if test "x$GLIB_COMPILE_RESOURCES" = x; then + PSPP_REQUIRED_PREREQ([glib-compile-resources (or use --without-gui)]) + fi + fi gl_NEXT_HEADERS([gtk/gtk.h]) diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 9ee870e042..0000000000 --- a/doc/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -Makefile -Makefile.in -ni.texi -pspp-dev.info -pspp.aux -pspp.cp -pspp.cps -pspp.fn -pspp.fns -pspp.info* -pspp.ky -pspp.log -pspp.pg -pspp.toc -pspp.tp -pspp.vr -pspp.vrs -pspp.xml -stamp-1 -stamp-vti -tut.texi -version-dev.texi -version.texi diff --git a/examples/.gitignore b/examples/.gitignore deleted file mode 100644 index 282522db03..0000000000 --- a/examples/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/lib/.gitignore b/lib/.gitignore deleted file mode 100644 index 282522db03..0000000000 --- a/lib/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/lib/linreg/.gitignore b/lib/linreg/.gitignore deleted file mode 100644 index 282522db03..0000000000 --- a/lib/linreg/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/po/.gitignore b/po/.gitignore deleted file mode 100644 index e9b69f8b18..0000000000 --- a/po/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -Makefile -Makevars.template -POTFILES -POTFILES.in -Rules-quot -boldquot.sed -de.gmo -en@boldquot.header -en@quot.header -en_GB.gmo -insert-header.sin -quot.sed -remove-potcdate.sin -stamp-po diff --git a/po/automake.mk b/po/automake.mk index 20540d06b5..6c400624dd 100644 --- a/po/automake.mk +++ b/po/automake.mk @@ -49,7 +49,9 @@ $(POFILES): $(POTFILE) touch $@,tmp ; \ msgcat --use-first $(top_srcdir)/$@,aux $@,tmp -o $@,tmp; \ fi ; - $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: /d' $@,tmp > $@ + $(AM_V_at)$(SED) -e '/^"POT-Creation-Date: /d' $@,tmp > $@,tmp2 + $(RM) $@,tmp + mv $@,tmp2 $@ SUFFIXES += .po .gmo .po.gmo: diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 282522db03..0000000000 --- a/src/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile -Makefile.in diff --git a/src/language/expressions/.gitignore b/src/language/expressions/.gitignore deleted file mode 100644 index d84d1242ee..0000000000 --- a/src/language/expressions/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -Makefile -Makefile.in -evaluate.h -evaluate.inc -operations.h -optimize.inc -parse.inc diff --git a/src/language/lexer/.gitignore b/src/language/lexer/.gitignore deleted file mode 100644 index 8101ae3e0d..0000000000 --- a/src/language/lexer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -q2c diff --git a/src/language/stats/.gitignore b/src/language/stats/.gitignore deleted file mode 100644 index 48d8eaa3ca..0000000000 --- a/src/language/stats/.gitignore +++ /dev/null @@ -1 +0,0 @@ -crosstabs.c diff --git a/src/language/tests/.gitignore b/src/language/tests/.gitignore deleted file mode 100644 index 61e8b4e141..0000000000 --- a/src/language/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -check-model.c diff --git a/src/language/utilities/.gitignore b/src/language/utilities/.gitignore deleted file mode 100644 index 0ce9268fdf..0000000000 --- a/src/language/utilities/.gitignore +++ /dev/null @@ -1 +0,0 @@ -set.c diff --git a/src/libpspp/.gitignore b/src/libpspp/.gitignore deleted file mode 100644 index 17435c8754..0000000000 --- a/src/libpspp/.gitignore +++ /dev/null @@ -1 +0,0 @@ -version.c diff --git a/src/ui/gui/.gitignore b/src/ui/gui/.gitignore deleted file mode 100644 index 5ecf6695b3..0000000000 --- a/src/ui/gui/.gitignore +++ /dev/null @@ -1 +0,0 @@ -psppire diff --git a/src/ui/gui/artwork/.gitignore b/src/ui/gui/artwork/.gitignore deleted file mode 100644 index ada1dfaa18..0000000000 --- a/src/ui/gui/artwork/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -splash-r.svg -splash-t.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-bivariate-correlation.svg b/src/ui/gui/artwork/16x16/actions/analyze-bivariate-correlation.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-bivariate-correlation.svg rename to src/ui/gui/artwork/16x16/actions/analyze-bivariate-correlation.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-compare-means.svg b/src/ui/gui/artwork/16x16/actions/analyze-compare-means.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-compare-means.svg rename to src/ui/gui/artwork/16x16/actions/analyze-compare-means.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-descriptive-statistics.svg b/src/ui/gui/artwork/16x16/actions/analyze-descriptive-statistics.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-descriptive-statistics.svg rename to src/ui/gui/artwork/16x16/actions/analyze-descriptive-statistics.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-factor-analysis.svg b/src/ui/gui/artwork/16x16/actions/analyze-factor-analysis.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-factor-analysis.svg rename to src/ui/gui/artwork/16x16/actions/analyze-factor-analysis.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-kmeans-cluster.svg b/src/ui/gui/artwork/16x16/actions/analyze-kmeans-cluster.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-kmeans-cluster.svg rename to src/ui/gui/artwork/16x16/actions/analyze-kmeans-cluster.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-non-parametric-statistics.svg b/src/ui/gui/artwork/16x16/actions/analyze-non-parametric-statistics.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-non-parametric-statistics.svg rename to src/ui/gui/artwork/16x16/actions/analyze-non-parametric-statistics.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-regression.svg b/src/ui/gui/artwork/16x16/actions/analyze-regression.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-regression.svg rename to src/ui/gui/artwork/16x16/actions/analyze-regression.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-realiability.svg b/src/ui/gui/artwork/16x16/actions/analyze-reliability.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-realiability.svg rename to src/ui/gui/artwork/16x16/actions/analyze-reliability.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-roc-curve.svg b/src/ui/gui/artwork/16x16/actions/analyze-roc-curve.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-roc-curve.svg rename to src/ui/gui/artwork/16x16/actions/analyze-roc-curve.svg diff --git a/src/ui/gui/artwork/actions/16x16/analyze-univariate-analysis.svg b/src/ui/gui/artwork/16x16/actions/analyze-univariate-analysis.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/analyze-univariate-analysis.svg rename to src/ui/gui/artwork/16x16/actions/analyze-univariate-analysis.svg diff --git a/src/ui/gui/artwork/actions/16x16/data-aggregate.svg b/src/ui/gui/artwork/16x16/actions/data-aggregate.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/data-aggregate.svg rename to src/ui/gui/artwork/16x16/actions/data-aggregate.svg diff --git a/src/ui/gui/artwork/actions/16x16/data-select-cases.svg b/src/ui/gui/artwork/16x16/actions/data-select-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/data-select-cases.svg rename to src/ui/gui/artwork/16x16/actions/data-select-cases.svg diff --git a/src/ui/gui/artwork/actions/16x16/data-sort-cases.svg b/src/ui/gui/artwork/16x16/actions/data-sort-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/data-sort-cases.svg rename to src/ui/gui/artwork/16x16/actions/data-sort-cases.svg diff --git a/src/ui/gui/artwork/actions/16x16/data-split-file.svg b/src/ui/gui/artwork/16x16/actions/data-split-file.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/data-split-file.svg rename to src/ui/gui/artwork/16x16/actions/data-split-file.svg diff --git a/src/ui/gui/artwork/actions/16x16/data-transpose.svg b/src/ui/gui/artwork/16x16/actions/data-transpose.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/data-transpose.svg rename to src/ui/gui/artwork/16x16/actions/data-transpose.svg diff --git a/src/ui/gui/artwork/actions/16x16/data-weight-cases.svg b/src/ui/gui/artwork/16x16/actions/data-weight-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/data-weight-cases.svg rename to src/ui/gui/artwork/16x16/actions/data-weight-cases.svg diff --git a/src/ui/gui/artwork/actions/16x16/display-information-external-file.svg b/src/ui/gui/artwork/16x16/actions/display-information-external-file.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/display-information-external-file.svg rename to src/ui/gui/artwork/16x16/actions/display-information-external-file.svg diff --git a/src/ui/gui/artwork/actions/16x16/display-information-working-file.svg b/src/ui/gui/artwork/16x16/actions/display-information-working-file.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/display-information-working-file.svg rename to src/ui/gui/artwork/16x16/actions/display-information-working-file.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-clear.svg b/src/ui/gui/artwork/16x16/actions/edit-clear.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-clear.svg rename to src/ui/gui/artwork/16x16/actions/edit-clear.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-copy.svg b/src/ui/gui/artwork/16x16/actions/edit-copy.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-copy.svg rename to src/ui/gui/artwork/16x16/actions/edit-copy.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-cut.svg b/src/ui/gui/artwork/16x16/actions/edit-cut.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-cut.svg rename to src/ui/gui/artwork/16x16/actions/edit-cut.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-delete.svg b/src/ui/gui/artwork/16x16/actions/edit-delete.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-delete.svg rename to src/ui/gui/artwork/16x16/actions/edit-delete.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-find.svg b/src/ui/gui/artwork/16x16/actions/edit-find.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-find.svg rename to src/ui/gui/artwork/16x16/actions/edit-find.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-go-to-case.svg b/src/ui/gui/artwork/16x16/actions/edit-go-to-case.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-go-to-case.svg rename to src/ui/gui/artwork/16x16/actions/edit-go-to-case.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-go-to-variable.svg b/src/ui/gui/artwork/16x16/actions/edit-go-to-variable.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-go-to-variable.svg rename to src/ui/gui/artwork/16x16/actions/edit-go-to-variable.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-insert-case.svg b/src/ui/gui/artwork/16x16/actions/edit-insert-case.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-insert-case.svg rename to src/ui/gui/artwork/16x16/actions/edit-insert-case.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-insert-variable.svg b/src/ui/gui/artwork/16x16/actions/edit-insert-variable.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-insert-variable.svg rename to src/ui/gui/artwork/16x16/actions/edit-insert-variable.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-paste.svg b/src/ui/gui/artwork/16x16/actions/edit-paste.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-paste.svg rename to src/ui/gui/artwork/16x16/actions/edit-paste.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-redo.svg b/src/ui/gui/artwork/16x16/actions/edit-redo.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-redo.svg rename to src/ui/gui/artwork/16x16/actions/edit-redo.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-select-all.svg b/src/ui/gui/artwork/16x16/actions/edit-select-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-select-all.svg rename to src/ui/gui/artwork/16x16/actions/edit-select-all.svg diff --git a/src/ui/gui/artwork/actions/16x16/edit-undo.svg b/src/ui/gui/artwork/16x16/actions/edit-undo.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/edit-undo.svg rename to src/ui/gui/artwork/16x16/actions/edit-undo.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-display-information.svg b/src/ui/gui/artwork/16x16/actions/file-display-information.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-display-information.svg rename to src/ui/gui/artwork/16x16/actions/file-display-information.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-export-data.svg b/src/ui/gui/artwork/16x16/actions/file-export-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-export-data.svg rename to src/ui/gui/artwork/16x16/actions/file-export-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-import-data.svg b/src/ui/gui/artwork/16x16/actions/file-import-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-import-data.svg rename to src/ui/gui/artwork/16x16/actions/file-import-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-new-data.svg b/src/ui/gui/artwork/16x16/actions/file-new-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-new-data.svg rename to src/ui/gui/artwork/16x16/actions/file-new-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-open-data.svg b/src/ui/gui/artwork/16x16/actions/file-open-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-open-data.svg rename to src/ui/gui/artwork/16x16/actions/file-open-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-print.svg b/src/ui/gui/artwork/16x16/actions/file-print.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-print.svg rename to src/ui/gui/artwork/16x16/actions/file-print.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-quit.svg b/src/ui/gui/artwork/16x16/actions/file-quit.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-quit.svg rename to src/ui/gui/artwork/16x16/actions/file-quit.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-recently-used.svg b/src/ui/gui/artwork/16x16/actions/file-recently-used.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-recently-used.svg rename to src/ui/gui/artwork/16x16/actions/file-recently-used.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-rename-data-set.svg b/src/ui/gui/artwork/16x16/actions/file-rename-data-set.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-rename-data-set.svg rename to src/ui/gui/artwork/16x16/actions/file-rename-data-set.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-save-as.svg b/src/ui/gui/artwork/16x16/actions/file-save-as.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-save-as.svg rename to src/ui/gui/artwork/16x16/actions/file-save-as.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-save-data.svg b/src/ui/gui/artwork/16x16/actions/file-save-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-save-data.svg rename to src/ui/gui/artwork/16x16/actions/file-save-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-syntax-data.svg b/src/ui/gui/artwork/16x16/actions/file-syntax-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-syntax-data.svg rename to src/ui/gui/artwork/16x16/actions/file-syntax-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/file-system-data.svg b/src/ui/gui/artwork/16x16/actions/file-system-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/file-system-data.svg rename to src/ui/gui/artwork/16x16/actions/file-system-data.svg diff --git a/src/ui/gui/artwork/actions/16x16/help-about.svg b/src/ui/gui/artwork/16x16/actions/help-about.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/help-about.svg rename to src/ui/gui/artwork/16x16/actions/help-about.svg diff --git a/src/ui/gui/artwork/actions/16x16/help-reference-manual.svg b/src/ui/gui/artwork/16x16/actions/help-reference-manual.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/help-reference-manual.svg rename to src/ui/gui/artwork/16x16/actions/help-reference-manual.svg diff --git a/src/ui/gui/artwork/actions/16x16/run-all.svg b/src/ui/gui/artwork/16x16/actions/run-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/run-all.svg rename to src/ui/gui/artwork/16x16/actions/run-all.svg diff --git a/src/ui/gui/artwork/actions/16x16/run-current-line.svg b/src/ui/gui/artwork/16x16/actions/run-current-line.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/run-current-line.svg rename to src/ui/gui/artwork/16x16/actions/run-current-line.svg diff --git a/src/ui/gui/artwork/actions/16x16/run-selection.svg b/src/ui/gui/artwork/16x16/actions/run-selection.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/run-selection.svg rename to src/ui/gui/artwork/16x16/actions/run-selection.svg diff --git a/src/ui/gui/artwork/actions/16x16/run-to-end.svg b/src/ui/gui/artwork/16x16/actions/run-to-end.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/run-to-end.svg rename to src/ui/gui/artwork/16x16/actions/run-to-end.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-automatic-recode.svg b/src/ui/gui/artwork/16x16/actions/transform-automatic-recode.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-automatic-recode.svg rename to src/ui/gui/artwork/16x16/actions/transform-automatic-recode.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-compute.svg b/src/ui/gui/artwork/16x16/actions/transform-compute.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-compute.svg rename to src/ui/gui/artwork/16x16/actions/transform-compute.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-count.svg b/src/ui/gui/artwork/16x16/actions/transform-count.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-count.svg rename to src/ui/gui/artwork/16x16/actions/transform-count.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-in-to-different-variables.svg b/src/ui/gui/artwork/16x16/actions/transform-in-to-different-variables.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-in-to-different-variables.svg rename to src/ui/gui/artwork/16x16/actions/transform-in-to-different-variables.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-in-to-same-variables.svg b/src/ui/gui/artwork/16x16/actions/transform-in-to-same-variables.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-in-to-same-variables.svg rename to src/ui/gui/artwork/16x16/actions/transform-in-to-same-variables.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-rank-cases.svg b/src/ui/gui/artwork/16x16/actions/transform-rank-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-rank-cases.svg rename to src/ui/gui/artwork/16x16/actions/transform-rank-cases.svg diff --git a/src/ui/gui/artwork/actions/16x16/transform-run-pending.svg b/src/ui/gui/artwork/16x16/actions/transform-run-pending.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/transform-run-pending.svg rename to src/ui/gui/artwork/16x16/actions/transform-run-pending.svg diff --git a/src/ui/gui/artwork/actions/16x16/utilities-data-file-comments.svg b/src/ui/gui/artwork/16x16/actions/utilities-data-file-comments.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/utilities-data-file-comments.svg rename to src/ui/gui/artwork/16x16/actions/utilities-data-file-comments.svg diff --git a/src/ui/gui/artwork/actions/16x16/utilities-variables.svg b/src/ui/gui/artwork/16x16/actions/utilities-variables.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/utilities-variables.svg rename to src/ui/gui/artwork/16x16/actions/utilities-variables.svg diff --git a/src/ui/gui/artwork/actions/16x16/view-font.svg b/src/ui/gui/artwork/16x16/actions/view-font.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/view-font.svg rename to src/ui/gui/artwork/16x16/actions/view-font.svg diff --git a/src/ui/gui/artwork/actions/16x16/view-value-labels.svg b/src/ui/gui/artwork/16x16/actions/view-value-labels.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/view-value-labels.svg rename to src/ui/gui/artwork/16x16/actions/view-value-labels.svg diff --git a/src/ui/gui/artwork/actions/16x16/windows-minimize-all.svg b/src/ui/gui/artwork/16x16/actions/windows-minimize-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/windows-minimize-all.svg rename to src/ui/gui/artwork/16x16/actions/windows-minimize-all.svg diff --git a/src/ui/gui/artwork/actions/16x16/windows-split.svg b/src/ui/gui/artwork/16x16/actions/windows-split.svg similarity index 100% rename from src/ui/gui/artwork/actions/16x16/windows-split.svg rename to src/ui/gui/artwork/16x16/actions/windows-split.svg diff --git a/src/ui/gui/artwork/apps/16x16/pspp.svg b/src/ui/gui/artwork/16x16/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/16x16/pspp.svg rename to src/ui/gui/artwork/16x16/apps/pspp.svg diff --git a/src/ui/gui/artwork/categories/16x16/align-center.svg b/src/ui/gui/artwork/16x16/categories/align-center.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/align-center.svg rename to src/ui/gui/artwork/16x16/categories/align-center.svg diff --git a/src/ui/gui/artwork/categories/16x16/align-left.svg b/src/ui/gui/artwork/16x16/categories/align-left.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/align-left.svg rename to src/ui/gui/artwork/16x16/categories/align-left.svg diff --git a/src/ui/gui/artwork/categories/16x16/align-right.svg b/src/ui/gui/artwork/16x16/categories/align-right.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/align-right.svg rename to src/ui/gui/artwork/16x16/categories/align-right.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-currency-nominal.svg b/src/ui/gui/artwork/16x16/categories/measure-currency-nominal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-currency-nominal.svg rename to src/ui/gui/artwork/16x16/categories/measure-currency-nominal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-currency-ordinal.svg b/src/ui/gui/artwork/16x16/categories/measure-currency-ordinal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-currency-ordinal.svg rename to src/ui/gui/artwork/16x16/categories/measure-currency-ordinal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-currency-scale.svg b/src/ui/gui/artwork/16x16/categories/measure-currency-scale.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-currency-scale.svg rename to src/ui/gui/artwork/16x16/categories/measure-currency-scale.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-date-nominal.svg b/src/ui/gui/artwork/16x16/categories/measure-date-nominal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-date-nominal.svg rename to src/ui/gui/artwork/16x16/categories/measure-date-nominal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-date-ordinal.svg b/src/ui/gui/artwork/16x16/categories/measure-date-ordinal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-date-ordinal.svg rename to src/ui/gui/artwork/16x16/categories/measure-date-ordinal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-date-scale.svg b/src/ui/gui/artwork/16x16/categories/measure-date-scale.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-date-scale.svg rename to src/ui/gui/artwork/16x16/categories/measure-date-scale.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-nominal.svg b/src/ui/gui/artwork/16x16/categories/measure-nominal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-nominal.svg rename to src/ui/gui/artwork/16x16/categories/measure-nominal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-ordinal.svg b/src/ui/gui/artwork/16x16/categories/measure-ordinal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-ordinal.svg rename to src/ui/gui/artwork/16x16/categories/measure-ordinal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-scale.svg b/src/ui/gui/artwork/16x16/categories/measure-scale.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-scale.svg rename to src/ui/gui/artwork/16x16/categories/measure-scale.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-string-nominal.svg b/src/ui/gui/artwork/16x16/categories/measure-string-nominal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-string-nominal.svg rename to src/ui/gui/artwork/16x16/categories/measure-string-nominal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-string-ordinal.svg b/src/ui/gui/artwork/16x16/categories/measure-string-ordinal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-string-ordinal.svg rename to src/ui/gui/artwork/16x16/categories/measure-string-ordinal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-time-nominal.svg b/src/ui/gui/artwork/16x16/categories/measure-time-nominal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-time-nominal.svg rename to src/ui/gui/artwork/16x16/categories/measure-time-nominal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-time-ordinal.svg b/src/ui/gui/artwork/16x16/categories/measure-time-ordinal.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-time-ordinal.svg rename to src/ui/gui/artwork/16x16/categories/measure-time-ordinal.svg diff --git a/src/ui/gui/artwork/categories/16x16/measure-time-scale.svg b/src/ui/gui/artwork/16x16/categories/measure-time-scale.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/measure-time-scale.svg rename to src/ui/gui/artwork/16x16/categories/measure-time-scale.svg diff --git a/src/ui/gui/artwork/categories/16x16/role-both.svg b/src/ui/gui/artwork/16x16/categories/role-both.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/role-both.svg rename to src/ui/gui/artwork/16x16/categories/role-both.svg diff --git a/src/ui/gui/artwork/categories/16x16/role-input.svg b/src/ui/gui/artwork/16x16/categories/role-input.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/role-input.svg rename to src/ui/gui/artwork/16x16/categories/role-input.svg diff --git a/src/ui/gui/artwork/categories/16x16/role-none.svg b/src/ui/gui/artwork/16x16/categories/role-none.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/role-none.svg rename to src/ui/gui/artwork/16x16/categories/role-none.svg diff --git a/src/ui/gui/artwork/categories/16x16/role-partition.svg b/src/ui/gui/artwork/16x16/categories/role-partition.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/role-partition.svg rename to src/ui/gui/artwork/16x16/categories/role-partition.svg diff --git a/src/ui/gui/artwork/categories/16x16/role-split.svg b/src/ui/gui/artwork/16x16/categories/role-split.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/role-split.svg rename to src/ui/gui/artwork/16x16/categories/role-split.svg diff --git a/src/ui/gui/artwork/categories/16x16/role-target.svg b/src/ui/gui/artwork/16x16/categories/role-target.svg similarity index 100% rename from src/ui/gui/artwork/categories/16x16/role-target.svg rename to src/ui/gui/artwork/16x16/categories/role-target.svg diff --git a/src/ui/gui/artwork/mimetypes/16x16/application-x-spss-por.svg b/src/ui/gui/artwork/16x16/mimetypes/application-x-spss-por.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/16x16/application-x-spss-por.svg rename to src/ui/gui/artwork/16x16/mimetypes/application-x-spss-por.svg diff --git a/src/ui/gui/artwork/mimetypes/16x16/application-x-spss-sav.svg b/src/ui/gui/artwork/16x16/mimetypes/application-x-spss-sav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/16x16/application-x-spss-sav.svg rename to src/ui/gui/artwork/16x16/mimetypes/application-x-spss-sav.svg diff --git a/src/ui/gui/artwork/mimetypes/16x16/application-x-spss-sps.svg b/src/ui/gui/artwork/16x16/mimetypes/application-x-spss-sps.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/16x16/application-x-spss-sps.svg rename to src/ui/gui/artwork/16x16/mimetypes/application-x-spss-sps.svg diff --git a/src/ui/gui/artwork/mimetypes/16x16/application-x-spss-zsav.svg b/src/ui/gui/artwork/16x16/mimetypes/application-x-spss-zsav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/16x16/application-x-spss-zsav.svg rename to src/ui/gui/artwork/16x16/mimetypes/application-x-spss-zsav.svg diff --git a/src/ui/gui/artwork/apps/22x22/pspp.svg b/src/ui/gui/artwork/22x22/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/22x22/pspp.svg rename to src/ui/gui/artwork/22x22/apps/pspp.svg diff --git a/src/ui/gui/artwork/mimetypes/22x22/application-x-spss-por.svg b/src/ui/gui/artwork/22x22/mimetypes/application-x-spss-por.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/22x22/application-x-spss-por.svg rename to src/ui/gui/artwork/22x22/mimetypes/application-x-spss-por.svg diff --git a/src/ui/gui/artwork/mimetypes/22x22/application-x-spss-sav.svg b/src/ui/gui/artwork/22x22/mimetypes/application-x-spss-sav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/22x22/application-x-spss-sav.svg rename to src/ui/gui/artwork/22x22/mimetypes/application-x-spss-sav.svg diff --git a/src/ui/gui/artwork/mimetypes/22x22/application-x-spss-sps.svg b/src/ui/gui/artwork/22x22/mimetypes/application-x-spss-sps.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/22x22/application-x-spss-sps.svg rename to src/ui/gui/artwork/22x22/mimetypes/application-x-spss-sps.svg diff --git a/src/ui/gui/artwork/mimetypes/22x22/application-x-spss-zsav.svg b/src/ui/gui/artwork/22x22/mimetypes/application-x-spss-zsav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/22x22/application-x-spss-zsav.svg rename to src/ui/gui/artwork/22x22/mimetypes/application-x-spss-zsav.svg diff --git a/src/ui/gui/artwork/actions/24x24/data-select-cases.svg b/src/ui/gui/artwork/24x24/actions/data-select-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/data-select-cases.svg rename to src/ui/gui/artwork/24x24/actions/data-select-cases.svg diff --git a/src/ui/gui/artwork/actions/24x24/data-split-file.svg b/src/ui/gui/artwork/24x24/actions/data-split-file.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/data-split-file.svg rename to src/ui/gui/artwork/24x24/actions/data-split-file.svg diff --git a/src/ui/gui/artwork/actions/24x24/data-weight-cases.svg b/src/ui/gui/artwork/24x24/actions/data-weight-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/data-weight-cases.svg rename to src/ui/gui/artwork/24x24/actions/data-weight-cases.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-copy.svg b/src/ui/gui/artwork/24x24/actions/edit-copy.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-copy.svg rename to src/ui/gui/artwork/24x24/actions/edit-copy.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-cut.svg b/src/ui/gui/artwork/24x24/actions/edit-cut.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-cut.svg rename to src/ui/gui/artwork/24x24/actions/edit-cut.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-find.svg b/src/ui/gui/artwork/24x24/actions/edit-find.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-find.svg rename to src/ui/gui/artwork/24x24/actions/edit-find.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-go-to-case.svg b/src/ui/gui/artwork/24x24/actions/edit-go-to-case.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-go-to-case.svg rename to src/ui/gui/artwork/24x24/actions/edit-go-to-case.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-go-to-variable.svg b/src/ui/gui/artwork/24x24/actions/edit-go-to-variable.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-go-to-variable.svg rename to src/ui/gui/artwork/24x24/actions/edit-go-to-variable.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-insert-case.svg b/src/ui/gui/artwork/24x24/actions/edit-insert-case.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-insert-case.svg rename to src/ui/gui/artwork/24x24/actions/edit-insert-case.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-insert-variable.svg b/src/ui/gui/artwork/24x24/actions/edit-insert-variable.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-insert-variable.svg rename to src/ui/gui/artwork/24x24/actions/edit-insert-variable.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-paste.svg b/src/ui/gui/artwork/24x24/actions/edit-paste.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-paste.svg rename to src/ui/gui/artwork/24x24/actions/edit-paste.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-redo.svg b/src/ui/gui/artwork/24x24/actions/edit-redo.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-redo.svg rename to src/ui/gui/artwork/24x24/actions/edit-redo.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-select-all.svg b/src/ui/gui/artwork/24x24/actions/edit-select-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-select-all.svg rename to src/ui/gui/artwork/24x24/actions/edit-select-all.svg diff --git a/src/ui/gui/artwork/actions/24x24/edit-undo.svg b/src/ui/gui/artwork/24x24/actions/edit-undo.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/edit-undo.svg rename to src/ui/gui/artwork/24x24/actions/edit-undo.svg diff --git a/src/ui/gui/artwork/actions/24x24/file-export-data.svg b/src/ui/gui/artwork/24x24/actions/file-export-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/file-export-data.svg rename to src/ui/gui/artwork/24x24/actions/file-export-data.svg diff --git a/src/ui/gui/artwork/actions/24x24/file-open-data.svg b/src/ui/gui/artwork/24x24/actions/file-open-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/file-open-data.svg rename to src/ui/gui/artwork/24x24/actions/file-open-data.svg diff --git a/src/ui/gui/artwork/actions/24x24/file-print.svg b/src/ui/gui/artwork/24x24/actions/file-print.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/file-print.svg rename to src/ui/gui/artwork/24x24/actions/file-print.svg diff --git a/src/ui/gui/artwork/actions/24x24/file-save-data.svg b/src/ui/gui/artwork/24x24/actions/file-save-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/file-save-data.svg rename to src/ui/gui/artwork/24x24/actions/file-save-data.svg diff --git a/src/ui/gui/artwork/actions/24x24/run-all.svg b/src/ui/gui/artwork/24x24/actions/run-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/run-all.svg rename to src/ui/gui/artwork/24x24/actions/run-all.svg diff --git a/src/ui/gui/artwork/actions/24x24/transform-compute.svg b/src/ui/gui/artwork/24x24/actions/transform-compute.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/transform-compute.svg rename to src/ui/gui/artwork/24x24/actions/transform-compute.svg diff --git a/src/ui/gui/artwork/actions/24x24/utilities-variables.svg b/src/ui/gui/artwork/24x24/actions/utilities-variables.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/utilities-variables.svg rename to src/ui/gui/artwork/24x24/actions/utilities-variables.svg diff --git a/src/ui/gui/artwork/actions/24x24/view-value-labels.svg b/src/ui/gui/artwork/24x24/actions/view-value-labels.svg similarity index 100% rename from src/ui/gui/artwork/actions/24x24/view-value-labels.svg rename to src/ui/gui/artwork/24x24/actions/view-value-labels.svg diff --git a/src/ui/gui/artwork/apps/24x24/pspp.svg b/src/ui/gui/artwork/24x24/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/24x24/pspp.svg rename to src/ui/gui/artwork/24x24/apps/pspp.svg diff --git a/src/ui/gui/artwork/mimetypes/24x24/application-x-spss-por.svg b/src/ui/gui/artwork/24x24/mimetypes/application-x-spss-por.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/24x24/application-x-spss-por.svg rename to src/ui/gui/artwork/24x24/mimetypes/application-x-spss-por.svg diff --git a/src/ui/gui/artwork/mimetypes/24x24/application-x-spss-sav.svg b/src/ui/gui/artwork/24x24/mimetypes/application-x-spss-sav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/24x24/application-x-spss-sav.svg rename to src/ui/gui/artwork/24x24/mimetypes/application-x-spss-sav.svg diff --git a/src/ui/gui/artwork/mimetypes/24x24/application-x-spss-sps.svg b/src/ui/gui/artwork/24x24/mimetypes/application-x-spss-sps.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/24x24/application-x-spss-sps.svg rename to src/ui/gui/artwork/24x24/mimetypes/application-x-spss-sps.svg diff --git a/src/ui/gui/artwork/mimetypes/24x24/application-x-spss-zsav.svg b/src/ui/gui/artwork/24x24/mimetypes/application-x-spss-zsav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/24x24/application-x-spss-zsav.svg rename to src/ui/gui/artwork/24x24/mimetypes/application-x-spss-zsav.svg diff --git a/src/ui/gui/artwork/apps/256x256/pspp.svg b/src/ui/gui/artwork/256x256/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/256x256/pspp.svg rename to src/ui/gui/artwork/256x256/apps/pspp.svg diff --git a/src/ui/gui/artwork/mimetypes/256x256/application-x-spss-por.svg b/src/ui/gui/artwork/256x256/mimetypes/application-x-spss-por.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/256x256/application-x-spss-por.svg rename to src/ui/gui/artwork/256x256/mimetypes/application-x-spss-por.svg diff --git a/src/ui/gui/artwork/mimetypes/256x256/application-x-spss-sav.svg b/src/ui/gui/artwork/256x256/mimetypes/application-x-spss-sav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/256x256/application-x-spss-sav.svg rename to src/ui/gui/artwork/256x256/mimetypes/application-x-spss-sav.svg diff --git a/src/ui/gui/artwork/mimetypes/256x256/application-x-spss-sps.svg b/src/ui/gui/artwork/256x256/mimetypes/application-x-spss-sps.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/256x256/application-x-spss-sps.svg rename to src/ui/gui/artwork/256x256/mimetypes/application-x-spss-sps.svg diff --git a/src/ui/gui/artwork/mimetypes/256x256/application-x-spss-zsav.svg b/src/ui/gui/artwork/256x256/mimetypes/application-x-spss-zsav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/256x256/application-x-spss-zsav.svg rename to src/ui/gui/artwork/256x256/mimetypes/application-x-spss-zsav.svg diff --git a/src/ui/gui/artwork/actions/32x32/data-select-cases.svg b/src/ui/gui/artwork/32x32/actions/data-select-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/data-select-cases.svg rename to src/ui/gui/artwork/32x32/actions/data-select-cases.svg diff --git a/src/ui/gui/artwork/actions/32x32/data-split-file.svg b/src/ui/gui/artwork/32x32/actions/data-split-file.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/data-split-file.svg rename to src/ui/gui/artwork/32x32/actions/data-split-file.svg diff --git a/src/ui/gui/artwork/actions/32x32/data-weight-cases.svg b/src/ui/gui/artwork/32x32/actions/data-weight-cases.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/data-weight-cases.svg rename to src/ui/gui/artwork/32x32/actions/data-weight-cases.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-copy.svg b/src/ui/gui/artwork/32x32/actions/edit-copy.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-copy.svg rename to src/ui/gui/artwork/32x32/actions/edit-copy.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-cut.svg b/src/ui/gui/artwork/32x32/actions/edit-cut.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-cut.svg rename to src/ui/gui/artwork/32x32/actions/edit-cut.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-find.svg b/src/ui/gui/artwork/32x32/actions/edit-find.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-find.svg rename to src/ui/gui/artwork/32x32/actions/edit-find.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-go-to-case.svg b/src/ui/gui/artwork/32x32/actions/edit-go-to-case.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-go-to-case.svg rename to src/ui/gui/artwork/32x32/actions/edit-go-to-case.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-go-to-variable.svg b/src/ui/gui/artwork/32x32/actions/edit-go-to-variable.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-go-to-variable.svg rename to src/ui/gui/artwork/32x32/actions/edit-go-to-variable.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-insert-case.svg b/src/ui/gui/artwork/32x32/actions/edit-insert-case.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-insert-case.svg rename to src/ui/gui/artwork/32x32/actions/edit-insert-case.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-insert-variable.svg b/src/ui/gui/artwork/32x32/actions/edit-insert-variable.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-insert-variable.svg rename to src/ui/gui/artwork/32x32/actions/edit-insert-variable.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-paste.svg b/src/ui/gui/artwork/32x32/actions/edit-paste.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-paste.svg rename to src/ui/gui/artwork/32x32/actions/edit-paste.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-redo.svg b/src/ui/gui/artwork/32x32/actions/edit-redo.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-redo.svg rename to src/ui/gui/artwork/32x32/actions/edit-redo.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-select-all.svg b/src/ui/gui/artwork/32x32/actions/edit-select-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-select-all.svg rename to src/ui/gui/artwork/32x32/actions/edit-select-all.svg diff --git a/src/ui/gui/artwork/actions/32x32/edit-undo.svg b/src/ui/gui/artwork/32x32/actions/edit-undo.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/edit-undo.svg rename to src/ui/gui/artwork/32x32/actions/edit-undo.svg diff --git a/src/ui/gui/artwork/actions/32x32/file-export-data.svg b/src/ui/gui/artwork/32x32/actions/file-export-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/file-export-data.svg rename to src/ui/gui/artwork/32x32/actions/file-export-data.svg diff --git a/src/ui/gui/artwork/actions/32x32/file-open-data.svg b/src/ui/gui/artwork/32x32/actions/file-open-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/file-open-data.svg rename to src/ui/gui/artwork/32x32/actions/file-open-data.svg diff --git a/src/ui/gui/artwork/actions/32x32/file-print.svg b/src/ui/gui/artwork/32x32/actions/file-print.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/file-print.svg rename to src/ui/gui/artwork/32x32/actions/file-print.svg diff --git a/src/ui/gui/artwork/actions/32x32/file-save-data.svg b/src/ui/gui/artwork/32x32/actions/file-save-data.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/file-save-data.svg rename to src/ui/gui/artwork/32x32/actions/file-save-data.svg diff --git a/src/ui/gui/artwork/actions/32x32/run-all.svg b/src/ui/gui/artwork/32x32/actions/run-all.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/run-all.svg rename to src/ui/gui/artwork/32x32/actions/run-all.svg diff --git a/src/ui/gui/artwork/actions/32x32/transform-compute.svg b/src/ui/gui/artwork/32x32/actions/transform-compute.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/transform-compute.svg rename to src/ui/gui/artwork/32x32/actions/transform-compute.svg diff --git a/src/ui/gui/artwork/actions/32x32/utilities-variables.svg b/src/ui/gui/artwork/32x32/actions/utilities-variables.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/utilities-variables.svg rename to src/ui/gui/artwork/32x32/actions/utilities-variables.svg diff --git a/src/ui/gui/artwork/actions/32x32/view-value-labels.svg b/src/ui/gui/artwork/32x32/actions/view-value-labels.svg similarity index 100% rename from src/ui/gui/artwork/actions/32x32/view-value-labels.svg rename to src/ui/gui/artwork/32x32/actions/view-value-labels.svg diff --git a/src/ui/gui/artwork/apps/32x32/pspp.svg b/src/ui/gui/artwork/32x32/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/32x32/pspp.svg rename to src/ui/gui/artwork/32x32/apps/pspp.svg diff --git a/src/ui/gui/artwork/mimetypes/32x32/application-x-spss-por.svg b/src/ui/gui/artwork/32x32/mimetypes/application-x-spss-por.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/32x32/application-x-spss-por.svg rename to src/ui/gui/artwork/32x32/mimetypes/application-x-spss-por.svg diff --git a/src/ui/gui/artwork/mimetypes/32x32/application-x-spss-sav.svg b/src/ui/gui/artwork/32x32/mimetypes/application-x-spss-sav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/32x32/application-x-spss-sav.svg rename to src/ui/gui/artwork/32x32/mimetypes/application-x-spss-sav.svg diff --git a/src/ui/gui/artwork/mimetypes/32x32/application-x-spss-sps.svg b/src/ui/gui/artwork/32x32/mimetypes/application-x-spss-sps.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/32x32/application-x-spss-sps.svg rename to src/ui/gui/artwork/32x32/mimetypes/application-x-spss-sps.svg diff --git a/src/ui/gui/artwork/mimetypes/32x32/application-x-spss-zsav.svg b/src/ui/gui/artwork/32x32/mimetypes/application-x-spss-zsav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/32x32/application-x-spss-zsav.svg rename to src/ui/gui/artwork/32x32/mimetypes/application-x-spss-zsav.svg diff --git a/src/ui/gui/artwork/apps/48x48/pspp.svg b/src/ui/gui/artwork/48x48/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/48x48/pspp.svg rename to src/ui/gui/artwork/48x48/apps/pspp.svg diff --git a/src/ui/gui/artwork/mimetypes/48x48/application-x-spss-por.svg b/src/ui/gui/artwork/48x48/mimetypes/application-x-spss-por.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/48x48/application-x-spss-por.svg rename to src/ui/gui/artwork/48x48/mimetypes/application-x-spss-por.svg diff --git a/src/ui/gui/artwork/mimetypes/48x48/application-x-spss-sav.svg b/src/ui/gui/artwork/48x48/mimetypes/application-x-spss-sav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/48x48/application-x-spss-sav.svg rename to src/ui/gui/artwork/48x48/mimetypes/application-x-spss-sav.svg diff --git a/src/ui/gui/artwork/mimetypes/48x48/application-x-spss-sps.svg b/src/ui/gui/artwork/48x48/mimetypes/application-x-spss-sps.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/48x48/application-x-spss-sps.svg rename to src/ui/gui/artwork/48x48/mimetypes/application-x-spss-sps.svg diff --git a/src/ui/gui/artwork/mimetypes/48x48/application-x-spss-zsav.svg b/src/ui/gui/artwork/48x48/mimetypes/application-x-spss-zsav.svg similarity index 100% rename from src/ui/gui/artwork/mimetypes/48x48/application-x-spss-zsav.svg rename to src/ui/gui/artwork/48x48/mimetypes/application-x-spss-zsav.svg diff --git a/src/ui/gui/artwork/actions/.empty b/src/ui/gui/artwork/actions/.empty deleted file mode 100644 index da1585c347..0000000000 --- a/src/ui/gui/artwork/actions/.empty +++ /dev/null @@ -1 +0,0 @@ -I'm a folder! \ No newline at end of file diff --git a/src/ui/gui/artwork/apps/scalable/.empty b/src/ui/gui/artwork/apps/scalable/.empty deleted file mode 100644 index da1585c347..0000000000 --- a/src/ui/gui/artwork/apps/scalable/.empty +++ /dev/null @@ -1 +0,0 @@ -I'm a folder! \ No newline at end of file diff --git a/src/ui/gui/artwork/apps/scalable/pspp.svg b/src/ui/gui/artwork/scalable/apps/pspp.svg similarity index 100% rename from src/ui/gui/artwork/apps/scalable/pspp.svg rename to src/ui/gui/artwork/scalable/apps/pspp.svg diff --git a/src/ui/gui/automake.mk b/src/ui/gui/automake.mk index 3da8349c02..e991eb2e47 100644 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@ -11,7 +11,6 @@ UI_FILES = \ src/ui/gui/comments.ui \ src/ui/gui/crosstabs.ui \ src/ui/gui/chi-square.ui \ - src/ui/gui/data-sheet.ui \ src/ui/gui/descriptives.ui \ src/ui/gui/entry-dialog.ui \ src/ui/gui/examine.ui \ @@ -48,7 +47,6 @@ UI_FILES = \ src/ui/gui/data-editor.ui \ src/ui/gui/output-window.ui \ src/ui/gui/syntax-editor.ui \ - src/ui/gui/var-sheet.ui \ src/ui/gui/var-type-dialog.ui \ src/ui/gui/weight.ui @@ -63,8 +61,6 @@ EXTRA_DIST += doc/help-pages-list EXTRA_DIST += \ src/ui/gui/memorandum.txt \ - src/ui/gui/artwork/actions/.empty \ - src/ui/gui/artwork/apps/scalable/.empty \ src/ui/gui/gen-dot-desktop.sh \ src/ui/gui/marshaller-list \ src/ui/gui/pspplogo.svg @@ -346,7 +342,8 @@ OBSOLETE = \ nodist_src_ui_gui_psppire_SOURCES = \ src/ui/gui/psppire-marshal.c \ - src/ui/gui/psppire-marshal.h + src/ui/gui/psppire-marshal.h \ + src/ui/gui/resources.c yelp-check: @if ! yelp --version > /dev/null 2>&1 ; then \ @@ -367,6 +364,13 @@ src/ui/gui/pspp.desktop: src/ui/gui/gen-dot-desktop.sh $(POFILES) CLEANFILES+=src/ui/gui/pspp.desktop +src/ui/gui/resources.c: src/ui/gui/resources.xml + $(AM_V_at)$(GLIB_COMPILE_RESOURCES) --sourcedir=$(top_srcdir)/src/ui/gui --generate-source $< --target=$@,out + $(AM_V_GEN)echo '#include ' > $@,tmp + cat $@,out >> $@,tmp + $(RM) $@,out + mv $@,tmp $@ + src/ui/gui/psppire-marshal.c: src/ui/gui/marshaller-list $(AM_V_GEN)echo '#include ' > $@ $(AM_V_at)$(GLIB_GENMARSHAL) --body --prefix=psppire_marshal $? >> $@ @@ -380,9 +384,10 @@ desktop_DATA = src/ui/gui/pspp.desktop appdatadir = $(datadir)/appdata dist_appdata_DATA = src/ui/gui/pspp.appdata.xml -BUILT_SOURCES += src/ui/gui/psppire-marshal.c src/ui/gui/psppire-marshal.h +BUILT_SOURCES += src/ui/gui/psppire-marshal.c src/ui/gui/psppire-marshal.h src/ui/gui/resources.c + CLEANFILES += src/ui/gui/psppire-marshal.c src/ui/gui/psppire-marshal.h \ - $(nodist_src_ui_gui_psppire_DATA) + src/ui/gui/resources.c $(nodist_src_ui_gui_psppire_DATA) endif HAVE_GUI #ensure the installcheck passes even if there is no X server available @@ -404,7 +409,7 @@ src/ui/gui/include/gtk/gtk.h: src/ui/gui/include/gtk/gtk.in.h } > $@-t && \ mv $@-t $@ CLEANFILES += src/ui/gui/include/gtk/gtk.h -EXTRA_DIST += src/ui/gui/include/gtk/gtk.in.h +EXTRA_DIST += src/ui/gui/include/gtk/gtk.in.h src/ui/gui/resources.xml include $(top_srcdir)/src/ui/gui/icons/automake.mk diff --git a/src/ui/gui/builder-wrapper.c b/src/ui/gui/builder-wrapper.c index 5db4c824dc..a00d796889 100644 --- a/src/ui/gui/builder-wrapper.c +++ b/src/ui/gui/builder-wrapper.c @@ -74,12 +74,6 @@ get_object_assert (GtkBuilder *builder, const gchar *name, GType type) } -GtkAction * -get_action_assert (GtkBuilder *builder, const gchar *name) -{ - return GTK_ACTION (get_object_assert (builder, name, GTK_TYPE_ACTION)); -} - GtkWidget * get_widget_assert (GtkBuilder *builder, const gchar *name) { diff --git a/src/ui/gui/builder-wrapper.h b/src/ui/gui/builder-wrapper.h index c5a6734eb2..43c3204e18 100644 --- a/src/ui/gui/builder-wrapper.h +++ b/src/ui/gui/builder-wrapper.h @@ -31,7 +31,6 @@ GtkBuilder * builder_new_x (const gchar *obj_name); #define builder_new(NAME) (builder_new_real (relocate (PKGDATADIR "/" NAME))) GObject *get_object_assert (GtkBuilder *builder, const gchar *name, GType type); -GtkAction * get_action_assert (GtkBuilder *builder, const gchar *name); GtkWidget * get_widget_assert (GtkBuilder *builder, const gchar *name); diff --git a/src/ui/gui/data-editor.ui b/src/ui/gui/data-editor.ui index 785a87b22a..9bd7415754 100644 --- a/src/ui/gui/data-editor.ui +++ b/src/ui/gui/data-editor.ui @@ -1,672 +1,7 @@ - - - - - - file - _File - - - - - file-new-data - _New... - new1 - - - - - file_new_syntax - file-syntax-data - _Syntax - - - - - file_new_data - file-system-data - _Data - - - - - file-open-data - file_open - _Open... - - - - - - file_import - I_mport Data... - file-import-data - - - - - rename_dataset - _Rename Dataset... - file-rename-data-set - - - - - file-save-data - file_save - _Save - - - - - - file-save-as - file_save_as - Save _As... - - - - - - file-information - D_isplay Data File Information - file-display-information - - - - - file_information_working-file - Working File - display-information-working-file - - - - - file_information_external-file - External File... - display-information-external-file - - - - - file_recent-data - Recently Used Da_ta - file-recently-used - - - - - file_recent-files - Recently Used _Files - file-recently-used - - - - - file-quit - file_quit - - - - - edit - _Edit - - - - - view - _View - - - - - True - view_statusbar - _Status Bar - - - - - view_fonts - view-font - _Font... - - - - - True - view_gridlines - _Grid Lines - - - - - view_value-labels - Value _Labels - Show/hide value labels - view-value-labels - - - - - view_data - _Data - - - - - view_variables - _Variables - view_data - - - - - data - _Data - - - - - _Sort Cases... - data_sort-cases - uimanager1 - data-sort-cases - Sort cases in the active dataset - - - - - data-transpose - data_transpose - uimanager1 - _Transpose... - Transpose the cases with the variables - - - - - data-aggregate - data_aggregate - uimanager1 - _Aggregate... - Aggregate the case values into a new variable - - - - - data_split-file - uimanager1 - S_plit File... - Split the active dataset - data-split-file - - - - - data_select-cases - uimanager1 - Select _Cases... - Choose a subset of cases for analysis - data-select-cases - - - - - data_weight-cases - _Weight Cases... - uimanager1 - Weight cases by variable - data-weight-cases - - - - - transform - _Transform - - - - - transform_compute - uimanager1 - _Compute... - transform-compute - - - - - transform_count - uimanager1 - Cou_nt... - transform-count - - - - - transform_rank - uimanager1 - Ran_k Cases... - transform-rank-cases - - - - - transform_autorecode - uimanager1 - Auto_matic Recode... - transform-automatic-recode - - - - - transform_recode-same - uimanager1 - Recode into _Same Variables... - transform-in-to-same-variables - - - - - uimanager1 - transform_recode-different - Recode into _Different Variables... - transform-in-to-different-variables - - - - - transform_run-pending - _Run Pending Transforms - transform-run-pending - - - - - - analyze - _Analyze - - - - - descriptive-statistics - _Descriptive Statistics - analyze-descriptive-statistics - - - - - uimanager1 - frequencies - _Frequencies... - - - - - uimanager1 - analyze_descriptives - _Descriptives... - - - - - analyze_explore - uimanager1 - _Explore... - - - - - crosstabs - uimanager1 - _Crosstabs... - - - - - compare-means - Compare _Means - analyze-compare-means - - - - - means - uimanager1 - _Means... - - - - - one-sample-t-test - uimanager1 - _One Sample T Test... - - - - - indep-t-test - uimanager1 - _Independent Samples T Test... - - - - - paired-t-test - uimanager1 - _Paired Samples T Test... - - - - - oneway-anova - uimanager1 - One Way _ANOVA... - - - - - univariate - uimanager1 - _Univariate Analysis... - analyze-univariate-analysis - - - - - correlation - uimanager1 - Bivariate _Correlation... - analyze-bivariate-correlation - - - - - k-means - uimanager1 - _K-Means Cluster... - analyze-kmeans-cluster - - - - - factor-analysis - uimanager1 - Factor _Analysis... - analyze-factor-analysis - - - - - reliability - uimanager1 - Re_liability... - analyze-realiability - - - - - regression - _Regression - analyze-regression - - - - - linear-regression - uimanager1 - _Linear... - - - - - logistic-regression - uimanager1 - _Binary Logistic... - - - - - non-parametrics - _Non-Parametric Statistics - analyze-non-parametric-statistics - - - - - chi-square - uimanager1 - _Chi-Square... - - - - - binomial - uimanager1 - _Binomial... - - - - - runs - uimanager1 - R_uns... - - - - - ks-one-sample - uimanager1 - 1-Sample _K-S... - - - - - two-related-samples - uimanager1 - 2 _Related Samples... - - - - - k-related-samples - uimanager1 - K Related _Samples... - - - - - roc-curve - uimanager1 - ROC Cur_ve... - analyze-roc-curve - - - - - graphs - _Graphs - - - - - uimanager1 - graphs_scatterplot - _Scatterplot - graphs-scatterplot - - - - - uimanager1 - graphs_histogram - _Histogram - graphs-histogram - - - - - uimanager1 - graphs_barchart - _Barchart - graphs-barchart - - - - - utilities - _Utilities - - - - - uimanager1 - utilities_variables - _Variables... - Jump to variable - utilities-variables - - - - - uimanager1 - utilities_comments - Data File _Comments... - utilities-data-file-comments - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - True - GTK_TOOLBAR_ICONS - True GTK_ORIENTATION_HORIZONTAL @@ -797,4 +132,253 @@ + + + + _View +
+ + _Status Bar + win.statusbar + +
+
+ + _Font... + win.fonts + + + _Grid Lines + win.gridlines + + + Value _Labels + win.value_labels + +
+
+ + _Data + DATA + win.view_dv + + + _Variables + VARS + win.view_dv + +
+
+ + _Data +
+ + _Sort Cases... + win.PsppireDialogActionSort + + + _Transpose... + win.PsppireDialogActionFlip + + + _Aggregate... + win.PsppireDialogActionAggregate + +
+
+ + S_plit File... + win.PsppireDialogActionSplit + + + Select _Cases... + win.PsppireDialogActionSelect + + + _Weight Cases... + win.PsppireDialogActionWeight + +
+
+ + _Transform +
+ + _Compute... + win.PsppireDialogActionCompute + + + Cou_nt... + win.PsppireDialogActionCount + + + Ran_k Cases... + win.PsppireDialogActionRank + + + Auto_matic Recode... + win.PsppireDialogActionAutorecode + +
+
+ + Recode into _Same Variables... + win.PsppireDialogActionRecodeSame + + + Recode into _Different Variables... + win.PsppireDialogActionRecodeDifferent + +
+
+ + _Run Pending Transforms + win.transform-pending + +
+
+ + _Analyze +
+ + _Descriptive Statistics + + _Frequencies... + win.PsppireDialogActionFrequencies + + + _Descriptives... + win.PsppireDialogActionDescriptives + + + _Explore... + win.PsppireDialogActionExamine + + + _Crosstabs... + win.PsppireDialogActionCrosstabs + + + + Compare _Means + + _Means... + win.PsppireDialogActionMeans + + + _One Sample T Test... + win.PsppireDialogActionTt1s + + + _Independent Samples T Test... + win.PsppireDialogActionIndepSamps + + + _Paired Samples T Test... + win.PsppireDialogActionPaired + + + _One Way _ANOVA... + win.PsppireDialogActionOneway + + + + _Univariate Analysis... + win.PsppireDialogActionUnivariate + + + Bivariate _Correlation... + win.PsppireDialogActionCorrelation + + + _K-Means Cluster... + win.PsppireDialogActionKmeans + + + _Factor Analysis... + win.PsppireDialogActionFactor + + + Re_liability... + win.PsppireDialogActionReliability + + + _Regression +
+ + _Linear... + win.PsppireDialogActionRegression + + + _Binary Logistic... + win.PsppireDialogActionLogistic + +
+
+ + _Non-Parametric Statistics +
+ + _Chi Square... + win.PsppireDialogActionChisquare + + + _Binomial... + win.PsppireDialogActionBinomial + + + _Runs... + win.PsppireDialogActionRuns + + + _1 Sample K-S... + win.PsppireDialogAction1sks + + + _2 Related Samples... + win.PsppireDialogActionTwoSample + + + _K Related Samples... + win.PsppireDialogActionKRelated + +
+
+ + ROC Cur_ve... + win.PsppireDialogActionRoc + +
+
+ + _Graphs +
+ + _Scatterplot + win.PsppireDialogActionScatterplot + + + _Histogram + win.PsppireDialogActionHistogram + + + _Barchart + win.PsppireDialogActionBarchart + +
+
+ + _Utilities +
+ + _Variables... + win.PsppireDialogActionVarInfo + + + Data File _Comments... + win.PsppireDialogActionComments + +
+
+
diff --git a/src/ui/gui/data-sheet.ui b/src/ui/gui/data-sheet.ui deleted file mode 100644 index 83df966b23..0000000000 --- a/src/ui/gui/data-sheet.ui +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - edit - _Edit - - - - - edit_insert-variable - Insert Variable - Create a new variable at the current position - edit-insert-variable - - - - - edit_insert-case - Insert Case - Create a new case at the current position - edit-insert-case - - - - - edit_goto-variable - Go To Variable... - Jump to variable - edit-go-to-variable - - - - - Go To Case... - edit_goto-case - Jump to a case in the data sheet - edit-go-to-case - - - - - edit-cut - edit_cut - - - - - edit-copy - edit_copy - - - - - edit-paste - edit_paste - - - - - edit_clear-variables - Cl_ear Variables - Delete the variables at the selected position(s) - edit-clear - - - - - edit_clear-cases - edit-clear - _Clear Cases - Delete the cases at the selected position(s) - - - - - edit-find - edit_find - _Find... - - - - - data-sort-ascending - sort_ascending - Sort _Ascending - - - - - data-sort-descending - sort_descending - Sort _Descending - - - - - - - True - - - True - - diff --git a/src/ui/gui/icons/.gitignore b/src/ui/gui/icons/.gitignore deleted file mode 100644 index 31d0202e65..0000000000 --- a/src/ui/gui/icons/.gitignore +++ /dev/null @@ -1,10 +0,0 @@ -about-logo.png -actions/ -apps/ -categories/ -icon-names.c -manifest -mimetypes/ -splash.png -splash-r.png -splash-t.png diff --git a/src/ui/gui/icons/automake.mk b/src/ui/gui/icons/automake.mk index 2061316651..7aee3f3424 100644 --- a/src/ui/gui/icons/automake.mk +++ b/src/ui/gui/icons/automake.mk @@ -1,7 +1,7 @@ -include $(top_srcdir)/src/ui/gui/icons/manifest - EXTRA_DIST += $(icons) $(icon_srcs) src/ui/gui/icons/COPYING_CCBYSA3 +include $(top_srcdir)/src/ui/gui/icons/manifest + themedir = $(DESTDIR)$(datadir)/icons/hicolor sizes=16x16 22x22 24x24 32x32 48x48 256x256 scalable @@ -10,9 +10,9 @@ install-ext-icons: for context in apps mimetypes; do \ for size in $(sizes); do \ $(MKDIR_P) $(themedir)/$$size/$$context ; \ - if (cd $(top_srcdir)/src/ui/gui/icons/$$context/$$size && \ + if (cd $(top_srcdir)/src/ui/gui/icons/$$size/$$context && \ (test ! "`printf '%s %s %s' . .. *`" = '. .. *' || test -f '*')) 2> /dev/null ; then \ - $(INSTALL_DATA) $(top_srcdir)/src/ui/gui/icons/$$context/$$size/* $(themedir)/$$size/$$context ; \ + $(INSTALL_DATA) $(top_srcdir)/src/ui/gui/icons/$$size/$$context/* $(themedir)/$$size/$$context ; \ fi ; \ done ; \ done @@ -21,7 +21,7 @@ install-ext-icons: uninstall-ext-icons: for context in apps mimetypes; do \ for size in $(sizes); do \ - if (cd $(top_srcdir)/src/ui/gui/icons/$$context/$$size && \ + if (cd $(top_srcdir)/src/ui/gui/icons/$$size/$$context && \ (test ! "`printf '%s %s %s' . .. *`" = '. .. *' || test -f '*')) 2> /dev/null ; then \ rm -rf $(themedir)/$$size/$$context/application-x-spss-* ; \ rm -rf $(themedir)/$$size/$$context/pspp* ; \ @@ -62,6 +62,7 @@ if HAVE_GUI nodist_src_ui_gui_psppire_DATA = src/ui/gui/icons/splash.png src/ui/gui/icons/splash.png: $(top_srcdir)/src/ui/gui/icons/splash-t.png $(top_srcdir)/src/ui/gui/icons/splash-r.png Makefile + @$(MKDIR_P) src/ui/gui/icons @case `echo $(VERSION) | $(SED) -e 's/[0-9][0-9]*\.[0-9]*\([0-9]\)\.[0-9][0-9]*/\1/'` in \ [13579]) cp $(top_srcdir)/src/ui/gui/icons/splash-t.png $@ ; \ ;;\ @@ -69,11 +70,7 @@ src/ui/gui/icons/splash.png: $(top_srcdir)/src/ui/gui/icons/splash-t.png $(top_s ;;\ esac -EXTRA_DIST += $(top_srcdir)/src/ui/gui/artwork/splash.svg - -src_ui_gui_psppire_SOURCES += \ - src/ui/gui/icons/icon-names.c \ - src/ui/gui/icons/icon-names.h +EXTRA_DIST += $(top_srcdir)/src/ui/gui/artwork/splash.svg $(icons) $(icon_srcs) endif diff --git a/src/ui/gui/icons/icon-names.h b/src/ui/gui/icons/icon-names.h deleted file mode 100644 index 514ca2a63c..0000000000 --- a/src/ui/gui/icons/icon-names.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef ICON_NAMES_H -#define ICON_NAMES_H 1 - -struct icon_context -{ - const char **icon_name; - int n_icons; - const char *context_name; -}; - - -extern const struct icon_context action_icon_context; -extern const struct icon_context category_icon_context; - - - -#endif diff --git a/src/ui/gui/main.c b/src/ui/gui/main.c index 59ee43a7e7..2d90ce8fd2 100644 --- a/src/ui/gui/main.c +++ b/src/ui/gui/main.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015 Free Software Foundation + Copyright (C) 2004, 2005, 2006, 2010, 2011, 2012, 2013, 2014, 2015, 2016 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 @@ -31,6 +31,9 @@ #include "libpspp/string-array.h" #include "libpspp/version.h" #include "ui/source-init-opts.h" +#include "ui/gui/psppire-syntax-window.h" +#include "ui/gui/psppire-data-window.h" +#include "ui/gui/psppire-output-window.h" #include "gl/configmake.h" #include "gl/progname.h" @@ -43,188 +46,40 @@ #define N_(msgid) msgid -GdkWindow *create_splash_window (GMainContext *context); -gboolean destroy_splash_window (gpointer ud); - - - -/* Arguments to be interpreted before the X server gets initialised */ - -enum - { - OPT_HELP, - OPT_VERSION, - OPT_NO_SPLASH, - OPT_MEASURE_STARTUP, - N_STARTUP_OPTIONS - }; - -static const struct argv_option startup_options[N_STARTUP_OPTIONS] = - { - {"help", 'h', no_argument, OPT_HELP}, - {"version", 'V', no_argument, OPT_VERSION}, - {"no-splash", 'q', no_argument, OPT_NO_SPLASH}, - {"measure-startup", 0, no_argument, OPT_MEASURE_STARTUP}, - }; - -/* --measure-startup: Prints the elapsed time to start up and load any file - specified on the command line. */ -static gboolean measure_startup; -static GTimer *startup; - -static void -usage (void) +static gboolean +show_version_and_exit () { - char *inc_path = string_array_join (include_path_default (), " "); - GOptionGroup *gtk_options; - GOptionContext *ctx; - gchar *gtk_help_base, *gtk_help; - - /* Get help text for GTK+ options. */ - ctx = g_option_context_new ("psppire"); - gtk_options = gtk_get_option_group (FALSE); - gtk_help_base = g_option_context_get_help (ctx, FALSE, gtk_options); - g_option_context_free (ctx); - - /* The GTK+ help text starts with usage instructions that we don't want, - followed by a blank line. Trim off everything up to and including the - first blank line. */ - gtk_help = strstr (gtk_help_base, "\n\n"); - gtk_help = gtk_help != NULL ? gtk_help + 2 : gtk_help_base; - - printf (_("\ -PSPPIRE, a GUI for PSPP, a program for statistical analysis of sampled data.\n\ -Usage: %s [OPTION]... FILE\n\ -\n\ -Arguments to long options also apply to equivalent short options.\n\ -\n\ -GUI options:\n\ - -q, --no-splash don't show splash screen during startup\n\ -\n\ -%s\ -Language options:\n\ - -I, --include=DIR append DIR to search path\n\ - -I-, --no-include clear search path\n\ - -a, --algorithm={compatible|enhanced}\n\ - set to `compatible' if you want output\n\ - calculated from broken algorithms\n\ - -x, --syntax={compatible|enhanced}\n\ - set to `compatible' to disable PSPP extensions\n\ - -i, --interactive interpret syntax in interactive mode\n\ - -s, --safer don't allow some unsafe operations\n\ -Default search path: %s\n\ -\n\ -Informative output:\n\ - -h, --help display this help and exit\n\ - -V, --version output version information and exit\n\ -\n\ -A non-option argument is interpreted as a data file in .sav or .zsav or .por\n\ -format or a syntax file to load.\n"), - program_name, gtk_help, inc_path); - - free (inc_path); - g_free (gtk_help_base); - - emit_bug_reporting_address (); - exit (EXIT_SUCCESS); -} + version_etc (stdout, "psppire", PACKAGE_NAME, PACKAGE_VERSION, + "Ben Pfaff", "John Darrington", "Jason Stover", NULL_SENTINEL); -static void -startup_option_callback (int id, void *show_splash_) -{ - gboolean *show_splash = show_splash_; + exit (0); - switch (id) - { - case OPT_HELP: - usage (); - break; - - case OPT_VERSION: - version_etc (stdout, "psppire", PACKAGE_NAME, PACKAGE_VERSION, - "Ben Pfaff", "John Darrington", "Jason Stover", - NULL_SENTINEL); - exit (EXIT_SUCCESS); - - case OPT_NO_SPLASH: - *show_splash = FALSE; - break; - - case OPT_MEASURE_STARTUP: - measure_startup = TRUE; - break; - - default: - NOT_REACHED (); - } + return TRUE; } + -static gboolean UNUSED -print_startup_time (gpointer data) -{ - g_timer_stop (startup); - printf ("%.3f seconds elapsed\n", g_timer_elapsed (startup, NULL)); - g_timer_destroy (startup); - startup = NULL; - - return FALSE; -} -#ifdef __APPLE__ -static const bool apple = true; -#else -static const bool apple = false; -#endif - -/* Searches ARGV for the -psn_xxxx option that the desktop application - launcher passes in, and removes it if it finds it. Returns the new value - of ARGC. */ -static inline int -remove_psn (int argc, char **argv) -{ - if (apple) - { - int i; - - for (i = 0; i < argc; i++) - { - if (!strncmp (argv[i], "-psn", 4)) - { - remove_element (argv, argc + 1, sizeof *argv, i); - return argc - 1; - } - } - } - return argc; -} - - gboolean -init_prepare (GSource *source, gint *timeout_) +init_prepare (GSource * source, gint * timeout_) { return TRUE; } - - gboolean -init_check (GSource *source) +init_check (GSource * source) { return TRUE; } - gboolean -init_dispatch (GSource *ss, - GSourceFunc callback, - gpointer user_data) +init_dispatch (GSource * ss, GSourceFunc callback, gpointer user_data) { - struct init_source *is = (struct init_source *)ss; + struct init_source *is = (struct init_source *) ss; bool finished = initialize (is); is->state++; - + if (finished) { g_main_loop_quit (is->loop); @@ -234,221 +89,208 @@ init_dispatch (GSource *ss, return TRUE; } -static GSourceFuncs init_funcs = {init_prepare, init_check, init_dispatch, NULL}; - +static GSourceFuncs init_funcs = + { init_prepare, init_check, init_dispatch, NULL }; -int -main (int argc, char *argv[]) + +GtkWidget *wsplash; +gint64 start_time = 0; + + +static GtkWidget * +create_splash_window (void) { - gboolean show_splash = TRUE; - struct argv_parser *parser; - const gchar *vers; + GtkWidget *sp = gtk_window_new (GTK_WINDOW_TOPLEVEL); - set_program_name (argv[0]); + const gchar *filename = PKGDATADIR "/splash.png"; + const char *relocated_filename = relocate (filename); + GtkWidget *l = gtk_image_new_from_file (relocated_filename); + if (filename != relocated_filename) + free (CONST_CAST (char *, relocated_filename)); -#if !GLIB_CHECK_VERSION(2,32,0) - /* g_thread_init() was required before glib 2.32, but it is deprecated since - then and calling it yields a compile-time warning. */ - g_thread_init (NULL); -#endif + gtk_container_add (GTK_CONTAINER (sp), l); + gtk_window_set_type_hint (GTK_WINDOW (sp), + GDK_WINDOW_TYPE_HINT_SPLASHSCREEN); + gtk_window_set_position (GTK_WINDOW (sp), GTK_WIN_POS_CENTER); + gtk_window_set_skip_pager_hint (GTK_WINDOW (sp), TRUE); + gtk_window_set_skip_taskbar_hint (GTK_WINDOW (sp), TRUE); + gtk_window_set_focus_on_map (GTK_WINDOW (sp), FALSE); + gtk_window_set_accept_focus (GTK_WINDOW (sp), FALSE); + + GdkGeometry hints; + hints.max_height = 100; + hints.max_width = 200; + gtk_window_set_geometry_hints (GTK_WINDOW (sp), + NULL, &hints, GDK_HINT_MAX_SIZE); + + + gtk_window_set_gravity (GTK_WINDOW (sp), GDK_GRAVITY_CENTER); + + gtk_window_set_modal (GTK_WINDOW (sp), TRUE); + gtk_window_set_decorated (GTK_WINDOW (sp), FALSE); + gtk_window_set_keep_above (GTK_WINDOW (sp), TRUE); + gtk_widget_show_all (sp); + return sp; +} - gtk_disable_setlocale (); - startup = g_timer_new (); - g_timer_start (startup); +static gint +on_local_options (GApplication * application, + GVariantDict * options, gpointer user_data) +{ + GVariant *b; - if ( (vers = gtk_check_version (GTK_MAJOR_VERSION, - GTK_MINOR_VERSION, - GTK_MICRO_VERSION)) ) + b = + g_variant_dict_lookup_value (options, "no-splash", + G_VARIANT_TYPE_BOOLEAN); + if (b) { - g_warning ("%s", vers); + g_variant_unref (b); + } + else + { + start_time = g_get_monotonic_time (); } - argc = remove_psn (argc, argv); - - /* Parse our own options. - This must come BEFORE gdk_init otherwise options such as - --help --version which ought to work without an X server, won't. - */ - parser = argv_parser_create (); - argv_parser_add_options (parser, startup_options, N_STARTUP_OPTIONS, - startup_option_callback, &show_splash); - source_init_register_argv_parser (parser); - if (!argv_parser_run (parser, argc, argv)) - exit (EXIT_FAILURE); - argv_parser_destroy (parser); + return -1; +} - /* Initialise GDK. GTK gets initialized later. */ - gdk_init (&argc, &argv); +static void +on_startup (GApplication * app, gpointer ud) +{ GMainContext *context = g_main_context_new (); - - GdkWindow *win = show_splash ? create_splash_window (context) : NULL; + + if (start_time != 0) + { + wsplash = create_splash_window (); + gtk_application_add_window (GTK_APPLICATION (app), + GTK_WINDOW (wsplash)); + } GMainLoop *loop = g_main_loop_new (context, FALSE); - GSource *ss = g_source_new (&init_funcs, - sizeof (struct init_source)); - - ((struct init_source *) ss)->state = 0; - - g_source_set_priority (ss, G_PRIORITY_DEFAULT); - - g_source_attach (ss, context); + GSource *ss = g_source_new (&init_funcs, sizeof (struct init_source)); - ((struct init_source *) ss)->argc = &argc; - ((struct init_source *) ss)->argv = &argv; ((struct init_source *) ss)->loop = loop; - ((struct init_source *) ss)->filename_arg = optind < argc ? optind : -1; - - g_source_unref (ss); + ((struct init_source *) ss)->state = 0; - g_main_loop_run (loop); + g_source_set_priority (ss, G_PRIORITY_DEFAULT); - g_main_loop_unref (loop); - g_main_context_unref (context); + g_source_attach (ss, context); + g_main_loop_run (loop); +} - if (win) - g_timeout_add (500, destroy_splash_window, win); - gtk_main (); +static void +post_initialise (GApplication * app) +{ + register_selection_functions (); + psppire_output_window_setup (); - /* Not much point in this except to check for memory leaks */ - de_initialize (); - - return 0; + GSimpleAction *quit = g_simple_action_new ("quit", NULL); + g_signal_connect_swapped (quit, "activate", G_CALLBACK (psppire_quit), app); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (quit)); } +#define SPLASH_DURATION 1000 - - -struct splash_source -{ - GSource parent; - cairo_surface_t *sfc; -}; - -void -fill_splash_window (GdkWindow *win, cairo_surface_t *sfce) +static gboolean +destroy_splash (gpointer ud) { - cairo_t *cr = gdk_cairo_create (win); - - cairo_set_source_surface (cr, sfce, 0, 0); - - cairo_paint (cr); - cairo_destroy (cr); + GtkWidget *sp = GTK_WIDGET (ud); + gtk_widget_destroy (sp); + return G_SOURCE_REMOVE; } -gboolean -splash_prepare (GSource *source, - gint *timeout_) +static void +on_activate (GApplication * app, gpointer ud) { - GdkEvent *e = gdk_event_peek (); - if (!e) - return FALSE; - - gdk_event_free (e); - return TRUE; + post_initialise (app); + + GtkWindow *x = create_data_window (); + gtk_window_set_transient_for (GTK_WINDOW (wsplash), GTK_WINDOW (x)); + gtk_application_add_window (GTK_APPLICATION (app), x); + gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (wsplash)); + gtk_window_set_keep_above (GTK_WINDOW (wsplash), TRUE); + gtk_window_present (GTK_WINDOW (wsplash)); + + /* Remove the splash screen after SPLASH_DURATION milliseconds */ + gint64 elapsed_time = (g_get_monotonic_time () - start_time) / 1000; + if (SPLASH_DURATION - elapsed_time <= 0) + destroy_splash (wsplash); + else + g_timeout_add (SPLASH_DURATION - elapsed_time, destroy_splash, wsplash); } -gboolean -splash_check (GSource *source) + +static void +on_open (GApplication * app, GFile ** files, gint n_files, gchar * hint, + gpointer ud) { - GdkEvent *e = gdk_event_peek (); - if (!e) - return FALSE; + post_initialise (app); - gdk_event_free (e); - return TRUE; + gchar *file = g_file_get_parse_name (files[0]); + psppire_preload_file (file); + g_free (file); } -gboolean -splash_dispatch (GSource *ss, - GSourceFunc callback, - gpointer user_data) +/* These are arguments which must be processed BEFORE the X server has been initialised */ +static void +process_pre_start_arguments (int *argc, char ***argv) { - struct splash_source *source = (struct splash_source *) ss; - GdkEvent *e = gdk_event_get (); - if (!e) - return TRUE; - - GdkWindow *w = ((GdkEventAny *)e)->window; - - if (!w) - { - gdk_event_free (e); - return TRUE; - } - - fill_splash_window (w, source->sfc); - gdk_display_flush (gdk_window_get_display (w)); - - gdk_event_free (e); + GOptionEntry oe[] = { + {"version", 'V', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, + show_version_and_exit, "Show version information and exit", 0}, + {NULL} + }; - return TRUE; + GOptionContext *oc = g_option_context_new (""); + g_option_context_set_help_enabled (oc, FALSE); + g_option_context_set_ignore_unknown_options (oc, FALSE); + g_option_context_add_main_entries (oc, oe, NULL); + g_option_context_parse (oc, argc, argv, NULL); } -gboolean -destroy_splash_window (gpointer ud) +int +main (int argc, char *argv[]) { - GdkWindow *win = GDK_WINDOW (ud); - gdk_window_withdraw (win); - gdk_display_flush (gdk_window_get_display (win)); - gdk_window_destroy (win); - - return FALSE; -} + GtkApplication *app = + gtk_application_new ("gnu.pspp", G_APPLICATION_HANDLES_OPEN); -GSourceFuncs splash_funcs = {splash_prepare, splash_check, splash_dispatch, NULL}; + process_pre_start_arguments (&argc, &argv); + GOptionEntry oe[] = { + {"no-splash", 'q', G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, NULL, + "Do not display the splash screen", 0}, + {NULL} + }; -GdkWindow * -create_splash_window (GMainContext *context) -{ - const gchar *filename = PKGDATADIR "/splash.png"; + g_application_add_main_option_entries (G_APPLICATION (app), oe); - const char *relocated_filename = relocate (filename); - cairo_surface_t *the_surface = - cairo_image_surface_create_from_png (relocated_filename); + g_signal_connect (app, "startup", G_CALLBACK (on_startup), NULL); + g_signal_connect (app, "activate", G_CALLBACK (on_activate), NULL); + g_signal_connect (app, "handle-local-options", + G_CALLBACK (on_local_options), NULL); + g_signal_connect (app, "open", G_CALLBACK (on_open), NULL); - if (filename != relocated_filename) - free (CONST_CAST (char *, relocated_filename)); + { + GSimpleAction *act_new_syntax = g_simple_action_new ("new-syntax", NULL); + g_signal_connect_swapped (act_new_syntax, "activate", + G_CALLBACK (create_syntax_window), NULL); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (act_new_syntax)); + } - - g_return_val_if_fail (the_surface, NULL); - - int attr_mask = GDK_WA_TYPE_HINT; - GdkWindowAttr attr; - - attr.width = cairo_image_surface_get_width (the_surface); - attr.height = cairo_image_surface_get_height (the_surface); - attr.wclass = GDK_INPUT_OUTPUT; - attr.window_type = GDK_WINDOW_TOPLEVEL; - - attr.type_hint = GDK_WINDOW_TYPE_HINT_SPLASHSCREEN; - - GdkWindow *win = gdk_window_new (NULL, &attr, attr_mask); - - gdk_window_set_events (win, GDK_EXPOSURE_MASK); - gdk_window_set_keep_above (win, TRUE); - gdk_window_show (win); - - - GSource *ss = g_source_new (&splash_funcs, - sizeof (struct splash_source)); - - ((struct splash_source *) ss)->sfc = the_surface; - g_source_set_priority (ss, G_PRIORITY_HIGH); - - g_source_attach (ss, context); + { + GSimpleAction *act_new_data = g_simple_action_new ("new-data", NULL); + g_signal_connect_swapped (act_new_data, "activate", + G_CALLBACK (create_data_window), NULL); + g_action_map_add_action (G_ACTION_MAP (app), G_ACTION (act_new_data)); + } - g_source_unref (ss); - - return win; + return g_application_run (G_APPLICATION (app), argc, argv); } - - diff --git a/src/ui/gui/memorandum.txt b/src/ui/gui/memorandum.txt index 60db53fc38..0df450b5c3 100644 --- a/src/ui/gui/memorandum.txt +++ b/src/ui/gui/memorandum.txt @@ -169,7 +169,7 @@ Displaying the Dialog box in Psppire 1. Define a new PsppireDialogAction Class Create a new object class derived from PsppireDialogAction (note that -PsppireDialogAction itself derives from GtkAction). It's probably +PsppireDialogAction itself implements GAction). It's probably best if you use an existing example as a template. The minimum you require is: @@ -213,7 +213,7 @@ refresh (PsppireDialogAction *rd_) // This function is called when the menuitem is activated. // It is what pops up the dialog static void -psppire_dialog_action_foobar_activate (GtkAction *a) +psppire_dialog_action_foobar_activate (GAction *a) { PsppireDialogAction *pda = PSPPIRE_DIALOG_ACTION (a); PsppireDialogActionFoobar *act = PSPPIRE_DIALOG_ACTION_FOOBAR (a); @@ -244,7 +244,7 @@ psppire_dialog_action_foobar_activate (GtkAction *a) static void psppire_dialog_action_foobar_class_init (PsppireDialogActionFoobarClass *class) { - GtkActionClass *action_class = GTK_ACTION_CLASS (class); + GActionClass *action_class = GTK_ACTION_CLASS (class); action_class->activate = psppire_dialog_action_foobar_activate; PSPPIRE_DIALOG_ACTION_CLASS (class)->generate_syntax = generate_syntax; diff --git a/src/ui/gui/output-window.ui b/src/ui/gui/output-window.ui index 1a1a02f940..faa85b27c3 100644 --- a/src/ui/gui/output-window.ui +++ b/src/ui/gui/output-window.ui @@ -1,131 +1,86 @@ - + + - + + + True + True + 112 + True - - - - menuitem1 - _File - - - - - file_print - file-print - _Print... - - - - - - file_export - file-export-data - _Export... - - - - - menuitem2 - _Edit - - - - - edit_select-all - edit-select-all - Select _All - - + + True + True - - edit-copy - edit_copy - _Copy + + True + True + False + + + - - - - - - - - - - - - - - - - - - True - GTK_ORIENTATION_VERTICAL - 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 - - False - 0 + False + True - + True - GTK_ORIENTATION_HORIZONTAL True - 112 - True - - - True - True - automatic - automatic - - - True - True - False - - - - - False - True - - + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True - True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - automatic - automatic - - - True - 5 - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - + 5 - - True - True - - 1 - True + True + True + + + _File +
+ + _Print... + win.print + <Primary>p + + + _Export... + win.export + +
+
+ + _Quit + <Primary>q + app.quit + +
+
+ + _Edit +
+ + Select _All + win.select-all + + + _Copy + win.copy + +
+
+
diff --git a/src/ui/gui/psppire-data-editor.c b/src/ui/gui/psppire-data-editor.c index 18fd5e8e8d..1c6143aaf4 100644 --- a/src/ui/gui/psppire-data-editor.c +++ b/src/ui/gui/psppire-data-editor.c @@ -48,7 +48,6 @@ static void psppire_data_editor_init (PsppireDataEditor *de) static void disconnect_data_sheets (PsppireDataEditor *); static void refresh_entry (PsppireDataEditor *); -static void psppire_data_editor_update_ui_manager (PsppireDataEditor *); GType psppire_data_editor_get_type (void) @@ -104,12 +103,6 @@ psppire_data_editor_dispose (GObject *obj) de->font = NULL; } - if (de->ui_manager) - { - g_object_unref (de->ui_manager); - de->ui_manager = NULL; - } - /* Chain up to the parent class */ G_OBJECT_CLASS (parent_class)->dispose (obj); } @@ -120,8 +113,7 @@ enum PROP_DATA_STORE, PROP_DICTIONARY, PROP_VALUE_LABELS, - PROP_SPLIT_WINDOW, - PROP_UI_MANAGER + PROP_SPLIT_WINDOW }; static void @@ -182,7 +174,7 @@ psppire_data_editor_set_property (GObject *object, psppire_data_sheet_set_value_labels (data_sheet, g_value_get_boolean (value)); break; - case PROP_UI_MANAGER: + default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -213,9 +205,6 @@ psppire_data_editor_get_property (GObject *object, psppire_data_sheet_get_value_labels ( PSPPIRE_DATA_SHEET (de->data_sheets[0]))); break; - case PROP_UI_MANAGER: - g_value_set_object (value, psppire_data_editor_get_ui_manager (de)); - break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -228,7 +217,7 @@ psppire_data_editor_switch_page (GtkNotebook *notebook, guint page_num) { GTK_NOTEBOOK_CLASS (parent_class)->switch_page (notebook, w, page_num); - psppire_data_editor_update_ui_manager (PSPPIRE_DATA_EDITOR (notebook)); + } static void @@ -236,7 +225,7 @@ psppire_data_editor_set_focus_child (GtkContainer *container, GtkWidget *widget) { GTK_CONTAINER_CLASS (parent_class)->set_focus_child (container, widget); - psppire_data_editor_update_ui_manager (PSPPIRE_DATA_EDITOR (container)); + } static void @@ -246,7 +235,7 @@ psppire_data_editor_class_init (PsppireDataEditorClass *klass) GParamSpec *dict_spec ; GParamSpec *value_labels_spec; GParamSpec *split_window_spec; - GParamSpec *ui_manager_spec; + GObjectClass *object_class = G_OBJECT_CLASS (klass); GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass); GtkNotebookClass *notebook_class = GTK_NOTEBOOK_CLASS (klass); @@ -304,15 +293,6 @@ psppire_data_editor_class_init (PsppireDataEditorClass *klass) PROP_SPLIT_WINDOW, split_window_spec); - ui_manager_spec = - g_param_spec_object ("ui-manager", - "UI Manager", - "UI manager for the active notebook tab. The client should merge this UI manager with the active UI manager to obtain menu items and tool bar items specific to the active notebook tab.", - GTK_TYPE_UI_MANAGER, - G_PARAM_READABLE); - g_object_class_install_property (object_class, - PROP_UI_MANAGER, - ui_manager_spec); } static gboolean @@ -703,7 +683,6 @@ psppire_data_editor_init (PsppireDataEditor *de) gchar *fontname = NULL; de->font = NULL; - de->ui_manager = NULL; de->old_vbox_widget = NULL; g_object_set (de, "tab-pos", GTK_POS_BOTTOM, NULL); @@ -759,7 +738,6 @@ psppire_data_editor_init (PsppireDataEditor *de) set_font_recursively (GTK_WIDGET (de), de->font); } - psppire_data_editor_update_ui_manager (de); } GtkWidget* @@ -863,7 +841,6 @@ psppire_data_editor_split_window (PsppireDataEditor *de, gboolean split) de->split = split; g_object_notify (G_OBJECT (de), "split"); - psppire_data_editor_update_ui_manager (de); } /* Makes the variable with dictionary index DICT_INDEX in DE's dictionary @@ -922,58 +899,3 @@ psppire_data_editor_get_active_data_sheet (PsppireDataEditor *de) return PSPPIRE_DATA_SHEET (de->data_sheets[0]); } - -/* Returns the UI manager that should be merged into DE's toplevel widget's UI - manager to display menu items and toolbar items specific to DE's current - page and data sheet. - - DE's toplevel widget can watch for changes by connecting to DE's - notify::ui-manager signal. */ -GtkUIManager * -psppire_data_editor_get_ui_manager (PsppireDataEditor *de) -{ - psppire_data_editor_update_ui_manager (de); - return de->ui_manager; -} - -static void -psppire_data_editor_update_ui_manager (PsppireDataEditor *de) -{ - PsppireDataSheet *data_sheet; - GtkUIManager *ui_manager; - - ui_manager = NULL; - - switch (gtk_notebook_get_current_page (GTK_NOTEBOOK (de))) - { - case PSPPIRE_DATA_EDITOR_DATA_VIEW: - data_sheet = psppire_data_editor_get_active_data_sheet (de); - if (data_sheet != NULL) - ui_manager = psppire_data_sheet_get_ui_manager (data_sheet); - else - { - /* This happens transiently in psppire_data_editor_split_window(). */ - } - break; - - case PSPPIRE_DATA_EDITOR_VARIABLE_VIEW: - ui_manager = psppire_var_sheet_get_ui_manager ( - PSPPIRE_VAR_SHEET (de->var_sheet)); - break; - - default: - /* This happens transiently in psppire_data_editor_init(). */ - break; - } - - if (ui_manager != de->ui_manager) - { - if (de->ui_manager) - g_object_unref (de->ui_manager); - if (ui_manager) - g_object_ref (ui_manager); - de->ui_manager = ui_manager; - - g_object_notify (G_OBJECT (de), "ui-manager"); - } -} diff --git a/src/ui/gui/psppire-data-editor.h b/src/ui/gui/psppire-data-editor.h index 81495d5120..28ae214a68 100644 --- a/src/ui/gui/psppire-data-editor.h +++ b/src/ui/gui/psppire-data-editor.h @@ -71,7 +71,6 @@ struct _PsppireDataEditor gboolean split; /* True if data sheets are split. */ /* UI manager for whichever var or data sheet is currently in use. */ - GtkUIManager *ui_manager; GtkWidget *old_vbox_widget; }; @@ -91,8 +90,6 @@ void psppire_data_editor_goto_variable (PsppireDataEditor *, gint di struct _PsppireDataSheet *psppire_data_editor_get_active_data_sheet (PsppireDataEditor *); -GtkUIManager *psppire_data_editor_get_ui_manager (PsppireDataEditor *); - enum {PSPPIRE_DATA_EDITOR_DATA_VIEW = 0, PSPPIRE_DATA_EDITOR_VARIABLE_VIEW}; G_END_DECLS diff --git a/src/ui/gui/psppire-data-sheet.c b/src/ui/gui/psppire-data-sheet.c index dbc9215977..b4e3d5f3d6 100644 --- a/src/ui/gui/psppire-data-sheet.c +++ b/src/ui/gui/psppire-data-sheet.c @@ -591,16 +591,71 @@ on_data_column_resized (GObject *gobject, var_set_display_width (var, display_width); } +enum sort_order + { + SORT_ASCEND, + SORT_DESCEND + }; + +static void +do_sort (PsppireDataSheet *data_sheet, enum sort_order order) +{ + PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); + PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); + PsppireDataWindow *pdw; + GList *list, *iter; + GString *syntax; + int n_vars; + + pdw = psppire_data_window_for_data_store (data_sheet->data_store); + g_return_if_fail (pdw != NULL); + + list = pspp_sheet_selection_get_selected_columns (selection); + + syntax = g_string_new ("SORT CASES BY"); + n_vars = 0; + for (iter = list; iter; iter = iter->next) + { + PsppSheetViewColumn *column = iter->data; + struct variable *var; + + var = g_object_get_data (G_OBJECT (column), "variable"); + if (var != NULL) + { + g_string_append_printf (syntax, " %s", var_get_name (var)); + n_vars++; + } + } + if (n_vars > 0) + { + if (order == SORT_DESCEND) + g_string_append (syntax, " (DOWN)"); + g_string_append_c (syntax, '.'); + execute_const_syntax_string (pdw, syntax->str); + } + g_string_free (syntax, TRUE); +} + +static void +on_sort_up (PsppireDataSheet *data_sheet) +{ + do_sort (data_sheet, SORT_ASCEND); +} + +static void +on_sort_down (PsppireDataSheet *data_sheet) +{ + do_sort (data_sheet, SORT_DESCEND); +} + static void do_data_column_popup_menu (PsppSheetViewColumn *column, guint button, guint32 time) { GtkWidget *sheet_view = pspp_sheet_view_column_get_tree_view (column); PsppireDataSheet *data_sheet = PSPPIRE_DATA_SHEET (sheet_view); - GtkWidget *menu; - menu = get_widget_assert (data_sheet->builder, "datasheet-variable-popup"); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, time); + gtk_menu_popup (GTK_MENU (data_sheet->column_popup_menu), NULL, NULL, NULL, NULL, button, time); } static void @@ -838,8 +893,7 @@ enum PROP_CASE_NUMBERS, PROP_CURRENT_CASE, PROP_MAY_CREATE_VARS, - PROP_MAY_DELETE_VARS, - PROP_UI_MANAGER + PROP_MAY_DELETE_VARS }; static void @@ -879,7 +933,6 @@ psppire_data_sheet_set_property (GObject *object, g_value_get_boolean (value)); break; - case PROP_UI_MANAGER: default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -920,10 +973,6 @@ psppire_data_sheet_get_property (GObject *object, g_value_set_boolean (value, obj->may_delete_vars); break; - case PROP_UI_MANAGER: - g_value_set_object (value, psppire_data_sheet_get_ui_manager (obj)); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1189,20 +1238,6 @@ psppire_data_sheet_get_current_case (const PsppireDataSheet *data_sheet) return row; } -GtkUIManager * -psppire_data_sheet_get_ui_manager (PsppireDataSheet *data_sheet) -{ - if (data_sheet->uim == NULL) - { - data_sheet->uim = - GTK_UI_MANAGER (get_object_assert (data_sheet->builder, - "data_sheet_uim", - GTK_TYPE_UI_MANAGER)); - g_object_ref (data_sheet->uim); - } - - return data_sheet->uim; -} static void psppire_data_sheet_dispose (GObject *object) @@ -1223,11 +1258,6 @@ psppire_data_sheet_dispose (GObject *object) psppire_data_sheet_unset_data_store (data_sheet); - g_object_unref (data_sheet->builder); - - if (data_sheet->uim) - g_object_unref (data_sheet->uim); - G_OBJECT_CLASS (psppire_data_sheet_parent_class)->dispose (object); } @@ -1314,6 +1344,7 @@ psppire_data_sheet_class_init (PsppireDataSheetClass *class) TRUE, G_PARAM_READWRITE)); + g_object_class_install_property ( gobject_class, PROP_MAY_DELETE_VARS, @@ -1322,31 +1353,21 @@ psppire_data_sheet_class_init (PsppireDataSheetClass *class) "Whether the user may delete variables", TRUE, G_PARAM_READWRITE)); - - g_object_class_install_property ( - gobject_class, - PROP_UI_MANAGER, - g_param_spec_object ("ui-manager", - "UI Manager", - "UI manager for the data sheet. The client should merge this UI manager with the active UI manager to obtain data sheet specific menu items and tool bar items.", - GTK_TYPE_UI_MANAGER, - G_PARAM_READABLE)); } static void -do_popup_menu (GtkWidget *widget, guint button, guint32 time) +do_row_popup_menu (GtkWidget *widget, guint button, guint32 time) { PsppireDataSheet *data_sheet = PSPPIRE_DATA_SHEET (widget); - GtkWidget *menu; - menu = get_widget_assert (data_sheet->builder, "datasheet-cases-popup"); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, time); + + gtk_menu_popup (GTK_MENU (data_sheet->row_popup_menu), NULL, NULL, NULL, NULL, button, time); } static void on_popup_menu (GtkWidget *widget, gpointer user_data UNUSED) { - do_popup_menu (widget, 0, gtk_get_current_event_time ()); + do_row_popup_menu (widget, 0, gtk_get_current_event_time ()); } static gboolean @@ -1374,7 +1395,7 @@ on_button_pressed (GtkWidget *widget, GdkEventButton *event, } } - do_popup_menu (widget, event->button, event->time); + do_row_popup_menu (widget, event->button, event->time); return TRUE; } @@ -1382,8 +1403,8 @@ on_button_pressed (GtkWidget *widget, GdkEventButton *event, return FALSE; } -static void -on_edit_clear_cases (GtkAction *action, PsppireDataSheet *data_sheet) +void +psppire_data_sheet_edit_clear_cases (PsppireDataSheet *data_sheet) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); @@ -1408,17 +1429,20 @@ on_selection_changed (PsppSheetSelection *selection, { PsppSheetView *sheet_view = pspp_sheet_selection_get_tree_view (selection); PsppireDataSheet *data_sheet = PSPPIRE_DATA_SHEET (sheet_view); - gint n_selected_rows; gboolean any_variables_selected; gboolean may_delete_cases, may_delete_vars, may_insert_vars; GList *list, *iter; GtkTreePath *path; - GtkAction *action; - n_selected_rows = pspp_sheet_selection_count_selected_rows (selection); + GtkWidget *top = gtk_widget_get_toplevel (GTK_WIDGET (data_sheet)); + if (! PSPPIRE_IS_DATA_WINDOW (top)) + return; + + PsppireDataWindow *dw = PSPPIRE_DATA_WINDOW (top); + + gint n_selected_rows = pspp_sheet_selection_count_selected_rows (selection); - action = get_action_assert (data_sheet->builder, "edit_insert-case"); - gtk_action_set_sensitive (action, n_selected_rows > 0); + gtk_widget_set_sensitive (dw->mi_insert_case, n_selected_rows > 0); switch (n_selected_rows) { @@ -1439,12 +1463,13 @@ on_selection_changed (PsppSheetSelection *selection, may_delete_cases = TRUE; break; } - action = get_action_assert (data_sheet->builder, "edit_clear-cases"); - gtk_action_set_sensitive (action, may_delete_cases); + + gtk_widget_set_sensitive (dw->mi_clear_cases, may_delete_cases); any_variables_selected = FALSE; may_delete_vars = may_insert_vars = FALSE; list = pspp_sheet_selection_get_selected_columns (selection); + for (iter = list; iter != NULL; iter = iter->next) { PsppSheetViewColumn *column = iter->data; @@ -1464,17 +1489,10 @@ on_selection_changed (PsppSheetSelection *selection, may_insert_vars = may_insert_vars && data_sheet->may_create_vars; may_delete_vars = may_delete_vars && data_sheet->may_delete_vars; - action = get_action_assert (data_sheet->builder, "edit_insert-variable"); - gtk_action_set_sensitive (action, may_insert_vars); - - action = get_action_assert (data_sheet->builder, "edit_clear-variables"); - gtk_action_set_sensitive (action, may_delete_vars); - - action = get_action_assert (data_sheet->builder, "sort-up"); - gtk_action_set_sensitive (action, may_delete_vars); - - action = get_action_assert (data_sheet->builder, "sort-down"); - gtk_action_set_sensitive (action, may_delete_vars); + gtk_widget_set_sensitive (dw->mi_insert_var, may_insert_vars); + gtk_widget_set_sensitive (dw->mi_clear_variables, may_delete_vars); + gtk_widget_set_sensitive (data_sheet->pu_sort_up, may_delete_vars); + gtk_widget_set_sensitive (data_sheet->pu_sort_down, may_delete_vars); psppire_data_sheet_update_clip_actions (data_sheet); psppire_data_sheet_update_primary_selection (data_sheet, @@ -1529,25 +1547,23 @@ psppire_data_sheet_get_selected_range (PsppireDataSheet *data_sheet, return TRUE; } -static void -on_edit_insert_case (GtkAction *action, PsppireDataSheet *data_sheet) +/* Insert a case at the selected row */ +void +psppire_data_sheet_insert_case (PsppireDataSheet *data_sheet) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); PsppireDataStore *data_store = data_sheet->data_store; - struct range_set *selected; - unsigned long row; - - selected = pspp_sheet_selection_get_range_set (selection); - row = range_set_scan (selected, 0); + struct range_set *selected = pspp_sheet_selection_get_range_set (selection); + unsigned long row = range_set_scan (selected, 0); range_set_destroy (selected); if (row <= psppire_data_store_get_case_count (data_store)) psppire_data_store_insert_new_case (data_store, row); } -static void -on_edit_insert_variable (GtkAction *action, PsppireDataSheet *data_sheet) +void +psppire_data_sheet_insert_variable (PsppireDataSheet *data_sheet) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); @@ -1570,118 +1586,42 @@ on_edit_insert_variable (GtkAction *action, PsppireDataSheet *data_sheet) psppire_dict_insert_variable (dict, index, name); } -static void -on_edit_clear_variables (GtkAction *action, PsppireDataSheet *data_sheet) +void +psppire_data_sheet_edit_clear_variables (PsppireDataSheet *data_sheet) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); PsppireDict *dict = data_sheet->data_store->dict; - GList *list, *iter; - - list = pspp_sheet_selection_get_selected_columns (selection); + GList *iter; + GList *list = pspp_sheet_selection_get_selected_columns (selection); + if (list == NULL) return; list = g_list_reverse (list); for (iter = list; iter; iter = iter->next) { PsppSheetViewColumn *column = iter->data; - struct variable *var; - - var = g_object_get_data (G_OBJECT (column), "variable"); + struct variable *var = g_object_get_data (G_OBJECT (column), "variable"); if (var != NULL) psppire_dict_delete_variables (dict, var_get_dict_index (var), 1); } g_list_free (list); } -enum sort_order - { - SORT_ASCEND, - SORT_DESCEND - }; - -static void -do_sort (PsppireDataSheet *data_sheet, enum sort_order order) -{ - PsppSheetView *sheet_view = PSPP_SHEET_VIEW (data_sheet); - PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); - PsppireDataWindow *pdw; - GList *list, *iter; - GString *syntax; - int n_vars; - - pdw = psppire_data_window_for_data_store (data_sheet->data_store); - g_return_if_fail (pdw != NULL); - - list = pspp_sheet_selection_get_selected_columns (selection); - - syntax = g_string_new ("SORT CASES BY"); - n_vars = 0; - for (iter = list; iter; iter = iter->next) - { - PsppSheetViewColumn *column = iter->data; - struct variable *var; - - var = g_object_get_data (G_OBJECT (column), "variable"); - if (var != NULL) - { - g_string_append_printf (syntax, " %s", var_get_name (var)); - n_vars++; - } - } - if (n_vars > 0) - { - if (order == SORT_DESCEND) - g_string_append (syntax, " (DOWN)"); - g_string_append_c (syntax, '.'); - execute_const_syntax_string (pdw, syntax->str); - } - g_string_free (syntax, TRUE); -} - -void -on_sort_up (GtkAction *action, PsppireDataSheet *data_sheet) -{ - do_sort (data_sheet, SORT_ASCEND); -} - -void -on_sort_down (GtkAction *action, PsppireDataSheet *data_sheet) -{ - do_sort (data_sheet, SORT_DESCEND); -} - -void -on_edit_goto_case (GtkAction *action, PsppireDataSheet *data_sheet) -{ - goto_case_dialog (data_sheet); -} - -void -on_edit_find (GtkAction *action, PsppireDataSheet *data_sheet) -{ - PsppireDataWindow *pdw; - - pdw = psppire_data_window_for_data_store (data_sheet->data_store); - g_return_if_fail (pdw != NULL); - - find_dialog (pdw); -} - void -on_edit_copy (GtkAction *action, PsppireDataSheet *data_sheet) +psppire_data_sheet_edit_copy (PsppireDataSheet *data_sheet) { psppire_data_sheet_set_clip (data_sheet, FALSE); } void -on_edit_cut (GtkAction *action, PsppireDataSheet *data_sheet) +psppire_data_sheet_edit_cut (PsppireDataSheet *data_sheet) { psppire_data_sheet_set_clip (data_sheet, TRUE); } void -on_edit_paste (GtkAction *action, PsppireDataSheet *data_sheet) +psppire_data_sheet_edit_paste (PsppireDataSheet *data_sheet) { GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (data_sheet)); GtkClipboard *clipboard = @@ -1697,7 +1637,6 @@ static void psppire_data_sheet_init (PsppireDataSheet *obj) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (obj); - GtkAction *action; obj->show_value_labels = FALSE; obj->show_case_numbers = TRUE; @@ -1712,11 +1651,53 @@ psppire_data_sheet_init (PsppireDataSheet *obj) obj->new_variable_column = NULL; obj->container = NULL; - obj->uim = NULL; obj->dispose_has_run = FALSE; pspp_sheet_view_set_special_cells (sheet_view, PSPP_SHEET_VIEW_SPECIAL_CELLS_YES); + { + obj->row_popup_menu = gtk_menu_new (); + int i = 0; + + GtkWidget *insert_case = gtk_menu_item_new_with_mnemonic (_("_Insert Case")); + GtkWidget *clear_cases = gtk_menu_item_new_with_mnemonic (_("Cl_ear Cases")); + + gtk_menu_attach (GTK_MENU (obj->row_popup_menu), insert_case, 0, 1, i, i + 1); ++i; + gtk_menu_attach (GTK_MENU (obj->row_popup_menu), clear_cases, 0, 1, i, i + 1); ++i; + + g_signal_connect_swapped (clear_cases, "activate", G_CALLBACK (psppire_data_sheet_edit_clear_cases), obj); + g_signal_connect_swapped (insert_case, "activate", G_CALLBACK (psppire_data_sheet_insert_case), obj); + + gtk_widget_show_all (obj->row_popup_menu); + } + + { + obj->column_popup_menu = gtk_menu_new (); + int i = 0; + + GtkWidget *insert_variable = gtk_menu_item_new_with_mnemonic (_("_Insert Variable")); + GtkWidget *clear_variables = gtk_menu_item_new_with_mnemonic (_("Cl_ear Variables")); + obj->pu_sort_up = gtk_menu_item_new_with_mnemonic (_("Sort _Ascending")); + obj->pu_sort_down = gtk_menu_item_new_with_mnemonic (_("Sort _Descending")); + + g_signal_connect_swapped (clear_variables, "activate", G_CALLBACK (psppire_data_sheet_edit_clear_variables), obj); + g_signal_connect_swapped (insert_variable, "activate", G_CALLBACK (psppire_data_sheet_insert_variable), obj); + + g_signal_connect_swapped (obj->pu_sort_up, "activate", G_CALLBACK (on_sort_up), obj); + g_signal_connect_swapped (obj->pu_sort_down, "activate", G_CALLBACK (on_sort_down), obj); + + gtk_menu_attach (GTK_MENU (obj->column_popup_menu), insert_variable, 0, 1, i, i + 1); ++i; + gtk_menu_attach (GTK_MENU (obj->column_popup_menu), clear_variables, 0, 1, i, i + 1); ++i; + + gtk_menu_attach (GTK_MENU (obj->column_popup_menu), gtk_separator_menu_item_new (), 0, 1, i, i + 1); ++i; + + gtk_menu_attach (GTK_MENU (obj->column_popup_menu), obj->pu_sort_up, 0, 1, i, i + 1); ++i; + gtk_menu_attach (GTK_MENU (obj->column_popup_menu), obj->pu_sort_down, 0, 1, i, i + 1); ++i; + + gtk_widget_show_all (obj->column_popup_menu); + } + + g_signal_connect (obj, "notify::model", G_CALLBACK (psppire_data_sheet_model_changed), NULL); @@ -1729,51 +1710,11 @@ psppire_data_sheet_init (PsppireDataSheet *obj) G_CALLBACK (on_query_tooltip), NULL); g_signal_connect (obj, "button-press-event", G_CALLBACK (on_button_pressed), NULL); + g_signal_connect (obj, "popup-menu", G_CALLBACK (on_popup_menu), NULL); - obj->builder = builder_new ("data-sheet.ui"); - - action = get_action_assert (obj->builder, "edit_clear-cases"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_clear_cases), - obj); - gtk_action_set_sensitive (action, FALSE); g_signal_connect (pspp_sheet_view_get_selection (sheet_view), "changed", G_CALLBACK (on_selection_changed), NULL); - - action = get_action_assert (obj->builder, "edit_insert-case"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_insert_case), - obj); - - action = get_action_assert (obj->builder, "edit_insert-variable"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_insert_variable), - obj); - - action = get_action_assert (obj->builder, "edit_goto-case"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_goto_case), - obj); - - action = get_action_assert (obj->builder, "edit_copy"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_copy), obj); - - action = get_action_assert (obj->builder, "edit_cut"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_cut), obj); - - action = get_action_assert (obj->builder, "edit_paste"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_paste), obj); - - action = get_action_assert (obj->builder, "edit_clear-variables"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_clear_variables), - obj); - - action = get_action_assert (obj->builder, "edit_find"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_find), obj); - - action = get_action_assert (obj->builder, "sort-up"); - g_signal_connect (action, "activate", G_CALLBACK (on_sort_up), obj); - - action = get_action_assert (obj->builder, "sort-down"); - g_signal_connect (action, "activate", G_CALLBACK (on_sort_down), obj); - } GtkWidget * @@ -1795,19 +1736,11 @@ refresh_model (PsppireDataSheet *data_sheet) if (data_sheet->data_store != NULL) { - PsppireEmptyListStore *model; - GtkAction *action; - int n_rows; - - n_rows = psppire_data_store_get_case_count (data_sheet->data_store) + 1; - model = psppire_empty_list_store_new (n_rows); + int n_rows = psppire_data_store_get_case_count (data_sheet->data_store) + 1; + PsppireEmptyListStore *model = psppire_empty_list_store_new (n_rows); pspp_sheet_view_set_model (PSPP_SHEET_VIEW (data_sheet), GTK_TREE_MODEL (model)); g_object_unref (model); - - action = get_action_assert (data_sheet->builder, "edit_copy"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_copy), - data_sheet); } } @@ -2371,21 +2304,22 @@ static void psppire_data_sheet_update_clip_actions (PsppireDataSheet *data_sheet) { struct range_set *rows, *cols; - GtkAction *action; - gboolean enable; + GtkWidget *top = gtk_widget_get_toplevel (GTK_WIDGET (data_sheet)); + if (! PSPPIRE_IS_DATA_WINDOW (top)) + return; + + PsppireDataWindow *dw = PSPPIRE_DATA_WINDOW (top); + gboolean enable = + psppire_data_sheet_get_selected_range (data_sheet, &rows, &cols); - enable = psppire_data_sheet_get_selected_range (data_sheet, &rows, &cols); if (enable) { range_set_destroy (rows); range_set_destroy (cols); } - action = get_action_assert (data_sheet->builder, "edit_copy"); - gtk_action_set_sensitive (action, enable); - - action = get_action_assert (data_sheet->builder, "edit_cut"); - gtk_action_set_sensitive (action, enable); + gtk_widget_set_sensitive (dw->mi_copy, enable); + gtk_widget_set_sensitive (dw->mi_cut, enable); } static void @@ -2501,11 +2435,9 @@ psppire_data_sheet_targets_received_cb (GtkClipboard *clipboard, gint n_atoms, gpointer data) { - GtkAction *action = GTK_ACTION (data); - gboolean compatible_target; + GtkWidget *mi = GTK_WIDGET (data); + gboolean compatible_target = FALSE; gint i; - - compatible_target = FALSE; for (i = 0; i < G_N_ELEMENTS (targets); i++) { GdkAtom target = gdk_atom_intern (targets[i].target, TRUE); @@ -2519,17 +2451,21 @@ psppire_data_sheet_targets_received_cb (GtkClipboard *clipboard, } } - gtk_action_set_sensitive (action, compatible_target); - g_object_unref (action); + gtk_widget_set_sensitive (mi, compatible_target); } static void on_owner_change (GtkClipboard *clip, GdkEventOwnerChange *event, gpointer data) { PsppireDataSheet *data_sheet = PSPPIRE_DATA_SHEET (data); - GtkAction *action = get_action_assert (data_sheet->builder, "edit_paste"); - g_object_ref (action); - gtk_clipboard_request_targets (clip, psppire_data_sheet_targets_received_cb, - action); + GtkWidget *top = gtk_widget_get_toplevel (GTK_WIDGET (data_sheet)); + if (! PSPPIRE_IS_DATA_WINDOW (top)) + return; + + PsppireDataWindow *dw = PSPPIRE_DATA_WINDOW (top); + + gtk_clipboard_request_targets (clip, + psppire_data_sheet_targets_received_cb, + dw->mi_paste); } diff --git a/src/ui/gui/psppire-data-sheet.h b/src/ui/gui/psppire-data-sheet.h index 8497e2c115..0a7cc18e37 100644 --- a/src/ui/gui/psppire-data-sheet.h +++ b/src/ui/gui/psppire-data-sheet.h @@ -58,11 +58,14 @@ struct _PsppireDataSheet PsppSheetViewColumn *new_variable_column; - GtkBuilder *builder; - GtkWidget *container; - GtkUIManager *uim; gboolean dispose_has_run; + + GtkWidget *column_popup_menu; + GtkWidget *row_popup_menu; + + GtkWidget *pu_sort_up; + GtkWidget *pu_sort_down; }; struct _PsppireDataSheetClass @@ -98,7 +101,15 @@ void psppire_data_sheet_goto_case (PsppireDataSheet *, gint case_index); gint psppire_data_sheet_get_selected_case (const PsppireDataSheet *); gint psppire_data_sheet_get_current_case (const PsppireDataSheet *); -GtkUIManager *psppire_data_sheet_get_ui_manager (PsppireDataSheet *); +void psppire_data_sheet_insert_case (PsppireDataSheet *data_sheet); +void psppire_data_sheet_insert_variable (PsppireDataSheet *data_sheet); + +void psppire_data_sheet_edit_cut (PsppireDataSheet *data_sheet); +void psppire_data_sheet_edit_copy (PsppireDataSheet *data_sheet); +void psppire_data_sheet_edit_paste (PsppireDataSheet *data_sheet); + +void psppire_data_sheet_edit_clear_cases (PsppireDataSheet *data_sheet); +void psppire_data_sheet_edit_clear_variables (PsppireDataSheet *data_sheet); G_END_DECLS diff --git a/src/ui/gui/psppire-data-window.c b/src/ui/gui/psppire-data-window.c index 5b300295b3..b2f61c60a3 100644 --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016 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 @@ -36,7 +36,10 @@ #include "ui/gui/psppire-encoding-selector.h" #include "ui/gui/psppire-syntax-window.h" #include "ui/gui/psppire-window.h" +#include "ui/gui/psppire-data-sheet.h" +#include "ui/gui/psppire-var-sheet.h" #include "ui/gui/windows-menu.h" +#include "ui/gui/goto-case-dialog.h" #include "ui/gui/psppire.h" #include "ui/syntax-gen.h" @@ -44,6 +47,49 @@ #include "gl/c-strcasestr.h" #include "gl/xvasprintf.h" +#include "find-dialog.h" +#include "psppire-dialog-action-1sks.h" +#include "psppire-dialog-action-aggregate.h" +#include "psppire-dialog-action-autorecode.h" +#include "psppire-dialog-action-barchart.h" +#include "psppire-dialog-action-binomial.h" +#include "psppire-dialog-action-chisquare.h" +#include "psppire-dialog-action-comments.h" +#include "psppire-dialog-action-compute.h" +#include "psppire-dialog-action-correlation.h" +#include "psppire-dialog-action-count.h" +#include "psppire-dialog-action-crosstabs.h" +#include "psppire-dialog-action-descriptives.h" +#include "psppire-dialog-action-examine.h" +#include "psppire-dialog-action-factor.h" +#include "psppire-dialog-action-flip.h" +#include "psppire-dialog-action-frequencies.h" +#include "psppire-dialog-action-histogram.h" +#include "psppire-dialog-action-indep-samps.h" +#include "psppire-dialog-action-k-related.h" +#include "psppire-dialog-action-kmeans.h" +#include "psppire-dialog-action-logistic.h" +#include "psppire-dialog-action-means.h" +#include "psppire-dialog-action-oneway.h" +#include "psppire-dialog-action-paired.h" +#include "psppire-dialog-action-rank.h" +#include "psppire-dialog-action-recode-same.h" +#include "psppire-dialog-action-recode-different.h" +#include "psppire-dialog-action-regression.h" +#include "psppire-dialog-action-reliability.h" +#include "psppire-dialog-action-roc.h" +#include "psppire-dialog-action-runs.h" +#include "psppire-dialog-action-scatterplot.h" +#include "psppire-dialog-action-select.h" +#include "psppire-dialog-action-sort.h" +#include "psppire-dialog-action-split.h" +#include "psppire-dialog-action-tt1s.h" +#include "psppire-dialog-action-two-sample.h" +#include "psppire-dialog-action-univariate.h" +#include "psppire-dialog-action-var-info.h" +#include "psppire-dialog-action-weight.h" + + #include #define _(msgid) gettext (msgid) #define N_(msgid) msgid @@ -68,10 +114,6 @@ static void psppire_data_window_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static guint psppire_data_window_add_ui (PsppireDataWindow *, GtkUIManager *); -static void psppire_data_window_remove_ui (PsppireDataWindow *, - GtkUIManager *, guint); - GType psppire_data_window_get_type (void) { @@ -115,7 +157,7 @@ psppire_data_window_get_type (void) static GObjectClass *parent_class ; enum { - PROP_DATASET = 1 + PROP_DATASET = 1 }; static void @@ -131,12 +173,14 @@ psppire_data_window_class_init (PsppireDataWindowClass *class) object_class->get_property = psppire_data_window_get_property; g_object_class_install_property ( - object_class, PROP_DATASET, - g_param_spec_pointer ("dataset", "Dataset", - "'struct datset *' represented by the window", - G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); + object_class, PROP_DATASET, + g_param_spec_pointer ("dataset", "Dataset", + "'struct datset *' represented by the window", + G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); } + + /* Run the EXECUTE command. */ static void execute (PsppireDataWindow *dw) @@ -153,17 +197,14 @@ transformation_change_callback (bool transformations_pending, GtkWidget *status_label = get_widget_assert (de->builder, "case-counter-area"); - { /* Set the sensitivity of the "Transformations Pending" menuitem */ - GtkUIManager *uim = - GTK_UI_MANAGER (get_object_assert (de->builder, "uimanager1", GTK_TYPE_UI_MANAGER)); + { + GAction *action = g_action_map_lookup_action (G_ACTION_MAP (de), + "transform-pending"); - GtkWidget *menuitem = - gtk_ui_manager_get_widget (uim,"/ui/menubar/transform/transform_run-pending"); - - gtk_widget_set_sensitive (menuitem, transformations_pending); + g_simple_action_set_enabled (G_SIMPLE_ACTION (action), + transformations_pending); } - if ( transformations_pending) gtk_label_set_text (GTK_LABEL (status_label), _("Transformations Pending")); @@ -452,7 +493,7 @@ sysfile_info (PsppireDataWindow *de) NULL); const gchar *encoding = psppire_encoding_selector_get_encoding ( - gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (dialog))); + gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (dialog))); gchar *syntax; @@ -605,14 +646,14 @@ confirm_delete_dataset (PsppireDataWindow *de, int result; dialog = gtk_message_dialog_new ( - GTK_WINDOW (de), 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", - _("Delete Existing Dataset?")); + GTK_WINDOW (de), 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, "%s", + _("Delete Existing Dataset?")); gtk_message_dialog_format_secondary_text ( - GTK_MESSAGE_DIALOG (dialog), - _("Renaming \"%s\" to \"%s\" will destroy the existing " - "dataset named \"%s\". Are you sure that you want to do this?"), - old_dataset, new_dataset, existing_dataset); + GTK_MESSAGE_DIALOG (dialog), + _("Renaming \"%s\" to \"%s\" will destroy the existing " + "dataset named \"%s\". Are you sure that you want to do this?"), + old_dataset, new_dataset, existing_dataset); gtk_dialog_add_buttons (GTK_DIALOG (dialog), _("Cancel"), GTK_RESPONSE_CANCEL, @@ -657,40 +698,90 @@ on_rename_dataset (PsppireDataWindow *de) free (new_name); } + static void -status_bar_activate (PsppireDataWindow *de, GtkToggleAction *action) +status_bar_activate (GAction *action, GVariant *param, PsppireDataWindow *de) { GtkWidget *statusbar = get_widget_assert (de->builder, "status-bar"); + + GVariant *state = g_action_get_state (action); + const gboolean visible = g_variant_get_boolean (state); + g_action_change_state (action, g_variant_new_boolean (!visible)); - if ( gtk_toggle_action_get_active (action)) - gtk_widget_show (statusbar); - else - gtk_widget_hide (statusbar); + gtk_widget_set_visible (statusbar, !visible); } static void -grid_lines_activate (PsppireDataWindow *de, GtkToggleAction *action) +grid_lines_activate (GAction *action, GVariant *param, PsppireDataWindow *de) { - const gboolean grid_visible = gtk_toggle_action_get_active (action); + GVariant *state = g_action_get_state (action); + const gboolean grid_visible = g_variant_get_boolean (state); + g_action_change_state (action, g_variant_new_boolean (!grid_visible)); - psppire_data_editor_show_grid (de->data_editor, grid_visible); + psppire_data_editor_show_grid (de->data_editor, !grid_visible); } + static void -data_view_activate (PsppireDataWindow *de) +on_switch_page (GtkNotebook *notebook, GtkWidget *page, guint pn, gpointer ud) { - gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_DATA_VIEW); + PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (ud); + + GAction *action = g_action_map_lookup_action (G_ACTION_MAP (de), "view_dv"); + + switch (pn) + { + case 0: + g_action_change_state (action, g_variant_new_string ("DATA")); + gtk_widget_show (GTK_WIDGET (de->ti_insert_case)); + gtk_widget_show (GTK_WIDGET (de->ti_jump_to_case)); + gtk_widget_show (GTK_WIDGET (de->ti_find)); + + gtk_widget_show (GTK_WIDGET (de->mi_go_to_case)); + gtk_widget_show (GTK_WIDGET (de->mi_insert_case)); + gtk_widget_show (GTK_WIDGET (de->mi_find)); + gtk_widget_show (GTK_WIDGET (de->mi_find_separator)); + gtk_widget_show (GTK_WIDGET (de->mi_clear_cases)); + + break; + + case 1: + g_action_change_state (action, g_variant_new_string ("VARS")); + gtk_widget_hide (GTK_WIDGET (de->ti_insert_case)); + gtk_widget_hide (GTK_WIDGET (de->ti_jump_to_case)); + gtk_widget_hide (GTK_WIDGET (de->ti_find)); + + gtk_widget_hide (GTK_WIDGET (de->mi_go_to_case)); + gtk_widget_hide (GTK_WIDGET (de->mi_insert_case)); + gtk_widget_hide (GTK_WIDGET (de->mi_find)); + gtk_widget_hide (GTK_WIDGET (de->mi_find_separator)); + gtk_widget_hide (GTK_WIDGET (de->mi_clear_cases)); + + break; + } } static void -variable_view_activate (PsppireDataWindow *de) +activate_change_view (GAction *action, GVariant *param, PsppireDataWindow *de) { - gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); + g_action_change_state (action, param); + GVariant *new_state = g_action_get_state (action); + + const gchar *what = g_variant_get_string (new_state, NULL); + if (0 == g_strcmp0 (what, "DATA")) + { + gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_DATA_VIEW); + } + else if (0 == g_strcmp0 (what, "VARS")) + { + gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); + } } + static void fonts_activate (PsppireDataWindow *de) { @@ -717,20 +808,34 @@ fonts_activate (PsppireDataWindow *de) /* Callback for the value labels action */ + static void -toggle_value_labels (PsppireDataWindow *de, GtkToggleAction *ta) +value_labels_activate (GAction *action, GVariant *param, PsppireDataWindow *de) { - g_object_set (de->data_editor, "value-labels", gtk_toggle_action_get_active (ta), NULL); -} + GVariant *v = g_action_get_state (action); + gboolean labels_active = g_variant_get_boolean (v); + g_action_change_state (action, g_variant_new_boolean (!labels_active)); + GVariant *new_state = g_action_get_state (action); + labels_active = g_variant_get_boolean (new_state); + g_object_set (de->data_editor, "value-labels", labels_active, NULL); + + gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON (de->ti_value_labels_button), + labels_active); +} static void -file_quit (PsppireDataWindow *de) +on_labels_button_toggle (GtkToggleToolButton *ttb, PsppireDataWindow *de) { - /* FIXME: Need to be more intelligent here. - Give the user the opportunity to save any unsaved data. - */ - psppire_quit (); + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), "value_labels"); + g_assert (a); + gboolean labels_active = gtk_toggle_tool_button_get_active (ttb); + + g_action_change_state (a, g_variant_new_boolean (labels_active)); + + GVariant *new_state = g_action_get_state (a); + labels_active = g_variant_get_boolean (new_state); + g_object_set (de->data_editor, "value-labels", labels_active, NULL); } static void @@ -823,60 +928,6 @@ set_unsaved (gpointer w) psppire_window_set_unsaved (PSPPIRE_WINDOW (w)); } -static void -on_switch_page (PsppireDataEditor *de, gpointer p, - gint pagenum, PsppireDataWindow *dw) -{ - /* Set the appropriate ui_manager according to the selected page. - This is necessary, because the menus for the variable view and - the data view are different (slightly). */ - - gboolean is_ds = pagenum == PSPPIRE_DATA_EDITOR_DATA_VIEW; - const char *path = (is_ds - ? "/ui/menubar/view/view_data" - : "/ui/menubar/view/view_variables"); - - GtkWidget *page_menu_item = gtk_ui_manager_get_widget (dw->ui_manager, path); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (page_menu_item), TRUE); -} - -static void -on_ui_manager_changed (PsppireDataEditor *de, - GParamSpec *pspec UNUSED, - PsppireDataWindow *dw) -{ - GtkUIManager *uim = psppire_data_editor_get_ui_manager (de); - if (uim == dw->uim) - return; - - if (dw->uim) - { - psppire_data_window_remove_ui (dw, dw->uim, dw->merge_id); - g_object_unref (dw->uim); - dw->uim = NULL; - } - - dw->uim = uim; - if (dw->uim) - { - g_object_ref (dw->uim); - dw->merge_id = psppire_data_window_add_ui (dw, dw->uim); - } -} - -/* Connects the action called ACTION_NAME to HANDLER passing DW as the auxilliary data. - Returns a pointer to the action -*/ -static GtkAction * -connect_action (PsppireDataWindow *dw, const char *action_name, - GCallback handler) -{ - GtkAction *action = get_action_assert (dw->builder, action_name); - - g_signal_connect_swapped (action, "activate", handler, dw); - - return action; -} /* Only a data file with at least one variable can be saved. */ static void @@ -884,10 +935,14 @@ enable_save (PsppireDataWindow *dw) { gboolean enable = psppire_dict_get_var_cnt (dw->dict) > 0; - gtk_action_set_sensitive (get_action_assert (dw->builder, "file_save"), - enable); - gtk_action_set_sensitive (get_action_assert (dw->builder, "file_save_as"), - enable); + GAction *save_as = g_action_map_lookup_action (G_ACTION_MAP (dw), "save-as"); + GAction *save = g_action_map_lookup_action (G_ACTION_MAP (dw), "save"); + + if (save) + g_object_set (save, "enabled", enable, NULL); + + if (save_as) + g_object_set (save_as, "enabled", enable, NULL); } /* Initializes as much of a PsppireDataWindow as we can and must before the @@ -901,11 +956,6 @@ static void psppire_data_window_init (PsppireDataWindow *de) { de->builder = builder_new ("data-editor.ui"); - - de->ui_manager = GTK_UI_MANAGER (get_object_assert (de->builder, "uimanager1", GTK_TYPE_UI_MANAGER)); - - de->uim = NULL; - de->merge_id = 0; } static void @@ -926,14 +976,12 @@ file_import (PsppireDataWindow *dw) { case GTK_RESPONSE_APPLY: { - g_debug ("HERE"); gchar *fn = g_path_get_basename (asst->file_name); open_data_window (PSPPIRE_WINDOW (dw), fn, NULL, psppire_import_assistant_generate_syntax (asst)); g_free (fn); } break; case PSPPIRE_RESPONSE_PASTE: - g_debug ("THERE"); free (paste_syntax_to_window (psppire_import_assistant_generate_syntax (asst))); break; default: @@ -944,6 +992,380 @@ file_import (PsppireDataWindow *dw) gtk_widget_destroy (GTK_WIDGET (asst)); } + + +static void +connect_dialog_action (GType type, PsppireDataWindow *de) +{ + GAction *act = g_object_new (type, + "top-level", de, + NULL); + + g_action_map_add_action (G_ACTION_MAP (de), act); +} + +static void +g_action_activate_null (GAction *a) +{ + g_action_activate (a, NULL); +} + +static void +connect_action_to_menuitem (GActionMap *map, const gchar *action_name, GtkWidget *w, const gchar *accel) +{ + GAction *a = g_action_map_lookup_action (map, action_name); + + if (NULL == a) + g_error ("Action \"%s\" not found in map", action_name); + + if (accel) + { + GtkApplication *app = GTK_APPLICATION (g_application_get_default()); + + /* First set the label for the accellerator so that it appears + on the menuitem */ + GtkWidget *child = gtk_bin_get_child (GTK_BIN (w)); + guint key; + GdkModifierType modifier; + gtk_accelerator_parse (accel, &key, &modifier); + gtk_accel_label_set_accel (GTK_ACCEL_LABEL (child), key, modifier); + + /* Now tell the application that it must do something when that + key combination is pressed */ + const gchar *accels[2]; + accels[0] = accel; + accels[1] = NULL; + + gchar *detailed_action_name = NULL; + if (GTK_IS_WINDOW (map)) + detailed_action_name = g_strdup_printf ("win.%s", action_name); + else if (GTK_IS_APPLICATION (map)) + detailed_action_name = g_strdup_printf ("app.%s", action_name); + + gtk_application_set_accels_for_action (app, + detailed_action_name, + accels); + free (detailed_action_name); + } + + g_signal_connect_swapped (w, "activate", G_CALLBACK (g_action_activate_null), a); + } + + +static void +set_data_page (PsppireDataWindow *dw) +{ + gtk_notebook_set_current_page (GTK_NOTEBOOK (dw->data_editor), 1); + gtk_notebook_set_current_page (GTK_NOTEBOOK (dw->data_editor), 0); +} + + +static void +on_cut (PsppireDataWindow *dw) +{ + int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor)); + if (p == 0) + { + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + psppire_data_sheet_edit_cut (ds); + } +} + +static void +on_copy (PsppireDataWindow *dw) +{ + int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor)); + if (p == 0) + { + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + psppire_data_sheet_edit_copy (ds); + } +} + +static void +on_paste (PsppireDataWindow *dw) +{ + int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor)); + if (p == 0) + { + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + psppire_data_sheet_edit_paste (ds); + } +} + + +static void +on_clear_cases (PsppireDataWindow *dw) +{ + int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor)); + if (p == 0) + { + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + psppire_data_sheet_edit_clear_cases (ds); + } +} + +static void +on_clear_variables (PsppireDataWindow *dw) +{ + int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor)); + if (p == 0) + { + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + psppire_data_sheet_edit_clear_variables (ds); + } + else + { + psppire_var_sheet_clear_variables (PSPPIRE_VAR_SHEET (dw->data_editor->var_sheet)); + } +} + + +static void +insert_variable (PsppireDataWindow *dw) +{ + int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor)); + if (p == 0) + { + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + psppire_data_sheet_insert_variable (ds); + } + else + { + psppire_var_sheet_insert_variable (PSPPIRE_VAR_SHEET (dw->data_editor->var_sheet)); + } +} + + +static void +insert_case_at_row (PsppireDataWindow *dw) +{ + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + + psppire_data_sheet_insert_case (ds); +} + +static void +goto_case (PsppireDataWindow *dw) +{ + PsppireDataSheet *ds = psppire_data_editor_get_active_data_sheet (dw->data_editor); + + goto_case_dialog (ds); +} + + + +static GtkWidget * +create_file_menu (PsppireDataWindow *dw) +{ + GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic (_("_File")); + GtkWidget *menu = gtk_menu_new (); + + { + GtkWidget *new = gtk_menu_item_new_with_mnemonic (_("_New")); + gtk_menu_attach (GTK_MENU (menu), new, 0, 1, 0, 1); + + GtkWidget *new_menu = gtk_menu_new (); + + g_object_set (new, "submenu", new_menu, NULL); + + GtkWidget *syntax = gtk_menu_item_new_with_mnemonic (_("_Syntax")); + connect_action_to_menuitem (G_ACTION_MAP (g_application_get_default ()), "new-syntax", syntax, 0); + + GtkWidget *data = gtk_menu_item_new_with_mnemonic (_("_Data")); + connect_action_to_menuitem (G_ACTION_MAP (g_application_get_default ()), "new-data", data, 0); + + gtk_menu_attach (GTK_MENU (new_menu), syntax, 0, 1, 0, 1); + gtk_menu_attach (GTK_MENU (new_menu), data, 0, 1, 1, 2); + } + + GtkWidget *open = gtk_menu_item_new_with_mnemonic (_("_Open")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "open", open, "O"); + + GtkWidget *import = gtk_menu_item_new_with_mnemonic (_("_Import Data...")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "file-import", import, 0); + + gtk_menu_attach (GTK_MENU (menu), open, 0, 1, 1, 2); + gtk_menu_attach (GTK_MENU (menu), import, 0, 1, 2, 3); + + gtk_menu_attach (GTK_MENU (menu), gtk_separator_menu_item_new (), 0, 1, 3, 4); + + GtkWidget *save = gtk_menu_item_new_with_mnemonic (_("_Save...")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "save", save, "S"); + + GtkWidget *save_as = gtk_menu_item_new_with_mnemonic (_("Save _As...")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "save-as", save_as, "S"); + + GtkWidget *rename_dataset = gtk_menu_item_new_with_mnemonic (_("_Rename Dataset...")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "rename-dataset", rename_dataset, 0); + + + gtk_menu_attach (GTK_MENU (menu), save, 0, 1, 4, 5); + gtk_menu_attach (GTK_MENU (menu), save_as, 0, 1, 5, 6); + gtk_menu_attach (GTK_MENU (menu), rename_dataset, 0, 1, 6, 7); + + gtk_menu_attach (GTK_MENU (menu), gtk_separator_menu_item_new (), 0, 1, 7, 8); + + { + GtkWidget *display_data = gtk_menu_item_new_with_mnemonic (_("_Display Data File Information")); + gtk_menu_attach (GTK_MENU (menu), display_data, 0, 1, 8, 9); + + GtkWidget *dd_menu = gtk_menu_new (); + + g_object_set (display_data, "submenu", dd_menu, NULL); + + GtkWidget *working_file = gtk_menu_item_new_with_mnemonic (_("Working File")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "info-working", working_file, 0); + GtkWidget *external_file = gtk_menu_item_new_with_mnemonic (_("_External File...")); + connect_action_to_menuitem (G_ACTION_MAP (dw), "info-external", external_file, 0); + + gtk_menu_attach (GTK_MENU (dd_menu), working_file, 0, 1, 0, 1); + gtk_menu_attach (GTK_MENU (dd_menu), external_file, 0, 1, 1, 2); + } + + gtk_menu_attach (GTK_MENU (menu), gtk_separator_menu_item_new (), 0, 1, 9, 10); + + { + GtkWidget *mi_data = gtk_menu_item_new_with_mnemonic (_("_Recently Used Data")); + GtkWidget *mi_files = gtk_menu_item_new_with_mnemonic (_("Recently Used _Files")); + + GtkWidget *menu_data = gtk_recent_chooser_menu_new_for_manager ( + gtk_recent_manager_get_default ()); + + GtkWidget *menu_files = gtk_recent_chooser_menu_new_for_manager ( + gtk_recent_manager_get_default ()); + + gtk_menu_attach (GTK_MENU (menu), mi_data, 0, 1, 10, 11); + gtk_menu_attach (GTK_MENU (menu), mi_files, 0, 1, 11, 12); + + g_object_set (menu_data, "show-tips", TRUE, NULL); + g_object_set (menu_files, "show-tips", TRUE, NULL); + + g_object_set (mi_data, "submenu", menu_data, NULL); + g_object_set (mi_files, "submenu", menu_files, NULL); + + { + GtkRecentFilter *filter = gtk_recent_filter_new (); + + gtk_recent_filter_add_mime_type (filter, "application/x-spss-sav"); + gtk_recent_filter_add_mime_type (filter, "application/x-spss-por"); + + gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu_data), GTK_RECENT_SORT_MRU); + + gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu_data), filter); + } + + g_signal_connect (menu_data, "selection-done", G_CALLBACK (on_recent_data_select), dw); + + { + GtkRecentFilter *filter = gtk_recent_filter_new (); + + gtk_recent_filter_add_pattern (filter, "*.sps"); + gtk_recent_filter_add_pattern (filter, "*.SPS"); + + gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu_files), GTK_RECENT_SORT_MRU); + + gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu_files), filter); + } + + g_signal_connect (menu_files, "selection-done", G_CALLBACK (on_recent_files_select), dw); + } + + gtk_menu_attach (GTK_MENU (menu), gtk_separator_menu_item_new (), 0, 1, 12, 13); + + { + GtkWidget *quit = gtk_menu_item_new_with_mnemonic (_("_Quit")); + gtk_menu_attach (GTK_MENU (menu), quit, 0, 1, 13, 14); + + connect_action_to_menuitem (G_ACTION_MAP (g_application_get_default ()), + "quit", quit, "Q"); + } + + g_object_set (menuitem, "submenu", menu, NULL); + gtk_widget_show_all (menuitem); + + return menuitem; +} + +static GtkWidget * +create_edit_menu (PsppireDataWindow *dw) +{ + int i = 0; + GtkWidget *menuitem = gtk_menu_item_new_with_mnemonic (_("_Edit")); + + GtkWidget *menu = gtk_menu_new (); + + dw->mi_insert_var = gtk_menu_item_new_with_mnemonic (_("_Insert Variable")); + dw->mi_insert_case = gtk_menu_item_new_with_mnemonic (_("_Insert Case")); + GtkWidget *go_to_variable = gtk_menu_item_new_with_mnemonic (_("_Go To Variable...")); + dw->mi_go_to_case = gtk_menu_item_new_with_mnemonic (_("_Go To Case...")); + + gtk_menu_attach (GTK_MENU (menu), dw->mi_insert_var, 0, 1, i, i + 1); ++i; + gtk_menu_attach (GTK_MENU (menu), dw->mi_insert_case, 0, 1, i, i + 1); ++i; + + g_signal_connect_swapped (dw->mi_insert_case, "activate", G_CALLBACK (insert_case_at_row), dw); + g_signal_connect_swapped (dw->mi_go_to_case, "activate", G_CALLBACK (goto_case), dw); + g_signal_connect_swapped (dw->mi_insert_var, "activate", G_CALLBACK (insert_variable), dw); + + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (dw), "PsppireDialogActionVarInfo"); + g_assert (a); + g_signal_connect_swapped (go_to_variable, "activate", G_CALLBACK (psppire_dialog_action_activate_null), a); + + gtk_menu_attach (GTK_MENU (menu), go_to_variable, 0, 1, i, i + 1); ++i; + gtk_menu_attach (GTK_MENU (menu), dw->mi_go_to_case, 0, 1, i, i + 1); ++i; + + { + GtkAccelGroup *ag = gtk_accel_group_new (); + + dw->mi_edit_separator = gtk_separator_menu_item_new (); + gtk_menu_attach (GTK_MENU (menu), dw->mi_edit_separator, 0, 1, i, i + 1); ++i; + + dw->mi_cut = gtk_menu_item_new_with_mnemonic (_("Cu_t")); + gtk_menu_attach (GTK_MENU (menu), dw->mi_cut, 0, 1, i, i + 1); ++i; + g_signal_connect_swapped (dw->mi_cut, "activate", G_CALLBACK (on_cut), dw); + + gtk_window_add_accel_group (GTK_WINDOW (dw), ag); + gtk_widget_add_accelerator (dw->mi_cut, "activate", ag, + 'X', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); + + dw->mi_copy = gtk_menu_item_new_with_mnemonic (_("_Copy")); + gtk_menu_attach (GTK_MENU (menu), dw->mi_copy, 0, 1, i, i + 1); ++i; + g_signal_connect_swapped (dw->mi_copy, "activate", G_CALLBACK (on_copy), dw); + gtk_widget_add_accelerator (dw->mi_copy, "activate", ag, + 'C', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); + + dw->mi_paste = gtk_menu_item_new_with_mnemonic (_("_Paste")); + gtk_menu_attach (GTK_MENU (menu), dw->mi_paste, 0, 1, i, i + 1); ++i; + g_signal_connect_swapped (dw->mi_paste, "activate", G_CALLBACK (on_paste), dw); + gtk_widget_add_accelerator (dw->mi_paste, "activate", ag, + 'V', GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE); + + dw->mi_clear_variables = gtk_menu_item_new_with_mnemonic (_("Clear _Variables")); + gtk_menu_attach (GTK_MENU (menu), dw->mi_clear_variables, 0, 1, i, i + 1); ++i; + g_signal_connect_swapped (dw->mi_clear_variables, "activate", G_CALLBACK (on_clear_variables), dw); + + dw->mi_clear_cases = gtk_menu_item_new_with_mnemonic (_("Cl_ear Cases")); + gtk_menu_attach (GTK_MENU (menu), dw->mi_clear_cases, 0, 1, i, i + 1); ++i; + g_signal_connect_swapped (dw->mi_clear_cases, "activate", G_CALLBACK (on_clear_cases), dw); + } + + { + dw->mi_find_separator = gtk_separator_menu_item_new (); + gtk_menu_attach (GTK_MENU (menu), dw->mi_find_separator, 0, 1, i, i + 1); ++i; + + dw->mi_find = gtk_menu_item_new_with_mnemonic (_("_Find...")); + g_signal_connect_swapped (dw->mi_find, "activate", G_CALLBACK (find_dialog), dw); + gtk_menu_attach (GTK_MENU (menu), dw->mi_find, 0, 1, i, i + 1); ++i; + } + + g_object_set (menuitem, "submenu", menu, NULL); + + gtk_widget_show_all (menuitem); + + return menuitem; +} + + static void psppire_data_window_finish_init (PsppireDataWindow *de, struct dataset *ds) @@ -965,17 +1387,18 @@ psppire_data_window_finish_init (PsppireDataWindow *de, de->data_store = psppire_data_store_new (de->dict); psppire_data_store_set_reader (de->data_store, NULL); - menubar = get_widget_assert (de->builder, "menubar"); - hb = get_widget_assert (de->builder, "toolbar"); - sb = get_widget_assert (de->builder, "status-bar"); + GObject *menu = get_object_assert (de->builder, "data-editor-menu", G_TYPE_MENU); + menubar = gtk_menu_bar_new_from_model (G_MENU_MODEL (menu)); + gtk_widget_show (menubar); - de->uim = NULL; - de->merge_id = 0; + hb = gtk_toolbar_new (); + sb = get_widget_assert (de->builder, "status-bar"); de->data_editor = PSPPIRE_DATA_EDITOR (psppire_data_editor_new (de->dict, de->data_store)); - g_signal_connect (de->data_editor, "switch-page", - G_CALLBACK (on_switch_page), de); + + g_signal_connect (de, "realize", + G_CALLBACK (set_data_page), de); g_signal_connect_swapped (de->data_store, "case-changed", G_CALLBACK (set_unsaved), de); @@ -1017,97 +1440,301 @@ psppire_data_window_finish_init (PsppireDataWindow *de, G_CALLBACK (enable_save), de); enable_save (de); - connect_action (de, "file_new_data", G_CALLBACK (create_data_window)); - connect_action (de, "file_import", G_CALLBACK (file_import)); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_SORT, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_SPLIT, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_FLIP, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_AGGREGATE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_WEIGHT, de); + + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_COMPUTE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_COUNT, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_AUTORECODE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_RANK, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_SELECT, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_RECODE_SAME, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_RECODE_DIFFERENT, de); + + + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_DESCRIPTIVES, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_FREQUENCIES, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_EXAMINE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_CROSSTABS, de); + + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_INDEP_SAMPS, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_PAIRED, de); + + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_MEANS, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_TT1S, de); + + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_ONEWAY, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_UNIVARIATE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_KMEANS, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_FACTOR, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_CORRELATION, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_RELIABILITY, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_REGRESSION, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_LOGISTIC, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_ROC, de); + + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_COMMENTS, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_VAR_INFO, de); - connect_action (de, "file_save", G_CALLBACK (psppire_window_save)); - connect_action (de, "file_open", G_CALLBACK (psppire_window_open)); - connect_action (de, "file_save_as", G_CALLBACK (psppire_window_save_as)); - connect_action (de, "rename_dataset", G_CALLBACK (on_rename_dataset)); - connect_action (de, "file_information_working-file", G_CALLBACK (display_dict)); - connect_action (de, "file_information_external-file", G_CALLBACK (sysfile_info)); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_BARCHART, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_SCATTERPLOT, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_HISTOGRAM, de); - g_signal_connect_swapped (get_action_assert (de->builder, "view_value-labels"), "toggled", G_CALLBACK (toggle_value_labels), de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_CHISQUARE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_BINOMIAL, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_RUNS, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_1SKS, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_TWO_SAMPLE, de); + connect_dialog_action (PSPPIRE_TYPE_DIALOG_ACTION_K_RELATED, de); { - GtkWidget *recent_data = - gtk_ui_manager_get_widget (de->ui_manager, "/ui/menubar/file/file_recent-data"); + GSimpleAction *file_import_action = g_simple_action_new ("file-import", NULL); + g_signal_connect_swapped (file_import_action, "activate", G_CALLBACK (file_import), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (file_import_action)); + } + + { + GSimpleAction *save = g_simple_action_new ("save", NULL); + g_signal_connect_swapped (save, "activate", G_CALLBACK (psppire_window_save), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (save)); + } - GtkWidget *recent_files = - gtk_ui_manager_get_widget (de->ui_manager, "/ui/menubar/file/file_recent-files"); + { + GSimpleAction *open = g_simple_action_new ("open", NULL); + g_signal_connect_swapped (open, "activate", G_CALLBACK (psppire_window_open), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (open)); + } + { + GSimpleAction *save_as = g_simple_action_new ("save-as", NULL); + g_signal_connect_swapped (save_as, "activate", G_CALLBACK (psppire_window_save_as), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (save_as)); + } - GtkWidget *menu_data = gtk_recent_chooser_menu_new_for_manager ( - gtk_recent_manager_get_default ()); + { + GSimpleAction *rename_dataset_act = g_simple_action_new ("rename-dataset", NULL); + g_signal_connect_swapped (rename_dataset_act, "activate", + G_CALLBACK (on_rename_dataset), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (rename_dataset_act)); + } - GtkWidget *menu_files = gtk_recent_chooser_menu_new_for_manager ( - gtk_recent_manager_get_default ()); + { + GSimpleAction *info_working = g_simple_action_new ("info-working", NULL); + g_signal_connect_swapped (info_working, "activate", G_CALLBACK (display_dict), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (info_working)); + } + { + GSimpleAction *info_external = g_simple_action_new ("info-external", NULL); + g_signal_connect_swapped (info_external, "activate", G_CALLBACK (sysfile_info), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (info_external)); + } - g_object_set (menu_data, "show-tips", TRUE, NULL); - g_object_set (menu_files, "show-tips", TRUE, NULL); + { + GSimpleAction *act_statusbar = g_simple_action_new_stateful ("statusbar", NULL, g_variant_new_boolean (TRUE)); + g_signal_connect (act_statusbar, "activate", G_CALLBACK (status_bar_activate), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_statusbar)); + } - { - GtkRecentFilter *filter = gtk_recent_filter_new (); + { + GSimpleAction *act_gridlines = g_simple_action_new_stateful ("gridlines", NULL, g_variant_new_boolean (TRUE)); + g_signal_connect (act_gridlines, "activate", G_CALLBACK (grid_lines_activate), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_gridlines)); + } - gtk_recent_filter_add_mime_type (filter, "application/x-spss-sav"); - gtk_recent_filter_add_mime_type (filter, "application/x-spss-por"); + + { + GSimpleAction *act_view_data = g_simple_action_new_stateful ("view_dv", G_VARIANT_TYPE_STRING, + g_variant_new_string ("DATA")); + g_signal_connect (act_view_data, "activate", G_CALLBACK (activate_change_view), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_view_data)); + } - gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu_data), GTK_RECENT_SORT_MRU); + { + GSimpleAction *act_fonts = g_simple_action_new ("fonts", NULL); + g_signal_connect_swapped (act_fonts, "activate", G_CALLBACK (fonts_activate), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_fonts)); + } - gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu_data), filter); - } + { + GSimpleAction *act_value_labels = + g_simple_action_new_stateful ("value_labels", NULL, + g_variant_new_boolean (FALSE)); + g_signal_connect (act_value_labels, "activate", G_CALLBACK (value_labels_activate), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_value_labels)); + } - gtk_menu_item_set_submenu (GTK_MENU_ITEM (recent_data), menu_data); + { + GSimpleAction *act_transform_pending = g_simple_action_new ("transform-pending", NULL); + g_signal_connect_swapped (act_transform_pending, "activate", G_CALLBACK (execute), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_transform_pending)); + } + { + GSimpleAction *act_jump_to_variable = g_simple_action_new ("jump-to-variable", NULL); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_jump_to_variable)); + } - g_signal_connect (menu_data, "selection-done", G_CALLBACK (on_recent_data_select), de); + { + GSimpleAction *act_insert_variable = g_simple_action_new ("insert-variable", NULL); + g_signal_connect_swapped (act_insert_variable, "activate", G_CALLBACK (insert_variable), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_insert_variable)); + } - { - GtkRecentFilter *filter = gtk_recent_filter_new (); + { + GSimpleAction *act_jump_to_case = g_simple_action_new ("jump-to-case", NULL); + g_signal_connect_swapped (act_jump_to_case, "activate", G_CALLBACK (goto_case), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_jump_to_case)); + } - gtk_recent_filter_add_pattern (filter, "*.sps"); - gtk_recent_filter_add_pattern (filter, "*.SPS"); + { + GSimpleAction *act_insert_case = g_simple_action_new ("insert-case", NULL); + g_signal_connect_swapped (act_insert_case, "activate", G_CALLBACK (insert_case_at_row), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (act_insert_case)); + } - gtk_recent_chooser_set_sort_type (GTK_RECENT_CHOOSER (menu_files), GTK_RECENT_SORT_MRU); + { + GSimpleAction *find = g_simple_action_new ("find", NULL); + g_signal_connect_swapped (find, "activate", G_CALLBACK (find_dialog), de); + g_action_map_add_action (G_ACTION_MAP (de), G_ACTION (find)); + } + + { + int idx = 0; + { + GtkToolItem *ti = gtk_tool_button_new (NULL, "Open"); + g_signal_connect_swapped (ti, "clicked", G_CALLBACK (psppire_window_open), de); + gtk_toolbar_insert (GTK_TOOLBAR (hb), ti, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (ti), "file-open-data"); + } - gtk_recent_chooser_add_filter (GTK_RECENT_CHOOSER (menu_files), filter); + { + GtkToolItem *ti = gtk_tool_button_new (NULL, "Save"); + g_signal_connect_swapped (ti, "clicked", G_CALLBACK (psppire_window_save), de); + gtk_toolbar_insert (GTK_TOOLBAR (hb), ti, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (ti), "file-save-data"); } - gtk_menu_item_set_submenu (GTK_MENU_ITEM (recent_files), menu_files); + gtk_toolbar_insert (GTK_TOOLBAR (hb), gtk_separator_tool_item_new (), idx++); - g_signal_connect (menu_files, "selection-done", G_CALLBACK (on_recent_files_select), de); + { + de->ti_jump_to_variable = gtk_tool_button_new (NULL, "Goto Var"); - } + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), "PsppireDialogActionVarInfo"); + g_assert (a); + g_signal_connect_swapped (de->ti_jump_to_variable, "clicked", + G_CALLBACK (psppire_dialog_action_activate_null), a); - connect_action (de, "file_new_syntax", G_CALLBACK (create_syntax_window)); + gtk_toolbar_insert (GTK_TOOLBAR (hb), de->ti_jump_to_variable, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (de->ti_jump_to_variable), "edit-go-to-variable"); + gtk_widget_set_tooltip_text (GTK_WIDGET (de->ti_jump_to_variable), _("Jump to variable")); + } + { + de->ti_jump_to_case = gtk_tool_button_new (NULL, "Jump to Case"); + + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), "jump-to-case"); + g_assert (a); + g_signal_connect_swapped (de->ti_jump_to_case, "clicked", + G_CALLBACK (g_action_activate_null), a); + + gtk_toolbar_insert (GTK_TOOLBAR (hb), de->ti_jump_to_case, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (de->ti_jump_to_case), "edit-go-to-case"); + gtk_widget_set_tooltip_text (GTK_WIDGET (de->ti_jump_to_case), _("Jump to a case in the data sheet")); + } - gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); - gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_DATA_VIEW); + { + de->ti_find = gtk_tool_button_new (NULL, "Find"); + + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), "find"); + g_assert (a); + g_signal_connect_swapped (de->ti_find, "clicked", + G_CALLBACK (g_action_activate_null), a); - connect_action (de, "view_statusbar", G_CALLBACK (status_bar_activate)); + + gtk_toolbar_insert (GTK_TOOLBAR (hb), de->ti_find, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (de->ti_find), "edit-find"); + gtk_widget_set_tooltip_text (GTK_WIDGET (de->ti_find), _("Search for values in the data")); + } - connect_action (de, "view_gridlines", G_CALLBACK (grid_lines_activate)); + { + de->ti_insert_case = gtk_tool_button_new (NULL, "Create Case"); + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), "insert-case"); + g_assert (a); + g_signal_connect_swapped (de->ti_insert_case, "clicked", + G_CALLBACK (g_action_activate_null), a); + + gtk_toolbar_insert (GTK_TOOLBAR (hb), de->ti_insert_case, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (de->ti_insert_case), "edit-insert-case"); + gtk_widget_set_tooltip_text (GTK_WIDGET (de->ti_insert_case), _("Create a new case at the current position")); + } - connect_action (de, "view_data", G_CALLBACK (data_view_activate)); + { + de->ti_insert_variable = gtk_tool_button_new (NULL, "Create Variable"); + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), "insert-variable"); + g_assert (a); + g_signal_connect_swapped (de->ti_insert_variable, "clicked", + G_CALLBACK (g_action_activate_null), a); + + gtk_toolbar_insert (GTK_TOOLBAR (hb), de->ti_insert_variable, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (de->ti_insert_variable), "edit-insert-variable"); + gtk_widget_set_tooltip_text (GTK_WIDGET (de->ti_insert_variable), _("Create a new variable at the current position")); + } + + gtk_toolbar_insert (GTK_TOOLBAR (hb), gtk_separator_tool_item_new (), idx++); + + { + GtkToolItem *ti = gtk_tool_button_new (NULL, "Split"); + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), + "PsppireDialogActionSplit"); + g_assert (a); + g_signal_connect_swapped (ti, "clicked", + G_CALLBACK (psppire_dialog_action_activate_null), a); + gtk_toolbar_insert (GTK_TOOLBAR (hb), ti, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (ti), "data-split-file"); + gtk_widget_set_tooltip_text (GTK_WIDGET (ti), _("Split the active dataset")); + } - connect_action (de, "view_variables", G_CALLBACK (variable_view_activate)); + { + GtkToolItem *ti = gtk_tool_button_new (NULL, "Weight"); + GAction *a = g_action_map_lookup_action (G_ACTION_MAP (de), + "PsppireDialogActionWeight"); + g_assert (a); + g_signal_connect_swapped (ti, "clicked", + G_CALLBACK (psppire_dialog_action_activate_null), a); + gtk_toolbar_insert (GTK_TOOLBAR (hb), ti, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (ti), "data-weight-cases"); + gtk_widget_set_tooltip_text (GTK_WIDGET (ti), _("Weight cases by variable")); + } - connect_action (de, "view_fonts", G_CALLBACK (fonts_activate)); + { + de->ti_value_labels_button = gtk_toggle_tool_button_new (); + gtk_tool_button_set_label (GTK_TOOL_BUTTON (de->ti_value_labels_button), + "Value Labels"); + g_signal_connect (de->ti_value_labels_button, "toggled", + G_CALLBACK (on_labels_button_toggle), de); + gtk_toolbar_insert (GTK_TOOLBAR (hb), de->ti_value_labels_button, idx++); + gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (de->ti_value_labels_button), "view-value-labels"); + gtk_widget_set_tooltip_text (GTK_WIDGET (de->ti_value_labels_button), _("Show/hide value labels")); + } + } - connect_action (de, "file_quit", G_CALLBACK (file_quit)); - connect_action (de, "transform_run-pending", G_CALLBACK (execute)); + gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_VARIABLE_VIEW); + gtk_notebook_set_current_page (GTK_NOTEBOOK (de->data_editor), PSPPIRE_DATA_EDITOR_DATA_VIEW); + gtk_menu_shell_insert (GTK_MENU_SHELL (menubar), create_file_menu (de), 0); + gtk_menu_shell_insert (GTK_MENU_SHELL (menubar), create_edit_menu (de), 1); gtk_menu_shell_append (GTK_MENU_SHELL (menubar), create_windows_menu (GTK_WINDOW (de))); gtk_menu_shell_append (GTK_MENU_SHELL (menubar), create_help_menu (GTK_WINDOW (de))); - - g_signal_connect (de->data_editor, "notify::ui-manager", - G_CALLBACK (on_ui_manager_changed), de); - on_ui_manager_changed (de->data_editor, NULL, de); + + g_signal_connect (de->data_editor, "switch-page", + G_CALLBACK (on_switch_page), de); gtk_widget_show (GTK_WIDGET (de->data_editor)); - gtk_widget_show (box); + gtk_widget_show_all (box); ll_push_head (&all_data_windows, &de->ll); } @@ -1117,13 +1744,6 @@ psppire_data_window_dispose (GObject *object) { PsppireDataWindow *dw = PSPPIRE_DATA_WINDOW (object); - if (dw->uim) - { - psppire_data_window_remove_ui (dw, dw->uim, dw->merge_id); - g_object_unref (dw->uim); - dw->uim = NULL; - } - if (dw->builder != NULL) { g_object_unref (dw->builder); @@ -1220,64 +1840,6 @@ psppire_data_window_get_property (GObject *object, }; } -static guint -psppire_data_window_add_ui (PsppireDataWindow *pdw, GtkUIManager *uim) -{ - gchar *ui_string; - guint merge_id; - GList *list; - - ui_string = gtk_ui_manager_get_ui (uim); - merge_id = gtk_ui_manager_add_ui_from_string (pdw->ui_manager, ui_string, - -1, NULL); - g_free (ui_string); - - g_return_val_if_fail (merge_id != 0, 0); - - list = gtk_ui_manager_get_action_groups (uim); - for (; list != NULL; list = list->next) - { - GtkActionGroup *action_group = list->data; - GList *actions = gtk_action_group_list_actions (action_group); - GList *action; - - for (action = actions; action != NULL; action = action->next) - { - GtkAction *a = action->data; - - if (PSPPIRE_IS_DIALOG_ACTION (a)) - g_object_set (a, "manager", pdw->ui_manager, NULL); - } - - gtk_ui_manager_insert_action_group (pdw->ui_manager, action_group, 0); - } - - gtk_window_add_accel_group (GTK_WINDOW (pdw), - gtk_ui_manager_get_accel_group (uim)); - - return merge_id; -} - -static void -psppire_data_window_remove_ui (PsppireDataWindow *pdw, - GtkUIManager *uim, guint merge_id) -{ - GList *list; - - g_return_if_fail (merge_id != 0); - - gtk_ui_manager_remove_ui (pdw->ui_manager, merge_id); - - list = gtk_ui_manager_get_action_groups (uim); - for (; list != NULL; list = list->next) - { - GtkActionGroup *action_group = list->data; - gtk_ui_manager_remove_action_group (pdw->ui_manager, action_group); - } - - gtk_window_remove_accel_group (GTK_WINDOW (pdw), - gtk_ui_manager_get_accel_group (uim)); -} GtkWidget* psppire_data_window_new (struct dataset *ds) @@ -1296,15 +1858,19 @@ psppire_data_window_new (struct dataset *ds) assert (dataset_session (ds) == the_session); dw = GTK_WIDGET ( - g_object_new ( - psppire_data_window_get_type (), - "description", _("Data Editor"), - "dataset", ds, - NULL)); + g_object_new ( + psppire_data_window_get_type (), + "description", _("Data Editor"), + "dataset", ds, + NULL)); if (dataset_name (ds) != NULL) g_object_set (dw, "id", dataset_name (ds), (void *) NULL); + + GApplication *app = g_application_get_default (); + gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (dw)); + return dw; } @@ -1321,7 +1887,9 @@ psppire_data_window_iface_init (PsppireWindowIface *iface) iface->pick_filename = data_pick_filename; iface->load = load_file; } + + PsppireDataWindow * psppire_default_data_window (void) { @@ -1368,10 +1936,14 @@ psppire_data_window_for_data_store (PsppireDataStore *data_store) return NULL; } -void +GtkWindow * create_data_window (void) { - gtk_widget_show (psppire_data_window_new (NULL)); + GtkWidget *w = psppire_data_window_new (NULL); + + gtk_widget_show (w); + + return GTK_WINDOW (w); } void @@ -1392,4 +1964,3 @@ open_data_window (PsppireWindow *victim, const char *file_name, psppire_window_load (PSPPIRE_WINDOW (window), file_name, encoding, hint); gtk_widget_show_all (window); } - diff --git a/src/ui/gui/psppire-data-window.h b/src/ui/gui/psppire-data-window.h index a578501fc2..ee4d8e0cab 100644 --- a/src/ui/gui/psppire-data-window.h +++ b/src/ui/gui/psppire-data-window.h @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2010, 2011, 2012, 2013, 2014 Free Software Foundation + Copyright (C) 2008, 2010, 2011, 2012, 2013, 2014, 2016 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 @@ -65,7 +65,6 @@ struct _PsppireDataWindow /* */ PsppireDataEditor *data_editor; GtkBuilder *builder; - GtkUIManager *ui_manager; PsppireDict *dict; struct dataset *dataset; @@ -77,8 +76,27 @@ struct _PsppireDataWindow unsigned long int lazy_serial; unsigned int dataset_seqno; - GtkUIManager *uim; - guint merge_id; + GtkToolItem *ti_value_labels_button; + + GtkToolItem *ti_jump_to_variable; + GtkToolItem *ti_insert_variable; + GtkToolItem *ti_jump_to_case; + GtkToolItem *ti_insert_case; + GtkToolItem *ti_find; + + GtkWidget *mi_go_to_case; + GtkWidget *mi_insert_case; + GtkWidget *mi_find; + GtkWidget *mi_find_separator; + + + GtkWidget *mi_edit_separator ; + GtkWidget *mi_cut; + GtkWidget *mi_copy; + GtkWidget *mi_paste; + GtkWidget *mi_clear_variables; + GtkWidget *mi_clear_cases; + GtkWidget *mi_insert_var; }; struct _PsppireDataWindowClass @@ -100,7 +118,7 @@ PsppireDataWindow *psppire_data_window_for_dataset (struct dataset *); PsppireDataWindow *psppire_data_window_for_data_store (PsppireDataStore *); bool psppire_data_window_is_empty (PsppireDataWindow *); -void create_data_window (void); +GtkWindow * create_data_window (void); void open_data_window (PsppireWindow *victim, const char *file_name, const char *encoding, gpointer hint); diff --git a/src/ui/gui/psppire-dialog-action-1sks.c b/src/ui/gui/psppire-dialog-action-1sks.c index b96a16f0aa..7f31ebac47 100644 --- a/src/ui/gui/psppire-dialog-action-1sks.c +++ b/src/ui/gui/psppire-dialog-action-1sks.c @@ -143,8 +143,6 @@ psppire_dialog_action_1sks_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_1sks_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_1sks_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-aggregate.c b/src/ui/gui/psppire-dialog-action-aggregate.c index 0ed0b1636a..66dda9edcd 100644 --- a/src/ui/gui/psppire-dialog-action-aggregate.c +++ b/src/ui/gui/psppire-dialog-action-aggregate.c @@ -594,8 +594,6 @@ psppire_dialog_action_aggregate_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); } - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_aggregate_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_aggregate_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-autorecode.c b/src/ui/gui/psppire-dialog-action-autorecode.c index a3c2eefb8a..505ff30261 100644 --- a/src/ui/gui/psppire-dialog-action-autorecode.c +++ b/src/ui/gui/psppire-dialog-action-autorecode.c @@ -380,8 +380,6 @@ psppire_dialog_action_autorecode_activate (PsppireDialogAction *a) psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_autorecode_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_autorecode_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-barchart.c b/src/ui/gui/psppire-dialog-action-barchart.c index 813e92be0f..ee85831b64 100644 --- a/src/ui/gui/psppire-dialog-action-barchart.c +++ b/src/ui/gui/psppire-dialog-action-barchart.c @@ -153,8 +153,6 @@ psppire_dialog_action_barchart_activate (PsppireDialogAction *a) dialog_state_valid); } - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_barchart_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_barchart_parent_class)->activate (pda); } static char * diff --git a/src/ui/gui/psppire-dialog-action-binomial.c b/src/ui/gui/psppire-dialog-action-binomial.c index a88fe0ffd5..cafed134a2 100644 --- a/src/ui/gui/psppire-dialog-action-binomial.c +++ b/src/ui/gui/psppire-dialog-action-binomial.c @@ -128,8 +128,6 @@ psppire_dialog_action_binomial_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_binomial_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_binomial_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-chisquare.c b/src/ui/gui/psppire-dialog-action-chisquare.c index 305d741204..3a45e4a714 100644 --- a/src/ui/gui/psppire-dialog-action-chisquare.c +++ b/src/ui/gui/psppire-dialog-action-chisquare.c @@ -184,8 +184,6 @@ psppire_dialog_action_chisquare_activate (PsppireDialogAction *a) psppire_acr_set_model(PSPPIRE_ACR (values_acr), act->expected_list); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_chisquare_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_chisquare_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-comments.c b/src/ui/gui/psppire-dialog-action-comments.c index 05a2ec5a72..c500f1fad8 100644 --- a/src/ui/gui/psppire-dialog-action-comments.c +++ b/src/ui/gui/psppire-dialog-action-comments.c @@ -236,8 +236,6 @@ psppire_dialog_action_comments_activate (PsppireDialogAction *pda) - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_comments_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_comments_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-compute.c b/src/ui/gui/psppire-dialog-action-compute.c index c6d9692397..18292cec93 100644 --- a/src/ui/gui/psppire-dialog-action-compute.c +++ b/src/ui/gui/psppire-dialog-action-compute.c @@ -527,8 +527,6 @@ psppire_dialog_action_compute_activate (PsppireDialogAction *a) psppire_dialog_action_set_refresh (pda, refresh); } - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_compute_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-correlation.c b/src/ui/gui/psppire-dialog-action-correlation.c index 6f2702f115..676f13e6aa 100644 --- a/src/ui/gui/psppire-dialog-action-correlation.c +++ b/src/ui/gui/psppire-dialog-action-correlation.c @@ -115,8 +115,6 @@ psppire_dialog_action_correlation_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_correlation_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-count.c b/src/ui/gui/psppire-dialog-action-count.c index ae914ccfa8..337e38a01c 100644 --- a/src/ui/gui/psppire-dialog-action-count.c +++ b/src/ui/gui/psppire-dialog-action-count.c @@ -178,8 +178,6 @@ psppire_dialog_action_count_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_count_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_count_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-crosstabs.c b/src/ui/gui/psppire-dialog-action-crosstabs.c index 5fa62eeea6..97bdc46ba4 100644 --- a/src/ui/gui/psppire-dialog-action-crosstabs.c +++ b/src/ui/gui/psppire-dialog-action-crosstabs.c @@ -266,9 +266,6 @@ psppire_dialog_action_crosstabs_activate (PsppireDialogAction *a) G_CALLBACK (on_format_clicked), act); } - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_crosstabs_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_crosstabs_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-descriptives.c b/src/ui/gui/psppire-dialog-action-descriptives.c index f95ba90771..325596307e 100644 --- a/src/ui/gui/psppire-dialog-action-descriptives.c +++ b/src/ui/gui/psppire-dialog-action-descriptives.c @@ -231,8 +231,6 @@ psppire_dialog_action_descriptives_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, dialog_refresh); - - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_descriptives_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-examine.c b/src/ui/gui/psppire-dialog-action-examine.c index 51d3e7fd84..02a073cfba 100644 --- a/src/ui/gui/psppire-dialog-action-examine.c +++ b/src/ui/gui/psppire-dialog-action-examine.c @@ -259,8 +259,6 @@ psppire_dialog_action_examine_activate (PsppireDialogAction *a) g_signal_connect_swapped (opts_button, "clicked", G_CALLBACK (run_opts_dialog), act); - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_examine_parent_class)->activate (pda); - g_list_free (list); } diff --git a/src/ui/gui/psppire-dialog-action-factor.c b/src/ui/gui/psppire-dialog-action-factor.c index de78ae6c90..a417cc2d67 100644 --- a/src/ui/gui/psppire-dialog-action-factor.c +++ b/src/ui/gui/psppire-dialog-action-factor.c @@ -370,7 +370,6 @@ psppire_dialog_action_factor_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid); psppire_dialog_action_set_refresh (pda, dialog_refresh); - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_factor_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-flip.c b/src/ui/gui/psppire-dialog-action-flip.c index 40749d660d..1c823eddbe 100644 --- a/src/ui/gui/psppire-dialog-action-flip.c +++ b/src/ui/gui/psppire-dialog-action-flip.c @@ -112,8 +112,6 @@ psppire_dialog_action_flip_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_flip_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_flip_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-frequencies.c b/src/ui/gui/psppire-dialog-action-frequencies.c index a377d50a16..272723c2d7 100644 --- a/src/ui/gui/psppire-dialog-action-frequencies.c +++ b/src/ui/gui/psppire-dialog-action-frequencies.c @@ -348,11 +348,6 @@ psppire_dialog_action_frequencies_activate (PsppireDialogAction * a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); } - - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_frequencies_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS - (psppire_dialog_action_frequencies_parent_class)->activate (pda); } static char * diff --git a/src/ui/gui/psppire-dialog-action-histogram.c b/src/ui/gui/psppire-dialog-action-histogram.c index 4ac83d9787..bd0c8ea1f9 100644 --- a/src/ui/gui/psppire-dialog-action-histogram.c +++ b/src/ui/gui/psppire-dialog-action-histogram.c @@ -83,8 +83,6 @@ psppire_dialog_action_histogram_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_histogram_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_histogram_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-indep-samps.c b/src/ui/gui/psppire-dialog-action-indep-samps.c index a1fed40abf..de0d373be9 100644 --- a/src/ui/gui/psppire-dialog-action-indep-samps.c +++ b/src/ui/gui/psppire-dialog-action-indep-samps.c @@ -353,9 +353,6 @@ psppire_dialog_action_indep_samps_activate (PsppireDialogAction *a) G_CALLBACK (on_grp_var_change), act); on_grp_var_change (GTK_ENTRY (act->group_var_entry), act); - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_indep_samps_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_indep_samps_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-k-related.c b/src/ui/gui/psppire-dialog-action-k-related.c index dccf9e50d5..e8760fc4ba 100644 --- a/src/ui/gui/psppire-dialog-action-k-related.c +++ b/src/ui/gui/psppire-dialog-action-k-related.c @@ -133,8 +133,6 @@ psppire_dialog_action_k_related_activate (PsppireDialogAction *a) "predicate", var_is_numeric, NULL); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_k_related_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_k_related_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-kmeans.c b/src/ui/gui/psppire-dialog-action-kmeans.c index 0d5424012b..b25ecd475a 100644 --- a/src/ui/gui/psppire-dialog-action-kmeans.c +++ b/src/ui/gui/psppire-dialog-action-kmeans.c @@ -104,8 +104,6 @@ psppire_dialog_action_kmeans_activate (PsppireDialogAction *a) psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_kmeans_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_kmeans_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-logistic.c b/src/ui/gui/psppire-dialog-action-logistic.c index 4308d9b349..dcff91278a 100644 --- a/src/ui/gui/psppire-dialog-action-logistic.c +++ b/src/ui/gui/psppire-dialog-action-logistic.c @@ -145,8 +145,6 @@ psppire_dialog_action_logistic_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_logistic_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_logistic_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-means.c b/src/ui/gui/psppire-dialog-action-means.c index 7ff11177de..0093016150 100644 --- a/src/ui/gui/psppire-dialog-action-means.c +++ b/src/ui/gui/psppire-dialog-action-means.c @@ -127,7 +127,6 @@ psppire_dialog_action_means_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid); psppire_dialog_action_set_refresh (pda, dialog_refresh); - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_means_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-oneway.c b/src/ui/gui/psppire-dialog-action-oneway.c index f552a32148..d82ce27c31 100644 --- a/src/ui/gui/psppire-dialog-action-oneway.c +++ b/src/ui/gui/psppire-dialog-action-oneway.c @@ -273,8 +273,6 @@ psppire_dialog_action_oneway_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_oneway_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_oneway_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-paired.c b/src/ui/gui/psppire-dialog-action-paired.c index bdab615c81..31ff2844cf 100644 --- a/src/ui/gui/psppire-dialog-action-paired.c +++ b/src/ui/gui/psppire-dialog-action-paired.c @@ -197,8 +197,6 @@ psppire_dialog_action_paired_activate (PsppireDialogAction *a) act); } - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_paired_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_paired_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-rank.c b/src/ui/gui/psppire-dialog-action-rank.c index e5bce45e8c..16adb9f707 100644 --- a/src/ui/gui/psppire-dialog-action-rank.c +++ b/src/ui/gui/psppire-dialog-action-rank.c @@ -298,7 +298,6 @@ psppire_dialog_action_rank_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, (void *) dialog_state_valid); psppire_dialog_action_set_refresh (pda, dialog_refresh); - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_rank_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-recode-different.c b/src/ui/gui/psppire-dialog-action-recode-different.c index 2d28146c79..d8556cac41 100644 --- a/src/ui/gui/psppire-dialog-action-recode-different.c +++ b/src/ui/gui/psppire-dialog-action-recode-different.c @@ -335,9 +335,6 @@ psppire_dialog_action_recode_different_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_recode_different_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_recode_different_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-recode-same.c b/src/ui/gui/psppire-dialog-action-recode-same.c index 975ff8cead..d55745fbf9 100644 --- a/src/ui/gui/psppire-dialog-action-recode-same.c +++ b/src/ui/gui/psppire-dialog-action-recode-same.c @@ -119,9 +119,6 @@ psppire_dialog_action_recode_same_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_recode_same_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_recode_same_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-recode.c b/src/ui/gui/psppire-dialog-action-recode.c index 6e8b222b47..351b5b3995 100644 --- a/src/ui/gui/psppire-dialog-action-recode.c +++ b/src/ui/gui/psppire-dialog-action-recode.c @@ -440,14 +440,6 @@ psppire_dialog_action_recode_refresh (PsppireDialogAction *rd_) } -static void -psppire_dialog_action_recode_activate (PsppireDialogAction *act) -{ - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_recode_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_recode_parent_class)->activate (act); -} - - void psppire_dialog_action_recode_pre_activate (PsppireDialogActionRecode *act, void (*populate_treeview) (PsppireDialogActionRecode *)) { @@ -670,7 +662,6 @@ psppire_dialog_action_recode_generate_syntax (const PsppireDialogAction *act, static void psppire_dialog_action_recode_class_init (PsppireDialogActionRecodeClass *class) { - psppire_dialog_action_set_activation (class, psppire_dialog_action_recode_activate); } diff --git a/src/ui/gui/psppire-dialog-action-regression.c b/src/ui/gui/psppire-dialog-action-regression.c index 58d183e63f..183301d02f 100644 --- a/src/ui/gui/psppire-dialog-action-regression.c +++ b/src/ui/gui/psppire-dialog-action-regression.c @@ -186,8 +186,6 @@ psppire_dialog_action_regression_activate (PsppireDialogAction *a) G_CALLBACK (on_save_clicked), act); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_regression_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_regression_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-reliability.c b/src/ui/gui/psppire-dialog-action-reliability.c index e7b0d63f55..11d1eeefc1 100644 --- a/src/ui/gui/psppire-dialog-action-reliability.c +++ b/src/ui/gui/psppire-dialog-action-reliability.c @@ -165,8 +165,6 @@ psppire_dialog_action_reliability_activate (PsppireDialogAction *a) psppire_dialog_action_set_refresh (pda, refresh); psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_reliability_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-roc.c b/src/ui/gui/psppire-dialog-action-roc.c index a01942c670..9f44f7ad44 100644 --- a/src/ui/gui/psppire-dialog-action-roc.c +++ b/src/ui/gui/psppire-dialog-action-roc.c @@ -158,8 +158,6 @@ psppire_dialog_action_roc_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_roc_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_roc_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-runs.c b/src/ui/gui/psppire-dialog-action-runs.c index 6598b1e114..a0e9e30357 100644 --- a/src/ui/gui/psppire-dialog-action-runs.c +++ b/src/ui/gui/psppire-dialog-action-runs.c @@ -154,8 +154,6 @@ psppire_dialog_action_runs_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_runs_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_runs_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-scatterplot.c b/src/ui/gui/psppire-dialog-action-scatterplot.c index 503af138f5..fa5d6233f7 100644 --- a/src/ui/gui/psppire-dialog-action-scatterplot.c +++ b/src/ui/gui/psppire-dialog-action-scatterplot.c @@ -113,8 +113,6 @@ psppire_dialog_action_scatterplot_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_scatterplot_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-select.c b/src/ui/gui/psppire-dialog-action-select.c index 29e88ecc82..37451876ab 100644 --- a/src/ui/gui/psppire-dialog-action-select.c +++ b/src/ui/gui/psppire-dialog-action-select.c @@ -360,8 +360,6 @@ psppire_dialog_action_select_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_select_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_select_parent_class)->activate (pda); } diff --git a/src/ui/gui/psppire-dialog-action-sort.c b/src/ui/gui/psppire-dialog-action-sort.c index 2acbb19b2b..2a0be711a7 100644 --- a/src/ui/gui/psppire-dialog-action-sort.c +++ b/src/ui/gui/psppire-dialog-action-sort.c @@ -114,8 +114,6 @@ psppire_dialog_action_sort_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_sort_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-split.c b/src/ui/gui/psppire-dialog-action-split.c index ae8f30a757..bebc599aed 100644 --- a/src/ui/gui/psppire-dialog-action-split.c +++ b/src/ui/gui/psppire-dialog-action-split.c @@ -168,8 +168,6 @@ psppire_dialog_action_split_activate (PsppireDialogAction *pda) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_split_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_split_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-tt1s.c b/src/ui/gui/psppire-dialog-action-tt1s.c index d1a4d8e10c..d3ac045273 100644 --- a/src/ui/gui/psppire-dialog-action-tt1s.c +++ b/src/ui/gui/psppire-dialog-action-tt1s.c @@ -135,8 +135,6 @@ psppire_dialog_action_tt1s_activate (PsppireDialogAction *a) g_signal_connect_swapped (options_button, "clicked", G_CALLBACK (tt_options_dialog_run), act->opt); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_tt1s_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_tt1s_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-two-sample.c b/src/ui/gui/psppire-dialog-action-two-sample.c index 39c88b1d11..f450efb369 100644 --- a/src/ui/gui/psppire-dialog-action-two-sample.c +++ b/src/ui/gui/psppire-dialog-action-two-sample.c @@ -229,8 +229,6 @@ psppire_dialog_action_two_sample_activate (PsppireDialogAction *a) select_as_pair_member, act); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_two_sample_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_two_sample_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-univariate.c b/src/ui/gui/psppire-dialog-action-univariate.c index 7585cea2d2..aa833dd332 100644 --- a/src/ui/gui/psppire-dialog-action-univariate.c +++ b/src/ui/gui/psppire-dialog-action-univariate.c @@ -105,8 +105,6 @@ psppire_dialog_action_univariate_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_univariate_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_univariate_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-var-info.c b/src/ui/gui/psppire-dialog-action-var-info.c index dd2c9aefd2..59c9dabd47 100644 --- a/src/ui/gui/psppire-dialog-action-var-info.c +++ b/src/ui/gui/psppire-dialog-action-var-info.c @@ -180,7 +180,7 @@ psppire_dialog_action_var_info_activate (PsppireDialogAction *a) act->output = psppire_output_view_new (GTK_LAYOUT (get_widget_assert (xml, "layout1")), - NULL, NULL, NULL); + NULL); pda->dialog = get_widget_assert (xml, "variable-info-dialog"); pda->source = get_widget_assert (xml, "treeview2"); @@ -199,9 +199,6 @@ psppire_dialog_action_var_info_activate (PsppireDialogAction *a) psppire_dialog_action_set_valid_predicate (pda, treeview_item_selected); } - - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_var_info_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_var_info_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action-weight.c b/src/ui/gui/psppire-dialog-action-weight.c index eb8e5bd3af..79f7254c55 100644 --- a/src/ui/gui/psppire-dialog-action-weight.c +++ b/src/ui/gui/psppire-dialog-action-weight.c @@ -156,8 +156,6 @@ psppire_dialog_action_weight_activate (PsppireDialogAction *pda) psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid); psppire_dialog_action_set_refresh (pda, refresh); - if (PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_weight_parent_class)->activate) - PSPPIRE_DIALOG_ACTION_CLASS (psppire_dialog_action_weight_parent_class)->activate (pda); } static void diff --git a/src/ui/gui/psppire-dialog-action.c b/src/ui/gui/psppire-dialog-action.c index 32cfcc702d..ab04cae302 100644 --- a/src/ui/gui/psppire-dialog-action.c +++ b/src/ui/gui/psppire-dialog-action.c @@ -26,14 +26,117 @@ static void psppire_dialog_action_init (PsppireDialogAction *act); static void psppire_dialog_action_class_init (PsppireDialogActionClass *class); -G_DEFINE_ABSTRACT_TYPE (PsppireDialogAction, psppire_dialog_action, GTK_TYPE_ACTION); +static GObjectClass * parent_class = NULL; + + +static const gchar * +__get_name (GAction *act) +{ + return G_OBJECT_TYPE_NAME (act); +} + +static const GVariantType * +__get_state_type (GAction *act) +{ + return NULL; +} + + +static GVariant * +__get_state (GAction *act) +{ + return NULL; +} + + +static const GVariantType * +__get_parameter_type (GAction *act) +{ + return PSPPIRE_DIALOG_ACTION (act)->parameter_type; +} + +static gboolean +__get_enabled (GAction *act) +{ + return TRUE; +} + +static void psppire_dialog_action_activate (PsppireDialogAction *act, GVariant *parameter); + +void +psppire_dialog_action_activate_null (PsppireDialogAction *act) +{ + psppire_dialog_action_activate (act, NULL); +} + + +static void +__activate (GAction *action, GVariant *parameter) +{ + psppire_dialog_action_activate (PSPPIRE_DIALOG_ACTION (action), parameter); +} + + +static void +action_model_init (GActionInterface *iface) +{ + iface->get_name = __get_name; + iface->get_state_type = __get_state_type; + iface->get_state = __get_state; + iface->get_parameter_type = __get_parameter_type; + iface->get_enabled = __get_enabled; + iface->activate = __activate; +} + + +GType +psppire_dialog_action_get_type (void) +{ + static GType de_type = 0; + + if (!de_type) + { + static const GTypeInfo de_info = + { + sizeof (PsppireDialogActionClass), + NULL, /* base_init */ + NULL, /* base_finalize */ + (GClassInitFunc) psppire_dialog_action_class_init, + NULL, /* class_finalize */ + NULL, /* class_data */ + sizeof (PsppireDialogAction), + 0, + (GInstanceInitFunc) psppire_dialog_action_init, + }; + + + static const GInterfaceInfo ga_info = { + (GInterfaceInitFunc) action_model_init, + NULL, + NULL + }; + + + de_type = g_type_register_static (G_TYPE_OBJECT, "PsppireDialogAction", + &de_info, G_TYPE_FLAG_ABSTRACT); + + g_type_add_interface_static (de_type, G_TYPE_ACTION, &ga_info); + } + + return de_type; +} + /* Properties */ enum { PROP_0, - PROP_MANAGER, PROP_TOPLEVEL, + PROP_NAME, + PROP_ENABLED, + PROP_STATE, + PROP_STATE_TYPE, + PROP_PARAMETER_TYPE }; static void @@ -46,11 +149,10 @@ psppire_dialog_action_set_property (GObject *object, switch (prop_id) { - case PROP_MANAGER: + case PROP_TOPLEVEL: { - GObject *p = g_value_get_object (value); - act->uim = GTK_UI_MANAGER (p); + act->toplevel = GTK_WIDGET (p); } break; default: @@ -70,10 +172,7 @@ psppire_dialog_action_get_property (GObject *object, switch (prop_id) { - case PROP_MANAGER: - g_value_take_object (value, dialog_action->uim); - break; - case PROP_TOPLEVEL: + case PROP_TOPLEVEL: g_value_take_object (value, dialog_action->toplevel); break; default: @@ -83,18 +182,6 @@ psppire_dialog_action_get_property (GObject *object, } -static void -set_toplevel (PsppireDialogAction *act) -{ - if (act->toplevel) - return; - - GSList *sl = gtk_ui_manager_get_toplevels (act->uim, GTK_UI_MANAGER_MENUBAR | GTK_UI_MANAGER_TOOLBAR); - g_return_if_fail (sl); - - act->toplevel = gtk_widget_get_toplevel (GTK_WIDGET (sl->data)); - g_slist_free (sl); -} static void on_destroy_dataset (GObject *w) @@ -117,8 +204,6 @@ on_destroy_dataset (GObject *w) GHashTable * psppire_dialog_action_get_hash_table (PsppireDialogAction *act) { - set_toplevel (act); - GHashTable *t = g_object_get_data (G_OBJECT (act->toplevel), "thing-table"); if (t == NULL) { @@ -131,36 +216,37 @@ psppire_dialog_action_get_hash_table (PsppireDialogAction *act) return t; } + static void -psppire_dialog_action_activate (PsppireDialogAction *act) +psppire_dialog_action_activate (PsppireDialogAction *act, GVariant *parameter) { gint response; PsppireDialogActionClass *class = PSPPIRE_DIALOG_ACTION_GET_CLASS (act); - gboolean first_time = ! act->toplevel; - - set_toplevel (act); - act->dict = PSPPIRE_DATA_WINDOW(act->toplevel)->dict; - if (act->source) - g_object_set (act->source, "model", act->dict, NULL); GSList *wl = g_object_get_data (G_OBJECT (act->toplevel), "widget-list"); wl = g_slist_prepend (wl, act->dialog); g_object_set_data (G_OBJECT (act->toplevel), "widget-list", wl); - gtk_window_set_transient_for (GTK_WINDOW (act->dialog), GTK_WINDOW (act->toplevel)); + if (class->activate) + class->activate (act, parameter); - if (GTK_ACTION_CLASS (psppire_dialog_action_parent_class)->activate) - GTK_ACTION_CLASS (psppire_dialog_action_parent_class)->activate ( GTK_ACTION (act)); + gtk_window_set_transient_for (GTK_WINDOW (act->dialog), + GTK_WINDOW (act->toplevel)); if (act->source) - gtk_widget_grab_focus (act->source); + { + g_object_set (act->source, "model", act->dict, NULL); + gtk_widget_grab_focus (act->source); + } - if (first_time) + if (!act->activated) psppire_dialog_reload (PSPPIRE_DIALOG (act->dialog)); + act->activated = TRUE; + response = psppire_dialog_run (PSPPIRE_DIALOG (act->dialog)); if ( class->generate_syntax ) @@ -185,19 +271,14 @@ psppire_dialog_action_class_init (PsppireDialogActionClass *class) { GObjectClass *object_class = G_OBJECT_CLASS (class); - GParamSpec *manager_spec = - g_param_spec_object ("manager", - "Manager", - "The GtkUIManager which created this object", - GTK_TYPE_UI_MANAGER, - G_PARAM_READWRITE); + parent_class = g_type_class_peek_parent (class); GParamSpec *toplevel_spec = g_param_spec_object ("top-level", "Top Level", "The top level widget to which this dialog action belongs", GTK_TYPE_WINDOW, - G_PARAM_READABLE); + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY); object_class->set_property = psppire_dialog_action_set_property; object_class->get_property = psppire_dialog_action_get_property; @@ -206,13 +287,15 @@ psppire_dialog_action_class_init (PsppireDialogActionClass *class) class->activate = psppire_dialog_action_activate; - g_object_class_install_property (object_class, - PROP_MANAGER, - manager_spec); - g_object_class_install_property (object_class, PROP_TOPLEVEL, toplevel_spec); + + g_object_class_override_property (object_class, PROP_NAME, "name"); + g_object_class_override_property (object_class, PROP_ENABLED, "enabled"); + g_object_class_override_property (object_class, PROP_STATE, "state"); + g_object_class_override_property (object_class, PROP_STATE_TYPE, "state-type"); + g_object_class_override_property (object_class, PROP_PARAMETER_TYPE, "parameter-type"); } @@ -221,9 +304,10 @@ psppire_dialog_action_init (PsppireDialogAction *act) { act->toplevel = NULL; act->dict = NULL; + act->activated = FALSE; + act->parameter_type = NULL; } - void psppire_dialog_action_set_valid_predicate (PsppireDialogAction *act, ContentsAreValid dialog_state_valid) @@ -243,6 +327,6 @@ psppire_dialog_action_set_refresh (PsppireDialogAction *pda, void psppire_dialog_action_set_activation (gpointer class, activation activate) { - GTK_ACTION_CLASS (class)->activate = (void (*)(GtkAction *)) activate; + PSPPIRE_DIALOG_ACTION_CLASS (class)->activate = (void (*)(PsppireDialogAction *, GVariant *)) activate; } diff --git a/src/ui/gui/psppire-dialog-action.h b/src/ui/gui/psppire-dialog-action.h index c48173a107..6abe81419c 100644 --- a/src/ui/gui/psppire-dialog-action.h +++ b/src/ui/gui/psppire-dialog-action.h @@ -15,7 +15,7 @@ along with this program. If not, see . */ /* - This is a an abstract base class, deriving from GtkAction. + This is a an abstract base class, which implements GAction. It's purpose is to abstract the way in which dialog boxes behave. That is, this action will fire whenever a dialog box is to be popped up. @@ -67,22 +67,23 @@ typedef struct _PsppireDialogActionClass PsppireDialogActionClass; struct _PsppireDialogAction { - GtkAction parent; + GObject parent; /*< private >*/ - GtkUIManager *uim; - + GVariantType *parameter_type; GtkWidget *source; GtkWidget *dialog; GtkWidget *toplevel; PsppireDict *dict; + + gboolean activated; }; struct _PsppireDialogActionClass { - GtkActionClass parent_class; - void (*activate) (PsppireDialogAction *); + GObjectClass parent_class; + void (*activate) (PsppireDialogAction *, GVariant *); char * (*generate_syntax) (const PsppireDialogAction *); }; @@ -102,6 +103,7 @@ void psppire_dialog_action_set_activation (gpointer class, activation a); GHashTable *psppire_dialog_action_get_hash_table (PsppireDialogAction *act); +void psppire_dialog_action_activate_null (PsppireDialogAction *act); G_END_DECLS diff --git a/src/ui/gui/psppire-dictview.c b/src/ui/gui/psppire-dictview.c index b51d9ad4f0..f550f41381 100644 --- a/src/ui/gui/psppire-dictview.c +++ b/src/ui/gui/psppire-dictview.c @@ -359,9 +359,10 @@ var_icon_cell_data_func (GtkTreeViewColumn *col, gtk_tree_model_get (model, iter, DICT_TVM_COL_VAR, &var, -1); - g_object_set (cell, "stock_id", - get_var_measurement_stock_id (var_get_print_format (var)->type, - var_get_measure (var)), + g_object_set (cell, + "stock-size", GTK_ICON_SIZE_MENU, + "icon-name", get_var_measurement_stock_id (var_get_print_format (var)->type, + var_get_measure (var)), NULL); } diff --git a/src/ui/gui/psppire-output-view.c b/src/ui/gui/psppire-output-view.c index a7367ed76a..08daef95bf 100644 --- a/src/ui/gui/psppire-output-view.c +++ b/src/ui/gui/psppire-output-view.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008-2015 Free Software Foundation. + Copyright (C) 2008-2015, 2016 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 @@ -589,10 +589,12 @@ on_copy (struct psppire_output_view *view) } static void -on_selection_change (GtkTreeSelection *sel, GtkAction *copy_action) +on_selection_change (GtkTreeSelection *sel, GAction *copy_action) { /* The Copy action is available only if there is something selected */ - gtk_action_set_sensitive (copy_action, gtk_tree_selection_count_selected_rows (sel) > 0); + g_object_set (copy_action, + "enabled", gtk_tree_selection_count_selected_rows (sel) > 0, + NULL); } static void @@ -617,16 +619,41 @@ on_size_allocate (GtkWidget *widget, } } +static void +on_realize (GtkWidget *overview, GObject *view) +{ + GtkTreeSelection *sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (overview)); + gtk_tree_selection_set_mode (sel, GTK_SELECTION_MULTIPLE); + + GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (overview)); + + GAction *copy_action = g_action_map_lookup_action (G_ACTION_MAP (toplevel), + "copy"); + + GAction *select_all_action = g_action_map_lookup_action (G_ACTION_MAP (toplevel), + "select-all"); + + g_object_set (copy_action, "enabled", FALSE, NULL); + + g_signal_connect_swapped (select_all_action, "activate", + G_CALLBACK (on_select_all), view); + + g_signal_connect_swapped (copy_action, "activate", + G_CALLBACK (on_copy), view); + + g_signal_connect (sel, "changed", G_CALLBACK (on_selection_change), + copy_action); +} + struct psppire_output_view * -psppire_output_view_new (GtkLayout *output, GtkTreeView *overview, - GtkAction *copy_action, GtkAction *select_all_action) +psppire_output_view_new (GtkLayout *output, GtkTreeView *overview) { struct psppire_output_view *view; GtkTreeViewColumn *column; GtkCellRenderer *renderer; - GtkTreeSelection *sel; - GtkTreeModel *model; + GtkTreeModel *model; + view = xmalloc (sizeof *view); view->xr = NULL; view->font_height = 0; @@ -656,6 +683,8 @@ psppire_output_view_new (GtkLayout *output, GtkTreeView *overview, if (overview) { + g_signal_connect (overview, "realize", G_CALLBACK (on_realize), view); + model = GTK_TREE_MODEL (gtk_tree_store_new ( N_COLS, G_TYPE_STRING, /* COL_NAME */ @@ -664,11 +693,6 @@ psppire_output_view_new (GtkLayout *output, GtkTreeView *overview, gtk_tree_view_set_model (overview, model); g_object_unref (model); - sel = gtk_tree_view_get_selection (overview); - gtk_tree_selection_set_mode (sel, GTK_SELECTION_MULTIPLE); - g_signal_connect (sel, "changed", G_CALLBACK (on_selection_change), - copy_action); - column = gtk_tree_view_column_new (); gtk_tree_view_append_column (GTK_TREE_VIEW (overview), column); renderer = gtk_cell_renderer_text_new (); @@ -677,12 +701,6 @@ psppire_output_view_new (GtkLayout *output, GtkTreeView *overview, g_signal_connect (GTK_TREE_VIEW (overview), "row-activated", G_CALLBACK (on_row_activate), view); - - gtk_action_set_sensitive (copy_action, FALSE); - g_signal_connect_swapped (copy_action, "activate", - G_CALLBACK (on_copy), view); - g_signal_connect_swapped (select_all_action, "activate", - G_CALLBACK (on_select_all), view); } return view; diff --git a/src/ui/gui/psppire-output-view.h b/src/ui/gui/psppire-output-view.h index d46c5e0706..a54b953cfc 100644 --- a/src/ui/gui/psppire-output-view.h +++ b/src/ui/gui/psppire-output-view.h @@ -24,9 +24,8 @@ struct output_item; struct string_map; struct psppire_output_view *psppire_output_view_new (GtkLayout *output, - GtkTreeView *overview, - GtkAction *copy_action, - GtkAction *select_all_action); + GtkTreeView *overview); + void psppire_output_view_clear (struct psppire_output_view *); void psppire_output_view_destroy (struct psppire_output_view *); diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index 469966af23..ba2dc8410d 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2016 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 @@ -145,6 +145,10 @@ psppire_output_submit (struct output_driver *this, if (new) { pod->window = PSPPIRE_OUTPUT_WINDOW (psppire_output_window_new ()); + GApplication *app = g_application_get_default (); + gtk_application_add_window (GTK_APPLICATION (app), + GTK_WINDOW (pod->window)); + pod->window->driver = pod; } window = pod->window; @@ -475,17 +479,17 @@ static void psppire_output_window_init (PsppireOutputWindow *window) { GtkBuilder *xml = builder_new ("output-window.ui"); - - GtkWidget *box = get_widget_assert (xml, "box1"); + GtkApplication *app = GTK_APPLICATION (g_application_get_default()); + GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), box); + GtkWidget *paned = get_widget_assert (xml, "paned1"); + window->dispose_has_run = FALSE; window->view = psppire_output_view_new ( GTK_LAYOUT (get_widget_assert (xml, "output")), - GTK_TREE_VIEW (get_widget_assert (xml, "overview")), - get_action_assert (xml, "edit_copy"), - get_action_assert (xml, "edit_select-all")); + GTK_TREE_VIEW (get_widget_assert (xml, "overview"))); connect_help (xml); @@ -495,7 +499,10 @@ psppire_output_window_init (PsppireOutputWindow *window) G_CALLBACK (cancel_urgency), NULL); - GtkWidget *menubar = get_widget_assert (xml, "menubar"); + GObject *menu = get_object_assert (xml, "output-window-menu", G_TYPE_MENU); + GtkWidget *menubar = gtk_menu_bar_new_from_model (G_MENU_MODEL (menu)); + gtk_box_pack_start (GTK_BOX (box), menubar, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (box), paned, TRUE, TRUE, 0); gtk_menu_shell_append (GTK_MENU_SHELL (menubar), create_windows_menu (GTK_WINDOW (window))); @@ -503,14 +510,41 @@ psppire_output_window_init (PsppireOutputWindow *window) gtk_menu_shell_append (GTK_MENU_SHELL (menubar), create_help_menu (GTK_WINDOW (window))); + { + GSimpleAction *print = g_simple_action_new ("print", NULL); + g_signal_connect_swapped (print, "activate", G_CALLBACK (psppire_output_window_print), window); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (print)); + + + const gchar *accels[2] = { "P", NULL}; + gtk_application_set_accels_for_action (app, + "win.print", + accels); + } + + + { + GSimpleAction *export = g_simple_action_new ("export", NULL); + g_signal_connect_swapped (export, "activate", G_CALLBACK (psppire_output_window_export), window); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (export)); + } - g_signal_connect_swapped (get_action_assert (xml, "file_export"), "activate", - G_CALLBACK (psppire_output_window_export), window); + { + GSimpleAction *select_all = g_simple_action_new ("select-all", NULL); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (select_all)); + } + { + GSimpleAction *copy = g_simple_action_new ("copy", NULL); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (copy)); - g_signal_connect_swapped (get_action_assert (xml, "file_print"), "activate", - G_CALLBACK (psppire_output_window_print), window); + const gchar *accels[2] = { "C", NULL}; + gtk_application_set_accels_for_action (app, + "win.copy", + accels); + } + g_object_unref (xml); g_signal_connect (window, "delete-event", @@ -522,7 +556,7 @@ GtkWidget* psppire_output_window_new (void) { return GTK_WIDGET (g_object_new (psppire_output_window_get_type (), - /* TRANSLATORS: This will form a filename. Please avoid whitespace. */ + /* TRANSLATORS: This will be part of a filename. Please avoid whitespace. */ "filename", _("Output"), "description", _("Output Viewer"), NULL)); diff --git a/src/ui/gui/psppire-syntax-window.c b/src/ui/gui/psppire-syntax-window.c index f8758a0cd7..fddc005e5f 100644 --- a/src/ui/gui/psppire-syntax-window.c +++ b/src/ui/gui/psppire-syntax-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014, 2016 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 @@ -281,9 +281,9 @@ selection_changed (PsppireSyntaxWindow *sw) { gboolean sel = gtk_text_buffer_get_has_selection (GTK_TEXT_BUFFER (sw->buffer)); - gtk_action_set_sensitive (sw->edit_copy, sel); - gtk_action_set_sensitive (sw->edit_cut, sel); - gtk_action_set_sensitive (sw->edit_delete, sel); + g_object_set (sw->edit_copy, "enabled", sel, NULL); + g_object_set (sw->edit_cut, "enabled", sel, NULL); + g_object_set (sw->edit_delete, "enabled", sel, NULL); } /* The callback which runs when something request clipboard data */ @@ -400,7 +400,7 @@ set_paste_sensitivity (GtkClipboard *clip, GdkEventOwnerChange *event, gpointer } } - gtk_action_set_sensitive (sw->edit_paste, compatible_target); + g_object_set (sw->edit_paste, "enabled", compatible_target, NULL); } @@ -408,10 +408,9 @@ set_paste_sensitivity (GtkClipboard *clip, GdkEventOwnerChange *event, gpointer /* Parse and execute all the text in the buffer */ static void -on_run_all (GtkMenuItem *menuitem, gpointer user_data) +on_run_all (PsppireSyntaxWindow *se) { GtkTextIter begin, end; - PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (se->buffer), &begin, 0); gtk_text_buffer_get_iter_at_offset (GTK_TEXT_BUFFER (se->buffer), &end, -1); @@ -421,10 +420,9 @@ on_run_all (GtkMenuItem *menuitem, gpointer user_data) /* Parse and execute the currently selected text */ static void -on_run_selection (GtkMenuItem *menuitem, gpointer user_data) +on_run_selection (PsppireSyntaxWindow *se) { GtkTextIter begin, end; - PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); if ( gtk_text_buffer_get_selection_bounds (GTK_TEXT_BUFFER (se->buffer), &begin, &end) ) editor_execute_syntax (se, begin, end); @@ -434,14 +432,12 @@ on_run_selection (GtkMenuItem *menuitem, gpointer user_data) /* Parse and execute the from the current line, to the end of the buffer */ static void -on_run_to_end (GtkMenuItem *menuitem, gpointer user_data) +on_run_to_end (PsppireSyntaxWindow *se) { GtkTextIter begin, end; GtkTextIter here; gint line; - PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); - /* Get the current line */ gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (se->buffer), &here, @@ -462,14 +458,12 @@ on_run_to_end (GtkMenuItem *menuitem, gpointer user_data) /* Parse and execute the current line */ static void -on_run_current_line (GtkMenuItem *menuitem, gpointer user_data) +on_run_current_line (PsppireSyntaxWindow *se) { GtkTextIter begin, end; GtkTextIter here; gint line; - PsppireSyntaxWindow *se = PSPPIRE_SYNTAX_WINDOW (user_data); - /* Get the current line */ gtk_text_buffer_get_iter_at_mark (GTK_TEXT_BUFFER (se->buffer), &here, @@ -629,16 +623,6 @@ syntax_save (PsppireWindow *se) } -/* Callback for the File->Quit menuitem */ -static gboolean -on_quit (GtkMenuItem *menuitem, gpointer user_data) -{ - psppire_quit (); - - return FALSE; -} - - static void load_and_show_syntax_window (GtkWidget *se, const gchar *filename, const gchar *encoding) @@ -659,6 +643,7 @@ void create_syntax_window (void) { GtkWidget *w = psppire_syntax_window_new (NULL); + gtk_widget_show (w); } @@ -699,7 +684,9 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) GtkBuilder *xml = builder_new ("syntax-editor.ui"); GtkWidget *box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - GtkWidget *menubar = get_widget_assert (xml, "menubar"); + GObject *menu = get_object_assert (xml, "syntax-window-menu", G_TYPE_MENU); + GtkWidget *menubar = gtk_menu_bar_new_from_model (G_MENU_MODEL (menu)); + GtkWidget *sw = get_widget_assert (xml, "scrolledwindow8"); GtkWidget *text_view = get_widget_assert (xml, "syntax_text_view"); @@ -711,9 +698,14 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) GtkClipboard *clip_primary = gtk_widget_get_clipboard (GTK_WIDGET (window), GDK_SELECTION_PRIMARY); window->print_settings = NULL; - window->undo_menuitem = get_action_assert (xml, "edit_undo"); - window->redo_menuitem = get_action_assert (xml, "edit_redo"); + window->undo_menuitem = g_simple_action_new ("undo", NULL); + window->redo_menuitem = g_simple_action_new ("redo", NULL); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (window->undo_menuitem)); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (window->redo_menuitem)); + + if (class->lan) window->buffer = gtk_source_buffer_new_with_language (class->lan); else @@ -738,10 +730,19 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) window->cliptext = NULL; window->dispose_has_run = FALSE; - window->edit_delete = get_action_assert (xml, "edit_delete"); - window->edit_copy = get_action_assert (xml, "edit_copy"); - window->edit_cut = get_action_assert (xml, "edit_cut"); - window->edit_paste = get_action_assert (xml, "edit_paste"); + + window->edit_delete = g_simple_action_new ("delete", NULL); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (window->edit_delete)); + + window->edit_copy = g_simple_action_new ("copy", NULL); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (window->edit_copy)); + + window->edit_cut = g_simple_action_new ("cut", NULL); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (window->edit_cut)); + + window->edit_paste = g_simple_action_new ("paste", NULL); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (window->edit_paste)); + window->buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (text_view))); @@ -754,13 +755,19 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) g_signal_connect (window->buffer, "modified-changed", G_CALLBACK (on_modified_changed), window); - g_signal_connect_swapped (get_action_assert (xml, "file_print"), "activate", - G_CALLBACK (psppire_syntax_window_print), window); + { + GSimpleAction *print = g_simple_action_new ("print", NULL); + + g_signal_connect_swapped (print, "activate", + G_CALLBACK (psppire_syntax_window_print), window); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (print)); + } g_signal_connect_swapped (window->undo_menuitem, "activate", - G_CALLBACK (undo_last_edit), + G_CALLBACK (undo_last_edit), window); g_signal_connect_swapped (window->redo_menuitem, @@ -770,6 +777,7 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) undo_redo_update (window); + window->sel_handler = g_signal_connect_swapped (clip_primary, "owner-change", G_CALLBACK (selection_changed), window); @@ -780,8 +788,6 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) gtk_container_add (GTK_CONTAINER (window), box); - g_object_ref (menubar); - g_object_ref (sw); g_object_ref (window->sb); @@ -792,32 +798,55 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) gtk_widget_show_all (box); - g_signal_connect_swapped (get_action_assert (xml,"file_new_syntax"), "activate", G_CALLBACK (create_syntax_window), NULL); + GApplication *app = g_application_get_default (); + + { + GSimpleAction *open = g_simple_action_new ("open", NULL); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (open)); + + g_signal_connect_swapped (open, + "activate", + G_CALLBACK (psppire_window_open), + window); + } + + { + GSimpleAction *save = g_simple_action_new ("save", NULL); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (save)); + + g_signal_connect_swapped (save, + "activate", + G_CALLBACK (psppire_window_save), + window); + + const gchar *accels[2] = { "S", NULL}; + gtk_application_set_accels_for_action (app, + "win.save", + accels); + + } - g_signal_connect (get_action_assert (xml,"file_new_data"), - "activate", - G_CALLBACK (create_data_window), - window); + { + GSimpleAction *save_as = g_simple_action_new ("save_as", NULL); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (save_as)); + + g_signal_connect_swapped (save_as, + "activate", + G_CALLBACK (psppire_window_save_as), + window); - g_signal_connect_swapped (get_action_assert (xml, "file_open"), - "activate", - G_CALLBACK (psppire_window_open), - window); - - g_signal_connect_swapped (get_action_assert (xml, "file_save"), - "activate", - G_CALLBACK (psppire_window_save), - window); - g_signal_connect_swapped (get_action_assert (xml, "file_save_as"), - "activate", - G_CALLBACK (psppire_window_save_as), - window); + const gchar *accels[2] = { "S", NULL}; + gtk_application_set_accels_for_action (app, + "win.save_as", + accels); + + + } - g_signal_connect (get_action_assert (xml,"file_quit"), - "activate", - G_CALLBACK (on_quit), - window); g_signal_connect_swapped (window->edit_delete, "activate", @@ -839,31 +868,53 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) G_CALLBACK (on_edit_paste), window); - g_signal_connect (get_action_assert (xml,"run_all"), - "activate", - G_CALLBACK (on_run_all), - window); + { + GSimpleAction *run_all = g_simple_action_new ("run-all", NULL); - g_signal_connect (get_action_assert (xml,"run_selection"), - "activate", - G_CALLBACK (on_run_selection), - window); + g_signal_connect_swapped (run_all, "activate", + G_CALLBACK (on_run_all), window); - g_signal_connect (get_action_assert (xml,"run_current_line"), - "activate", - G_CALLBACK (on_run_current_line), - window); + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (run_all)); + } - g_signal_connect (get_action_assert (xml,"run_to_end"), - "activate", - G_CALLBACK (on_run_to_end), - window); + { + GSimpleAction *run_current_line = g_simple_action_new ("run-current-line", NULL); + + g_signal_connect_swapped (run_current_line, "activate", + G_CALLBACK (on_run_current_line), window); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (run_current_line)); + + GApplication *app = g_application_get_default (); + const gchar *accels[2] = { "R", NULL}; + gtk_application_set_accels_for_action (app, + "win.run-current-line", + accels); + } + + { + GSimpleAction *run_selection = g_simple_action_new ("run-selection", NULL); + + g_signal_connect_swapped (run_selection, "activate", + G_CALLBACK (on_run_selection), window); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (run_selection)); + } + + { + GSimpleAction *run_to_end = g_simple_action_new ("run-to-end", NULL); + + g_signal_connect_swapped (run_to_end, "activate", + G_CALLBACK (on_run_to_end), window); + + g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (run_to_end)); + } gtk_menu_shell_append (GTK_MENU_SHELL (menubar), - create_windows_menu (GTK_WINDOW (window))); + create_windows_menu (GTK_WINDOW (window))); gtk_menu_shell_append (GTK_MENU_SHELL (menubar), - create_help_menu (GTK_WINDOW (window))); + create_help_menu (GTK_WINDOW (window))); g_object_unref (xml); } @@ -872,13 +923,18 @@ psppire_syntax_window_init (PsppireSyntaxWindow *window) -GtkWidget* +GtkWidget * psppire_syntax_window_new (const char *encoding) { - return GTK_WIDGET (g_object_new (psppire_syntax_window_get_type (), - "description", _("Syntax Editor"), - "encoding", encoding, - NULL)); + GObject *sw = g_object_new (psppire_syntax_window_get_type (), + "description", _("Syntax Editor"), + "encoding", encoding, + NULL); + + GApplication *app = g_application_get_default (); + gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (sw)); + + return GTK_WIDGET (sw); } static void @@ -990,11 +1046,11 @@ psppire_syntax_window_iface_init (PsppireWindowIface *iface) static void undo_redo_update (PsppireSyntaxWindow *window) { - gtk_action_set_sensitive (window->undo_menuitem, - gtk_source_buffer_can_undo (window->buffer)); + g_object_set (window->undo_menuitem, "enabled", + gtk_source_buffer_can_undo (window->buffer), NULL); - gtk_action_set_sensitive (window->redo_menuitem, - gtk_source_buffer_can_redo (window->buffer)); + g_object_set (window->redo_menuitem, "enabled", + gtk_source_buffer_can_redo (window->buffer), NULL); } static void diff --git a/src/ui/gui/psppire-syntax-window.h b/src/ui/gui/psppire-syntax-window.h index c4a6d2c07a..3c6cd1e119 100644 --- a/src/ui/gui/psppire-syntax-window.h +++ b/src/ui/gui/psppire-syntax-window.h @@ -58,15 +58,15 @@ struct _PsppireSyntaxWindow GtkPrintSettings *print_settings; GtkSourcePrintCompositor *compositor; - GtkAction *undo_menuitem; - GtkAction *redo_menuitem; + GSimpleAction *undo_menuitem; + GSimpleAction *redo_menuitem; gchar *cliptext; - GtkAction *edit_cut; - GtkAction *edit_copy; - GtkAction *edit_delete; - GtkAction *edit_paste; + GSimpleAction *edit_cut; + GSimpleAction *edit_copy; + GSimpleAction *edit_delete; + GSimpleAction *edit_paste; gulong ps_handler; gulong sel_handler; diff --git a/src/ui/gui/psppire-var-sheet.c b/src/ui/gui/psppire-var-sheet.c index 66a95deeed..35e276cad3 100644 --- a/src/ui/gui/psppire-var-sheet.c +++ b/src/ui/gui/psppire-var-sheet.c @@ -474,7 +474,7 @@ render_var_cell (PsppSheetViewColumn *tree_column, "editable", TRUE, NULL); else - g_object_set (cell, "stock-id", + g_object_set (cell, "icon-name", get_var_align_stock_id (var_get_alignment (var)), NULL); break; @@ -489,7 +489,7 @@ render_var_cell (PsppSheetViewColumn *tree_column, enum fmt_type type = var_get_print_format (var)->type; enum measure measure = var_get_measure (var); - g_object_set (cell, "stock-id", + g_object_set (cell, "icon-name", get_var_measurement_stock_id (type, measure), NULL); } @@ -502,7 +502,7 @@ render_var_cell (PsppSheetViewColumn *tree_column, "editable", TRUE, NULL); else - g_object_set (cell, "stock-id", + g_object_set (cell, "icon-name", get_var_role_stock_id (var_get_role (var)), NULL); break; } @@ -695,7 +695,7 @@ render_var_pixbuf (GtkCellLayout *cell_layout, value_to_stock_id = g_object_get_data (G_OBJECT (cell), "value-to-stock-id"); gtk_tree_model_get (tree_model, iter, 0, &value, -1); - g_object_set (cell, "stock-id", value_to_stock_id (type, value), NULL); + g_object_set (cell, "icon-name", value_to_stock_id (type, value), NULL); } static void @@ -937,9 +937,21 @@ static void do_popup_menu (GtkWidget *widget, guint button, guint32 time) { PsppireVarSheet *var_sheet = PSPPIRE_VAR_SHEET (widget); - GtkWidget *menu; + GtkWidget *menu = gtk_menu_new (); - menu = get_widget_assert (var_sheet->builder, "varsheet-variable-popup"); + int i = 0; + + GtkWidget *insert_variable = gtk_menu_item_new_with_mnemonic (_("_Insert Variable")); + GtkWidget *clear_variables = gtk_menu_item_new_with_mnemonic (_("Cl_ear Variables")); + + g_signal_connect_swapped (insert_variable, "activate", G_CALLBACK (psppire_var_sheet_insert_variable), var_sheet); + g_signal_connect_swapped (clear_variables, "activate", G_CALLBACK (psppire_var_sheet_clear_variables), var_sheet); + + gtk_menu_attach (GTK_MENU (menu), insert_variable, 0, 1, i, i + 1); ++i; + gtk_menu_attach (GTK_MENU (menu), clear_variables, 0, 1, i, i + 1); ++i; + + gtk_widget_show_all (menu); + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, button, time); } @@ -979,6 +991,7 @@ on_button_pressed (GtkWidget *widget, GdkEventButton *event, return FALSE; } + GType psppire_fmt_use_get_type (void) @@ -1005,8 +1018,7 @@ enum PROP_DICTIONARY, PROP_MAY_CREATE_VARS, PROP_MAY_DELETE_VARS, - PROP_FORMAT_TYPE, - PROP_UI_MANAGER + PROP_FORMAT_TYPE }; static void @@ -1039,7 +1051,6 @@ psppire_var_sheet_set_property (GObject *object, obj->format_use = g_value_get_enum (value); break; - case PROP_UI_MANAGER: default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1073,10 +1084,6 @@ psppire_var_sheet_get_property (GObject *object, g_value_set_enum (value, obj->format_use); break; - case PROP_UI_MANAGER: - g_value_set_object (value, psppire_var_sheet_get_ui_manager (obj)); - break; - default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -1102,9 +1109,6 @@ psppire_var_sheet_dispose (GObject *obj) if (var_sheet->dict) g_object_unref (var_sheet->dict); - if (var_sheet->uim) - g_object_unref (var_sheet->uim); - /* These dialogs are not GObjects (although they should be!) But for now, unreffing them only causes a GCritical Error so comment them out for now. (and accept the memory leakage) @@ -1114,9 +1118,6 @@ psppire_var_sheet_dispose (GObject *obj) g_object_unref (var_sheet->var_type_dialog); */ - g_object_unref (var_sheet->builder); - - G_OBJECT_CLASS (psppire_var_sheet_parent_class)->dispose (obj); } @@ -1168,13 +1169,6 @@ psppire_var_sheet_class_init (PsppireVarSheetClass *class) FMT_FOR_OUTPUT, G_PARAM_READWRITE); g_object_class_install_property (gobject_class, PROP_FORMAT_TYPE, pspec); - - pspec = g_param_spec_object ("ui-manager", - "UI Manager", - "UI manager for the variable sheet. The client should merge this UI manager with the active UI manager to obtain variable sheet specific menu items and tool bar items.", - GTK_TYPE_UI_MANAGER, - G_PARAM_READABLE); - g_object_class_install_property (gobject_class, PROP_UI_MANAGER, pspec); } static void @@ -1259,16 +1253,15 @@ make_row_number_column (PsppireVarSheet *var_sheet) return column; } -static void -on_edit_clear_variables (GtkAction *action, PsppireVarSheet *var_sheet) +void +psppire_var_sheet_clear_variables (PsppireVarSheet *var_sheet) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (var_sheet); PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); PsppireDict *dict = var_sheet->dict; const struct range_set_node *node; - struct range_set *selected; - - selected = pspp_sheet_selection_get_range_set (selection); + struct range_set *selected = pspp_sheet_selection_get_range_set (selection); + for (node = range_set_last (selected); node != NULL; node = range_set_prev (selected, node)) { @@ -1290,17 +1283,17 @@ on_selection_changed (PsppSheetSelection *selection, { PsppSheetView *sheet_view = pspp_sheet_selection_get_tree_view (selection); PsppireVarSheet *var_sheet = PSPPIRE_VAR_SHEET (sheet_view); - gint n_selected_rows; + gint n_selected_rows = pspp_sheet_selection_count_selected_rows (selection); gboolean may_delete; GtkTreePath *path; - GtkAction *action; - - n_selected_rows = pspp_sheet_selection_count_selected_rows (selection); - - action = get_action_assert (var_sheet->builder, "edit_insert-variable"); - gtk_action_set_sensitive (action, (var_sheet->may_create_vars - && n_selected_rows > 0)); + GtkWidget *top = gtk_widget_get_toplevel (GTK_WIDGET (var_sheet)); + if (! PSPPIRE_IS_DATA_WINDOW (top)) + return; + + PsppireDataWindow *dw = PSPPIRE_DATA_WINDOW (top); + gtk_widget_set_sensitive (dw->mi_insert_var, n_selected_rows > 0); + switch (n_selected_rows) { case 0: @@ -1319,12 +1312,12 @@ on_selection_changed (PsppSheetSelection *selection, may_delete = TRUE; break; } - action = get_action_assert (var_sheet->builder, "edit_clear-variables"); - gtk_action_set_sensitive (action, var_sheet->may_delete_vars && may_delete); + + gtk_widget_set_sensitive (dw->mi_clear_variables, var_sheet->may_delete_vars && may_delete); } -static void -on_edit_insert_variable (GtkAction *action, PsppireVarSheet *var_sheet) +void +psppire_var_sheet_insert_variable (PsppireVarSheet *var_sheet) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (var_sheet); PsppSheetSelection *selection = pspp_sheet_view_get_selection (sheet_view); @@ -1349,7 +1342,6 @@ psppire_var_sheet_init (PsppireVarSheet *obj) { PsppSheetView *sheet_view = PSPP_SHEET_VIEW (obj); PsppSheetViewColumn *column; - GtkAction *action; GList *list; obj->dict = NULL; @@ -1361,7 +1353,6 @@ psppire_var_sheet_init (PsppireVarSheet *obj) obj->container = NULL; obj->dispose_has_run = FALSE; - obj->uim = NULL; pspp_sheet_view_append_column (sheet_view, make_row_number_column (obj)); @@ -1418,21 +1409,11 @@ psppire_var_sheet_init (PsppireVarSheet *obj) G_CALLBACK (on_query_var_tooltip), NULL); g_signal_connect (obj, "button-press-event", G_CALLBACK (on_button_pressed), NULL); + g_signal_connect (obj, "popup-menu", G_CALLBACK (on_popup_menu), NULL); - obj->builder = builder_new ("var-sheet.ui"); - - action = get_action_assert (obj->builder, "edit_clear-variables"); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_clear_variables), - obj); - gtk_action_set_sensitive (action, FALSE); g_signal_connect (pspp_sheet_view_get_selection (sheet_view), "changed", G_CALLBACK (on_selection_changed), NULL); - - action = get_action_assert (obj->builder, "edit_insert-variable"); - gtk_action_set_sensitive (action, FALSE); - g_signal_connect (action, "activate", G_CALLBACK (on_edit_insert_variable), - obj); } GtkWidget * @@ -1638,17 +1619,4 @@ psppire_var_sheet_goto_variable (PsppireVarSheet *var_sheet, int dict_index) gtk_tree_path_free (path); } -GtkUIManager * -psppire_var_sheet_get_ui_manager (PsppireVarSheet *var_sheet) -{ - if (var_sheet->uim == NULL) - { - var_sheet->uim = GTK_UI_MANAGER (get_object_assert (var_sheet->builder, - "var_sheet_uim", - GTK_TYPE_UI_MANAGER)); - g_object_ref (var_sheet->uim); - } - - return var_sheet->uim; -} diff --git a/src/ui/gui/psppire-var-sheet.h b/src/ui/gui/psppire-var-sheet.h index e8db83e12a..6a57cc6de9 100644 --- a/src/ui/gui/psppire-var-sheet.h +++ b/src/ui/gui/psppire-var-sheet.h @@ -66,13 +66,9 @@ struct _PsppireVarSheet gulong scroll_to_bottom_signal; gulong dict_signals[PSPPIRE_VAR_SHEET_N_SIGNALS]; - GtkBuilder *builder; - GtkWidget *container; gulong on_switch_page_handler; - GtkUIManager *uim; - gboolean dispose_has_run; }; @@ -95,8 +91,9 @@ gboolean psppire_var_sheet_get_may_delete_vars (PsppireVarSheet *); void psppire_var_sheet_set_may_delete_vars (PsppireVarSheet *, gboolean); void psppire_var_sheet_goto_variable (PsppireVarSheet *, int dict_index); +void psppire_var_sheet_insert_variable (PsppireVarSheet *var_sheet); +void psppire_var_sheet_clear_variables (PsppireVarSheet *var_sheet); -GtkUIManager *psppire_var_sheet_get_ui_manager (PsppireVarSheet *); G_END_DECLS diff --git a/src/ui/gui/psppire-window-base.c b/src/ui/gui/psppire-window-base.c index a9f73535df..78330ec100 100644 --- a/src/ui/gui/psppire-window-base.c +++ b/src/ui/gui/psppire-window-base.c @@ -35,7 +35,7 @@ static void psppire_window_base_class_init (PsppireWindowBaseClass *class); static void psppire_window_base_init (PsppireWindowBase *window); -G_DEFINE_ABSTRACT_TYPE (PsppireWindowBase, psppire_window_base, GTK_TYPE_WINDOW); +G_DEFINE_ABSTRACT_TYPE (PsppireWindowBase, psppire_window_base, GTK_TYPE_APPLICATION_WINDOW); /* Obtain a string identifying this window. diff --git a/src/ui/gui/psppire-window-base.h b/src/ui/gui/psppire-window-base.h index 5453bb78f8..b818314265 100644 --- a/src/ui/gui/psppire-window-base.h +++ b/src/ui/gui/psppire-window-base.h @@ -52,7 +52,7 @@ typedef struct _PsppireWindowBaseClass PsppireWindowBaseClass; struct _PsppireWindowBase { - GtkWindow parent; + GtkApplicationWindow parent; /* */ }; @@ -60,7 +60,7 @@ struct _PsppireWindowBase struct _PsppireWindowBaseClass { - GtkWindowClass parent_class; + GtkApplicationWindowClass parent_class; }; diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index 1532cbd316..7d9cdf5298 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -56,18 +56,24 @@ #include "ui/source-init-opts.h" #include "ui/syntax-gen.h" -#include "ui/gui/icons/icon-names.h" - #include "gl/configmake.h" #include "gl/xalloc.h" #include "gl/relocatable.h" -static void create_icon_factory (void); +void create_icon_factory (void); #define _(msgid) gettext (msgid) #define N_(msgid) msgid +void +register_selection_functions (void) +{ + psppire_selector_set_default_selection_func (GTK_TYPE_ENTRY, insert_source_row_into_entry); + psppire_selector_set_default_selection_func (PSPPIRE_VAR_VIEW_TYPE, insert_source_row_into_tree_view); + psppire_selector_set_default_selection_func (GTK_TYPE_TREE_VIEW, insert_source_row_into_tree_view); + psppire_selector_set_default_selection_func (PSPPIRE_TYPE_MEANS_LAYER, insert_source_row_into_layers); +} bool initialize (const struct init_source *is) @@ -106,66 +112,11 @@ initialize (const struct init_source *is) } break; case 9: - create_icon_factory (); - break; - case 10: - psppire_output_window_setup (); - break; - case 11: journal_init (); break; - case 12: + case 10: textdomain (PACKAGE); break; - case 13: - /* FIXME: This should be implemented with a GtkInterface */ - psppire_selector_set_default_selection_func (GTK_TYPE_ENTRY, insert_source_row_into_entry); - psppire_selector_set_default_selection_func (PSPPIRE_VAR_VIEW_TYPE, insert_source_row_into_tree_view); - psppire_selector_set_default_selection_func (GTK_TYPE_TREE_VIEW, insert_source_row_into_tree_view); - psppire_selector_set_default_selection_func (PSPPIRE_TYPE_MEANS_LAYER, insert_source_row_into_layers); - break; - case 14: - { - if (is->filename_arg != -1) - { -#ifndef G_OS_WIN32 - const char *file = (*is->argv)[is->filename_arg]; - const gchar *local_encoding = NULL; - g_get_charset (&local_encoding); -#else - char **as = g_win32_get_command_line (); - const char *file = as[is->filename_arg]; - const gchar *local_encoding = "UTF-8"; -#endif - - struct file_handle *fh = fh_create_file (NULL, - file, - local_encoding, - fh_default_properties ()); - - const char *filename = fh_get_file_name (fh); - - int retval = any_reader_detect (fh, NULL); - - /* Check to see if the file is a .sav or a .por file. If not - assume that it is a syntax file */ - if (retval == 1) - open_data_window (NULL, filename, NULL, NULL); - else if (retval == 0) - { - create_data_window (); - open_syntax_window (filename, NULL); - } - - fh_unref (fh); - } - else - { - create_data_window (); - } - return TRUE; - } - break; default: return TRUE; break; @@ -183,9 +134,9 @@ de_initialize (void) } void -psppire_quit (void) +psppire_quit (GApplication *app) { - gtk_main_quit (); + g_application_quit (app); } struct icon_size @@ -209,127 +160,13 @@ static const GtkIconSize small_toolbar[] = {GTK_ICON_SIZE_SMALL_TOOLBAR}; if such an icon exists. */ static const struct icon_size sizemap[] = -{ - {24, sizeof (small_toolbar) / sizeof (GtkIconSize), small_toolbar}, - {16, sizeof (menus) / sizeof (GtkIconSize), menus}, - {32, sizeof (large_toolbar) / sizeof (GtkIconSize), large_toolbar} -}; - - -static void -create_icon_factory (void) -{ - gint c; - GtkIconFactory *factory = gtk_icon_factory_new (); - struct icon_context ctx[2]; - ctx[0] = action_icon_context; - ctx[1] = category_icon_context; - for (c = 0 ; c < 2 ; ++c) { - const struct icon_context *ic = &ctx[c]; - gint i; - for (i = 0 ; i < ic->n_icons ; ++i) - { - gboolean wildcarded = FALSE; - GtkIconSet *icon_set = gtk_icon_set_new (); - int r; - for (r = 0 ; r < sizeof (sizemap) / sizeof (sizemap[0]); ++r) - { - int s; - GtkIconSource *source = gtk_icon_source_new (); - gchar *filename = g_strdup_printf ("%s/%s/%dx%d/%s.png", PKGDATADIR, - ic->context_name, - sizemap[r].resolution, sizemap[r].resolution, - ic->icon_name[i]); - const char *relocated_filename = relocate (filename); - GFile *gf = g_file_new_for_path (relocated_filename); - if (g_file_query_exists (gf, NULL)) - { - gtk_icon_source_set_filename (source, relocated_filename); - if (!wildcarded) - { - gtk_icon_source_set_size_wildcarded (source, TRUE); - wildcarded = TRUE; - } - } - g_object_unref (gf); - - for (s = 0 ; s < sizemap[r].n_sizes ; ++s) - gtk_icon_source_set_size (source, sizemap[r].usage[s]); - if (filename != relocated_filename) - free (CONST_CAST (char *, relocated_filename)); - g_free (filename); - - if ( gtk_icon_source_get_filename (source)) - gtk_icon_set_add_source (icon_set, source); - - gtk_icon_source_free (source); - } - - gtk_icon_factory_add (factory, ic->icon_name[i], icon_set); - } - } + {24, sizeof (small_toolbar) / sizeof (GtkIconSize), small_toolbar}, + {16, sizeof (menus) / sizeof (GtkIconSize), menus}, + {32, sizeof (large_toolbar) / sizeof (GtkIconSize), large_toolbar} + }; - { - struct iconmap - { - const gchar *gtk_id; - gchar *pspp_id; - }; - - /* We have our own icons for some things. - But we want the Stock Item to be identical to the Gtk standard - ones in all other respects. - */ - const struct iconmap map[] = { - {GTK_STOCK_NEW, "file-new-document"}, - {GTK_STOCK_QUIT, "file-quit"}, - {GTK_STOCK_SAVE, "file-save-document"}, - {GTK_STOCK_CUT, "edit-cut"}, - {GTK_STOCK_COPY, "edit-copy"}, - {GTK_STOCK_PASTE, "edit-paste"}, - {GTK_STOCK_UNDO, "edit-undo"}, - {GTK_STOCK_REDO, "edit-redo"}, - {GTK_STOCK_DELETE, "edit-delete"}, - {GTK_STOCK_ABOUT, "help-about"}, - {GTK_STOCK_PRINT, "file-print-document"} - }; - - GtkStockItem customised[sizeof (map) / sizeof (map[0])]; - int i; - - for (i = 0; i < sizeof (map) / sizeof (map[0]); ++i) - { - gtk_stock_lookup (map[i].gtk_id, &customised[i]); - customised[i].stock_id = map[i].pspp_id; - } - - - - gtk_stock_add (customised, sizeof (map) / sizeof (map[0])); - } - - { - /* Create our own "pspp-stock-reset" item, using the - GTK_STOCK_REFRESH icon set */ - GtkStockItem items[2] = { - {"pspp-stock-reset", N_("_Reset"), 0, 0, PACKAGE}, - {"pspp-stock-select", N_("_Select"), 0, 0, PACKAGE} - }; - - gtk_stock_add (items, 2); - - gtk_icon_factory_add (factory, "pspp-stock-reset", - gtk_icon_factory_lookup_default (GTK_STOCK_REFRESH) - ); - gtk_icon_factory_add (factory, "pspp-stock-select", - gtk_icon_factory_lookup_default (GTK_STOCK_INDEX) - ); - } - - gtk_icon_factory_add_default (factory); -} @@ -356,3 +193,30 @@ psppire_set_lexer (struct lexer *lexer) { msg_set_handler (handle_msg, lexer); } + + +void +psppire_preload_file (const gchar *file) +{ + const gchar *local_encoding = "UTF-8"; + + struct file_handle *fh = fh_create_file (NULL, + file, + local_encoding, + fh_default_properties ()); + const char *filename = fh_get_file_name (fh); + + int retval = any_reader_detect (fh, NULL); + + /* Check to see if the file is a .sav or a .por file. If not + assume that it is a syntax file */ + if (retval == 1) + open_data_window (NULL, filename, NULL, NULL); + else if (retval == 0) + { + create_data_window (); + open_syntax_window (filename, NULL); + } + + fh_unref (fh); +} diff --git a/src/ui/gui/psppire.h b/src/ui/gui/psppire.h index 32a412be35..e65554d13c 100644 --- a/src/ui/gui/psppire.h +++ b/src/ui/gui/psppire.h @@ -18,6 +18,7 @@ #define PSPPIRE_H #include +#include #include @@ -38,10 +39,15 @@ bool initialize (const struct init_source *is); void de_initialize (void); -void psppire_quit (void); +void psppire_quit (GApplication *app); const char * output_file_name (void); void psppire_set_lexer (struct lexer *); +void register_selection_functions (void); + +void psppire_preload_file (const gchar *file); + + #endif /* PSPPIRE_H */ diff --git a/src/ui/gui/syntax-editor.ui b/src/ui/gui/syntax-editor.ui index 797a7f04e0..a8451e0ef5 100644 --- a/src/ui/gui/syntax-editor.ui +++ b/src/ui/gui/syntax-editor.ui @@ -1,220 +1,135 @@ - - - - - - menu_syntax_file - _File - - - - - file-new-data - new2 - _New... - - - - - file-syntax-data - file_new_syntax - _Syntax - - - - - file-system-data - file_new_data - _Data - - - - - file-open-data - file_open - _Open... - - - - - file-save-data - file_save - _Save... - - - - - file-save-as - file_save_as - Save _As... - - - - - file_print - file-print - _Print... - - - - - file-quit - file_quit - - - - - edit-menu - _Edit - - - - - edit-cut - edit_cut - false - - - - - edit-copy - edit_copy - false - - - - - edit-paste - edit_paste - false - - - - - edit-delete - edit_delete - false - - - - - edit-undo - edit_undo - false - - - - - edit-redo - edit_redo - false - - - - - run1 - _Run - - - - - run-all - run_all - All - - - - - run-selection - run_selection - Selection - - - - - run-current-line - run_current_line - Current Line - - - - - - run-to-end - run-to-end - To End - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - GTK_PACK_DIRECTION_LTR - GTK_PACK_DIRECTION_LTR - - - True - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - True - True - True - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - True - + + + _File +
+ + _New + + Syntax + app.new-syntax + + + Data + app.new-data + + + + _Open + win.open + <Primary>o + + + _Save + win.save + <Primary>s + + + Save _As + win.save_as + <Primary><Shift>s + +
+
+ + _Print + win.print + +
+
+ + _Quit + <Primary>q + app.quit + +
+
+ + _Edit +
+ + Cu_t + win.cut + <Primary>x + + + _Copy + win.copy + <Primary>c + + + _Paste + win.paste + <Primary>v + + + _Delete + win.delete + +
+
+ + _Undo + win.undo + + + _Redo + win.redo + +
+
+ + _Run +
+ + _All + win.run-all + + + _Selection + win.run-selection + + + _Current Line + win.run-current-line + <Primary>r + + + _To End + win.run-to-end + +
+
+
+ + True + True + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + True + True + True + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_NONE + True + 0 + 0 + 0 + 0 + 0 + 0 + + + + + True +
diff --git a/src/ui/gui/var-sheet.ui b/src/ui/gui/var-sheet.ui deleted file mode 100644 index 6c990ef8f3..0000000000 --- a/src/ui/gui/var-sheet.ui +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - edit - _Edit - - - - - edit_insert-variable - Insert Variable - Create a new variable at the current position - edit-insert-variable - - - - - edit_goto-variable - Go To Variable... - Jump to variable - edit-go-to-variable - - - - - edit-cut - edit_cut - - - - - edit-copy - edit_copy - - - - - edit-paste - edit_paste - - - - - edit_clear-variables - Cl_ear Variables - Delete the variables at the selected position(s) - edit-clear - - - - - - - True - - diff --git a/src/ui/terminal/.gitignore b/src/ui/terminal/.gitignore deleted file mode 100644 index 278245a10c..0000000000 --- a/src/ui/terminal/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -pspp -.libs diff --git a/tests/.gitignore b/tests/.gitignore deleted file mode 100644 index 127f51a60d..0000000000 --- a/tests/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -Makefile -Makefile.in -/testsuite -/testsuite.at diff --git a/tests/formats/.gitignore b/tests/formats/.gitignore deleted file mode 100644 index 2fc41cd925..0000000000 --- a/tests/formats/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -inexactify -.libs diff --git a/tests/libpspp/.gitignore b/tests/libpspp/.gitignore deleted file mode 100644 index d19e422569..0000000000 --- a/tests/libpspp/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -ll-test -llx-test -.libs -- 2.30.2