Fixes #7156 "Bluetooth Preflet localization fix" by Jorma Karvonen.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40477 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -149,21 +149,22 @@ BluetoothDeviceView::SetBluetoothDevice(BluetoothDevice* bDevice)
|
|||||||
|
|
||||||
string = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("manufacturer", &value) == B_OK)
|
if (bDevice->GetProperty("manufacturer", &value) == B_OK)
|
||||||
string << "Manufacturer: " << BluetoothManufacturer(value);
|
string << B_TRANSLATE("Manufacturer: ")
|
||||||
|
<< BluetoothManufacturer(value);
|
||||||
fManufacturerProperties->SetText(string.String());
|
fManufacturerProperties->SetText(string.String());
|
||||||
|
|
||||||
string = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("acl_mtu", &value) == B_OK)
|
if (bDevice->GetProperty("acl_mtu", &value) == B_OK)
|
||||||
string << "ACL mtu: " << value;
|
string << "ACL mtu: " << value;
|
||||||
if (bDevice->GetProperty("acl_max_pkt", &value) == B_OK)
|
if (bDevice->GetProperty("acl_max_pkt", &value) == B_OK)
|
||||||
string << " packets: " << value;
|
string << B_TRANSLATE(" packets: ") << value;
|
||||||
fACLBuffersProperties->SetText(string.String());
|
fACLBuffersProperties->SetText(string.String());
|
||||||
|
|
||||||
string = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("sco_mtu", &value) == B_OK)
|
if (bDevice->GetProperty("sco_mtu", &value) == B_OK)
|
||||||
string << "SCO mtu: " << value;
|
string << "SCO mtu: " << value;
|
||||||
if (bDevice->GetProperty("sco_max_pkt", &value) == B_OK)
|
if (bDevice->GetProperty("sco_max_pkt", &value) == B_OK)
|
||||||
string << " packets: " << value;
|
string << B_TRANSLATE(" packets: ") << value;
|
||||||
fSCOBuffersProperties->SetText(string.String());
|
fSCOBuffersProperties->SetText(string.String());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <Locale.h>
|
|
||||||
#include <MessageRunner.h>
|
#include <MessageRunner.h>
|
||||||
#include <Roster.h>
|
#include <Roster.h>
|
||||||
|
|
||||||
@@ -30,9 +29,11 @@ BluetoothApplication::ReadyToRun()
|
|||||||
if (!be_roster->IsRunning(BLUETOOTH_SIGNATURE)) {
|
if (!be_roster->IsRunning(BLUETOOTH_SIGNATURE)) {
|
||||||
|
|
||||||
int32 choice = (new BAlert("bluetooth_server not running",
|
int32 choice = (new BAlert("bluetooth_server not running",
|
||||||
"bluetooth_server has not been found running on the system."
|
B_TRANSLATE("bluetooth_server has not been found running on the "
|
||||||
"Should be started, or stay offline", "Work offline",
|
"system. Should be started, or stay offline"),
|
||||||
"Quit", "Start please", B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
|
B_TRANSLATE("Work offline"), B_TRANSLATE("Quit"),
|
||||||
|
B_TRANSLATE("Start please"), B_WIDTH_AS_USUAL,
|
||||||
|
B_WARNING_ALERT))->Go();
|
||||||
|
|
||||||
|
|
||||||
switch (choice) {
|
switch (choice) {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <Locale.h>
|
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
@@ -156,35 +155,40 @@ BluetoothSettingsView::MessageReceived(BMessage* message)
|
|||||||
case kMsgSetDeviceClassDesktop:
|
case kMsgSetDeviceClassDesktop:
|
||||||
{
|
{
|
||||||
devClass.SetRecord(1, 1, 0x72);
|
devClass.SetRecord(1, 1, 0x72);
|
||||||
ActiveLocalDevice->SetDeviceClass(devClass);
|
if (ActiveLocalDevice != NULL)
|
||||||
|
ActiveLocalDevice->SetDeviceClass(devClass);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kMsgSetDeviceClassServer:
|
case kMsgSetDeviceClassServer:
|
||||||
{
|
{
|
||||||
devClass.SetRecord(1, 2, 0x72);
|
devClass.SetRecord(1, 2, 0x72);
|
||||||
ActiveLocalDevice->SetDeviceClass(devClass);
|
if (ActiveLocalDevice != NULL)
|
||||||
|
ActiveLocalDevice->SetDeviceClass(devClass);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kMsgSetDeviceClassLaptop:
|
case kMsgSetDeviceClassLaptop:
|
||||||
{
|
{
|
||||||
devClass.SetRecord(1, 3, 0x72);
|
devClass.SetRecord(1, 3, 0x72);
|
||||||
ActiveLocalDevice->SetDeviceClass(devClass);
|
if (ActiveLocalDevice != NULL)
|
||||||
|
ActiveLocalDevice->SetDeviceClass(devClass);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kMsgSetDeviceClassHandheld:
|
case kMsgSetDeviceClassHandheld:
|
||||||
{
|
{
|
||||||
devClass.SetRecord(1, 4, 0x72);
|
devClass.SetRecord(1, 4, 0x72);
|
||||||
ActiveLocalDevice->SetDeviceClass(devClass);
|
if (ActiveLocalDevice != NULL)
|
||||||
|
ActiveLocalDevice->SetDeviceClass(devClass);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kMsgSetDeviceClassSmartPhone:
|
case kMsgSetDeviceClassSmartPhone:
|
||||||
{
|
{
|
||||||
devClass.SetRecord(2, 3, 0x72);
|
devClass.SetRecord(2, 3, 0x72);
|
||||||
ActiveLocalDevice->SetDeviceClass(devClass);
|
if (ActiveLocalDevice != NULL)
|
||||||
|
ActiveLocalDevice->SetDeviceClass(devClass);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <Locale.h>
|
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
#include <TabView.h>
|
#include <TabView.h>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <Locale.h>
|
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <Locale.h>
|
|
||||||
#include <ListView.h>
|
#include <ListView.h>
|
||||||
#include <ListItem.h>
|
#include <ListItem.h>
|
||||||
#include <MessageRunner.h>
|
#include <MessageRunner.h>
|
||||||
@@ -94,7 +93,7 @@ private:
|
|||||||
|
|
||||||
InquiryPanel::InquiryPanel(BRect frame, LocalDevice* lDevice)
|
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 ),
|
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS, B_ALL_WORKSPACES ),
|
||||||
fMessenger(this),
|
fMessenger(this),
|
||||||
fScanning(false),
|
fScanning(false),
|
||||||
@@ -252,13 +251,15 @@ InquiryPanel::MessageReceived(BMessage* message)
|
|||||||
case kMsgSecond:
|
case kMsgSecond:
|
||||||
if (fScanning && scanningTime < timer) {
|
if (fScanning && scanningTime < timer) {
|
||||||
// TODO time formatting could use Locale Kit
|
// TODO time formatting could use Locale Kit
|
||||||
BString elapsedTime = B_TRANSLATE("Remaining ");
|
|
||||||
|
|
||||||
// TODO should not be needed if SetMaxValue works...
|
// TODO should not be needed if SetMaxValue works...
|
||||||
fScanProgress->SetTo(scanningTime * 100 / timer);
|
fScanProgress->SetTo(scanningTime * 100 / timer);
|
||||||
|
BString elapsedTime = B_TRANSLATE("Remaining %1 seconds");
|
||||||
|
|
||||||
elapsedTime << (int)(timer - scanningTime) <<
|
BString seconds("");
|
||||||
B_TRANSLATE(" seconds");
|
seconds << (int)(timer - scanningTime);
|
||||||
|
|
||||||
|
elapsedTime.ReplaceFirst("%1", seconds.String());
|
||||||
fScanProgress->SetTrailingText(elapsedTime.String());
|
fScanProgress->SetTrailingText(elapsedTime.String());
|
||||||
|
|
||||||
scanningTime = scanningTime + 1;
|
scanningTime = scanningTime + 1;
|
||||||
@@ -274,11 +275,13 @@ InquiryPanel::MessageReceived(BMessage* message)
|
|||||||
if (!labelPlaced) {
|
if (!labelPlaced) {
|
||||||
|
|
||||||
labelPlaced = true;
|
labelPlaced = true;
|
||||||
BString progressText =
|
BString progressText(B_TRANSLATE("Retrieving name of %1"));
|
||||||
B_TRANSLATE("Retrieving name of ");
|
|
||||||
progressText << bdaddrUtils::ToString(fDiscoveryAgent
|
BString namestr;
|
||||||
|
namestr << bdaddrUtils::ToString(fDiscoveryAgent
|
||||||
->RetrieveDevices(0).ItemAt(retrievalIndex)
|
->RetrieveDevices(0).ItemAt(retrievalIndex)
|
||||||
->GetBluetoothAddress());
|
->GetBluetoothAddress());
|
||||||
|
progressText.ReplaceFirst("%1", namestr.String());
|
||||||
fScanProgress->SetTrailingText(progressText.String());
|
fScanProgress->SetTrailingText(progressText.String());
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <Locale.h>
|
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
|
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user