1 /* 2 * Copyright 2008-2010, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Michael Pfeiffer <laplace@users.sourceforge.net> 7 * Axel Dörfler <axeld@pinc-software.de> 8 */ 9 10 11 #include "BootManagerWindow.h" 12 13 #include <Alert.h> 14 #include <Application.h> 15 #include <Catalog.h> 16 #include <Locale.h> 17 #include <TextView.h> 18 19 20 #undef B_TRANSLATE_CONTEXT 21 #define B_TRANSLATE_CONTEXT "BootManager" 22 23 24 static const char* kSignature = "application/x-vnd.Haiku-BootManager"; 25 26 27 class BootManager : public BApplication { 28 public: 29 BootManager(); 30 31 virtual void ReadyToRun(); 32 virtual void AboutRequested(); 33 }; 34 35 36 BootManager::BootManager() 37 : 38 BApplication(kSignature) 39 { 40 } 41 42 43 void 44 BootManager::ReadyToRun() 45 { 46 BootManagerWindow* window = new BootManagerWindow(); 47 window->Show(); 48 } 49 50 51 void 52 BootManager::AboutRequested() 53 { 54 BString aboutText; 55 const char* title = B_TRANSLATE_COMMENT("BootManager", "Application name"); 56 aboutText << title << "\n\n" 57 << B_TRANSLATE("written by") 58 << "\n" 59 "\tDavid Dengg\n" 60 "\tMichael Pfeiffer\n" 61 "\n" 62 << B_TRANSLATE_COMMENT("Copyright %year, Haiku Inc.\n", 63 "Leave %year untranslated"); 64 aboutText.ReplaceLast("%year", "2008-2010"); 65 BAlert *alert = new BAlert("about", 66 aboutText.String(), B_TRANSLATE("OK")); 67 BTextView *view = alert->TextView(); 68 BFont font; 69 70 view->SetStylable(true); 71 72 view->GetFont(&font); 73 font.SetSize(18); 74 font.SetFace(B_BOLD_FACE); 75 view->SetFontAndColor(0, strlen(title), &font); 76 77 alert->Go(); 78 } 79 80 81 // #pragma mark - 82 83 84 int 85 main(int /*argc*/, char** /*argv*/) 86 { 87 BootManager application; 88 application.Run(); 89 90 return 0; 91 } 92