]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[client] Add new reactivate command
authorScott James Remnant <scott@ubuntu.com>
Thu, 18 Mar 2010 20:56:39 +0000 (20:56 +0000)
committerRay Strode <rstrode@redhat.com>
Mon, 22 Mar 2010 03:23:39 +0000 (23:23 -0400)
This tells the daemon to reactivate itself after having previously
been suspended by the deactivate command.

src/client/ply-boot-client.c
src/client/ply-boot-client.h
src/client/plymouth.c

index fef7fb13e7d9ae5eb8da7ac22ae7e5e3177d4382..58c5e44d9a3d44dfa7c73da276425a9869a2bd99 100644 (file)
@@ -674,6 +674,18 @@ ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t                  *c
                                  NULL, handler, failed_handler, user_data);
 }
 
+void
+ply_boot_client_tell_daemon_to_reactivate (ply_boot_client_t                  *client,
+                                           ply_boot_client_response_handler_t  handler,
+                                           ply_boot_client_response_handler_t  failed_handler,
+                                           void                               *user_data)
+{
+  assert (client != NULL);
+
+  ply_boot_client_queue_request (client, PLY_BOOT_PROTOCOL_REQUEST_TYPE_REACTIVATE,
+                                 NULL, handler, failed_handler, user_data);
+}
+
 void
 ply_boot_client_tell_daemon_to_quit (ply_boot_client_t                  *client,
                                      bool                                retain_splash,
index 0e9122c4a0faa6b7408364efb4c2378c7109c48e..046b6f75778f5f92e69a986c2ad419e68aeed83a 100644 (file)
@@ -108,6 +108,10 @@ void ply_boot_client_tell_daemon_to_deactivate (ply_boot_client_t
                                                 ply_boot_client_response_handler_t  handler,
                                                 ply_boot_client_response_handler_t  failed_handler,
                                                 void                               *user_data);
+void ply_boot_client_tell_daemon_to_reactivate (ply_boot_client_t                  *client,
+                                                ply_boot_client_response_handler_t  handler,
+                                                ply_boot_client_response_handler_t  failed_handler,
+                                                void                               *user_data);
 void ply_boot_client_tell_daemon_to_quit (ply_boot_client_t                  *client,
                                           bool                                retain_splash,
                                           ply_boot_client_response_handler_t  handler,
index a5209014f515ea70ee7007100b3d4401448b68a2..5dffba818ce0e7f0559b2075d4d7cdda8f7686b0 100644 (file)
@@ -678,6 +678,17 @@ on_deactivate_request (state_t    *state,
                                              on_failure, state);
 }
 
+static void
+on_reactivate_request (state_t    *state,
+                       const char *command)
+{
+  ply_boot_client_tell_daemon_to_reactivate (state->client,
+                                             (ply_boot_client_response_handler_t)
+                                             on_success,
+                                             (ply_boot_client_response_handler_t)
+                                             on_failure, state);
+}
+
 static void
 on_quit_request (state_t    *state,
                  const char *command)
@@ -826,6 +837,11 @@ main (int    argc,
                                   (ply_command_handler_t)
                                   on_deactivate_request, &state, NULL);
 
+  ply_command_parser_add_command (state.command_parser,
+                                  "reactivate", "Tell boot daemon to reactivate",
+                                  (ply_command_handler_t)
+                                  on_reactivate_request, &state, NULL);
+
   ply_command_parser_add_command (state.command_parser,
                                   "quit", "Tell boot daemon to quit",
                                   (ply_command_handler_t)