summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharlie Brej <cbrej@cs.man.ac.uk>2010-09-07 21:25:10 +0100
committerCharlie Brej <cbrej@cs.man.ac.uk>2010-09-07 21:25:10 +0100
commitbdd6d45211ab1411265a380e86a6ba69fdfa0d99 (patch)
tree5c4bd528aeae7389b8fcb9fcdaffe902190ff078
parentc21bc99eeea065acc95b8cb1dfb0290fcb9feaec (diff)
main: Remove the hidden message from the message list
The plugins are not updated unless they are switched off and on again
-rw-r--r--src/main.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 6fdd790b..20791c63 100644
--- a/src/main.c
+++ b/src/main.c
@@ -454,6 +454,33 @@ on_display_message (state_t *state,
}
static void
+on_hide_message (state_t *state,
+ const char *message)
+{
+ ply_list_node_t *node;
+
+ ply_trace ("hiding message %s", message);
+
+ node = ply_list_get_first_node (state->messages);
+ while (node != NULL)
+ {
+ ply_list_node_t *next_node;
+ char *list_message;
+
+ list_message = ply_list_node_get_data (node);
+ next_node = ply_list_get_next_node (state->messages, node);
+
+ if (strcmp (list_message, message) == 0)
+ {
+ free (list_message);
+ ply_list_remove_node (state->messages, node);
+ }
+ node = next_node;
+ }
+
+}
+
+static void
on_watch_for_keystroke (state_t *state,
const char *keys,
ply_trigger_t *trigger)
@@ -1139,7 +1166,7 @@ start_boot_server (state_t *state)
(ply_boot_server_ask_for_password_handler_t) on_ask_for_password,
(ply_boot_server_ask_question_handler_t) on_ask_question,
(ply_boot_server_display_message_handler_t) on_display_message,
- (ply_boot_server_hide_message_handler_t) NULL,
+ (ply_boot_server_hide_message_handler_t) on_hide_message,
(ply_boot_server_watch_for_keystroke_handler_t) on_watch_for_keystroke,
(ply_boot_server_ignore_keystroke_handler_t) on_ignore_keystroke,
(ply_boot_server_progress_pause_handler_t) on_progress_pause,