From: Ben Pfaff Date: Sat, 16 Nov 2013 18:26:19 +0000 (-0800) Subject: Merge 'master' into 'gtk3'. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fbuilds%2F20131212033030%2Fpspp;hp=-c;p=pspp Merge 'master' into 'gtk3'. --- f2d4cc6e7a4d5948a2c0cf70883347000a79a2b0 diff --combined configure.ac index 9f4ecbda5c,81f00b9883..b0f16685b5 --- a/configure.ac +++ b/configure.ac @@@ -2,7 -2,7 +2,7 @@@ dnl Process this file with autoconf to dnl Initialize. AC_PREREQ(2.63) - AC_INIT([GNU PSPP], [0.8.1], [bug-gnu-pspp@gnu.org], [pspp]) + AC_INIT([GNU PSPP], [0.8.1.1], [bug-gnu-pspp@gnu.org], [pspp]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_TESTDIR([tests]) @@@ -71,11 -71,11 +71,11 @@@ if test "$with_cairo" != no && test "$w PKG_CHECK_MODULES([GTHREAD], [gthread-2.0], [], [PSPP_REQUIRED_PREREQ([gthread 2.0 (or use --without-gui)])]) - PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.24], [], - [PSPP_REQUIRED_PREREQ([gtk+ 2.0 version 2.24 or later (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([GTKSOURCEVIEW], [gtksourceview-2.0 >= 2.2], [], - [PSPP_REQUIRED_PREREQ([gtksourceview 2.0 version 2.2 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)])]) AC_ARG_VAR([GLIB_GENMARSHAL]) AC_CHECK_PROGS([GLIB_GENMARSHAL], [glib-genmarshal]) diff --combined src/ui/gui/automake.mk index 99b729f61c,9cb4ffd8fb..b19ea4b3f9 --- a/src/ui/gui/automake.mk +++ b/src/ui/gui/automake.mk @@@ -57,8 -57,8 +57,8 @@@ if HAVE_GU bin_PROGRAMS += src/ui/gui/psppire noinst_PROGRAMS += src/ui/gui/spreadsheet-test -src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) $(GTKSOURCEVIEW_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 -src_ui_gui_spreadsheet_test_CFLAGS = $(GTK_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 +src_ui_gui_psppire_CFLAGS = $(GTK_CFLAGS) $(GTKSOURCEVIEW_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 +src_ui_gui_spreadsheet_test_CFLAGS = $(GTK_CFLAGS) -Wall -DGDK_MULTIHEAD_SAFE=1 src_ui_gui_psppire_LDFLAGS = \ @@@ -345,6 -345,9 +345,9 @@@ src/ui/gui/psppire-marshal.h: src/ui/gu desktopdir = $(datadir)/applications 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 CLEANFILES += src/ui/gui/psppire-marshal.c src/ui/gui/psppire-marshal.h \ $(nodist_src_ui_gui_psppire_DATA) diff --combined src/ui/gui/main.c index 6bc9e9686c,c57c714988..24ac6c7581 --- a/src/ui/gui/main.c +++ b/src/ui/gui/main.c @@@ -88,7 -88,7 +88,7 @@@ usage (void gtk_help = gtk_help != NULL ? gtk_help + 2 : gtk_help_base; printf (_("\ - PSPPIRE, a GUI for PSPP, a program for statistical analysis of sample data.\n\ + 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\ @@@ -199,14 -199,12 +199,14 @@@ print_startup_time (gpointer data return FALSE; } +/* static gboolean quit_one_loop (gpointer data) { gtk_main_quit (); return FALSE; } +*/ struct initialisation_parameters { @@@ -331,14 -329,13 +331,14 @@@ main (int argc, char *argv[] init_p.splash_window = create_splash_window (); init_p.data_file = optind < argc ? argv[optind] : NULL; - if ( show_splash ) - gtk_widget_show (init_p.splash_window); + // if ( show_splash ) + // gtk_widget_show (init_p.splash_window); - g_idle_add (quit_one_loop, 0); + // g_idle_add (quit_one_loop, 0); - gtk_quit_add (0, run_inner_loop, &init_p); - gtk_main (); + // gtk_quit_add (0, run_inner_loop, &init_p); + run_inner_loop (&init_p); + // gtk_main (); return 0; } diff --combined src/ui/gui/psppire-data-sheet.c index 1b7b66a057,f991d79ffd..c7cced23af --- a/src/ui/gui/psppire-data-sheet.c +++ b/src/ui/gui/psppire-data-sheet.c @@@ -675,7 -675,7 +675,7 @@@ add_data_column_cell_renderer (PsppireD var = g_object_get_data (G_OBJECT (column), "variable"); g_return_if_fail (var != NULL); - if (var_has_value_labels (var)) + if (data_sheet->show_value_labels && var_has_value_labels (var)) { cell = gtk_cell_renderer_combo_new (); g_object_set (G_OBJECT (cell), @@@ -944,10 -944,11 +944,11 @@@ psppire_data_sheet_set_value_labels (Ps { ds->show_value_labels = show_value_labels; g_object_notify (G_OBJECT (ds), "value-labels"); - gtk_widget_queue_draw (GTK_WIDGET (ds)); - /* Make the cell being edited refresh too. */ - pspp_sheet_view_stop_editing (PSPP_SHEET_VIEW (ds), TRUE); + /* Pretend the model changed, to force the columns to be rebuilt. + Otherwise cell renderers won't get changed from combo boxes to text + entries or vice versa. */ + g_object_notify (G_OBJECT (ds), "model"); } } @@@ -2309,7 -2310,7 +2310,7 @@@ psppire_data_sheet_clipboard_set (GtkSe g_assert_not_reached (); } - gtk_selection_data_set (selection_data, selection_data->target, + gtk_selection_data_set (selection_data, gtk_selection_data_get_target (selection_data), 8, (const guchar *) string->str, string->len); @@@ -2442,13 -2443,13 +2443,13 @@@ psppire_data_sheet_clip_received_cb (Gt gint first_column; char *c; - if ( sd->length < 0 ) + if ( gtk_selection_data_get_length (sd) < 0 ) return; - if ( sd->type != gdk_atom_intern ("UTF8_STRING", FALSE)) + if ( gtk_selection_data_get_data_type (sd) != gdk_atom_intern ("UTF8_STRING", FALSE)) return; - c = (char *) sd->data; + c = (char *) gtk_selection_data_get_data (sd); /* Get the starting selected position in the data sheet. (Possibly we should only paste into the selected range if it's larger than one cell?) */ @@@ -2462,14 -2463,14 +2463,14 @@@ g_return_if_fail (next_row >= 0); g_return_if_fail (next_column >= 0); - while (count < sd->length) + while (count < gtk_selection_data_get_length (sd)) { gint row = next_row; gint column = next_column; struct variable *var; char *s = c; - while (*c != '\t' && *c != '\n' && count < sd->length) + while (*c != '\t' && *c != '\n' && count < gtk_selection_data_get_length (sd)) { c++; count++; diff --combined src/ui/gui/psppire-data-window.c index 5408f8d36c,ca4f21e221..5a00a64a8a --- a/src/ui/gui/psppire-data-window.c +++ b/src/ui/gui/psppire-data-window.c @@@ -501,6 -501,7 +501,7 @@@ data_pick_filename (PsppireWindow *wind gtk_file_filter_set_name (filter, _("All Files")); gtk_file_filter_add_pattern (filter, "*"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); + gtk_file_chooser_set_filter (GTK_FILE_CHOOSER (dialog), filter); { GtkCellRenderer *cell; @@@ -683,10 -684,14 +684,10 @@@ static voi fonts_activate (PsppireDataWindow *de) { GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (de)); - PangoFontDescription *current_font; - gchar *font_name; - GtkWidget *dialog = - gtk_font_selection_dialog_new (_("Font Selection")); - - - current_font = GTK_WIDGET(de->data_editor)->style->font_desc; - font_name = pango_font_description_to_string (current_font); + GtkWidget *dialog = gtk_font_selection_dialog_new (_("Font Selection")); + GtkStyle *style = gtk_widget_get_style (GTK_WIDGET(de->data_editor)); + PangoFontDescription *current_font = style->font_desc; + gchar *font_name = pango_font_description_to_string (current_font); gtk_font_selection_dialog_set_font_name (GTK_FONT_SELECTION_DIALOG (dialog), font_name); @@@ -901,14 -906,12 +902,14 @@@ enable_save (PsppireDataWindow *dw static void psppire_data_window_init (PsppireDataWindow *de) { + GtkWidget *w ; de->builder = builder_new ("data-editor.ui"); de->ui_manager = GTK_UI_MANAGER (get_object_assert (de->builder, "uimanager1", GTK_TYPE_UI_MANAGER)); - PSPPIRE_WINDOW (de)->menu = - GTK_MENU_SHELL (gtk_ui_manager_get_widget (de->ui_manager, "/ui/menubar/windows/windows_minimise_all")->parent); + w = gtk_ui_manager_get_widget (de->ui_manager, "/ui/menubar/windows/windows_minimise_all"); + + PSPPIRE_WINDOW (de)->menu = GTK_MENU_SHELL (gtk_widget_get_parent (w)); de->uim = NULL; de->merge_id = 0; diff --combined src/ui/gui/psppire-window.c index dcc44a8d55,65842bdc62..609b88120d --- a/src/ui/gui/psppire-window.c +++ b/src/ui/gui/psppire-window.c @@@ -310,10 -310,8 +310,10 @@@ psppire_window_base_init (PsppireWindow static void menu_toggled (GtkCheckMenuItem *mi, gpointer data) { +#if GTK3_TRANSITION /* Prohibit changes to the state */ mi->active = !mi->active; +#endif } @@@ -357,11 -355,9 +357,11 @@@ insert_menuitem_into_menu (PsppireWindo gtk_menu_shell_append (window->menu, item); +#if GTK3_TRANSITION /* Set the state without emitting a signal */ GTK_CHECK_MENU_ITEM (item)->active = (psppire_window_register_lookup (psppire_window_register_new (), key) == window); +#endif g_hash_table_insert (window->menuitem_table, key, item); } @@@ -727,13 -723,15 +727,15 @@@ psppire_window_file_chooser_dialog (Psp gtk_file_filter_set_name (filter, _("Data and Syntax Files")); gtk_file_filter_add_mime_type (filter, "application/x-spss-sav"); gtk_file_filter_add_mime_type (filter, "application/x-spss-por"); + gtk_file_filter_add_pattern (filter, "*.zsav"); gtk_file_filter_add_pattern (filter, "*.sps"); gtk_file_filter_add_pattern (filter, "*.SPS"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); filter = gtk_file_filter_new (); - gtk_file_filter_set_name (filter, _("System Files (*.sav)")); + gtk_file_filter_set_name (filter, _("System Files (*.sav, *.zsav)")); gtk_file_filter_add_mime_type (filter, "application/x-spss-sav"); + gtk_file_filter_add_pattern (filter, "*.zsav"); gtk_file_chooser_add_filter (GTK_FILE_CHOOSER (dialog), filter); filter = gtk_file_filter_new ();