1 /* 2 * Copyright 2007-2008 Oliver Ruiz Dorantes, oliver.ruiz.dorantes_at_gmail.com 3 * Copyright 2021, Haiku, Inc. 4 * Distributed under the terms of the MIT License. 5 * 6 * Authors: 7 * Tri-Edge AI <triedgeai@gmail.com> 8 */ 9 10 11 #include <ConnectionIncoming.h> 12 #include <ConnectionView.h> 13 14 namespace Bluetooth 15 { 16 17 ConnectionIncoming::ConnectionIncoming(bdaddr_t address) 18 : 19 BWindow(BRect(600, 100, 1000, 180), "Incoming Connection..", 20 B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 21 B_NOT_ZOOMABLE | B_NOT_RESIZABLE) 22 // 400x80 23 { 24 SetPulseRate(1 * 1000 * 1000); 25 // 1 second 26 fView = new ConnectionView(BRect(0, 0, 400, 80), "<unknown_device>", 27 bdaddrUtils::ToString(address)); 28 AddChild(fView); 29 } 30 31 32 ConnectionIncoming::ConnectionIncoming(RemoteDevice* rDevice) 33 : 34 BWindow(BRect(600, 100, 1000, 180), "Incoming Connection", 35 B_FLOATING_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 36 B_NOT_ZOOMABLE | B_NOT_RESIZABLE) 37 { 38 SetPulseRate(1 * 1000 * 1000); 39 // 1 second 40 41 if (rDevice != NULL) 42 fView = new ConnectionView(BRect(0, 0, 400, 80), rDevice->GetFriendlyName(), 43 bdaddrUtils::ToString(rDevice->GetBluetoothAddress())); 44 else 45 fView = new ConnectionView(BRect(0, 0, 400, 80), "<unknown_device>", 46 bdaddrUtils::ToString(bdaddrUtils::NullAddress())); 47 48 AddChild(fView); 49 } 50 51 52 ConnectionIncoming::~ConnectionIncoming() 53 { 54 } 55 56 57 void 58 ConnectionIncoming::MessageReceived(BMessage* message) 59 { 60 } 61 62 63 bool 64 ConnectionIncoming::QuitRequested() 65 { 66 return BWindow::QuitRequested(); 67 } 68 69 70 } /* end namespace Bluetooth */ 71