2 * Copyright (c) 2010 Philippe Saint-Pierre, stpere@gmail.com
3 * All rights reserved. Distributed under the terms of the MIT license.
5 * Copyright (c) 1999 Mike Steed. You are free to use and distribute this software
6 * as long as it is accompanied by it's documentation and this copyright notice.
7 * The software comes with no warranty, etc.
14 #include <StringView.h>
18 #include <LayoutBuilder.h>
20 #include "DiskUsage.h"
21 #include "MainWindow.h"
23 #include "StatusView.h"
25 #include "VolumeView.h"
27 #undef B_TRANSLATION_CONTEXT
28 #define B_TRANSLATION_CONTEXT "Volume View"
30 const float kMinWinSize
= 275.0;
32 VolumeView::VolumeView(const char* name
, BVolume
* volume
)
33 : BView(name
, B_WILL_DRAW
)
35 SetLayout(new BGroupLayout(B_HORIZONTAL
));
36 fPieView
= new PieView(volume
);
38 fPieView
->SetExplicitMinSize(BSize(kMinWinSize
, kMinWinSize
));
40 fStatusView
= new StatusView();
42 AddChild(BLayoutBuilder::Group
<>(B_VERTICAL
, 2)
49 VolumeView::~VolumeView()
55 VolumeView::EnableRescan()
57 fStatusView
->EnableRescan();
62 VolumeView::EnableCancel()
64 fStatusView
->EnableCancel();
69 VolumeView::SetPath(BPath path
)
71 fPieView
->SetPath(path
);
77 VolumeView::MessageReceived(BMessage
* msg
)
82 fPieView
->MessageReceived(msg
);
86 BView::MessageReceived(msg
);
92 VolumeView::ShowInfo(const FileInfo
* info
)
94 fStatusView
->ShowInfo(info
);