pspp
11 years agoMerge "master" into "psppsheet" to obtain bug fixes from "master".
Ben Pfaff [Wed, 11 Jul 2012 04:48:01 +0000 (21:48 -0700)]
Merge "master" into "psppsheet" to obtain bug fixes from "master".

11 years agoPsppireVarStore: Fix memory leak 20120711000504/pspp 20120712000504/pspp 20120713000505/pspp
John Darrington [Tue, 10 Jul 2012 17:02:47 +0000 (19:02 +0200)]
PsppireVarStore: Fix memory leak

11 years agoPsppireDataEditor: No longer keep a reference to the data window.
John Darrington [Tue, 10 Jul 2012 16:41:31 +0000 (18:41 +0200)]
PsppireDataEditor: No longer keep a reference to the data window.

11 years agopsppire-window-base: Avoid memory leak in get_window_id(). 20120710000508/pspp
Ben Pfaff [Tue, 10 Jul 2012 04:54:39 +0000 (21:54 -0700)]
psppire-window-base: Avoid memory leak in get_window_id().

g_object_get() returns a string copy, so the caller has to free it,
but gtk_widget_get_name() gets the same string without a copy.

Found by valgrind.

11 years agopsppire-data-window: Destroy dataset from finalize.
Ben Pfaff [Tue, 10 Jul 2012 04:47:02 +0000 (21:47 -0700)]
psppire-data-window: Destroy dataset from finalize.

One rule of thumb for "destroy" is that it should just unref
GObjects.  This commit fixes that up for
psppire_data_window_dispose().  Previously, this could not be done
because of a reference leak in psppire_data_window_finish_init()
that caused doing the dataset destroy in finalize to crash, but
that problem was fixed in the previous commit.

11 years agopsppire-data-window: Avoid reference leak to PsppireDict.
Ben Pfaff [Tue, 10 Jul 2012 04:36:31 +0000 (21:36 -0700)]
psppire-data-window: Avoid reference leak to PsppireDict.

psppire_var_store_new() takes its own reference to PsppireDict so
the original reference owned by psppire_data_window_finish_init()
wasn't getting tracked anywhere.

11 years agoFixed memory leak in cairo driver.
John Darrington [Mon, 9 Jul 2012 20:44:13 +0000 (22:44 +0200)]
Fixed memory leak in cairo driver.

11 years agopsppire-data-editor: Unref old data_window upon change. 20120709000503/pspp
Ben Pfaff [Mon, 9 Jul 2012 06:27:52 +0000 (23:27 -0700)]
psppire-data-editor: Unref old data_window upon change.

Otherwise there's a reference leak.

Found by inspection; I haven't looked for clients that actually
change the data window after setting it.

11 years agopsppire-data-window: Delete dataset when closing window.
Ben Pfaff [Sun, 8 Jul 2012 06:44:37 +0000 (23:44 -0700)]
psppire-data-window: Delete dataset when closing window.

When the user closes the window it means that he wants to close the
underlying dataset also.  Otherwise the dataset essentially leaks
(in theory it's still there in the list of datasets but in practice
that takes a DATASET ACTIVATE <name> WINDOW=FRONT command to show
it).

This also fixes a Gtk-CRITICAL and following crash in the following
scenario brought up by John Darrington:
1. Start psppire
2. File | Open and load x.sav (dataset1)
3. File | New | Data (a new data window will appear: dataset2)
4. Using the window manager close the window for dataset1
5. In dataset2:  File | Open and load x.sav

I'm not 100% certain of the reason that this fixes it but I think
that there's some lingering association between the dataset and the
window that this change eliminates, by eliminating the dataset along
with the window.

The code added to psppire_data_window_dispose() in this commit
should probably go in a "finalize" function instead but there seems
to be a separate problem with references to PsppireVarSheet such
that if this new code is in "finalize" then dataset_destroy() will
call dict_clear() which will invoke the callbacks for PsppireDict
which will try to access the destroyed window.  On the other hand,
with this code in "dispose" the window isn't fully destroyed yet so
while the same code path gets followed it isn't fatal.

11 years agopsppire-var-store: Chain up to correct parent method from "dispose".
Ben Pfaff [Mon, 9 Jul 2012 06:04:49 +0000 (23:04 -0700)]
psppire-var-store: Chain up to correct parent method from "dispose".

I'm pretty sure that "dispose" should not chain up to "finalize".

11 years agoMerge "master" into "psppsheet" to obtain bug fixes from "master". 20120709001830/pspp 20120710001843/pspp
Ben Pfaff [Mon, 9 Jul 2012 05:18:20 +0000 (22:18 -0700)]
Merge "master" into "psppsheet" to obtain bug fixes from "master".

11 years agopsppire-dict: Make PsppireDict not own its "struct dictionary".
Ben Pfaff [Sat, 7 Jul 2012 20:00:19 +0000 (13:00 -0700)]
psppire-dict: Make PsppireDict not own its "struct dictionary".

I see two places where PsppireDict are created.  The first is in
psppire-data-window.c.  In this case, the PsppireDataWindow is
borrowing a dictionary owned by a "struct dataset" for use in its
PsppireDict.  When it destroys the PsppireDict, therefore, the
dictionary must not be destroyed because the dataset still owns it.
However, this is not what actually happens, and doing the
following:

1. Start psppire
2. File | Open and load x.sav (dataset1)
3. File | New | Data (a new data window will appear: dataset2)
4. Using the window manager close the window for dataset1
5. In dataset2:  File | Open and load x.sav

or similar will cause a use-after-free error.

The second use is in text-data-import-dialog.c.  This code does own
the struct dictionary, but it can simply free it itself at the same
time as the PsppireDict.

There is still some underlying issue with the above scenario,
because it still reports a GtkCritical, but valgrind no longer
reports a use-after-free error.

Reported by John Darrington.

11 years agogui: Fix Glib-GObject-WARNING when closing the active dataset.
Ben Pfaff [Mon, 9 Jul 2012 05:12:49 +0000 (22:12 -0700)]
gui: Fix Glib-GObject-WARNING when closing the active dataset.

The DATASET CLOSE command, when it acts on the active dataset, just
removes the active dataset's name, changing it to the empty string.
(This is the documented behavior.)  However, the GUI relies on
every dataset having a name, so this caused the following warning:

GLib-GObject-WARNING **: value """" of type `gchararray' is invalid
or out of range for property `id' of type `gchararray'

This commit fixes the problem by giving any unnamed dataset a name
after running syntax.

11 years agoFix compiler warnings
John Darrington [Sun, 8 Jul 2012 10:39:12 +0000 (12:39 +0200)]
Fix compiler warnings

11 years agoPsppireDataEditor: Add comment emphasising lack of final unref of old_vbox_widget
John Darrington [Sun, 8 Jul 2012 10:25:26 +0000 (12:25 +0200)]
PsppireDataEditor: Add comment emphasising lack of final unref of old_vbox_widget

11 years agoPsppSheetView unrealize: Call parent method before any other operation
John Darrington [Sat, 7 Jul 2012 07:39:21 +0000 (09:39 +0200)]
PsppSheetView unrealize: Call parent method before any other operation

If this is not done, then gtk_widget_get_realized returns true, during
the unrealize execution, leading to mutual recursion.

11 years agoDelete module customentry
John Darrington [Sat, 7 Jul 2012 07:34:18 +0000 (09:34 +0200)]
Delete module customentry

This is no longer used, so am removing it completely.

11 years agoPsppireDataWindow: Deal with ui_manager in dispose routine
John Darrington [Sat, 7 Jul 2012 07:30:17 +0000 (09:30 +0200)]
PsppireDataWindow: Deal with ui_manager in dispose routine

11 years agoPsppSheetView resize handler: Do nothing if the widget is not realized
John Darrington [Sat, 7 Jul 2012 05:14:53 +0000 (07:14 +0200)]
PsppSheetView resize handler:  Do nothing if the widget is not realized

This seems to avoid the occasional GtkCritical that I get.

11 years agoReduce the flicker when redrawing the toolbar and menubar.
John Darrington [Thu, 5 Jul 2012 21:17:48 +0000 (23:17 +0200)]
Reduce the flicker when redrawing the toolbar and menubar.

11 years agopspp-sheet-view.c: Separate destroy method into finalize and dispose.
John Darrington [Thu, 5 Jul 2012 19:53:17 +0000 (21:53 +0200)]
pspp-sheet-view.c: Separate destroy method into finalize and dispose.

This still needs work to disentangle them completely, but I think this
is an improvement.

11 years agoPsppireDataStore: Move datasheet_destroy from dispose to finalize
John Darrington [Thu, 5 Jul 2012 18:33:58 +0000 (20:33 +0200)]
PsppireDataStore: Move datasheet_destroy from dispose to finalize

This actually destroys stuff, not merely unreffing.  So it belongs in finalize.

11 years agoPsppireVarSheet: Keep reference to the return value of _get_ui_manager
John Darrington [Thu, 5 Jul 2012 17:55:52 +0000 (19:55 +0200)]
PsppireVarSheet: Keep reference to the return value of _get_ui_manager

I changed the var_sheett to keep a reference to the uim object which it
returns from the _get_ui_manager objects.  This avoids a problem where
the object was getting its last reference unreffed by another object.

11 years agoPsppireVarSheet: Replace Destroy with Dispose
John Darrington [Thu, 5 Jul 2012 17:36:08 +0000 (19:36 +0200)]
PsppireVarSheet: Replace Destroy with Dispose

Also, use a statically allocated array for signal handler ids, since
it just complicates things to have a dynamically allocated one.

11 years agoPsppireCellRendererButton: Replace destroy with dispose
John Darrington [Thu, 5 Jul 2012 17:03:08 +0000 (19:03 +0200)]
PsppireCellRendererButton: Replace destroy with dispose

The destroy method did nothing except drop references, so was
appropriate for dispose.

11 years agoPsppireDataSheet: Reference handler improvements.
John Darrington [Thu, 5 Jul 2012 16:46:33 +0000 (18:46 +0200)]
PsppireDataSheet: Reference handler improvements.

Changed the destroy method to dispose, because all it does is drop
references.  Also, keep a reference to the object returned by _get_ui_manager
since this seems to be causing issues elsewhere.

11 years agopsppire-data-editor: Avoid ' modifier with g_string_append_printf(). 20120708001829/pspp
Ben Pfaff [Sat, 7 Jul 2012 18:39:47 +0000 (11:39 -0700)]
psppire-data-editor: Avoid ' modifier with g_string_append_printf().

On Windows, g_string_append_printf() does not understand the '
modifier, so use ds_put_format() instead, which does.

Reported by John Darrington.

11 years agopo: Update Slovenian translation from translationproject.org. 20120708000503/pspp
Ben Pfaff [Sat, 7 Jul 2012 17:28:47 +0000 (10:28 -0700)]
po: Update Slovenian translation from translationproject.org.

11 years agoFixed crash in two sample npar tests with (paired)
John Darrington [Fri, 6 Jul 2012 14:30:14 +0000 (16:30 +0200)]
Fixed crash in two sample npar tests with (paired)

This change fixes a bug where an assertion would
fire if a two sample npar test was given where
a variable appeared twice in a variable list.

11 years agoDocumentation: correct punctuation and grammar
John Darrington [Wed, 4 Jul 2012 20:28:25 +0000 (22:28 +0200)]
Documentation: correct punctuation and grammar

11 years agoUse text_aa instead of solid black for sheet grid lines. 20120704001842/pspp 20120705001852/pspp 20120706001843/pspp
John Darrington [Tue, 3 Jul 2012 17:52:39 +0000 (19:52 +0200)]
Use text_aa instead of solid black for sheet grid lines.

Use the widget's text_aa graphics context instead of black_gc to give a softer
appearance (and to ensure they are visible for themes which use black as their
background).

11 years agoNew Slovenian localisation from http://translationproject.org 20120702000514/pspp 20120703000504/pspp 20120704000504/pspp 20120705000505/pspp 20120706000503/pspp
John Darrington [Sun, 1 Jul 2012 11:25:31 +0000 (13:25 +0200)]
New Slovenian localisation from  translationproject.org

Updated po/sl.po from http://translationproject.org/latest/pspp/sl.po

11 years agopsppire-var-store: Remove. 20120625204929/pspp 20120626001903/pspp 20120627001918/pspp 20120628001950/pspp 20120629001900/pspp 20120630002026/pspp 20120701001910/pspp 20120702001907/pspp 20120703001900/pspp
Ben Pfaff [Tue, 27 Mar 2012 06:21:28 +0000 (23:21 -0700)]
psppire-var-store: Remove.

PsppireVarStore used to provide a model to allow GtkSheet to display
a dictionary.  Now, it is just a superfluous wrapper for
PsppireDict, so this commit removes it in favor of using PsppireDict
directly.

11 years agogoto-case-dialog: Avoid gtk critical for invalid case number.
Ben Pfaff [Fri, 23 Mar 2012 05:04:38 +0000 (22:04 -0700)]
goto-case-dialog: Avoid gtk critical for invalid case number.

I noticed this when Go To Case was invoked with an empty data
sheet, in which case the default case number is the invalid case
number 0.

11 years agogui: Speed up initial file load with many columns
Ben Pfaff [Sat, 12 Nov 2011 23:06:23 +0000 (15:06 -0800)]
gui: Speed up initial file load with many columns

This makes a huge difference in startup time when there are hundreds of
columns, by setting up the data sheet before showing the window that
contains it.

Files opened from File|Open were already opened this way.  I was a little
surprised that File|Open was so much faster than specifying a file on the
command line until I figured out the difference.

11 years agogtk-contrib: Remove GtkSheet-derived PsppireSheet.
Ben Pfaff [Tue, 20 Mar 2012 04:41:35 +0000 (21:41 -0700)]
gtk-contrib: Remove GtkSheet-derived PsppireSheet.

This code is no longer used.

11 years agogui: Redo var sheet, data sheet, text import with PsppSheetView.
Ben Pfaff [Tue, 24 Apr 2012 05:27:54 +0000 (22:27 -0700)]
gui: Redo var sheet, data sheet, text import with PsppSheetView.

This commit replaces the existing variable and data sheets in the
GUI by new ones based on PsppSheetView.

Thanks to John Darrington and Michel Boaventura for helpful testing,
bug reports and suggestions.

11 years agoReadme.Git: Update gnulib SHA to include fixes for windows tempfile issues 20120621000503/pspp 20120622000503/pspp 20120623000503/pspp 20120624000504/pspp 20120625000504/pspp 20120625203456/pspp 20120626000502/pspp 20120627000503/pspp 20120628000505/pspp 20120629000503/pspp 20120630000506/pspp 20120701000504/pspp
John Darrington [Wed, 20 Jun 2012 21:54:32 +0000 (23:54 +0200)]
Readme.Git: Update gnulib SHA to include fixes for windows tempfile issues

11 years agotext-data-import-dialog: Allow user to choose input encoding.
Ben Pfaff [Wed, 20 Jun 2012 06:09:25 +0000 (23:09 -0700)]
text-data-import-dialog: Allow user to choose input encoding.

Otherwise only automatically detected encodings can be used.

Debian bug #676371.
Reported-by: Gunther Furtado <gunfurtado@gmail.com>
11 years agoAdd ENCODING subcommand to several commands.
Ben Pfaff [Wed, 20 Jun 2012 05:43:24 +0000 (22:43 -0700)]
Add ENCODING subcommand to several commands.

I believe that this completes support for encodings for data input
commands such as DATA LIST and GET DATA/TYPE=TXT.  Support is still
incomplete for data output commands such as PRINT, which confuse
byte offsets with character positions.

Debian bug #676371.
Reported-by: Gunther Furtado <gunfurtado@gmail.com>
11 years agoline-reader: New library for reading a file line-by-line.
Ben Pfaff [Sat, 19 Mar 2011 23:26:55 +0000 (16:26 -0700)]
line-reader: New library for reading a file line-by-line.

This library reads a file line-by-line in an arbitrary 8-bit or wider
encoding, without requiring the file to be recoded.  This will be used
in an upcoming commit.

11 years agoPRINT SPACE: Fix missing fh_unref() on error path.
Ben Pfaff [Tue, 17 Apr 2012 06:02:29 +0000 (23:02 -0700)]
PRINT SPACE: Fix missing fh_unref() on error path.

The first "return" in this function failed to unref the handle.

11 years agoext-array.c: Ensure that fseek is called before switching between read and write. 20120616000502/pspp 20120617000503/pspp 20120618000503/pspp 20120619000503/pspp 20120620000508/pspp
John Darrington [Fri, 15 Jun 2012 18:29:24 +0000 (20:29 +0200)]
ext-array.c: Ensure that fseek is called before switching between read and write.

ANSI C requires that a file positioning function (eg seek) occurs before a switch
from reading to writing a stream (or vici-versa).  We had not been doing this.
This had caused problems which manifested themselves on Windows operating systems,
by mysteriously failing to write the stream (and thus truncating the datafile).
This change corrects this.

Thanks to Harry Thijssen and Henry Gong for their very valuable assistance tracking
down the cause of this problem.

Reviewed-by: Ben Pfaff
11 years agoCORRELATIONS: Fixed bug displaying non-sqaure correlation matrices 20120608060502/pspp 20120610000508/pspp 20120611000503/pspp 20120612000502/pspp 20120613000503/pspp 20120614000503/pspp 20120615000509/pspp
John Darrington [Thu, 7 Jun 2012 19:20:22 +0000 (21:20 +0200)]
CORRELATIONS: Fixed bug displaying non-sqaure correlation matrices

When CORRELATIONS was run using the WITH keyword, the wrong index
was calculated for the columns/rows - hence the program crashed.
This change fixes that.

Reported-by: Ebel Magnin
11 years agoExtract the independent samples gui from t-test.ui into its own file.
John Darrington [Sat, 2 Jun 2012 08:09:12 +0000 (10:09 +0200)]
Extract the independent samples gui from  t-test.ui into its own file.

This will benefit upcoming commits, since other (non t-test) guis are
very similar.

12 years agoRegression Dialog: Convert to PsppireDialogAction object 20120520030503/pspp 20120521030502/pspp 20120522030504/pspp 20120523030503/pspp 20120524030503/pspp 20120525030504/pspp 20120526030503/pspp 20120527030504/pspp 20120528030503/pspp 20120530030501/pspp 20120531030508/pspp 20120602060505/pspp 20120603060503/pspp 20120604060508/pspp 20120605060508/pspp 20120606060502/pspp
John Darrington [Sun, 20 May 2012 07:12:04 +0000 (09:12 +0200)]
Regression Dialog: Convert to PsppireDialogAction object

12 years agoT-TEST Independent Samples Dialog: Converted to a PsppireDialogAction object
John Darrington [Sat, 19 May 2012 09:55:12 +0000 (11:55 +0200)]
T-TEST Independent Samples Dialog: Converted to a PsppireDialogAction object

12 years agoAdd SET TVARS option. Closes bug #31566 20120515030501/pspp 20120516030503/pspp 20120517030502/pspp 20120518030503/pspp 20120519030503/pspp
John Darrington [Sun, 13 May 2012 20:25:39 +0000 (22:25 +0200)]
Add SET TVARS option. Closes bug #31566

12 years agoMinor documentation formatting changes
John Darrington [Wed, 9 May 2012 18:05:04 +0000 (20:05 +0200)]
Minor documentation formatting changes

12 years agoHISTOGRAMS: Fix bin width problems on large numbers of bins 20120510030503/pspp 20120511030508/pspp 20120512030503/pspp 20120513030508/pspp 20120514030504/pspp
John Darrington [Wed, 9 May 2012 19:21:01 +0000 (21:21 +0200)]
HISTOGRAMS: Fix bin width problems on large numbers of bins

12 years agoHistograms: Rotate labels when there are lots of bins
John Darrington [Wed, 9 May 2012 09:11:50 +0000 (11:11 +0200)]
Histograms: Rotate labels when there are lots of bins

12 years agoMove comment to correct function
John Darrington [Wed, 9 May 2012 06:43:49 +0000 (08:43 +0200)]
Move comment to correct function

12 years agoi18n: Set LC_COLLATE locale category based on system locale.
Ben Pfaff [Wed, 9 May 2012 05:04:47 +0000 (22:04 -0700)]
i18n: Set LC_COLLATE locale category based on system locale.

LC_COLLATE controls the sort order of file names in GTK+ file
chooser dialog boxes, so we should set this locale category so as
to honor the user's preferences.

In the standard C library, only a few functions honor LC_COLLATE:
strcoll, wcscoll, strxfm, and wcsxfrm.  PSPP doesn't use any of
these functions, so this commit should not affect PSPP's use of
standard library functions.

The libunistring manual only mentions collation rules in the entries
for a few functions: u8_strcoll, u16_strcoll, u32_strcoll,
u8_normcoll, u16_normcoll, u32_normcoll, u8_casecoll, u16_casecoll
u32_casecoll.  PSPP doesn't use any of those functions either.

Reported by "ajk-eis" <ajk-eis@rvhome.de>.

12 years agogui: Make lex_gtk_text_buffer_read() count bytes, not characters. 20120507030502/pspp 20120508030509/pspp 20120509030502/pspp
Ben Pfaff [Sun, 6 May 2012 15:06:57 +0000 (08:06 -0700)]
gui: Make lex_gtk_text_buffer_read() count bytes, not characters.

The N parameter to lex_gtk_text_buffer_read() is a count of bytes,
but the implementation treated it as characters.

Also fixes a memory leak, since gtk_text_iter_get_text()'s caller
is responsible for freeing the memory that it returns.

Reported by Alle <ajk-eis@rvhome.de>.
First investigated by John Darrington <john@darrington.wattle.id.au>.
Reviewed by John Darrington <john@darrington.wattle.id.au>.

12 years agolexer: Check that 'read' function in lex_source returns valid value.
Ben Pfaff [Sun, 6 May 2012 05:07:34 +0000 (22:07 -0700)]
lexer: Check that 'read' function in lex_source returns valid value.

A 'read' function may only read as many bytes as the size of the
buffer passed into it, but the caller didn't check, which made an
actual violation of this invariant hard to diagnose.

12 years agoFrequencies.ui: Adjust widget packing properties. 20120506030509/pspp
John Darrington [Sat, 5 May 2012 18:41:25 +0000 (20:41 +0200)]
Frequencies.ui: Adjust widget packing properties.

Reported-by: Mindaugas.
12 years agofrequencies.ui: Reformat using glade-3
John Darrington [Sat, 5 May 2012 18:38:42 +0000 (20:38 +0200)]
frequencies.ui: Reformat using glade-3

12 years agoconfigure.ac: Link PSPPIRE explicitly against gthread.
Ben Pfaff [Sat, 5 May 2012 04:30:49 +0000 (21:30 -0700)]
configure.ac: Link PSPPIRE explicitly against gthread.

Seems to be required on OpenSUSE.

PSPPIRE does not make explicit use of threads, but it does use
GTimer.  Thus, it calls g_thread_init() because of the following
note in the documentation for GTimer:

    GTimer uses a higher-quality clock when thread support is
    available.  Therefore, calling g_thread_init() while timers
    are running may lead to unreliable results.  It is best to
    call g_thread_init() before starting any timers, if you are
    using threads at all.

Separately, the documentation for threads in Glib says:

    Calling g_thread_init() with a NULL argument is somewhat more
    relaxed.  You may call any other glib functions in the main
    thread before g_thread_init() as long as g_thread_init() is
    not called from a glib callback, or with any locks held.
    However, many libraries above glib does not support late
    initialization of threads, so doing this should be avoided if
    possible.

    Please note that since version 2.24 the GObject
    initialization function g_type_init() initializes threads
    (with a NULL argument), so most applications, including those
    using Gtk+ will run with threads enabled.  If you want a
    special thread implementation, make sure you call
    g_thread_init() before g_type_init() is called.

Taken together, it seems to imply that PSPPIRE should call
g_thread_init() before g_timer_new(), or the timer might be
unreliable because Glib would call it later for us.  But the
documentation doesn't seem entirely clear.

Reported by Mindaugas.
Bug #36396.

12 years agoMEANS: Use var_to_string instead of var_get_name for factor variable display 20120502030502/pspp 20120503030502/pspp 20120504030503/pspp 20120505030504/pspp
John Darrington [Tue, 1 May 2012 16:35:36 +0000 (18:35 +0200)]
MEANS: Use var_to_string instead of var_get_name for factor variable display

12 years agoFrequencies dialog: Add Mnemonics
John Darrington [Tue, 1 May 2012 12:17:27 +0000 (14:17 +0200)]
Frequencies dialog: Add Mnemonics

12 years agorange-tower-test: Fix test failures on 64-bit architectures.
Ben Pfaff [Tue, 1 May 2012 05:11:06 +0000 (22:11 -0700)]
range-tower-test: Fix test failures on 64-bit architectures.

Reported by 'gandalfar' on #pspp.

12 years agoIndependent T-TEST Dialog: Use PsppireValueEntry in the group value definition sub...
John Darrington [Sun, 29 Apr 2012 22:07:55 +0000 (00:07 +0200)]
Independent T-TEST Dialog: Use PsppireValueEntry in the group value definition sub-dialog

12 years agoConverted Factor Dialog to PsppireDialogAction class 20120430030504/pspp
John Darrington [Sun, 29 Apr 2012 05:56:07 +0000 (07:56 +0200)]
Converted Factor Dialog to PsppireDialogAction class

12 years agoConvert Rank Dialog to PsppireDialogAction 20120429030503/pspp
John Darrington [Sat, 28 Apr 2012 18:24:43 +0000 (20:24 +0200)]
Convert Rank Dialog to PsppireDialogAction

12 years agoUnref GtkBuilder objects when they are no longer required
John Darrington [Sat, 28 Apr 2012 14:11:10 +0000 (16:11 +0200)]
Unref GtkBuilder objects when they are no longer required

12 years agoPsppireDialogAction: Destroy dialog after it has been run
John Darrington [Sat, 28 Apr 2012 14:09:58 +0000 (16:09 +0200)]
PsppireDialogAction: Destroy dialog after it has been run

12 years agoPsppireSelector: Don't try to set callbacks on null model
John Darrington [Sat, 28 Apr 2012 14:09:02 +0000 (16:09 +0200)]
PsppireSelector: Don't try to set callbacks on null model

12 years agoRegression Dialog: Tidy up and comment.
John Darrington [Sat, 28 Apr 2012 11:03:32 +0000 (13:03 +0200)]
Regression Dialog: Tidy up and comment.

12 years agoCorrect erroneous g_object_unref calls
John Darrington [Sat, 28 Apr 2012 10:41:05 +0000 (12:41 +0200)]
Correct erroneous g_object_unref calls

commit e89158e8abd2dae27d985e3574eb5aa1d265fc66 placed g_object_unref calls after every instance
of *_set_model - In most instances this was correct, but not all.  When (for example)
gtk_tree_view_set_model (view, model) is called, it takes a ref to model, but it will then
unref it upon the next call to _set_model and/or when view is destroyed.
Unreffing the model ourself, is therefore appropriate only when we have created it ourselves.
This change fixes the few instances where this was not the case.

12 years agopo: Update Catalan translation from translation-project.org. 20120426030505/pspp 20120427030503/pspp 20120428030504/pspp
Ben Pfaff [Thu, 26 Apr 2012 04:31:16 +0000 (21:31 -0700)]
po: Update Catalan translation from translation-project.org.

12 years agopo: Update Spanish translation from translation-project.org.
Ben Pfaff [Thu, 26 Apr 2012 04:31:09 +0000 (21:31 -0700)]
po: Update Spanish translation from translation-project.org.

12 years agopsppire-cell-renderer-button: Add "slash" property. 20120425030503/pspp
Ben Pfaff [Sat, 3 Mar 2012 19:50:20 +0000 (11:50 -0800)]
psppire-cell-renderer-button: Add "slash" property.

When "slash" is set to true, the button gets a diagonal slash drawn
across it.  This is ugly, but it matches what SPSS does for cases
that are filtered out.

12 years agopsppire-cell-renderer-button: New cell renderer for GtkButton.
Ben Pfaff [Tue, 24 Apr 2012 05:49:30 +0000 (22:49 -0700)]
psppire-cell-renderer-button: New cell renderer for GtkButton.

This allows one to put a clickable GtkButton inside a PsppSheetView row.

12 years agopspp-sheet-view: Add "fixed-height" and "fixed-height-set" properties.
Ben Pfaff [Thu, 2 Feb 2012 05:44:50 +0000 (21:44 -0800)]
pspp-sheet-view: Add "fixed-height" and "fixed-height-set" properties.

The data sheet will use this in the "split view" to make sure that
side-by-side data sheets have the same row height.

12 years agopspp-sheet-view: Make pspp_sheet_view_stop_editing() public.
Ben Pfaff [Sat, 3 Mar 2012 19:43:39 +0000 (11:43 -0800)]
pspp-sheet-view: Make pspp_sheet_view_stop_editing() public.

12 years agopspp-sheet-view: Improve look of sheet when there are few columns.
Ben Pfaff [Sat, 3 Mar 2012 19:25:20 +0000 (11:25 -0800)]
pspp-sheet-view: Improve look of sheet when there are few columns.

GtkTreeView always expands one or more columns so that the visible
columns fill up the entire width of the treeview.  This looks funny
in a spreadsheet-like view.  This commit changes PsppSheetView so
that, instead, extra space is left blanks instead of being filled
up with columns.

12 years agopspp-sheet-view: Optimize by making column header widgets lazy.
Ben Pfaff [Wed, 21 Mar 2012 04:42:52 +0000 (21:42 -0700)]
pspp-sheet-view: Optimize by making column header widgets lazy.

This is a major speedup when there are hundreds of columns.

12 years agopspp-widget-facade: New code to measure and render some GTK+ widgets.
Ben Pfaff [Tue, 24 Apr 2012 05:43:13 +0000 (22:43 -0700)]
pspp-widget-facade: New code to measure and render some GTK+ widgets.

There are two upcoming uses for this in the tree, both related to
rendering fake buttons.  First, creating, maintaining, and rendering
the column header buttons in a PsppSheetView is a huge cost when
there are hundreds or thousands of columns.  Using this facade code
to "fake" buttons makes the sheet much faster.  Second, this code
will be used to implement a cell renderer for GtkButton, so that
buttons can be put into PsppSheetView rows.

12 years agopspp-sheet-view: Add "special-cells" property to speed drawing many columns.
Ben Pfaff [Sat, 12 Nov 2011 05:50:31 +0000 (21:50 -0800)]
pspp-sheet-view: Add "special-cells" property to speed drawing many columns.

A "special cell" is a cell that is editable or activatable.  When a row
that contains a special cell is selected, the cursor is drawn around a
single cell; when other rows are selected, the cursor is drawn around the
entire row.

With the default of "detect" (the only mode previously supported), whether
a given row contains a special cell is detected automatically.  This is the
best choice most of the time.  For sheet views that contain more than 100
columns, an explicit "yes" or "no" improves performance.

12 years agopspp-sheet-view: Start editing upon button release, not press.
Ben Pfaff [Sun, 13 Nov 2011 00:21:22 +0000 (16:21 -0800)]
pspp-sheet-view: Start editing upon button release, not press.

This makes the user interface more natural.

12 years agopspp-sheet-view: Support rectangular selection, column popup menus.
Ben Pfaff [Tue, 28 Jun 2011 05:17:57 +0000 (22:17 -0700)]
pspp-sheet-view: Support rectangular selection, column popup menus.

A "rectangular selection" is where you can click and drag to select
a rectangular group of columns and rows, like in a spreadsheet.

In this commit, rectangular selections don't interact well with
"quick-edit" mode where the first click on a cell starts editing,
because clicking in a quick-edit cell starts editing instead of
rectangular selection.  The following commit will fix the problem.

This commit also adds a gtk_widget_queue_draw() call to
pspp_sheet_view_update_rubber_band() that should really
invalidate less sheet area.

12 years agopspp-sheet-view: Edit cells on the first click by default.
Ben Pfaff [Fri, 24 Jun 2011 05:16:28 +0000 (22:16 -0700)]
pspp-sheet-view: Edit cells on the first click by default.

With GtkTreeView it takes two clicks to edit a cell.  The first click
selects the row and the second click starts editing.  This isn't a
great user experience for a spreadsheet, so this commit enables
single-click editing.

12 years agopspp-sheet-view-column: Add support for tooltips on columns.
Ben Pfaff [Wed, 22 Jun 2011 05:45:48 +0000 (22:45 -0700)]
pspp-sheet-view-column: Add support for tooltips on columns.

12 years agopspp-sheet-view: Fix rendering moving cursor left or right with keyboard.
Ben Pfaff [Wed, 16 Nov 2011 05:05:30 +0000 (21:05 -0800)]
pspp-sheet-view: Fix rendering moving cursor left or right with keyboard.

I don't understand why this is not necessary for GtkTreeView.  Without it,
the cursor doesn't get properly redrawn after a left or right arrow
keystroke moves it.

12 years agopspp-sheet-view: Fix visual artifacts for sheet views > 65535 pixels wide.
Ben Pfaff [Sat, 12 Nov 2011 05:48:46 +0000 (21:48 -0800)]
pspp-sheet-view: Fix visual artifacts for sheet views > 65535 pixels wide.

gdk_draw_line() draws lines by passing the coordinates to XDrawLine(),
which in turn casts the coordinates to "signed int" as it formats them for
the X Protocol.  Thus, large coordinate values wrap around and cause odd
visual artifacts.

This fixes the problem by only calling gdk_draw_line() with coordinate
values that should actually be visible.

12 years agopspp-sheet-view: Improve scrolling performance.
Ben Pfaff [Fri, 27 May 2011 05:11:42 +0000 (22:11 -0700)]
pspp-sheet-view: Improve scrolling performance.

Drawing dashed lines is very slow, at least on my computer.  This commit
changes them to solid, which makes scrolling in a large sheet feel much,
much more responsive on my system.

12 years agopspp-sheet-view: Reduce time and memory cost to O(1) in number of rows.
Ben Pfaff [Sun, 22 Apr 2012 17:15:46 +0000 (10:15 -0700)]
pspp-sheet-view: Reduce time and memory cost to O(1) in number of rows.

The standard GtkTreeView uses time and memory linear in the number of
rows in the tree.  When the model is set, it iterates over every row
and creates a corresponding GtkRbNode.  After that, GtkTreeView uses
the GtkRbNodes for many operations on the tree.

This commit adapts GtkTreeView to avoid the need to iterate over the
entire model up front, as well as the need to maintain data for every
row.  It makes the following major changes:

  - The tree model must now be just a list (GTK_TREE_MODEL_LIST_ONLY);
    that is, rows may not have children.

  - The height of a row in the view must be fixed (as with
    gtk_tree_view_set_fixed_height_mode()).  Column widths must also
    be fixed.

The following minor changes follow mainly as consequences of the above:

  - Expander arrows, tree lines, and level indentation are no longer
    supported, because these only make sense with rows that have
    children.

  - Separator rows are no longer supported.  (They are ugly in
    fixed-height mode because they occupy an entire row.)

12 years agoImport GtkTreeView from GTK+ 2.0-2.20.1 renamed as PsppSheetView.
Ben Pfaff [Tue, 24 Apr 2012 05:39:58 +0000 (22:39 -0700)]
Import GtkTreeView from GTK+ 2.0-2.20.1 renamed as PsppSheetView.

This includes minimal modifications to make it compile and link
cleanly.

I used the following Perl script to do the bulk of the renaming:

for $pair (['tree_view_column', 'sheet_view_column'],
           ['tree_selection', 'sheet_selection'],
           ['tree_view', 'sheet_view'],
           ['rbtree', 'rbtree'],
           ['rbnode', 'rbnode']) {
    my ($from, $to) = @$pair;

    my ($tfrom) = join ('', map ("\u$_", split ('_', $from)));
    my ($tto) = join ('', map ("\u$_", split ('_', $to)));

    s/gtk_$from/pspp_$to/g;
    s/\Ugtk_$from/\Upspp_$to/g;
    s/GTK_TYPE_\U$from/PSPP_TYPE_\U$to/g;
    s/GTK_IS_\U$from/PSPP_IS_\U$to/g;
    s/Gtk$tfrom/Pspp$tto/g;
}

s/GtkTreeCellDataFunc/PsppSheetCellDataFunc/g;
s/GtkTreeDestroyCountFunc/PsppSheetDestroyCountFunc/g;

12 years agoPsppireValueEntry: Simplify 'if' condition.
Ben Pfaff [Wed, 25 Apr 2012 05:24:55 +0000 (22:24 -0700)]
PsppireValueEntry: Simplify 'if' condition.

The statement
  if ((model != NULL) && (model != old_model))
can be simplifed to just:
  if (model != NULL)
because if 'model' is nonnull then it is different from old_model,
because 'model' is a newly allocated GtkListStore.

12 years agopsppire-dialog-action: Remove unused variable.
Ben Pfaff [Wed, 25 Apr 2012 05:17:46 +0000 (22:17 -0700)]
psppire-dialog-action: Remove unused variable.

12 years agogui: Put <?xml> declaration at beginning of roc.ui.
Ben Pfaff [Wed, 25 Apr 2012 05:17:33 +0000 (22:17 -0700)]
gui: Put <?xml> declaration at beginning of roc.ui.

xgettext objected to the blank line at the beginning.

12 years agogui: Properly manage ref counts of combo box and tree view models.
Ben Pfaff [Wed, 25 Apr 2012 05:16:30 +0000 (22:16 -0700)]
gui: Properly manage ref counts of combo box and tree view models.

gtk_combo_box_set_model() and gtk_tree_view_set_model() add a
reference to the passed-in model, instead of transferring a
reference from the caller.  A lot of the calls to these functions,
however, assumed that a reference was transferred and therefore
leaked a reference.  This fixes them up.

This doesn't change PsppireValueEntry, because there's an ongoing
discussion about that.

12 years agopsppire-acr: Clarify acr ownership of its list store.
Ben Pfaff [Wed, 25 Apr 2012 05:14:58 +0000 (22:14 -0700)]
psppire-acr: Clarify acr ownership of its list store.

PsppireAcr retains a pointer to the GtkListStore inside it but it
didn't, until now, keep a reference to it.  This commit makes
PsppireAcr retain a reference, documents the interface, and updates
callers to properly maintain reference counts.

12 years agoROC Dialog: Use PsppireValueEntry for the state value entry
John Darrington [Tue, 24 Apr 2012 19:24:40 +0000 (21:24 +0200)]
ROC Dialog: Use PsppireValueEntry for the state value entry

12 years agoAdd PsppireValueEntry to the list of pre-declared widgets
John Darrington [Tue, 24 Apr 2012 19:24:13 +0000 (21:24 +0200)]
Add PsppireValueEntry to the list of pre-declared widgets

12 years agoPsppireValueEntry: Unref model after the combo box assumes it
John Darrington [Tue, 24 Apr 2012 19:22:04 +0000 (21:22 +0200)]
PsppireValueEntry: Unref model after the combo box assumes it

12 years agoPsppireValueEntry: Remove unnecessary function calls
John Darrington [Tue, 24 Apr 2012 19:18:03 +0000 (21:18 +0200)]
PsppireValueEntry: Remove unnecessary function calls

12 years agoval_labs_equal: Accept null pointers
John Darrington [Tue, 24 Apr 2012 19:14:17 +0000 (21:14 +0200)]
val_labs_equal: Accept null pointers

Instead of checking for NULL before calling val_labs_equal, put the onus
on the function itself to deal with null pointers and behave appropriately.

12 years agoPsppireValueEntry: Clear the entry, when the underlying model changes.
John Darrington [Mon, 23 Apr 2012 19:08:21 +0000 (21:08 +0200)]
PsppireValueEntry: Clear the entry, when the underlying model changes.

Since the labels will have changed, the existing text is most likely
inappropriate.

12 years agoPsppireValueEntry: Remove GNU_CONST declaration because it prevents the type being...
John Darrington [Mon, 23 Apr 2012 18:34:57 +0000 (20:34 +0200)]
PsppireValueEntry: Remove GNU_CONST declaration because it prevents the type being found by GtkBuilder