vfs: check userland buffers before reading them.
[haiku.git] / src / apps / firstbootprompt / BootPrompt.cpp
blobc19a41c2955204d06a43af1f0de7790fc1161b71
1 /*
2 * Copyright 2010, Stephan Aßmus <superstippi@gmx.de>
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
7 #include "BootPrompt.h"
9 #include <stdlib.h>
11 #include <Catalog.h>
12 #include <LaunchRoster.h>
13 #include <Locale.h>
15 #include "BootPromptWindow.h"
18 static int sExitValue;
21 int
22 main(int, char **)
24 BootPromptApp app;
25 app.Run();
26 return sExitValue;
30 // #pragma mark -
33 const char* kAppSignature = "application/x-vnd.Haiku-FirstBootPrompt";
36 BootPromptApp::BootPromptApp()
38 BApplication(kAppSignature)
43 void
44 BootPromptApp::MessageReceived(BMessage* message)
46 switch (message->what) {
47 case MSG_BOOT_DESKTOP:
48 BLaunchRoster().Target("desktop");
49 sExitValue = 1;
50 PostMessage(B_QUIT_REQUESTED);
51 break;
52 case MSG_RUN_INSTALLER:
53 BLaunchRoster().Target("installer");
54 sExitValue = 0;
55 PostMessage(B_QUIT_REQUESTED);
56 break;
58 default:
59 BApplication::MessageReceived(message);
64 void
65 BootPromptApp::ReadyToRun()
67 // Prompt the user to select his preferred language.
68 new BootPromptWindow();