Roy's Projects
/
dhcpcd-ui
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
70926a8
)
Don't spam the last message if the same.
author
Roy Marples
<roy@marples.name>
Tue, 12 Oct 2010 10:58:35 +0000
(10:58 +0000)
committer
Roy Marples
<roy@marples.name>
Tue, 12 Oct 2010 10:58:35 +0000
(10:58 +0000)
src/dhcpcd-gtk/main.c
patch
|
blob
|
history
diff --git
a/src/dhcpcd-gtk/main.c
b/src/dhcpcd-gtk/main.c
index 9734ad50e152675f51a7dbe9c44f09ed833e2bf7..222ef5c450a43088b59a99e63bc2ddc1320189da 100644
(file)
--- a/
src/dhcpcd-gtk/main.c
+++ b/
src/dhcpcd-gtk/main.c
@@
-177,6
+177,8
@@
notify_close(void)
}
#ifdef NOTIFY
+static char *notify_last_msg;
+
static void
notify_closed(void)
{
@@
-188,6
+190,14
@@
notify(const char *title, const char *msg, const char *icon)
{
char **msgs, **m;
+ /* Don't spam the same message */
+ if (notify_last_msg) {
+ if (strcmp(msg, notify_last_msg) == 0)
+ return;
+ g_free(notify_last_msg);
+ }
+ notify_last_msg = g_strdup(msg);
+
msgs = g_strsplit(msg, "\n", 0);
for (m = msgs; *m; m++)
g_message("%s", *m);