BTRFS: Implement BTree::Path and change _Find.
[haiku.git] / src / apps / devices / DevicesApplication.cpp
blob67466e39369dfb2a3ece3b327a394f6b8889ca6b
1 /*
2 * Copyright 2008-2009 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Pieter Panman
7 */
9 #include <Alert.h>
10 #include <Application.h>
11 #include <Catalog.h>
12 #include <LayoutBuilder.h>
13 #include <TextView.h>
15 #include "DevicesView.h"
17 #undef B_TRANSLATION_CONTEXT
18 #define B_TRANSLATION_CONTEXT "DevicesApplication"
20 class DevicesApplication : public BApplication {
21 public:
22 DevicesApplication();
26 class DevicesWindow : public BWindow {
27 public:
28 DevicesWindow();
29 virtual void MessageReceived(BMessage* message);
30 private:
31 DevicesView* fDevicesView;
35 DevicesApplication::DevicesApplication()
37 BApplication("application/x-vnd.Haiku-Devices")
39 DevicesWindow* window = new DevicesWindow();
40 window->CenterOnScreen();
41 window->Show();
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)
52 .SetInsets(0)
53 .Add(fDevicesView = new DevicesView());
54 GetLayout()->SetExplicitMinSize(BSize(600, 300));
58 void
59 DevicesWindow::MessageReceived(BMessage* message)
61 switch (message->what) {
62 case kMsgRefresh:
63 case kMsgReportCompatibility:
64 case kMsgGenerateSysInfo:
65 case kMsgSelectionChanged:
66 case kMsgOrderCategory:
67 case kMsgOrderConnection:
68 fDevicesView->MessageReceived(message);
69 break;
71 default:
72 BWindow::MessageReceived(message);
73 break;
78 int
79 main()
81 DevicesApplication app;
82 app.Run();
83 return 0;