+ if (g_queue_get_length (late_queue) >= MAX_LATE_MESSAGES)
+ {
+ struct msg *m = g_queue_pop_head (late_queue);
+ msg_destroy (m);
+ dropped_messages++;
+ }
+ g_queue_push_tail (late_queue, m);
+ }
+}
+
+gboolean
+popup_messages (gpointer unused UNUSED)
+{
+ GtkTextBuffer *text_buffer;
+ GtkTextIter end;
+ GtkTextView *text_view;
+ GtkLabel *label;
+ struct string lead = DS_EMPTY_INITIALIZER;
+ struct string msg = DS_EMPTY_INITIALIZER;
+ int message_cnt;
+
+ /* If a pointer grab is in effect, then the combination of that, and
+ a modal dialog box, will cause an impossible situation.
+ So don't pop it up just yet.
+ */
+ if ( gdk_pointer_is_grabbed ())
+ return TRUE;
+
+ /* Compose the lead-in. */
+ message_cnt = error_cnt + warning_cnt + note_cnt;
+ if (dropped_messages == 0)
+ ds_put_format (
+ &lead,
+ ngettext ("The PSPP processing engine reported the following message:",
+ "The PSPP processing engine reported the following messages:",
+ message_cnt));
+ else
+ {
+ ds_put_format (
+ &lead,
+ ngettext ("The PSPP processing engine reported %d message.",
+ "The PSPP processing engine reported %d messages.",
+ message_cnt),
+ message_cnt);
+ ds_put_cstr (&lead, " ");
+ ds_put_format (
+ &lead,
+ ngettext ("%d of these messages are displayed below.",
+ "%d of these messages are displayed below.",
+ MAX_EARLY_MESSAGES + MAX_LATE_MESSAGES),
+ MAX_EARLY_MESSAGES + MAX_LATE_MESSAGES);
+ }