Add Pair button to show the pincode screen(class testing purposes)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34331 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -6,15 +6,18 @@
|
||||
|
||||
#include <Alert.h>
|
||||
#include <Catalog.h>
|
||||
#include <Locale.h>
|
||||
#include <Messenger.h>
|
||||
|
||||
#include <Directory.h>
|
||||
#include <Entry.h>
|
||||
#include <File.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <Locale.h>
|
||||
#include <Messenger.h>
|
||||
#include <Path.h>
|
||||
|
||||
#include <GroupLayoutBuilder.h>
|
||||
#include <SpaceLayoutItem.h>
|
||||
|
||||
#include <PincodeWindow.h>
|
||||
|
||||
#include "defs.h"
|
||||
#include "InquiryPanel.h"
|
||||
@@ -26,7 +29,7 @@
|
||||
|
||||
static const uint32 kMsgAddDevices = 'ddDv';
|
||||
static const uint32 kMsgRemoveDevice = 'rmDv';
|
||||
static const uint32 kMsgTrustDevice = 'trDv';
|
||||
static const uint32 kMsgPairDevice = 'trDv';
|
||||
static const uint32 kMsgBlockDevice = 'blDv';
|
||||
static const uint32 kMsgRefreshDevices = 'rfDv';
|
||||
|
||||
@@ -41,19 +44,17 @@ RemoteDevicesView::RemoteDevicesView(const char *name, uint32 flags)
|
||||
removeButton = new BButton("remove", TR("Remove"),
|
||||
new BMessage(kMsgRemoveDevice));
|
||||
|
||||
trustButton = new BButton("trust", TR("As Trusted"),
|
||||
new BMessage(kMsgTrustDevice));
|
||||
pairButton = new BButton("pair", TR("Pair" B_UTF8_ELLIPSIS),
|
||||
new BMessage(kMsgPairDevice));
|
||||
|
||||
|
||||
blockButton = new BButton("trust", TR("As Blocked"),
|
||||
blockButton = new BButton("block", TR("As Blocked"),
|
||||
new BMessage(kMsgBlockDevice));
|
||||
|
||||
|
||||
availButton = new BButton("check", TR("Refresh" B_UTF8_ELLIPSIS),
|
||||
new BMessage(kMsgRefreshDevices));
|
||||
|
||||
|
||||
|
||||
// Set up device list
|
||||
fDeviceList = new BListView("DeviceList", B_SINGLE_SELECTION_LIST);
|
||||
|
||||
@@ -72,7 +73,7 @@ RemoteDevicesView::RemoteDevicesView(const char *name, uint32 flags)
|
||||
.AddGlue()
|
||||
.Add(availButton)
|
||||
.AddGlue()
|
||||
.Add(trustButton)
|
||||
.Add(pairButton)
|
||||
.Add(blockButton)
|
||||
.AddGlue()
|
||||
.SetInsets(0, 15, 0, 15)
|
||||
@@ -94,7 +95,7 @@ RemoteDevicesView::AttachedToWindow(void)
|
||||
fDeviceList->SetTarget(this);
|
||||
addButton->SetTarget(this);
|
||||
removeButton->SetTarget(this);
|
||||
trustButton->SetTarget(this);
|
||||
pairButton->SetTarget(this);
|
||||
blockButton->SetTarget(this);
|
||||
availButton->SetTarget(this);
|
||||
|
||||
@@ -111,8 +112,9 @@ RemoteDevicesView::MessageReceived(BMessage *msg)
|
||||
{
|
||||
InquiryPanel* iPanel = new InquiryPanel(BRect(100,100,450,450), ActiveLocalDevice);
|
||||
iPanel->Show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case kMsgRemoveDevice:
|
||||
printf("kMsgRemoveDevice: %ld\n", fDeviceList->CurrentSelection(0));
|
||||
fDeviceList->RemoveItem(fDeviceList->CurrentSelection(0));
|
||||
@@ -123,8 +125,24 @@ RemoteDevicesView::MessageReceived(BMessage *msg)
|
||||
msg->FindPointer("device", (void**)&device);
|
||||
fDeviceList->AddItem(device);
|
||||
fDeviceList->Invalidate();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case kMsgPairDevice:
|
||||
{
|
||||
bdaddr_t address;
|
||||
address.b[5] = 0x55;
|
||||
address.b[4] = 0x44;
|
||||
address.b[3] = 0x33;
|
||||
address.b[2] = 0x22;
|
||||
address.b[1] = 0x11;
|
||||
address.b[0] = 0x00;
|
||||
|
||||
PincodeWindow* iPincode = new PincodeWindow(address, 0);
|
||||
iPincode->Show();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
BView::MessageReceived(msg);
|
||||
break;
|
||||
|
||||
@@ -41,7 +41,7 @@ protected:
|
||||
|
||||
BButton* addButton;
|
||||
BButton* removeButton;
|
||||
BButton* trustButton;
|
||||
BButton* pairButton;
|
||||
BButton* blockButton;
|
||||
BButton* availButton;
|
||||
BListView* fDeviceList;
|
||||
|
||||
Reference in New Issue
Block a user