g_free (uri);
- psppire_window_load (window, file);
+ open_data_window (window, file);
g_free (file);
}
{
gtk_widget_show (psppire_data_window_new (NULL));
}
+
+void
+open_data_window (PsppireWindow *victim, const char *file_name)
+{
+ GtkWidget *window;
+
+ if (PSPPIRE_IS_DATA_WINDOW (victim)
+ && psppire_data_window_is_empty (PSPPIRE_DATA_WINDOW (victim)))
+ window = GTK_WIDGET (victim);
+ else
+ window = psppire_data_window_new (NULL);
+
+ psppire_window_load (PSPPIRE_WINDOW (window), file_name);
+ gtk_widget_show (window);
+}
bool psppire_data_window_is_empty (PsppireDataWindow *);
void create_data_window (void);
+void open_data_window (PsppireWindow *victim, const char *file_name);
G_END_DECLS
gchar *sysname = convert_glib_filename_to_system_filename (name, NULL);
if (any_reader_may_open (sysname))
- {
- PsppireWindow *window;
-
- if (PSPPIRE_IS_DATA_WINDOW (de)
- && psppire_data_window_is_empty (PSPPIRE_DATA_WINDOW (de)))
- window = de;
- else
- window = PSPPIRE_WINDOW (psppire_data_window_new (NULL));
-
- psppire_window_load (window, name);
- gtk_widget_show (GTK_WIDGET (window));
- }
+ open_data_window (de, name);
else
open_syntax_window (name);