- 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:
Oliver Ruiz Dorantes
2009-03-14 14:51:41 +00:00
parent 492e224b8e
commit 0db890095c
2 changed files with 7 additions and 4 deletions
@@ -126,12 +126,14 @@ BluetoothSettingsView::MessageReceived(BMessage *msg)
if (msg->FindPointer("LocalDevice", (void**) &lDevice) == B_OK) {
// Device integrity should be rechecked
fExtDeviceView->SetLocalDevice(lDevice);
fExtDeviceView->SetEnabled(true);
ActiveLocalDevice = lDevice;
}
}
break;
case kMsgRefresh:
_BuildLocalDevicesMenu();
fLocalDevicesMenu->SetTargetForItems(this);
break;
default:
BView::MessageReceived(msg);
@@ -31,7 +31,8 @@ ExtendedLocalDeviceView::ExtendedLocalDeviceView(BRect frame, LocalDevice* bDevi
fDiscoverable = new BCheckBox(iDontCare, "Discoverable","Discoverable", new BMessage(SET_DISCOVERABLE));
fVisible = new BCheckBox(iDontCare, "Visible", "Show Name", new BMessage(SET_VISIBLE));
fDiscoverable->SetEnabled(false);
fVisible->SetEnabled(false);
AddChild(BGroupLayoutBuilder(B_VERTICAL, 0)
.Add(fDeviceView)
@@ -103,8 +104,8 @@ ExtendedLocalDeviceView::MessageReceived(BMessage *msg)
if (fVisible->Value())
fScanMode |= 2;
fDevice->SetDiscoverable(fScanMode);
if (fDevice != NULL)
fDevice->SetDiscoverable(fScanMode);
break;
@@ -118,5 +119,5 @@ ExtendedLocalDeviceView::MessageReceived(BMessage *msg)
void
ExtendedLocalDeviceView::SetEnabled(bool value)
{
fDiscoverable->SetEnabled(value);
}