2 * Copyright 2008-2009 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
10 #include <Application.h>
12 #include <LayoutBuilder.h>
15 #include "DevicesView.h"
17 #undef B_TRANSLATION_CONTEXT
18 #define B_TRANSLATION_CONTEXT "DevicesApplication"
20 class DevicesApplication
: public BApplication
{
26 class DevicesWindow
: public BWindow
{
29 virtual void MessageReceived(BMessage
* message
);
31 DevicesView
* fDevicesView
;
35 DevicesApplication::DevicesApplication()
37 BApplication("application/x-vnd.Haiku-Devices")
39 DevicesWindow
* window
= new DevicesWindow();
40 window
->CenterOnScreen();
45 DevicesWindow::DevicesWindow()
47 BWindow(BRect(50, 50, 750, 550), B_TRANSLATE_SYSTEM_NAME("Devices"),
48 B_TITLED_WINDOW
, B_ASYNCHRONOUS_CONTROLS
| B_AUTO_UPDATE_SIZE_LIMITS
49 | B_QUIT_ON_WINDOW_CLOSE
)
51 BLayoutBuilder::Group
<>(this, B_VERTICAL
)
53 .Add(fDevicesView
= new DevicesView());
54 GetLayout()->SetExplicitMinSize(BSize(600, 300));
59 DevicesWindow::MessageReceived(BMessage
* message
)
61 switch (message
->what
) {
63 case kMsgReportCompatibility
:
64 case kMsgGenerateSysInfo
:
65 case kMsgSelectionChanged
:
66 case kMsgOrderCategory
:
67 case kMsgOrderConnection
:
68 fDevicesView
->MessageReceived(message
);
72 BWindow::MessageReceived(message
);
81 DevicesApplication app
;