projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge commit 'origin/stable'
[pspp-builds.git]
/
src
/
ui
/
gui
/
comments-dialog.c
diff --git
a/src/ui/gui/comments-dialog.c
b/src/ui/gui/comments-dialog.c
index e4304db4db75c24d72f26942ff741771dfff4a81..923953a1514bd34e0d223144ed4d4aaec27107ed 100644
(file)
--- a/
src/ui/gui/comments-dialog.c
+++ b/
src/ui/gui/comments-dialog.c
@@
-16,21
+16,20
@@
#include <config.h>
#include <config.h>
-#include <gtksheet/gtksheet.h>
#include "psppire-dialog.h"
#include "helper.h"
#include "psppire-dialog.h"
#include "helper.h"
-#include "data-editor.h"
+#include "psppire-data-window.h"
+#include "psppire-data-editor.h"
#include <language/syntax-string-source.h>
#include <language/syntax-string-source.h>
-#include "
syntax-edi
tor.h"
+#include "
execu
tor.h"
#include "psppire-var-store.h"
#include "psppire-var-store.h"
-#include <
libpspp
/syntax-gen.h>
+#include <
ui
/syntax-gen.h>
#include "comments-dialog.h"
#include "dialog-common.h"
#include <gtk/gtk.h>
#include "comments-dialog.h"
#include "dialog-common.h"
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include <gettext.h>
#include <gettext.h>
@@
-40,7
+39,7
@@
struct comment_dialog
{
struct comment_dialog
{
- G
ladeXML
*xml;
+ G
tkBuilder
*xml;
PsppireDict *dict;
};
PsppireDict *dict;
};
@@
-96,10
+95,10
@@
comments_dialog (GObject *o, gpointer data)
{
GtkTextIter iter;
gint response ;
{
GtkTextIter iter;
gint response ;
-
struct data_editor *de = data
;
+
PsppireDataWindow *de = PSPPIRE_DATA_WINDOW (data)
;
struct comment_dialog cd;
struct comment_dialog cd;
- G
ladeXML *xml = XML_NEW ("psppire.glade
");
+ G
tkBuilder *xml = builder_new ("psppire.ui
");
GtkWidget *dialog = get_widget_assert (xml, "comments-dialog");
GtkWidget *textview = get_widget_assert (xml, "comments-textview1");
GtkWidget *dialog = get_widget_assert (xml, "comments-dialog");
GtkWidget *textview = get_widget_assert (xml, "comments-textview1");
@@
-110,7
+109,7
@@
comments_dialog (GObject *o, gpointer data)
g_object_get (de->data_editor, "var-store", &vs, NULL);
g_object_get (de->data_editor, "var-store", &vs, NULL);
- gtk_window_set_transient_for (GTK_WINDOW (dialog),
de->parent.window
);
+ gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (de)
);
{
PangoContext * context ;
{
PangoContext * context ;
@@
-168,6
+167,7
@@
comments_dialog (GObject *o, gpointer data)
case GTK_RESPONSE_OK:
{
gchar *syntax = generate_syntax (&cd);
case GTK_RESPONSE_OK:
{
gchar *syntax = generate_syntax (&cd);
+
struct getl_interface *sss = create_syntax_string_source (syntax);
execute_syntax (sss);
struct getl_interface *sss = create_syntax_string_source (syntax);
execute_syntax (sss);
@@
-178,10
+178,7
@@
comments_dialog (GObject *o, gpointer data)
{
gchar *syntax = generate_syntax (&cd);
{
gchar *syntax = generate_syntax (&cd);
- struct syntax_editor *se =
- (struct syntax_editor *) window_create (WINDOW_SYNTAX, NULL);
-
- gtk_text_buffer_insert_at_cursor (se->buffer, syntax, -1);
+ paste_syntax_in_new_window (syntax);
g_free (syntax);
}
g_free (syntax);
}
@@
-245,27
+242,27
@@
generate_syntax (const struct comment_dialog *cd)
for (i = 0 ; i < gtk_text_buffer_get_line_count (buffer) ; ++i )
{
for (i = 0 ; i < gtk_text_buffer_get_line_count (buffer) ; ++i )
{
- struct string
line
;
- GtkTextIter start
, end
;
-
gtk_text_buffer_get_iter_at_line (buffer, &start, i)
;
+ struct string
tmp
;
+ GtkTextIter start;
+
char *line
;
- end = start;
-
- gtk_text_iter_forward_to_line_end (&end);
-
- if ( gtk_text_iter_ends_line (&start))
- ds_init_cstr (&line, "");
+ gtk_text_buffer_get_iter_at_line (buffer, &start, i);
+ if (gtk_text_iter_ends_line (&start))
+ line = g_strdup ("");
else
else
- ds_init_cstr (&line,
- gtk_text_buffer_get_text (buffer,
- &start, &end,
- FALSE));
+ {
+ GtkTextIter end = start;
+ gtk_text_iter_forward_to_line_end (&end);
+ line = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
+ }
- gen_quoted_string (&line);
+ ds_init_empty (&tmp);
+ syntax_gen_string (&tmp, ss_cstr (line));
+ g_free (line);
- g_string_append_printf (str, " %s\n", ds_cstr (&
line
));
+ g_string_append_printf (str, " %s\n", ds_cstr (&
tmp
));
- ds_destroy (&
line
);
+ ds_destroy (&
tmp
);
}
g_string_append (str, " .\n");
}
g_string_append (str, " .\n");