xref: /haiku/src/add-ons/network_settings/dialup/DialUpApplication.cpp (revision adae1a12b807112b9419f9523950251c862d5d7d)
1*adae1a12SAugustin Cavalier /*
2*adae1a12SAugustin Cavalier  * Copyright 2003-2004 Waldemar Kornewald. All rights reserved.
3*adae1a12SAugustin Cavalier  * Copyright 2017 Haiku, Inc. All rights reserved.
4*adae1a12SAugustin Cavalier  * Distributed under the terms of the MIT License.
5*adae1a12SAugustin Cavalier  */
6a325aa03SAugustin Cavalier 
7a325aa03SAugustin Cavalier #include <Application.h>
8a325aa03SAugustin Cavalier #include <Window.h>
9a325aa03SAugustin Cavalier 
10a325aa03SAugustin Cavalier #include "InterfaceUtils.h"
11a325aa03SAugustin Cavalier 
12a325aa03SAugustin Cavalier #include "DialUpView.h"
13a325aa03SAugustin Cavalier 
14a325aa03SAugustin Cavalier 
15a325aa03SAugustin Cavalier static const char *kSignature = "application/x-vnd.haiku.dial-up-preflet";
16a325aa03SAugustin Cavalier 
17a325aa03SAugustin Cavalier 
18a325aa03SAugustin Cavalier class DialUpApplication : public BApplication {
19a325aa03SAugustin Cavalier 	public:
20a325aa03SAugustin Cavalier 		DialUpApplication();
21a325aa03SAugustin Cavalier };
22a325aa03SAugustin Cavalier 
23a325aa03SAugustin Cavalier 
24a325aa03SAugustin Cavalier class DialUpWindow : public BWindow {
25a325aa03SAugustin Cavalier 	public:
26a325aa03SAugustin Cavalier 		DialUpWindow(BRect frame);
27a325aa03SAugustin Cavalier 
QuitRequested()28a325aa03SAugustin Cavalier 		virtual bool QuitRequested()
29a325aa03SAugustin Cavalier 			{ be_app->PostMessage(B_QUIT_REQUESTED); return true; }
30a325aa03SAugustin Cavalier };
31a325aa03SAugustin Cavalier 
32a325aa03SAugustin Cavalier 
main()33a325aa03SAugustin Cavalier int main()
34a325aa03SAugustin Cavalier {
35a325aa03SAugustin Cavalier 	new DialUpApplication();
36a325aa03SAugustin Cavalier 
37a325aa03SAugustin Cavalier 	be_app->Run();
38a325aa03SAugustin Cavalier 
39a325aa03SAugustin Cavalier 	delete be_app;
40a325aa03SAugustin Cavalier 
41a325aa03SAugustin Cavalier 	return 0;
42a325aa03SAugustin Cavalier }
43a325aa03SAugustin Cavalier 
44a325aa03SAugustin Cavalier 
DialUpApplication()45a325aa03SAugustin Cavalier DialUpApplication::DialUpApplication()
46a325aa03SAugustin Cavalier 	: BApplication(kSignature)
47a325aa03SAugustin Cavalier {
48a325aa03SAugustin Cavalier 	BRect rect(150, 50, 450, 435);
49a325aa03SAugustin Cavalier 	DialUpWindow *window = new DialUpWindow(rect);
50a325aa03SAugustin Cavalier 	window->MoveTo(center_on_screen(rect, window));
51a325aa03SAugustin Cavalier 	window->Show();
52a325aa03SAugustin Cavalier }
53a325aa03SAugustin Cavalier 
54a325aa03SAugustin Cavalier 
DialUpWindow(BRect frame)55a325aa03SAugustin Cavalier DialUpWindow::DialUpWindow(BRect frame)
56a325aa03SAugustin Cavalier 	: BWindow(frame, "DialUp", B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
57a325aa03SAugustin Cavalier {
58a325aa03SAugustin Cavalier 	DialUpView *view = new DialUpView(Bounds());
59a325aa03SAugustin Cavalier 
60a325aa03SAugustin Cavalier 	AddChild(view);
61a325aa03SAugustin Cavalier }
62