[dia] Show most recent (error) message for repeated messages



commit 264a39c3a0c11bbd5487b522be46b33dfcb5ff37
Author: Hans Breuer <hans breuer org>
Date:   Sun Mar 27 22:13:48 2011 +0200

    Show most recent (error) message for repeated messages

 lib/message.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/lib/message.c b/lib/message.c
index 6ce70a2..eca2ae8 100644
--- a/lib/message.c
+++ b/lib/message.c
@@ -43,7 +43,8 @@ typedef struct {
 } DiaMessageInfo;
 
 static void
-gtk_message_toggle_repeats(GtkWidget *button, gpointer *userdata) {
+gtk_message_toggle_repeats(GtkWidget *button, gpointer *userdata) 
+{
   DiaMessageInfo *msginfo = (DiaMessageInfo*)userdata;
   if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)))
     gtk_widget_show(msginfo->repeat_view);
@@ -204,6 +205,9 @@ gtk_message_internal(const char* title, enum ShowAgainStyle showAgain,
 				 g_list_length(msginfo->repeats));
       gtk_label_set_text(GTK_LABEL(msginfo->repeat_label), newlabel);
     }
+    /* for repeated messages, show the last one */
+    g_object_set (msginfo->dialog, "text", buf, NULL);
+
     gtk_widget_show(msginfo->repeat_label);
     gtk_widget_show(msginfo->show_repeats);
   }
@@ -214,7 +218,7 @@ gtk_message_internal(const char* title, enum ShowAgainStyle showAgain,
     gtk_text_buffer_insert_at_cursor(textbuffer, buf, -1);
   }
 
-  msginfo->repeats = g_list_append(msginfo->repeats, g_strdup(buf));
+  msginfo->repeats = g_list_prepend(msginfo->repeats, g_strdup(buf));
 
   if (askForShowAgain) {
     gtk_widget_show(msginfo->no_show_again);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]