pspp
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

12 years agocrosstabs-dialog: Line up backslashes. 20120424030508/pspp
Ben Pfaff [Tue, 24 Apr 2012 05:05:20 +0000 (22:05 -0700)]
crosstabs-dialog: Line up backslashes.

12 years agotests: Fix reference to old library libpspp.la. 20120422030503/pspp 20120423030509/pspp
Ben Pfaff [Sat, 21 Apr 2012 16:22:04 +0000 (09:22 -0700)]
tests: Fix reference to old library libpspp.la.

Reported by John Darrington.

12 years agoImprove Independent Samples T-test dialog
John Darrington [Sat, 21 Apr 2012 16:09:32 +0000 (18:09 +0200)]
Improve Independent Samples T-test dialog

12 years agoPsppireButtonBox: Remove Close from the default set of buttons
John Darrington [Sat, 21 Apr 2012 15:50:56 +0000 (17:50 +0200)]
PsppireButtonBox: Remove Close from the default set of buttons

12 years agohelper: Move escape_underscores() here.
Ben Pfaff [Fri, 13 Apr 2012 05:33:07 +0000 (22:33 -0700)]
helper: Move escape_underscores() here.

An upcoming commit will introduce a new user in a different file.

12 years agogui: New widget PsppireValueEntry for editing a "union value".
Ben Pfaff [Mon, 9 Apr 2012 03:30:14 +0000 (20:30 -0700)]
gui: New widget PsppireValueEntry for editing a "union value".

This is intended to be a convenenient way to allow the user to
view and edit a "union value" that includes the ability to see
and select values by value label.

12 years agogui: New boxed type for struct fmt_spec.
Ben Pfaff [Mon, 9 Apr 2012 03:19:30 +0000 (20:19 -0700)]
gui: New boxed type for struct fmt_spec.

This makes it possible to use a struct fmt_spec as the value of a
property on a GObject, which I plan to use in an upcoming widget
PsppireValueEntry.

12 years agogui: New type PsppireEmptyListStore.
Ben Pfaff [Thu, 7 Jul 2011 15:09:17 +0000 (08:09 -0700)]
gui: New type PsppireEmptyListStore.

PsppireEmptyListStore is an GtkTreeModel implementation that has a
client-specified number of rows and zero columns.  It is a useful model for
GtkTreeView or PsppSheetView when the client can easily synthesize cell
data using a callback set with gtk_tree_view_column_set_cell_data_func().
In that situation, GtkListStore can be wasteful (because it uses a lot of
memory to store what does not need to be stored) and situation-specific
custom models require additional boilerplate.

This commit also modified the text data import dialog code to use
PsppireEmptyListStore.  Future commits will add other users.

12 years agogui: Add undocumented --measure-startup option.
Ben Pfaff [Sat, 21 Apr 2012 05:01:25 +0000 (22:01 -0700)]
gui: Add undocumented --measure-startup option.

This is useful for testing the effects of code changes upon the
time required to start PSPPIRE.

12 years agoNew "range-tower" data structure. 20120421030503/pspp
Ben Pfaff [Fri, 26 Aug 2011 03:20:52 +0000 (20:20 -0700)]
New "range-tower" data structure.

A range tower is a bitmap, implemented as an augmented binary tree.

Beyond the usual features of a bitmap, a range tower can efficiently
implement a "splice" operation that shifts ranges of bits left or right.
This feature does cost memory and time, so use a range tower only if this
feature is actually needed.  Otherwise, use a range set (see range-set.h),
which can do everything that a range tower can do except the "splice"
operation.

Each operation has O(lg N) cost, where N is the number of contiguous
regions of 1-bits in the bitmap.  Also, a cache reduces the second and
subsequent containment tests within a single contiguous region to O(1).

12 years agorange-set: New macro RANGE_SET_FOR_EACH to make iteration easier.
Ben Pfaff [Sat, 3 Mar 2012 18:34:24 +0000 (10:34 -0800)]
range-set: New macro RANGE_SET_FOR_EACH to make iteration easier.

12 years agorange-set: Rename "insert" function "set1", "delete" to "set0".
Ben Pfaff [Tue, 20 Sep 2011 04:34:13 +0000 (21:34 -0700)]
range-set: Rename "insert" function "set1", "delete" to "set0".

An upcoming commit will introduce a new "range-tower" data
structure that can actually insert and delete ranges.  It
makes sense not to use different terminology for the two data
structures, so renaming these functions makes sense.

12 years agoabt: New function abt_is_empty().
Ben Pfaff [Sun, 6 Nov 2011 21:03:24 +0000 (13:03 -0800)]
abt: New function abt_is_empty().

12 years agoabt: Drop child parameters from 'reaugment' function.
Ben Pfaff [Tue, 23 Aug 2011 05:00:12 +0000 (22:00 -0700)]
abt: Drop child parameters from 'reaugment' function.

The function can simply inspect the 'down' members.

12 years agovalue-labels: New function val_labs_find_value().
Ben Pfaff [Sat, 3 Mar 2012 18:46:37 +0000 (10:46 -0800)]
value-labels: New function val_labs_find_value().

The new data sheet implementation (in an upcoming commit) will use
this.

12 years agohelper: New function value_to_text__().
Ben Pfaff [Sat, 31 Mar 2012 22:46:43 +0000 (15:46 -0700)]
helper: New function value_to_text__().

One potential caller of value_to_text() doesn't have a "struct
variable" but does have the other needed information.

12 years agoformat: Fix typo in comment.
Ben Pfaff [Sat, 31 Mar 2012 22:41:39 +0000 (15:41 -0700)]
format: Fix typo in comment.

struct fmt_spec's 'd' member is not normally a number of "implied"
decimal places.  It is normally the number of decimal places that
will be presented in formatted values.  Thus, update the comment.

12 years agoformat: Introduce a new type "enum fmt_use".
Ben Pfaff [Tue, 5 Jul 2011 01:17:17 +0000 (18:17 -0700)]
format: Introduce a new type "enum fmt_use".

This seems slightly nicer than using a "bool" to distinguish
input and output formats.

12 years agoformat: New functions fmt_change_width(), fmt_change_decimals().
Ben Pfaff [Mon, 4 Jul 2011 21:48:57 +0000 (14:48 -0700)]
format: New functions fmt_change_width(), fmt_change_decimals().

These will be used in an upcoming commit for GUI-based format
adjustments, where we want to implement the user's request for
width or decimal places to the extent that we can, while
adjusting decimal places or width, respectively, as necessary.

12 years agogui: Use canonical names for signals.
Ben Pfaff [Thu, 12 Jan 2012 04:23:04 +0000 (20:23 -0800)]
gui: Use canonical names for signals.

Hyphens are canonical in parameter names, at least, and they seem
to be used consistently in signal names within GNOME, so use them
here too.

12 years agoDO IF test: Correct expected outcome 20120420030504/pspp
John Darrington [Thu, 19 Apr 2012 19:14:54 +0000 (21:14 +0200)]
DO IF test:  Correct expected outcome

Commit 27bd188495ec1a6085354b10545daba47771b517 added a test for an
error condition in DO IF, but appears to contain some cut and paste
errors.  This change corrects them.

12 years agoSHOW: New subcommand N
John Darrington [Thu, 19 Apr 2012 19:11:36 +0000 (21:11 +0200)]
SHOW: New subcommand N

This subcommand reports the number of cases in the active dataset.

12 years agoRevert "psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()." 20120419030507/pspp
Ben Pfaff [Thu, 19 Apr 2012 05:20:35 +0000 (22:20 -0700)]
Revert "psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable()."

This reverts commit edf4f6b1f7e2b9c17cc86f1c63ff9b4b7e24af26.
John pointed out that it causes the GUI to crash at startup.

12 years agoDO IF: Fix crash when END IF appears without DO IF. 20120418030503/pspp
Ben Pfaff [Wed, 18 Apr 2012 04:26:21 +0000 (21:26 -0700)]
DO IF: Fix crash when END IF appears without DO IF.

Reported by Jill Covert.
Bug #36231.

12 years agopsppire-dict: g_return_if_fail for idx in psppire_dict_get_variable().
Ben Pfaff [Wed, 18 Apr 2012 03:09:34 +0000 (20:09 -0700)]
psppire-dict: g_return_if_fail for idx in psppire_dict_get_variable().

Also, as long as we're checking for too-big we might as well check
for too-small too.

12 years agoCorrect bugs in PsppireSelector which cause the Examine Dialog to crash
John Darrington [Tue, 17 Apr 2012 19:51:29 +0000 (21:51 +0200)]
Correct bugs in PsppireSelector which cause the Examine Dialog to crash

12 years agopsppire-dict: Return new var from psppire_dict_insert_variable(). 20120417030503/pspp
Ben Pfaff [Wed, 21 Mar 2012 04:29:54 +0000 (21:29 -0700)]
psppire-dict: Return new var from psppire_dict_insert_variable().

An upcoming commit will introduce a user for the return value.

12 years agopsppire-dict: Make auto_generate_var_name() public, and rename.
Ben Pfaff [Wed, 21 Mar 2012 04:28:44 +0000 (21:28 -0700)]
psppire-dict: Make auto_generate_var_name() public, and rename.

This function will acquire a few users in upcoming commits.

This commit renames it to have the same prefix as other public
functions in this file.

12 years agopsppire-dict: Get rid of static var in auto_generate_var_name().
Ben Pfaff [Wed, 21 Mar 2012 04:18:32 +0000 (21:18 -0700)]
psppire-dict: Get rid of static var in auto_generate_var_name().

This isn't a big deal at the moment but I intend to add new users
of this function in future commits, so then it becomes more
important.

12 years agoAllow dictionary 'var_deleted' callback to examine the deleted var.
Ben Pfaff [Tue, 20 Mar 2012 06:00:05 +0000 (23:00 -0700)]
Allow dictionary 'var_deleted' callback to examine the deleted var.

The dictionary 'var_deleted' callback is the last chance to look at
a variable as it is getting deleted from a dictionary.  For some of
the information in the variable, it legitimately doesn't make any
sense to get it from the variable itself at this point, e.g. the
index into the dictionary or the case, since it no longer is in
a dictionary.  But for most of it, it's reasonable to get it from
the variable itself, but the callback doesn't provide any way to
do that, because it doesn't pass in the variable, just a dictionary
index that is no longer correct.

This commit changes the 'var_deleted' interface to pass in the
variable plus the information that can no longer be obtained from
the variable itself.  An upcoming change to the GUI will make use
of this.

This commit also adapts all the existing users to the new interface.

12 years agofind-dialog: Change "Cancel" button to "Close" button.
Ben Pfaff [Sat, 10 Mar 2012 18:59:17 +0000 (10:59 -0800)]
find-dialog: Change "Cancel" button to "Close" button.

This button doesn't cancel anything, it just closes the dialog box,
so "Close" seems like a better label.

12 years agogtkxpaned: Remove write-only variables.
Ben Pfaff [Mon, 30 Jan 2012 00:31:28 +0000 (16:31 -0800)]
gtkxpaned: Remove write-only variables.

12 years agopsppire-buttonbox: Fix style in header file.
Ben Pfaff [Sat, 10 Mar 2012 18:39:19 +0000 (10:39 -0800)]
psppire-buttonbox: Fix style in header file.

It's totally bizarre and unnecessary to define a macro in the
middle of a function prototype, so this commit moves it.

12 years agopsppire-data-store: Use NULL for a null pointer.
Ben Pfaff [Wed, 28 Mar 2012 03:52:11 +0000 (20:52 -0700)]
psppire-data-store: Use NULL for a null pointer.

12 years agopsppire-data-store: Use PSPPIRE namespace instead of GTK+'s.
Ben Pfaff [Wed, 28 Mar 2012 01:25:01 +0000 (18:25 -0700)]
psppire-data-store: Use PSPPIRE namespace instead of GTK+'s.

12 years agopsppire-data-editor: Drop psppire_data_editor_set_font() redundancy.
Ben Pfaff [Tue, 10 Apr 2012 05:33:35 +0000 (22:33 -0700)]
psppire-data-editor: Drop psppire_data_editor_set_font() redundancy.

set_font() recurses to a GtkContainer's children so
psppire_data_editor_set_font() does not need to also do so.

12 years agoRevert "Fix DSO linking issue"
Ben Pfaff [Mon, 16 Apr 2012 14:39:43 +0000 (07:39 -0700)]
Revert "Fix DSO linking issue"

This reverts commit 34abd8c7de0cac8efeead7fb3848427fb944b5bd.
The author blindly posted the patch without actually testing
whether it was necessary.  It was not, because the libraries
in question were already linked against.  Thanks to John
Darrington for pointing that out.

12 years agoFix DSO linking issue 20120416030503/pspp
Peter Lemenkov [Sun, 15 Apr 2012 16:09:59 +0000 (20:09 +0400)]
Fix DSO linking issue

We must explicitly list every required library in case then linker is built
with default behaviour which prevents implicit DSO linking.

See this for the details on DSO Linking issues:

http://fedoraproject.org/wiki/UnderstandingDSOLinkChange

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
12 years agoPsppireDictView: Call gtk_widget_destroy instead of g_object_unref
John Darrington [Sat, 14 Apr 2012 11:15:14 +0000 (13:15 +0200)]
PsppireDictView: Call gtk_widget_destroy instead of g_object_unref

GtkMenu is a toplevel window.  Therefore, gtk_widget_destroy is appropriate.

12 years agoPsppireDialog: Added assignment for parent_class which it seems was forgotten
John Darrington [Sat, 14 Apr 2012 11:13:20 +0000 (13:13 +0200)]
PsppireDialog: Added assignment for parent_class which it seems was forgotten

12 years agoReplace regression.q with regression.c 20120414030503/pspp 20120415030503/pspp
John Darrington [Fri, 13 Apr 2012 16:55:36 +0000 (18:55 +0200)]
Replace regression.q with regression.c

Reviewed-by: Jason Stover
12 years agoPspppireSelector: Prevent selection of disallowed entries. 20120412030503/pspp 20120413030504/pspp
John Darrington [Tue, 10 Apr 2012 20:12:19 +0000 (22:12 +0200)]
PspppireSelector: Prevent selection of disallowed entries.

We had been relying on the deselected state of the widget to prevent
selection with the "allow" predicate was false.   But clicking the
widget itself isn't the only way items can be selected (double clicking
the item for example).   This change adds a test at a lower level to
prevent selection of disallowed items.

12 years agoi18n: Factor out encoding categories from GUI into common code. 20120411030502/pspp
Ben Pfaff [Wed, 11 Apr 2012 06:18:40 +0000 (23:18 -0700)]
i18n: Factor out encoding categories from GUI into common code.

It would make sense to use these encodings and categories elsewhere.

12 years agosys-file-reader: Remove obsolete comment.
Ben Pfaff [Wed, 11 Apr 2012 06:17:14 +0000 (23:17 -0700)]
sys-file-reader: Remove obsolete comment.

The open_text_record() function does the recoding, so there's no
need for parse_long_var_name_map() to do any recoding of its own.

12 years agoExamine dialog: Allow only numeric variables to be selected as the dependent variable
John Darrington [Mon, 9 Apr 2012 19:50:20 +0000 (21:50 +0200)]
Examine dialog: Allow only numeric variables to be selected as the dependent variable