xref: /haiku/src/preferences/network/NetworkWindow.cpp (revision 1b8f7f13a3dc70e0e903cb94248220b40b732204)
1 /*
2  * Copyright 2004-2007 Haiku Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Author:
6  *		Andre Alves Garzia, andre@andregarzia.com
7  * With code from:
8  *		Axel Dorfler
9  *		Hugo Santos
10  */
11 
12 #include <Application.h>
13 
14 #include "NetworkWindow.h"
15 #include "EthernetSettingsView.h"
16 
17 
18 NetworkWindow::NetworkWindow()
19 	: BWindow(BRect(50, 50, 269, 302), "Network", B_TITLED_WINDOW,
20 		B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE)
21 {
22 
23 	fEthView = new EthernetSettingsView(Bounds());
24 	ResizeTo(fEthView->Frame().Width(), fEthView->Frame().Height());
25 
26 	AddChild(fEthView);
27 }
28 
29 
30 void
31 NetworkWindow::MessageReceived(BMessage* message)
32 {
33 	switch (message->what) {
34 		case kMsgInfo:
35 		fEthView->MessageReceived(message);
36 		break;
37 	default:
38 		BWindow::MessageReceived(message);
39 	}
40 
41 }
42 
43 NetworkWindow::~NetworkWindow()
44 {
45 }
46 
47 
48 bool
49 NetworkWindow::QuitRequested()
50 {
51 	be_app->PostMessage(B_QUIT_REQUESTED);
52 	return true;
53 }
54