diff --git a/src/preferences/bluetooth/BluetoothDeviceView.cpp b/src/preferences/bluetooth/BluetoothDeviceView.cpp index 29f7a5f2b8..52372f8a3d 100644 --- a/src/preferences/bluetooth/BluetoothDeviceView.cpp +++ b/src/preferences/bluetooth/BluetoothDeviceView.cpp @@ -149,21 +149,22 @@ BluetoothDeviceView::SetBluetoothDevice(BluetoothDevice* bDevice) string = ""; if (bDevice->GetProperty("manufacturer", &value) == B_OK) - string << "Manufacturer: " << BluetoothManufacturer(value); + string << B_TRANSLATE("Manufacturer: ") + << BluetoothManufacturer(value); fManufacturerProperties->SetText(string.String()); string = ""; if (bDevice->GetProperty("acl_mtu", &value) == B_OK) string << "ACL mtu: " << value; if (bDevice->GetProperty("acl_max_pkt", &value) == B_OK) - string << " packets: " << value; + string << B_TRANSLATE(" packets: ") << value; fACLBuffersProperties->SetText(string.String()); string = ""; if (bDevice->GetProperty("sco_mtu", &value) == B_OK) string << "SCO mtu: " << value; if (bDevice->GetProperty("sco_max_pkt", &value) == B_OK) - string << " packets: " << value; + string << B_TRANSLATE(" packets: ") << value; fSCOBuffersProperties->SetText(string.String()); } diff --git a/src/preferences/bluetooth/BluetoothMain.cpp b/src/preferences/bluetooth/BluetoothMain.cpp index e17006c26a..b3fc9abd36 100644 --- a/src/preferences/bluetooth/BluetoothMain.cpp +++ b/src/preferences/bluetooth/BluetoothMain.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include @@ -30,9 +29,11 @@ BluetoothApplication::ReadyToRun() if (!be_roster->IsRunning(BLUETOOTH_SIGNATURE)) { int32 choice = (new BAlert("bluetooth_server not running", - "bluetooth_server has not been found running on the system." - "Should be started, or stay offline", "Work offline", - "Quit", "Start please", B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); + B_TRANSLATE("bluetooth_server has not been found running on the " + "system. Should be started, or stay offline"), + B_TRANSLATE("Work offline"), B_TRANSLATE("Quit"), + B_TRANSLATE("Start please"), B_WIDTH_AS_USUAL, + B_WARNING_ALERT))->Go(); switch (choice) { diff --git a/src/preferences/bluetooth/BluetoothSettingsView.cpp b/src/preferences/bluetooth/BluetoothSettingsView.cpp index dcd7840011..51f16cfb6a 100644 --- a/src/preferences/bluetooth/BluetoothSettingsView.cpp +++ b/src/preferences/bluetooth/BluetoothSettingsView.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -156,35 +155,40 @@ BluetoothSettingsView::MessageReceived(BMessage* message) case kMsgSetDeviceClassDesktop: { devClass.SetRecord(1, 1, 0x72); - ActiveLocalDevice->SetDeviceClass(devClass); + if (ActiveLocalDevice != NULL) + ActiveLocalDevice->SetDeviceClass(devClass); break; } case kMsgSetDeviceClassServer: { devClass.SetRecord(1, 2, 0x72); - ActiveLocalDevice->SetDeviceClass(devClass); + if (ActiveLocalDevice != NULL) + ActiveLocalDevice->SetDeviceClass(devClass); break; } case kMsgSetDeviceClassLaptop: { devClass.SetRecord(1, 3, 0x72); - ActiveLocalDevice->SetDeviceClass(devClass); + if (ActiveLocalDevice != NULL) + ActiveLocalDevice->SetDeviceClass(devClass); break; } case kMsgSetDeviceClassHandheld: { devClass.SetRecord(1, 4, 0x72); - ActiveLocalDevice->SetDeviceClass(devClass); + if (ActiveLocalDevice != NULL) + ActiveLocalDevice->SetDeviceClass(devClass); break; } case kMsgSetDeviceClassSmartPhone: { devClass.SetRecord(2, 3, 0x72); - ActiveLocalDevice->SetDeviceClass(devClass); + if (ActiveLocalDevice != NULL) + ActiveLocalDevice->SetDeviceClass(devClass); break; } diff --git a/src/preferences/bluetooth/BluetoothWindow.cpp b/src/preferences/bluetooth/BluetoothWindow.cpp index 37b49ff9b3..2b18fcc239 100644 --- a/src/preferences/bluetooth/BluetoothWindow.cpp +++ b/src/preferences/bluetooth/BluetoothWindow.cpp @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include diff --git a/src/preferences/bluetooth/ExtendedLocalDeviceView.cpp b/src/preferences/bluetooth/ExtendedLocalDeviceView.cpp index 693e605e9e..2bac4f9832 100644 --- a/src/preferences/bluetooth/ExtendedLocalDeviceView.cpp +++ b/src/preferences/bluetooth/ExtendedLocalDeviceView.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/src/preferences/bluetooth/InquiryPanel.cpp b/src/preferences/bluetooth/InquiryPanel.cpp index 66f9367105..3d39081370 100644 --- a/src/preferences/bluetooth/InquiryPanel.cpp +++ b/src/preferences/bluetooth/InquiryPanel.cpp @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -94,7 +93,7 @@ private: InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice) : - BWindow(frame, "Bluetooth", B_FLOATING_WINDOW, + BWindow(frame, B_TRANSLATE("Bluetooth"), B_FLOATING_WINDOW, B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS, B_ALL_WORKSPACES ), fMessenger(this), fScanning(false), @@ -252,13 +251,15 @@ InquiryPanel::MessageReceived(BMessage* message) case kMsgSecond: if (fScanning && scanningTime < timer) { // TODO time formatting could use Locale Kit - BString elapsedTime = B_TRANSLATE("Remaining "); // TODO should not be needed if SetMaxValue works... fScanProgress->SetTo(scanningTime * 100 / timer); + BString elapsedTime = B_TRANSLATE("Remaining %1 seconds"); - elapsedTime << (int)(timer - scanningTime) << - B_TRANSLATE(" seconds"); + BString seconds(""); + seconds << (int)(timer - scanningTime); + + elapsedTime.ReplaceFirst("%1", seconds.String()); fScanProgress->SetTrailingText(elapsedTime.String()); scanningTime = scanningTime + 1; @@ -274,11 +275,13 @@ InquiryPanel::MessageReceived(BMessage* message) if (!labelPlaced) { labelPlaced = true; - BString progressText = - B_TRANSLATE("Retrieving name of "); - progressText << bdaddrUtils::ToString(fDiscoveryAgent + BString progressText(B_TRANSLATE("Retrieving name of %1")); + + BString namestr; + namestr << bdaddrUtils::ToString(fDiscoveryAgent ->RetrieveDevices(0).ItemAt(retrievalIndex) ->GetBluetoothAddress()); + progressText.ReplaceFirst("%1", namestr.String()); fScanProgress->SetTrailingText(progressText.String()); } else { diff --git a/src/preferences/bluetooth/RemoteDevicesView.cpp b/src/preferences/bluetooth/RemoteDevicesView.cpp index e522f79d8c..c6ac12f200 100644 --- a/src/preferences/bluetooth/RemoteDevicesView.cpp +++ b/src/preferences/bluetooth/RemoteDevicesView.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include