2 * Copyright 2008-2010, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
6 * Michael Pfeiffer <laplace@users.sourceforge.net>
10 #include "BootManagerWindow.h"
12 #include <Application.h>
14 #include <LayoutBuilder.h>
18 #include <tracker_private.h>
20 #include "DefaultPartitionPage.h"
21 #include "PartitionsPage.h"
22 #include "WizardView.h"
25 #undef B_TRANSLATION_CONTEXT
26 #define B_TRANSLATION_CONTEXT "BootManagerWindow"
29 BootManagerWindow::BootManagerWindow()
31 BWindow(BRect(100, 100, 500, 400), B_TRANSLATE_SYSTEM_NAME("BootManager"),
32 B_TITLED_WINDOW
, B_ASYNCHRONOUS_CONTROLS
| B_NOT_ZOOMABLE
33 | B_AUTO_UPDATE_SIZE_LIMITS
)
35 float minWidth
, maxWidth
, minHeight
, maxHeight
;
36 GetSizeLimits(&minWidth
, &maxWidth
, &minHeight
, &maxHeight
);
38 // Use font to determine necessary size of window:
39 const BFont
* font
= be_plain_font
;
40 minWidth
= 400 * (double)font
->Size() / 12.0f
;
41 minHeight
= 250 * (double)font
->Size() / 12.0f
;
43 SetSizeLimits(minWidth
, maxWidth
, minHeight
, maxHeight
);
45 fWizardView
= new WizardView("wizard");
46 BLayoutBuilder::Group
<>(this)
49 fController
.Initialize(fWizardView
);
53 // Prevent minimizing this window if the user would have no way to
54 // get back to it. (For example when only the Installer runs.)
55 if (!be_roster
->IsRunning(kDeskbarSignature
))
56 SetFlags(Flags() | B_NOT_MINIMIZABLE
);
60 BootManagerWindow::~BootManagerWindow()
66 BootManagerWindow::MessageReceived(BMessage
* msg
)
70 fController
.Next(fWizardView
);
73 case kMessagePrevious
:
74 fController
.Previous(fWizardView
);
78 BWindow::MessageReceived(msg
);
84 BootManagerWindow::QuitRequested()
86 be_app
->PostMessage(B_QUIT_REQUESTED
);