de->xml = glade_xml_new (PKGDATADIR "/data-editor.glade", NULL, NULL);
+ connect_help (de->xml);
+
e->window = get_widget_assert (de->xml, "data_editor");
g_signal_connect (get_widget_assert (de->xml,"file_new_data"),
return recode_string (CONV_PSPP_TO_UTF8, text, len);
}
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
+
+
+static void
+give_help (void)
+{
+ static struct msg m = {
+ MSG_GENERAL,
+ MSG_NOTE,
+ {0, -1},
+ 0,
+ };
+
+ if (! m.text)
+ m.text=g_strdup (_("Sorry. The help system hasn't yet been implemented."));
+
+ popup_message (&m);
+}
+
+void
+connect_help (GladeXML *xml)
+{
+ GList *helps = glade_xml_get_widget_prefix (xml, "help_button_");
+
+ GList *i;
+ for ( i = g_list_first (helps); i ; i = g_list_next (i))
+ g_signal_connect (GTK_WIDGET (i->data), "clicked", give_help, 0);
+}
+
+
char * pspp_locale_to_utf8 (const gchar *text, gssize len, GError **err);
+void connect_help (GladeXML *xml);
+
#endif
popup_message (const struct msg *m)
{
GtkWidget *dialog;
+ gchar *location = NULL;
gint message_type;
const char *msg;
message_type,
GTK_BUTTONS_CLOSE,
msg);
+ if ( m->where.line_number != -1)
+ {
+ location = g_strdup_printf (_("%s (line %d)"),
+ m->where.file_name ? m->where.file_name : "",
+ m->where.line_number);
+ }
+ else
+ {
+ location = g_strdup_printf (_("%s"),
+ m->where.file_name ? m->where.file_name : ""); }
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
- _("%s (line %d) %s"),
- m->where.file_name,
- m->where.line_number,
- m->text);
+ _("%s %s"),
+ location,
+ m->text);
+ free (location);
gtk_window_set_keep_above (GTK_WINDOW (dialog), TRUE);
{
struct missing_val_dialog *dialog = g_malloc (sizeof (*dialog));
+ connect_help (xml);
+
dialog->window = get_widget_assert (xml, "missing_values_dialog");
gtk_window_set_transient_for
gchar **filename, GError **err);
-#define _(msgid) gettext (msgid)
-#define N_(msgid) msgid
-
-static void
-give_help (void)
-{
- static struct msg m = {
- MSG_GENERAL,
- MSG_NOTE,
- {0, -1},
- 0,
- };
-
- if (! m.text)
- m.text=g_strdup (_("Sorry. The help system hasn't yet been implemented."));
-
- popup_message (&m);
-}
-
PsppireVarStore *the_var_store = 0;
void create_icon_factory (void);
create_icon_factory ();
-#if 0
- /* load the interface */
- data_editor_xml = glade_xml_new (PKGDATADIR "/data-editor.glade", NULL, NULL);
-
- if ( !data_editor_xml ) return 1;
-
- data_editor = get_widget_assert (data_editor_xml, "data_editor");
-
- /* connect the signals in the interface */
- glade_xml_signal_autoconnect (data_editor_xml);
-
- var_sheet = GTK_SHEET (get_widget_assert (data_editor_xml, "variable_sheet"));
- data_sheet = GTK_SHEET (get_widget_assert (data_editor_xml, "data_sheet"));
-
- gtk_sheet_set_model (var_sheet, G_SHEET_MODEL (the_var_store));
-
- gtk_sheet_set_model (data_sheet, G_SHEET_MODEL (the_data_store));
-
- var_data_selection_init ();
-
- {
- GList *helps = glade_xml_get_widget_prefix (data_editor_xml, "help_button_");
-
- GList *i;
- for ( i = g_list_first (helps); i ; i = g_list_next (i))
- g_signal_connect (GTK_WIDGET (i->data), "clicked", give_help, 0);
- }
-
-#endif
-
new_data_window (NULL, NULL);
/* start the event loop */
gtk_icon_factory_add_default (factory);
}
+
+
+
struct syntax_editor *se ;
struct editor_window *e;
+ connect_help (xml);
+
se = g_malloc (sizeof (*se));
e = (struct editor_window *)se;
struct val_labs_dialog *dialog = g_malloc (sizeof (*dialog));
+ connect_help (xml);
+
dialog->window = get_widget_assert (xml,"val_labs_dialog");
dialog->value_entry = get_widget_assert (xml,"value_entry");
dialog->label_entry = get_widget_assert (xml,"label_entry");