80 column fix for devices
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39839 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
// This list comes from the pciid list, except for the last one
|
// This list comes from the pciid list, except for the last one
|
||||||
const char* kCategoryString[] = {
|
const char* kCategoryString[] = {
|
||||||
B_TRANSLATE("Unclassified device"), // 0x00
|
B_TRANSLATE("Unclassified device"), // 0x00
|
||||||
B_TRANSLATE("Mass storage controller"), // 0x01
|
B_TRANSLATE("Mass storage controller"), // 0x01
|
||||||
B_TRANSLATE("Network controller"), // 0x02
|
B_TRANSLATE("Network controller"), // 0x02
|
||||||
B_TRANSLATE("Display controller"), // 0x03
|
B_TRANSLATE("Display controller"), // 0x03
|
||||||
@@ -32,12 +32,12 @@ const char* kCategoryString[] = {
|
|||||||
B_TRANSLATE("Processor"), // 0x0b
|
B_TRANSLATE("Processor"), // 0x0b
|
||||||
B_TRANSLATE("Serial bus controller"), // 0x0c
|
B_TRANSLATE("Serial bus controller"), // 0x0c
|
||||||
B_TRANSLATE("Wireless controller"), // 0x0d
|
B_TRANSLATE("Wireless controller"), // 0x0d
|
||||||
B_TRANSLATE("Intelligent controller"), // 0x0e
|
B_TRANSLATE("Intelligent controller"), // 0x0e
|
||||||
B_TRANSLATE("Satellite communications controller"), // 0x0f
|
B_TRANSLATE("Satellite communications controller"), // 0x0f
|
||||||
B_TRANSLATE("Encryption controller"), // 0x10
|
B_TRANSLATE("Encryption controller"), // 0x10
|
||||||
B_TRANSLATE("Signal processing controller"), // 0x11
|
B_TRANSLATE("Signal processing controller"), // 0x11
|
||||||
B_TRANSLATE("Computer"), // 0x12 (added later)
|
B_TRANSLATE("Computer"), // 0x12 (added later)
|
||||||
B_TRANSLATE("ACPI controller") // 0x13 (added later)
|
B_TRANSLATE("ACPI controller") // 0x13 (added later)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -77,7 +77,8 @@ Device::GetBasicAttributes()
|
|||||||
{
|
{
|
||||||
Attributes attributes;
|
Attributes attributes;
|
||||||
attributes.push_back(Attribute(B_TRANSLATE("Device name:"), GetName()));
|
attributes.push_back(Attribute(B_TRANSLATE("Device name:"), GetName()));
|
||||||
attributes.push_back(Attribute(B_TRANSLATE("Manufacturer:"), GetManufacturer()));
|
attributes.push_back(Attribute(B_TRANSLATE("Manufacturer:"),
|
||||||
|
GetManufacturer()));
|
||||||
return attributes;
|
return attributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ DeviceACPI::InitFromAttributes()
|
|||||||
outlineName = B_TRANSLATE("ACPI Thermal Zone");
|
outlineName = B_TRANSLATE("ACPI Thermal Zone");
|
||||||
} else if (rootACPIPath == "\\_PR_.") {
|
} else if (rootACPIPath == "\\_PR_.") {
|
||||||
// each CPU node is considered a root node
|
// each CPU node is considered a root node
|
||||||
outlineName << B_TRANSLATE("ACPI Processor Namespace '") << nodeACPIPath << "'";
|
outlineName << B_TRANSLATE("ACPI Processor Namespace '")
|
||||||
|
<< nodeACPIPath << "'";
|
||||||
} else if (rootACPIPath == "\\_SI_") {
|
} else if (rootACPIPath == "\\_SI_") {
|
||||||
outlineName = B_TRANSLATE("ACPI System Indicator");
|
outlineName = B_TRANSLATE("ACPI System Indicator");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ DevicePCI::InitFromAttributes()
|
|||||||
|
|
||||||
// Fetch ClassInfo
|
// Fetch ClassInfo
|
||||||
char classInfo[64];
|
char classInfo[64];
|
||||||
get_class_info(fClassBaseId, fClassSubId, fClassApiId, classInfo, sizeof(classInfo));
|
get_class_info(fClassBaseId, fClassSubId, fClassApiId, classInfo,
|
||||||
|
sizeof(classInfo));
|
||||||
|
|
||||||
// Fetch ManufacturerName
|
// Fetch ManufacturerName
|
||||||
BString ManufacturerName;
|
BString ManufacturerName;
|
||||||
@@ -86,7 +87,8 @@ DevicePCI::InitFromAttributes()
|
|||||||
BString DeviceName;
|
BString DeviceName;
|
||||||
const char *devShort;
|
const char *devShort;
|
||||||
const char *devFull;
|
const char *devFull;
|
||||||
get_device_info(fVendorId, fDeviceId, fSubsystemVendorId, fSubSystemId, &devShort, &devFull);
|
get_device_info(fVendorId, fDeviceId, fSubsystemVendorId, fSubSystemId,
|
||||||
|
&devShort, &devFull);
|
||||||
if (!devShort && !devFull) {
|
if (!devShort && !devFull) {
|
||||||
DeviceName << "Unknown";
|
DeviceName << "Unknown";
|
||||||
} else if (devShort && devFull) {
|
} else if (devShort && devFull) {
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ PropertyList::PropertyList(const char* name)
|
|||||||
AddColumn(nameColumn = new BStringColumn(B_TRANSLATE("Name"), 150, 50, 500,
|
AddColumn(nameColumn = new BStringColumn(B_TRANSLATE("Name"), 150, 50, 500,
|
||||||
B_TRUNCATE_MIDDLE),
|
B_TRUNCATE_MIDDLE),
|
||||||
kNameColumn);
|
kNameColumn);
|
||||||
AddColumn(new BStringColumn(B_TRANSLATE("Value"), 150, 50, 500, B_TRUNCATE_END),
|
AddColumn(new BStringColumn(B_TRANSLATE("Value"), 150, 50, 500,
|
||||||
kValueColumn);
|
B_TRUNCATE_END), kValueColumn);
|
||||||
SetSortColumn(nameColumn, false, true);
|
SetSortColumn(nameColumn, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||||
|
|
||||||
|
|
||||||
// Includes ------------------------------------------------------------------------------------------ //
|
// Includes ------------------------------------------------------------------
|
||||||
#include <Box.h>
|
#include <Box.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <Screen.h>
|
#include <Screen.h>
|
||||||
@@ -184,18 +184,19 @@ RangeItem::Compare(const void *firstArg, const void *secondArg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// ResourceUsageWindow - Constructor
|
// ResourceUsageWindow - Constructor
|
||||||
ResourceUsageWindow::ResourceUsageWindow(BRect frame, BList &list)
|
ResourceUsageWindow::ResourceUsageWindow(BRect frame, BList &list)
|
||||||
: BWindow (frame, "Resource Usage", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL , B_NOT_ZOOMABLE|B_NOT_RESIZABLE)
|
: BWindow (frame, "Resource Usage", B_TITLED_WINDOW_LOOK,
|
||||||
|
B_NORMAL_WINDOW_FEEL , B_NOT_ZOOMABLE|B_NOT_RESIZABLE)
|
||||||
{
|
{
|
||||||
InitWindow(list);
|
InitWindow(list);
|
||||||
CenterOnScreen();
|
CenterOnScreen();
|
||||||
Show();
|
Show();
|
||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// ResourceUsageWindow - Destructor
|
// ResourceUsageWindow - Destructor
|
||||||
@@ -203,7 +204,7 @@ ResourceUsageWindow::~ResourceUsageWindow()
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// ResourceUsageWindow::InitWindow -- Initialization Commands here
|
// ResourceUsageWindow::InitWindow -- Initialization Commands here
|
||||||
@@ -225,23 +226,29 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
rtab.InsetBy(5,5);
|
rtab.InsetBy(5,5);
|
||||||
|
|
||||||
// Create the ListViews
|
// Create the ListViews
|
||||||
BListView *IRQListView = new BListView(rlist, "IRQListView", B_SINGLE_SELECTION_LIST,
|
BListView *IRQListView = new BListView(rlist, "IRQListView",
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
BListView *DMAListView = new BListView(rlist, "DMAListView", B_SINGLE_SELECTION_LIST,
|
B_WILL_DRAW | B_NAVIGABLE);
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
BListView *DMAListView = new BListView(rlist, "DMAListView",
|
||||||
BListView *IORangeListView = new BListView(rlist, "IORangeListView", B_SINGLE_SELECTION_LIST,
|
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
B_WILL_DRAW | B_NAVIGABLE);
|
||||||
BListView *memoryListView = new BListView(rlist, "memoryListView", B_SINGLE_SELECTION_LIST,
|
BListView *IORangeListView = new BListView(rlist, "IORangeListView",
|
||||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
|
B_WILL_DRAW | B_NAVIGABLE);
|
||||||
|
BListView *memoryListView = new BListView(rlist, "memoryListView",
|
||||||
|
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
|
B_WILL_DRAW | B_NAVIGABLE);
|
||||||
|
|
||||||
BScrollView *IRQScrollView = new BScrollView("scroll_list1", IRQListView, B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
BScrollView *IRQScrollView = new BScrollView("scroll_list1", IRQListView,
|
||||||
0, false, true, B_FANCY_BORDER);
|
B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true, B_FANCY_BORDER);
|
||||||
BScrollView *DMAScrollView = new BScrollView("scroll_list2", DMAListView, B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
BScrollView *DMAScrollView = new BScrollView("scroll_list2", DMAListView,
|
||||||
0, false, true, B_FANCY_BORDER);
|
B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true, B_FANCY_BORDER);
|
||||||
BScrollView *IORangeScrollView = new BScrollView("scroll_list3", IORangeListView, B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
BScrollView *IORangeScrollView = new BScrollView("scroll_list3",
|
||||||
0, false, true, B_FANCY_BORDER);
|
IORangeListView, B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true,
|
||||||
BScrollView *memoryScrollView = new BScrollView("scroll_list4", memoryListView, B_FOLLOW_LEFT|B_FOLLOW_TOP,
|
B_FANCY_BORDER);
|
||||||
0, false, true, B_FANCY_BORDER);
|
BScrollView *memoryScrollView = new BScrollView("scroll_list4",
|
||||||
|
memoryListView, B_FOLLOW_LEFT|B_FOLLOW_TOP, 0, false, true,
|
||||||
|
B_FANCY_BORDER);
|
||||||
|
|
||||||
BTab *tab = new BTab();
|
BTab *tab = new BTab();
|
||||||
tabView->AddTab(IRQScrollView, tab);
|
tabView->AddTab(IRQScrollView, tab);
|
||||||
@@ -267,14 +274,16 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||||
resource_descriptor r;
|
resource_descriptor r;
|
||||||
|
|
||||||
int32 num = count_resource_descriptors_of_type(current, B_IRQ_RESOURCE);
|
int32 num = count_resource_descriptors_of_type(current,
|
||||||
|
B_IRQ_RESOURCE);
|
||||||
|
|
||||||
for (int32 k=0;k<num;k++) {
|
for (int32 k=0;k<num;k++) {
|
||||||
get_nth_resource_descriptor_of_type(current, k, B_IRQ_RESOURCE,
|
get_nth_resource_descriptor_of_type(current, k, B_IRQ_RESOURCE,
|
||||||
&r, sizeof(resource_descriptor));
|
&r, sizeof(resource_descriptor));
|
||||||
|
|
||||||
if (mask & r.d.m.mask) {
|
if (mask & r.d.m.mask) {
|
||||||
IRQListView->AddItem(new IRQDMAItem(first ? i : -1, deviceInfo->GetCardName()));
|
IRQListView->AddItem(new IRQDMAItem(first ? i : -1,
|
||||||
|
deviceInfo->GetCardName()));
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,14 +306,16 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||||
resource_descriptor r;
|
resource_descriptor r;
|
||||||
|
|
||||||
int32 num = count_resource_descriptors_of_type(current, B_DMA_RESOURCE);
|
int32 num = count_resource_descriptors_of_type(current,
|
||||||
|
B_DMA_RESOURCE);
|
||||||
|
|
||||||
for (int32 k=0;k<num;k++) {
|
for (int32 k=0;k<num;k++) {
|
||||||
get_nth_resource_descriptor_of_type(current, k, B_DMA_RESOURCE,
|
get_nth_resource_descriptor_of_type(current, k,
|
||||||
&r, sizeof(resource_descriptor));
|
B_DMA_RESOURCE, &r, sizeof(resource_descriptor));
|
||||||
|
|
||||||
if (mask & r.d.m.mask) {
|
if (mask & r.d.m.mask) {
|
||||||
DMAListView->AddItem(new IRQDMAItem(first ? i : -1, deviceInfo->GetCardName()));
|
DMAListView->AddItem(new IRQDMAItem(first ? i : -1,
|
||||||
|
deviceInfo->GetCardName()));
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -322,11 +333,12 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||||
resource_descriptor r;
|
resource_descriptor r;
|
||||||
|
|
||||||
int32 num = count_resource_descriptors_of_type(current, B_IO_PORT_RESOURCE);
|
int32 num = count_resource_descriptors_of_type(current,
|
||||||
|
B_IO_PORT_RESOURCE);
|
||||||
|
|
||||||
for (int32 k=0;k<num;k++) {
|
for (int32 k=0;k<num;k++) {
|
||||||
get_nth_resource_descriptor_of_type(current, k, B_IO_PORT_RESOURCE,
|
get_nth_resource_descriptor_of_type(current, k,
|
||||||
&r, sizeof(resource_descriptor));
|
B_IO_PORT_RESOURCE, &r, sizeof(resource_descriptor));
|
||||||
|
|
||||||
IORangeListView->AddItem(new RangeItem(r.d.r.minbase,
|
IORangeListView->AddItem(new RangeItem(r.d.r.minbase,
|
||||||
r.d.r.minbase + r.d.r.len - 1, deviceInfo->GetCardName()));
|
r.d.r.minbase + r.d.r.len - 1, deviceInfo->GetCardName()));
|
||||||
@@ -342,7 +354,8 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||||
resource_descriptor r;
|
resource_descriptor r;
|
||||||
|
|
||||||
int32 num = count_resource_descriptors_of_type(current, B_MEMORY_RESOURCE);
|
int32 num = count_resource_descriptors_of_type(current,
|
||||||
|
B_MEMORY_RESOURCE);
|
||||||
|
|
||||||
for (int32 k=0;k<num;k++) {
|
for (int32 k=0;k<num;k++) {
|
||||||
get_nth_resource_descriptor_of_type(current, k, B_MEMORY_RESOURCE,
|
get_nth_resource_descriptor_of_type(current, k, B_MEMORY_RESOURCE,
|
||||||
@@ -362,7 +375,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
|||||||
AddChild(background);
|
AddChild(background);
|
||||||
background->AddChild(tabView);
|
background->AddChild(tabView);
|
||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
// ResourceUsageWindow::MessageReceived -- receives messages
|
// ResourceUsageWindow::MessageReceived -- receives messages
|
||||||
@@ -376,4 +389,4 @@ ResourceUsageWindow::MessageReceived (BMessage *message)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// -------------------------------------------------------------------------------------------------- //
|
// ----------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user