xref: /haiku/src/apps/haikudepot/ui/ShuttingDownWindow.cpp (revision 17889a8c70dbb3d59c1412f6431968753c767bab)
1 /*
2  * Copyright 2021, Andrew Lindesay <apl@lindesay.co.nz>.
3  * All rights reserved. Distributed under the terms of the MIT License.
4  */
5 #include "ShuttingDownWindow.h"
6 
7 #include <Catalog.h>
8 #include <LayoutBuilder.h>
9 #include <Locker.h>
10 
11 
12 #undef B_TRANSLATION_CONTEXT
13 #define B_TRANSLATION_CONTEXT "ShuttingDownWindow"
14 
15 #define WINDOW_FRAME BRect(0, 0, 240, 120)
16 
17 
18 ShuttingDownWindow::ShuttingDownWindow(BWindow* parent)
19 	:
20 	BWindow(WINDOW_FRAME, B_TRANSLATE("Cleaning up" B_UTF8_ELLIPSIS),
21 		B_FLOATING_WINDOW_LOOK, B_MODAL_SUBSET_WINDOW_FEEL,
22 		B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS
23 			| B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_NOT_CLOSABLE )
24 {
25 	AddToSubset(parent);
26 
27 	BTextView* textView = new BTextView("shutting down message");
28 	textView->AdoptSystemColors();
29 	textView->MakeEditable(false);
30 	textView->MakeSelectable(false);
31 	textView->SetText(B_TRANSLATE("HaikuDepot is stopping or completing "
32 		"running operations before quitting."));
33 
34 	BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
35 			.SetInsets(B_USE_WINDOW_SPACING, B_USE_WINDOW_SPACING,
36 				B_USE_WINDOW_SPACING, B_USE_DEFAULT_SPACING)
37 			.Add(textView)
38 		.End();
39 
40 	CenterOnScreen();
41 }
42 
43 
44 ShuttingDownWindow::~ShuttingDownWindow()
45 {
46 }
47 
48