X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fhelper.c;h=492797dbbad8885b405a866329fd5d94982295b0;hb=8f69116a2c31b8aed0527e225c368b3466da6c8d;hp=44396663daca80cf14af03b2b7bb81a51e57121c;hpb=52c0bf3d116ca8bc1d0b77b51dbe253ce9b32688;p=pspp diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index 44396663da..492797dbba 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -40,7 +40,9 @@ #include #include "psppire-data-store.h" +#include "psppire.h" +#include "gl/configmake.h" #include "xalloc.h" #include @@ -229,22 +231,6 @@ connect_help (GtkBuilder *xml) } -void -reference_manual (GtkMenuItem *menu, gpointer data) -{ - GError *err = NULL; - gchar *cmd = g_strdup_printf ("yelp file://%s", relocate (DOCDIR "/pspp.xml")); - - if ( ! g_spawn_command_line_async (cmd, &err) ) - { - msg (ME, _("Cannot open reference manual: %s"), err->message); - } - - g_free (cmd); - g_clear_error (&err); -} - - /* Create a deep copy of SRC */ GtkListStore * clone_list_store (const GtkListStore *src) @@ -289,14 +275,35 @@ clone_list_store (const GtkListStore *src) } + + +static gboolean +on_delete (GtkWindow *window, GdkEvent *e, GtkWindow **addr) +{ + *addr = NULL; + + return FALSE; +} + void -paste_syntax_in_new_window (const gchar *syntax) +paste_syntax_to_window (const gchar *syntax) { - GtkWidget *se = psppire_syntax_window_new (); + static GtkWidget *the_syntax_pasteboard = NULL; + + if ( NULL == the_syntax_pasteboard) + { + the_syntax_pasteboard = psppire_syntax_window_new (); + g_signal_connect (the_syntax_pasteboard, "delete-event", G_CALLBACK (on_delete), + &the_syntax_pasteboard); + } + + gtk_text_buffer_insert_at_cursor (PSPPIRE_SYNTAX_WINDOW (the_syntax_pasteboard)->buffer, + syntax, -1); - gtk_text_buffer_insert_at_cursor (PSPPIRE_SYNTAX_WINDOW (se)->buffer, syntax, -1); + gtk_text_buffer_insert_at_cursor (PSPPIRE_SYNTAX_WINDOW (the_syntax_pasteboard)->buffer, + "\n", 1); - gtk_widget_show (se); + gtk_widget_show (the_syntax_pasteboard); }