1 /* 2 * Copyright 2010, Stephan Aßmus <superstippi@gmx.de> 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 6 #include "BootPrompt.h" 7 8 #include <stdlib.h> 9 10 #include <Catalog.h> 11 #include <Locale.h> 12 13 #include "BootPromptWindow.h" 14 15 16 static int sExitValue; 17 18 19 int 20 main(int, char **) 21 { 22 BootPromptApp app; 23 app.Run(); 24 return sExitValue; 25 } 26 27 28 // #pragma mark - 29 30 31 const char* kAppSignature = "application/x-vnd.Haiku-FirstBootPrompt"; 32 33 34 BootPromptApp::BootPromptApp() 35 : 36 BApplication(kAppSignature) 37 { 38 } 39 40 41 void 42 BootPromptApp::MessageReceived(BMessage* message) 43 { 44 switch (message->what) { 45 case MSG_BOOT_DESKTOP: 46 sExitValue = 1; 47 PostMessage(B_QUIT_REQUESTED); 48 break; 49 case MSG_RUN_INSTALLER: 50 sExitValue = 0; 51 PostMessage(B_QUIT_REQUESTED); 52 break; 53 54 default: 55 BApplication::MessageReceived(message); 56 } 57 } 58 59 60 void 61 BootPromptApp::ReadyToRun() 62 { 63 // Prompt the user to select his preferred language. 64 new BootPromptWindow(); 65 } 66 67