projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d76becf
)
Fix bug where the gui was unresponsive after starting with a file as command line...
author
John Darrington
<john@darrington.wattle.id.au>
Sun, 14 Aug 2016 05:38:15 +0000
(07:38 +0200)
committer
John Darrington
<john@darrington.wattle.id.au>
Sun, 14 Aug 2016 05:38:15 +0000
(07:38 +0200)
src/ui/gui/main.c
patch
|
blob
|
history
src/ui/gui/psppire-data-window.c
patch
|
blob
|
history
src/ui/gui/psppire-data-window.h
patch
|
blob
|
history
src/ui/gui/psppire-syntax-window.c
patch
|
blob
|
history
src/ui/gui/psppire-syntax-window.h
patch
|
blob
|
history
src/ui/gui/psppire.c
patch
|
blob
|
history
src/ui/gui/psppire.h
patch
|
blob
|
history
diff --git
a/src/ui/gui/main.c
b/src/ui/gui/main.c
index 1c9c255047e82c6aa624bfc583353e0d3b6636e0..7fa660df84349806386d4c6c3e424ba7e18d4b82 100644
(file)
--- a/
src/ui/gui/main.c
+++ b/
src/ui/gui/main.c
@@
-215,16
+215,13
@@
destroy_splash (gpointer ud)
return G_SOURCE_REMOVE;
}
return G_SOURCE_REMOVE;
}
+
static void
static void
-
on_activate (GApplication * app, gpointer ud
)
+
wait_for_splash (GApplication *app, GtkWindow *x
)
{
{
- post_initialise (app);
-
- GtkWindow *x = create_data_window ();
- gtk_application_add_window (GTK_APPLICATION (app), x);
if (wsplash)
{
if (wsplash)
{
- gtk_window_set_transient_for (GTK_WINDOW (wsplash),
GTK_WINDOW (x)
);
+ gtk_window_set_transient_for (GTK_WINDOW (wsplash),
x
);
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (wsplash));
gtk_window_set_keep_above (GTK_WINDOW (wsplash), TRUE);
gtk_window_present (GTK_WINDOW (wsplash));
gtk_application_add_window (GTK_APPLICATION (app), GTK_WINDOW (wsplash));
gtk_window_set_keep_above (GTK_WINDOW (wsplash), TRUE);
gtk_window_present (GTK_WINDOW (wsplash));
@@
-240,14
+237,28
@@
on_activate (GApplication * app, gpointer ud)
static void
static void
-on_open (GApplication * app, GFile ** files, gint n_files, gchar * hint,
+on_activate (GApplication * app, gpointer ud)
+{
+ post_initialise (app);
+
+ GtkWindow *x = create_data_window ();
+ gtk_application_add_window (GTK_APPLICATION (app), x);
+
+ wait_for_splash (app, x);
+}
+
+
+static void
+on_open (GApplication *app, GFile **files, gint n_files, gchar * hint,
gpointer ud)
{
post_initialise (app);
gchar *file = g_file_get_parse_name (files[0]);
gpointer ud)
{
post_initialise (app);
gchar *file = g_file_get_parse_name (files[0]);
- psppire_preload_file (file);
+
GtkWindow *x =
psppire_preload_file (file);
g_free (file);
g_free (file);
+
+ wait_for_splash (app, x);
}
}
diff --git
a/src/ui/gui/psppire-data-window.c
b/src/ui/gui/psppire-data-window.c
index 1cccc20ea0a8d7d0247a892ad19e72a0d0022888..fddd3bb3e3b7f8a61f3fbeb62964e2c9803e8287 100644
(file)
--- a/
src/ui/gui/psppire-data-window.c
+++ b/
src/ui/gui/psppire-data-window.c
@@
-1948,7
+1948,7
@@
create_data_window (void)
return GTK_WINDOW (w);
}
return GTK_WINDOW (w);
}
-void
+GtkWindow *
open_data_window (PsppireWindow *victim, const char *file_name,
const char *encoding, gpointer hint)
{
open_data_window (PsppireWindow *victim, const char *file_name,
const char *encoding, gpointer hint)
{
@@
-1965,4
+1965,5
@@
open_data_window (PsppireWindow *victim, const char *file_name,
psppire_window_load (PSPPIRE_WINDOW (window), file_name, encoding, hint);
gtk_widget_show_all (window);
psppire_window_load (PSPPIRE_WINDOW (window), file_name, encoding, hint);
gtk_widget_show_all (window);
+ return GTK_WINDOW (window);
}
}
diff --git
a/src/ui/gui/psppire-data-window.h
b/src/ui/gui/psppire-data-window.h
index ee4d8e0cab767d54509194e7401d06471371e5a9..fa983fabf1129a2303e75f68b6a93a104264c16a 100644
(file)
--- a/
src/ui/gui/psppire-data-window.h
+++ b/
src/ui/gui/psppire-data-window.h
@@
-119,7
+119,7
@@
PsppireDataWindow *psppire_data_window_for_data_store (PsppireDataStore *);
bool psppire_data_window_is_empty (PsppireDataWindow *);
GtkWindow * create_data_window (void);
bool psppire_data_window_is_empty (PsppireDataWindow *);
GtkWindow * create_data_window (void);
-
void
open_data_window (PsppireWindow *victim, const char *file_name,
+
GtkWindow *
open_data_window (PsppireWindow *victim, const char *file_name,
const char *encoding, gpointer hint);
G_END_DECLS
const char *encoding, gpointer hint);
G_END_DECLS
diff --git
a/src/ui/gui/psppire-syntax-window.c
b/src/ui/gui/psppire-syntax-window.c
index 13101f9394da34ab08bad3eed75398951d87cc87..38a4a3f4ff94a3f8ddad8ac8be334de9d570c5fa 100644
(file)
--- a/
src/ui/gui/psppire-syntax-window.c
+++ b/
src/ui/gui/psppire-syntax-window.c
@@
-647,13
+647,15
@@
create_syntax_window (void)
gtk_widget_show (w);
}
gtk_widget_show (w);
}
-void
+GtkWindow *
open_syntax_window (const char *file_name, const gchar *encoding)
{
GtkWidget *se = psppire_syntax_window_new (NULL);
if ( file_name)
load_and_show_syntax_window (se, file_name, encoding);
open_syntax_window (const char *file_name, const gchar *encoding)
{
GtkWidget *se = psppire_syntax_window_new (NULL);
if ( file_name)
load_and_show_syntax_window (se, file_name, encoding);
+
+ return GTK_WINDOW (se);
}
}
diff --git
a/src/ui/gui/psppire-syntax-window.h
b/src/ui/gui/psppire-syntax-window.h
index 3c6cd1e1194fe83652392c4c9074e7cc20dae14a..ce4beac203488b04625af52088d9bbaef0242064 100644
(file)
--- a/
src/ui/gui/psppire-syntax-window.h
+++ b/
src/ui/gui/psppire-syntax-window.h
@@
-86,7
+86,7
@@
GType psppire_syntax_window_get_type (void);
GtkWidget* psppire_syntax_window_new (const char *encoding);
void create_syntax_window (void);
GtkWidget* psppire_syntax_window_new (const char *encoding);
void create_syntax_window (void);
-
void
open_syntax_window (const char *file_name, const char *encoding);
+
GtkWindow *
open_syntax_window (const char *file_name, const char *encoding);
G_END_DECLS
G_END_DECLS
diff --git
a/src/ui/gui/psppire.c
b/src/ui/gui/psppire.c
index 7d9cdf52981c2c424de41ffafd26e4041c08c7b8..69ad624c82529ff63e6a5a1e6e75cefba3d5d65a 100644
(file)
--- a/
src/ui/gui/psppire.c
+++ b/
src/ui/gui/psppire.c
@@
-195,7
+195,7
@@
psppire_set_lexer (struct lexer *lexer)
}
}
-void
+GtkWindow *
psppire_preload_file (const gchar *file)
{
const gchar *local_encoding = "UTF-8";
psppire_preload_file (const gchar *file)
{
const gchar *local_encoding = "UTF-8";
@@
-207,16
+207,18
@@
psppire_preload_file (const gchar *file)
const char *filename = fh_get_file_name (fh);
int retval = any_reader_detect (fh, NULL);
const char *filename = fh_get_file_name (fh);
int retval = any_reader_detect (fh, NULL);
-
+
+ GtkWindow *w ;
/* Check to see if the file is a .sav or a .por file. If not
assume that it is a syntax file */
if (retval == 1)
/* Check to see if the file is a .sav or a .por file. If not
assume that it is a syntax file */
if (retval == 1)
- open_data_window (NULL, filename, NULL, NULL);
+
w =
open_data_window (NULL, filename, NULL, NULL);
else if (retval == 0)
{
create_data_window ();
else if (retval == 0)
{
create_data_window ();
- open_syntax_window (filename, NULL);
+
w =
open_syntax_window (filename, NULL);
}
fh_unref (fh);
}
fh_unref (fh);
+ return w;
}
}
diff --git
a/src/ui/gui/psppire.h
b/src/ui/gui/psppire.h
index e65554d13c4c37cf459118f69a04efe2e16f80dc..311e7c19ad4f37ae9f962d86da98044c1606a007 100644
(file)
--- a/
src/ui/gui/psppire.h
+++ b/
src/ui/gui/psppire.h
@@
-19,6
+19,7
@@
#include <glib.h>
#include <gio/gio.h>
#include <glib.h>
#include <gio/gio.h>
+#include <gtk/gtk.h>
#include <stdbool.h>
#include <stdbool.h>
@@
-47,7
+48,7
@@
void psppire_set_lexer (struct lexer *);
void register_selection_functions (void);
void register_selection_functions (void);
-
void
psppire_preload_file (const gchar *file);
+
GtkWindow *
psppire_preload_file (const gchar *file);
#endif /* PSPPIRE_H */
#endif /* PSPPIRE_H */