summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-06-24 11:21:20 -0400
committerRay Strode <rstrode@redhat.com>2008-06-24 11:21:20 -0400
commit645f474d65dbe8f0d755fea5a144e637f9485a93 (patch)
tree50517fe2b61e9763147b61fab804e0226610dcd8
parentf0d9ecf425a4b970fd8c867441305f2063297c7c (diff)
downloadplymouth-645f474d65dbe8f0d755fea5a144e637f9485a93.tar.gz
plymouth-645f474d65dbe8f0d755fea5a144e637f9485a93.tar.xz
plymouth-645f474d65dbe8f0d755fea5a144e637f9485a93.zip
Make details plugin go back to default plugin if escape is pressed again
This fixes the TODO item: - consider making details plugin go back to pretty plugin if user presses escape
-rw-r--r--TODO1
-rw-r--r--src/main.c35
2 files changed, 33 insertions, 3 deletions
diff --git a/TODO b/TODO
index f56ea9d..6570dc7 100644
--- a/TODO
+++ b/TODO
@@ -5,7 +5,6 @@
- Make --ask-for-password take a prompt message
- consider making details plugin have stdin hooked up to the pty instead of tty so input works
- More on the last point, we need to have an escape hatch for fsck etc
-- consider making details plugin go back to pretty plugin if user presses escape
- add expose handler for plugins to draw from. We need to reset some state every frame of the animation, so better to hide that.
- rotate boot.log per boot cycle (might be easiest to just fork/exec out to logrotate directly)
- fix error handling. In particular, ply_open_module gets it completely wrong (replies on errno instead of dlerror())
diff --git a/src/main.c b/src/main.c
index 7fe4d15..7af0b16 100644
--- a/src/main.c
+++ b/src/main.c
@@ -57,6 +57,7 @@ typedef struct
long ptmx;
char kernel_command_line[PLY_MAX_COMMAND_LINE_SIZE];
+ uint32_t showing_details : 1;
} state_t;
static ply_boot_splash_t *start_boot_splash (state_t *state,
@@ -124,7 +125,21 @@ on_system_initialized (state_t *state)
}
static void
-on_show_splash (state_t *state)
+show_detailed_splash (state_t *state)
+{
+ ply_trace ("Showing detailed splash screen");
+ state->boot_splash = start_boot_splash (state,
+ PLYMOUTH_PLUGIN_PATH "details.so");
+
+ if (state->boot_splash == NULL)
+ {
+ ply_trace ("Could not start detailed splash screen, exiting");
+ exit (1);
+ }
+}
+
+static void
+show_default_splash (state_t *state)
{
ply_trace ("Showing splash screen");
state->boot_splash = start_boot_splash (state,
@@ -143,6 +158,12 @@ on_show_splash (state_t *state)
}
static void
+on_show_splash (state_t *state)
+{
+ show_default_splash (state);
+}
+
+static void
on_quit (state_t *state)
{
ply_trace ("time to quit, closing boot.log");
@@ -190,9 +211,19 @@ on_escape_pressed (state_t *state)
{
ply_boot_splash_hide (state->boot_splash);
ply_boot_splash_free (state->boot_splash);
+ state->boot_splash = NULL;
}
- state->boot_splash = start_boot_splash (state, PLYMOUTH_PLUGIN_PATH "details.so");
+ if (!state->showing_details)
+ {
+ show_detailed_splash (state);
+ state->showing_details = true;
+ }
+ else
+ {
+ show_default_splash (state);
+ state->showing_details = false;
+ }
}
static ply_window_t *