- Prevent crashing when there is no localDevice picked(raynald lesieur)
- SetTarget for localDevices not found during startup of the app git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29517 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -126,12 +126,14 @@ BluetoothSettingsView::MessageReceived(BMessage *msg)
|
|||||||
if (msg->FindPointer("LocalDevice", (void**) &lDevice) == B_OK) {
|
if (msg->FindPointer("LocalDevice", (void**) &lDevice) == B_OK) {
|
||||||
// Device integrity should be rechecked
|
// Device integrity should be rechecked
|
||||||
fExtDeviceView->SetLocalDevice(lDevice);
|
fExtDeviceView->SetLocalDevice(lDevice);
|
||||||
|
fExtDeviceView->SetEnabled(true);
|
||||||
ActiveLocalDevice = lDevice;
|
ActiveLocalDevice = lDevice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kMsgRefresh:
|
case kMsgRefresh:
|
||||||
_BuildLocalDevicesMenu();
|
_BuildLocalDevicesMenu();
|
||||||
|
fLocalDevicesMenu->SetTargetForItems(this);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BView::MessageReceived(msg);
|
BView::MessageReceived(msg);
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ ExtendedLocalDeviceView::ExtendedLocalDeviceView(BRect frame, LocalDevice* bDevi
|
|||||||
fDiscoverable = new BCheckBox(iDontCare, "Discoverable","Discoverable", new BMessage(SET_DISCOVERABLE));
|
fDiscoverable = new BCheckBox(iDontCare, "Discoverable","Discoverable", new BMessage(SET_DISCOVERABLE));
|
||||||
fVisible = new BCheckBox(iDontCare, "Visible", "Show Name", new BMessage(SET_VISIBLE));
|
fVisible = new BCheckBox(iDontCare, "Visible", "Show Name", new BMessage(SET_VISIBLE));
|
||||||
|
|
||||||
|
fDiscoverable->SetEnabled(false);
|
||||||
|
fVisible->SetEnabled(false);
|
||||||
|
|
||||||
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
|
||||||
.Add(fDeviceView)
|
.Add(fDeviceView)
|
||||||
@@ -103,8 +104,8 @@ ExtendedLocalDeviceView::MessageReceived(BMessage *msg)
|
|||||||
|
|
||||||
if (fVisible->Value())
|
if (fVisible->Value())
|
||||||
fScanMode |= 2;
|
fScanMode |= 2;
|
||||||
|
if (fDevice != NULL)
|
||||||
fDevice->SetDiscoverable(fScanMode);
|
fDevice->SetDiscoverable(fScanMode);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -118,5 +119,5 @@ ExtendedLocalDeviceView::MessageReceived(BMessage *msg)
|
|||||||
void
|
void
|
||||||
ExtendedLocalDeviceView::SetEnabled(bool value)
|
ExtendedLocalDeviceView::SetEnabled(bool value)
|
||||||
{
|
{
|
||||||
|
fDiscoverable->SetEnabled(value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user