X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fpsppire-window.c;h=bc28a15fd1b94a6be46cf1a7f0375159d857d771;hb=f50fd75b45786d9cd4f2c98d4076804d46795bec;hp=9826b702d9f4e005da364c0244a880f58655e36b;hpb=e12c4fd7aa872268da1380e02a6d82e4222e8b26;p=pspp
diff --git a/src/ui/gui/psppire-window.c b/src/ui/gui/psppire-window.c
index 9826b702d9..bc28a15fd1 100644
--- a/src/ui/gui/psppire-window.c
+++ b/src/ui/gui/psppire-window.c
@@ -15,6 +15,7 @@
along with this program. If not, see . */
#include
+#include
#include "psppire-window.h"
#include "psppire-window-base.h"
@@ -31,6 +32,7 @@
#include "data/any-reader.h"
#include "data/file-name.h"
#include "data/dataset.h"
+#include "libpspp/version.h"
#include "helper.h"
#include "psppire-data-window.h"
@@ -310,8 +312,10 @@ psppire_window_base_init (PsppireWindowClass *class)
static void
menu_toggled (GtkCheckMenuItem *mi, gpointer data)
{
+#if GTK3_TRANSITION
/* Prohibit changes to the state */
mi->active = !mi->active;
+#endif
}
@@ -355,9 +359,11 @@ insert_menuitem_into_menu (PsppireWindow *window, gpointer key)
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);
}
@@ -515,11 +521,11 @@ psppire_window_query_save (PsppireWindow *se)
GTK_RESPONSE_REJECT);
cancel_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_CANCEL,
+ _("Cancel"),
GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (dialog),
- GTK_STOCK_SAVE,
+ _("Save"),
GTK_RESPONSE_APPLY);
gtk_widget_grab_focus (cancel_button);
@@ -694,8 +700,8 @@ psppire_window_file_chooser_dialog (PsppireWindow *toplevel)
gtk_file_chooser_dialog_new (_("Open"),
GTK_WINDOW (toplevel),
GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("Cancel"), GTK_RESPONSE_CANCEL,
+ _("Save"), GTK_RESPONSE_ACCEPT,
NULL);
g_object_set (dialog, "local-only", FALSE, NULL);
@@ -765,6 +771,8 @@ psppire_window_open (PsppireWindow *de)
{
GtkWidget *dialog = psppire_window_file_chooser_dialog (de);
+ gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (dialog), relocate (examples_dir), NULL);
+
switch (gtk_dialog_run (GTK_DIALOG (dialog)))
{
case GTK_RESPONSE_ACCEPT:
@@ -777,10 +785,10 @@ psppire_window_open (PsppireWindow *de)
gchar *encoding = psppire_encoding_selector_get_encoding (
gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (dialog)));
- enum detect_result res = any_reader_may_open (sysname);
- if (ANY_YES == res)
+ int retval = any_reader_detect (sysname, NULL);
+ if (retval == 1)
open_data_window (de, name, encoding, NULL);
- else if (ANY_NO == res)
+ else if (retval == 0)
open_syntax_window (name, encoding);
g_free (encoding);