CheckStyled
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34775 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -20,12 +20,14 @@
|
|||||||
|
|
||||||
#define TR_CONTEXT "Device View"
|
#define TR_CONTEXT "Device View"
|
||||||
|
|
||||||
BluetoothDeviceView::BluetoothDeviceView(BRect frame, BluetoothDevice* bDevice, uint32 resizingMode, uint32 flags)
|
BluetoothDeviceView::BluetoothDeviceView(BRect frame, BluetoothDevice* bDevice,
|
||||||
: BView(frame,"BluetoothDeviceView", resizingMode, flags | B_WILL_DRAW),
|
uint32 resizingMode, uint32 flags)
|
||||||
|
:
|
||||||
|
BView(frame,"BluetoothDeviceView", resizingMode, flags | B_WILL_DRAW),
|
||||||
fDevice(bDevice)
|
fDevice(bDevice)
|
||||||
{
|
{
|
||||||
SetViewColor(B_TRANSPARENT_COLOR);
|
SetViewColor(B_TRANSPARENT_COLOR);
|
||||||
SetLowColor(0,0,0);
|
SetLowColor(0, 0, 0);
|
||||||
|
|
||||||
SetLayout(new BGroupLayout(B_VERTICAL));
|
SetLayout(new BGroupLayout(B_VERTICAL));
|
||||||
|
|
||||||
@@ -33,28 +35,36 @@ BluetoothDeviceView::BluetoothDeviceView(BRect frame, BluetoothDevice* bDevice,
|
|||||||
fName->SetFont(be_bold_font);
|
fName->SetFont(be_bold_font);
|
||||||
fName->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fName->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
||||||
|
|
||||||
fBdaddr = new BStringView("bdaddr", bdaddrUtils::ToString(bdaddrUtils::NullAddress()));
|
fBdaddr = new BStringView("bdaddr",
|
||||||
|
bdaddrUtils::ToString(bdaddrUtils::NullAddress()));
|
||||||
fBdaddr->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fBdaddr->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
||||||
|
|
||||||
fClassService = new BStringView("ServiceClass", TR("Service classes: "));
|
fClassService = new BStringView("ServiceClass", TR("Service classes: "));
|
||||||
fClassService->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fClassService->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
|
B_ALIGN_MIDDLE));
|
||||||
|
|
||||||
fClass = new BStringView("class", "- / -");
|
fClass = new BStringView("class", "- / -");
|
||||||
fClass->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fClass->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
||||||
|
|
||||||
fHCIVersionProperties = new BStringView("hci", "");
|
fHCIVersionProperties = new BStringView("hci", "");
|
||||||
fHCIVersionProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fHCIVersionProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
|
B_ALIGN_MIDDLE));
|
||||||
fLMPVersionProperties = new BStringView("lmp", "");
|
fLMPVersionProperties = new BStringView("lmp", "");
|
||||||
fLMPVersionProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fLMPVersionProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
|
B_ALIGN_MIDDLE));
|
||||||
fManufacturerProperties = new BStringView("manufacturer", "");
|
fManufacturerProperties = new BStringView("manufacturer", "");
|
||||||
fManufacturerProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fManufacturerProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
|
B_ALIGN_MIDDLE));
|
||||||
fACLBuffersProperties = new BStringView("buffers acl", "");
|
fACLBuffersProperties = new BStringView("buffers acl", "");
|
||||||
fACLBuffersProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fACLBuffersProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
|
B_ALIGN_MIDDLE));
|
||||||
fSCOBuffersProperties = new BStringView("buffers sco", "");
|
fSCOBuffersProperties = new BStringView("buffers sco", "");
|
||||||
fSCOBuffersProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));
|
fSCOBuffersProperties->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
|
||||||
|
B_ALIGN_MIDDLE));
|
||||||
|
|
||||||
|
|
||||||
fIcon = new BView(BRect(0, 0, 32 - 1, 32 - 1),"Icon", B_FOLLOW_ALL, B_WILL_DRAW);
|
fIcon = new BView(BRect(0, 0, 32 - 1, 32 - 1), "Icon", B_FOLLOW_ALL,
|
||||||
|
B_WILL_DRAW);
|
||||||
fIcon->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
fIcon->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
SetBluetoothDevice(bDevice);
|
SetBluetoothDevice(bDevice);
|
||||||
@@ -105,80 +115,78 @@ BluetoothDeviceView::SetBluetoothDevice(BluetoothDevice* bDevice)
|
|||||||
|
|
||||||
fName->SetText(bDevice->GetFriendlyName().String());
|
fName->SetText(bDevice->GetFriendlyName().String());
|
||||||
fBdaddr->SetText(bdaddrUtils::ToString(bDevice->GetBluetoothAddress()));
|
fBdaddr->SetText(bdaddrUtils::ToString(bDevice->GetBluetoothAddress()));
|
||||||
BString str(TR("Service classes: "));
|
|
||||||
bDevice->GetDeviceClass().GetServiceClass(str);
|
|
||||||
fClassService->SetText(str.String());
|
|
||||||
|
|
||||||
str = "";
|
BString string(TR("Service classes: "));
|
||||||
bDevice->GetDeviceClass().GetMajorDeviceClass(str);
|
bDevice->GetDeviceClass().GetServiceClass(string);
|
||||||
str << " / ";
|
fClassService->SetText(string.String());
|
||||||
bDevice->GetDeviceClass().GetMinorDeviceClass(str);
|
|
||||||
fClass->SetText(str.String());
|
string = "";
|
||||||
|
bDevice->GetDeviceClass().GetMajorDeviceClass(string);
|
||||||
|
string << " / ";
|
||||||
|
bDevice->GetDeviceClass().GetMinorDeviceClass(string);
|
||||||
|
fClass->SetText(string.String());
|
||||||
|
|
||||||
bDevice->GetDeviceClass().Draw(fIcon, BPoint(Bounds().left, Bounds().top));
|
bDevice->GetDeviceClass().Draw(fIcon, BPoint(Bounds().left, Bounds().top));
|
||||||
|
|
||||||
uint32 value;
|
uint32 value;
|
||||||
|
|
||||||
str = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("hci_version", &value) == B_OK)
|
if (bDevice->GetProperty("hci_version", &value) == B_OK)
|
||||||
str << "HCI ver: " << BluetoothHciVersion(value);
|
string << "HCI ver: " << BluetoothHciVersion(value);
|
||||||
if (bDevice->GetProperty("hci_revision", &value) == B_OK)
|
if (bDevice->GetProperty("hci_revision", &value) == B_OK)
|
||||||
str << " HCI rev: " << value ;
|
string << " HCI rev: " << value ;
|
||||||
|
|
||||||
fHCIVersionProperties->SetText(str.String());
|
fHCIVersionProperties->SetText(string.String());
|
||||||
|
|
||||||
str = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("lmp_version", &value) == B_OK)
|
if (bDevice->GetProperty("lmp_version", &value) == B_OK)
|
||||||
str << "LMP ver: " << BluetoothLmpVersion(value);
|
string << "LMP ver: " << BluetoothLmpVersion(value);
|
||||||
if (bDevice->GetProperty("lmp_subversion", &value) == B_OK)
|
if (bDevice->GetProperty("lmp_subversion", &value) == B_OK)
|
||||||
str << " LMP subver: " << value;
|
string << " LMP subver: " << value;
|
||||||
fLMPVersionProperties->SetText(str.String());
|
fLMPVersionProperties->SetText(string.String());
|
||||||
|
|
||||||
str = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("manufacturer", &value) == B_OK)
|
if (bDevice->GetProperty("manufacturer", &value) == B_OK)
|
||||||
str << "Manufacturer: " << BluetoothManufacturer(value);
|
string << "Manufacturer: " << BluetoothManufacturer(value);
|
||||||
fManufacturerProperties->SetText(str.String());
|
fManufacturerProperties->SetText(string.String());
|
||||||
|
|
||||||
str = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("acl_mtu", &value) == B_OK)
|
if (bDevice->GetProperty("acl_mtu", &value) == B_OK)
|
||||||
str << "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)
|
||||||
str << " packets: " << value;
|
string << " packets: " << value;
|
||||||
fACLBuffersProperties->SetText(str.String());
|
fACLBuffersProperties->SetText(string.String());
|
||||||
|
|
||||||
str = "";
|
string = "";
|
||||||
if (bDevice->GetProperty("sco_mtu", &value) == B_OK)
|
if (bDevice->GetProperty("sco_mtu", &value) == B_OK)
|
||||||
str << "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)
|
||||||
str << " packets: " << value;
|
string << " packets: " << value;
|
||||||
fSCOBuffersProperties->SetText(str.String());
|
fSCOBuffersProperties->SetText(string.String());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothDeviceView::SetTarget(BHandler *tgt)
|
BluetoothDeviceView::SetTarget(BHandler* target)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BluetoothDeviceView::MessageReceived(BMessage *msg)
|
BluetoothDeviceView::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
// If we received a dropped message, try to see if it has color data
|
// If we received a dropped message, try to see if it has color data
|
||||||
// in it
|
// in it
|
||||||
if(msg->WasDropped()) {
|
if (message->WasDropped()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The default
|
// The default
|
||||||
BView::MessageReceived(msg);
|
BView::MessageReceived(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user