gui: cut from editable to clipboard when cell is focused
When a cell is focused, then the cut operation
must operate on the selection in the cell editable
and not on the complete cell, i.e. the store content.
gui: trim displayed string for string variables (spaces)
The current gui always renders strings in the datasheet view
with the full width by adding spaces to the end of a string.
This patch renders the strings in the same way as they are rendered
in the status edit box above the cells array, i.e. trailing whitespace
is removed. Editing strings is straightforward.
gui: render empty string for numeric system missing value
Numeric cells which contain the system missing value are currently rendered
as a number of spaces, a dot and a number of spaces depending on the
current variable width and decimal places settings. When the cell is
edited, then this string is pretty confusing.
With the patch system missing values for numeric variables are rendered
as empty strings. Editing the cell is then straightforward and starts
with an empty cell.
icons: added psppire- prefix to action items #58708, #50026
The edit-find action icon is already available in the default
gnome and kde icon themes. Therefore the default icon is always found
first. I added the psppire- prefix to the action icon names such that
the icons are unique.
John Darrington [Sat, 4 Jul 2020 09:15:04 +0000 (11:15 +0200)]
Mitigate bug #48050
This bug caused an assertion failure in src/data/datasheet.c The change here
traps the faulty condition earlier and raises a G_CRITICAL rather than an
assertion.
John Darrington [Sat, 4 Jul 2020 06:38:33 +0000 (08:38 +0200)]
Unref variables after fetching from treeview model.
Commit e511c5a34a8dd5863c5f71c820609c3c0e363cc9 added a reference
to boxed variable pointers. This means they have to be unreffed
after fetching one with gtk_tree_model_get.
John Darrington [Sat, 4 Jul 2020 06:38:33 +0000 (08:38 +0200)]
Follow-up to bugfix #58664
If the width of a variable changes, then implicitly so does its
missing values --- even if the number of missing values is zero.
This is because the variable's width is cached in the missing_value
struct itself.
trim.c: avoid zero size xnrealloc memory allocation
Without the patch the regression fails on test
GET with /KEEP=ALL crashes -- uncompressed
when I compile with -fsanitize=address on MacOS. The reason
is that xnrealloc is called with a zero size allocation. I
simply avoid this, although it might be perfectly o.k. to do so.
desktop: open a file via xdg-open without additional output window
Currently there is a difference between opening an additional data
file via the Edit->Open menu or by opening a file via xdg-open (same
for doubleclick on Filebrowser). In the latter case the on_open
callback is called which runs an additional post_initialize. That
results in an additional output window.
I changed the behavior such that post_initialize is only called
when there is no psppire window yet. That happens when psppire
is started from a terminal with the file as argument on linux.
Further I check if there is an empty datawindow and replace that
in the same way as it is done via the Edit->Open menu.
John Darrington [Sat, 27 Jun 2020 16:00:16 +0000 (18:00 +0200)]
Fix bug #54784 (again).
Certain GUI entities hold pointers to variables. To ensure that
the variables survive the lifetime of the entity which holds the
pointer, the entity must take a reference.
This is particularly important where a transformation which involves
TEMPORARY of a filter is involved.
The pspp-mode is not automagically active in the 1.2.0-5 debian
release which install the emacs pspp mode. The reason was this
wrong elpa autoload comment.
desktop: add mimetypes application/x-spss-sps and application/x-spss-spv
I added an xml mime package which relates the files .sps and .spv
to a mime type. Via that mime type the files can then be openend
by clicking in the file browser.
desktop: reversed mimetype to application/x-spss-sps
If the mimetype is of type text, then the icons are not found
or displayed in gnome Files. No application except apt seems
to define text based mime types. And for apt it does not work
either. So I reverse.
Ben Pfaff [Sat, 20 Jun 2020 21:52:40 +0000 (21:52 +0000)]
sys-file-reader: Accept bad variable indexes, with warnings.
The SPSS file writer software at
https://packagist.org/packages/tiamo/spss sometimes generates malformed
variable indexes for weighting variables or value label records. PSPP
until now has rejected these files entirely. This commit should make
it issue a warning instead.
Thanks to István Ignácz for reporting this issue at
https://lists.gnu.org/archive/html/pspp-users/2020-06/msg00012.html
main.c: set "register-session" property for gtk_application
To open an application by clicking an associated file like
grid.sps in the Finder on Macos requires that the property
"register-session" is set for gtk_application. I did not
find a negative impact on Debian bullseye so I hope this
works also on other platforms. The gtk support for this
will be in the next gtk-3-24 release.
desktop file: added Keywords and removed Education category
During debian packaging of 1.2.0-5 the missing Keywords entry
was mentionend. I removed the Education category because this
was mentioned also. Education and Science are both toplevel
categories. I added also two more mimetypes for .sps and .spv
files.
desktop: changed translations to msgfmt and xgettext
During the build of the debian package 1.2.0-5 it turned out
that the pspp.appdata.xml file has a wrong structure with
respect to the translations. I did the following things
- renamed pspp.appdata.xml to org.fsf.pspp.metainfo.xml
- added gettext translation support for org.fsf.metainfo.xml
- renamed pspp.desktop to org.fsf.pspp.desktop
- replaced gen-det-desktop.sh based translation with gettext
gettext has now support for translating .desktop and .metainfo.xml
files. I took the naming conventions from the freedesktop and gnome
documentation, i.e. metainfo instead of appdata and the use of
an organization name.
John Darrington [Sat, 20 Jun 2020 05:17:06 +0000 (07:17 +0200)]
find-dialog.c: Replace exp10 with our own integer version
A previous commit introduced the use of exp10 from the standard
math library. However the use cases here don't need floating
point operands, and it's smaller and faster to implement our
own integer version.