projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Removed unreachable code section
[pspp]
/
src
/
ui
/
gui
/
psppire-window.c
diff --git
a/src/ui/gui/psppire-window.c
b/src/ui/gui/psppire-window.c
index 9826b702d9f4e005da364c0244a880f58655e36b..bc28a15fd1b94a6be46cf1a7f0375159d857d771 100644
(file)
--- 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 <http://www.gnu.org/licenses/>. */
#include <config.h>
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
+#include <gl/relocatable.h>
#include "psppire-window.h"
#include "psppire-window-base.h"
#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 "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"
#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)
{
static void
menu_toggled (GtkCheckMenuItem *mi, gpointer data)
{
+#if GTK3_TRANSITION
/* Prohibit changes to the state */
mi->active = !mi->active;
/* 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);
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);
/* 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);
}
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_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_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG (dialog),
-
GTK_STOCK_SAVE
,
+
_("Save")
,
GTK_RESPONSE_APPLY);
gtk_widget_grab_focus (cancel_button);
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_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);
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);
{
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:
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)));
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);
open_data_window (de, name, encoding, NULL);
- else if (
ANY_NO == res
)
+ else if (
retval == 0
)
open_syntax_window (name, encoding);
g_free (encoding);
open_syntax_window (name, encoding);
g_free (encoding);