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:
parent
5c87dff557
commit
eaa5d3bcea
@ -18,7 +18,7 @@
|
||||
|
||||
// This list comes from the pciid list, except for the last one
|
||||
const char* kCategoryString[] = {
|
||||
B_TRANSLATE("Unclassified device"), // 0x00
|
||||
B_TRANSLATE("Unclassified device"), // 0x00
|
||||
B_TRANSLATE("Mass storage controller"), // 0x01
|
||||
B_TRANSLATE("Network controller"), // 0x02
|
||||
B_TRANSLATE("Display controller"), // 0x03
|
||||
@ -32,12 +32,12 @@ const char* kCategoryString[] = {
|
||||
B_TRANSLATE("Processor"), // 0x0b
|
||||
B_TRANSLATE("Serial bus controller"), // 0x0c
|
||||
B_TRANSLATE("Wireless controller"), // 0x0d
|
||||
B_TRANSLATE("Intelligent controller"), // 0x0e
|
||||
B_TRANSLATE("Satellite communications controller"), // 0x0f
|
||||
B_TRANSLATE("Intelligent controller"), // 0x0e
|
||||
B_TRANSLATE("Satellite communications controller"), // 0x0f
|
||||
B_TRANSLATE("Encryption controller"), // 0x10
|
||||
B_TRANSLATE("Signal processing controller"), // 0x11
|
||||
B_TRANSLATE("Computer"), // 0x12 (added later)
|
||||
B_TRANSLATE("ACPI controller") // 0x13 (added later)
|
||||
B_TRANSLATE("Signal processing controller"), // 0x11
|
||||
B_TRANSLATE("Computer"), // 0x12 (added later)
|
||||
B_TRANSLATE("ACPI controller") // 0x13 (added later)
|
||||
};
|
||||
|
||||
|
||||
@ -77,7 +77,8 @@ Device::GetBasicAttributes()
|
||||
{
|
||||
Attributes attributes;
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -49,7 +49,8 @@ DeviceACPI::InitFromAttributes()
|
||||
outlineName = B_TRANSLATE("ACPI Thermal Zone");
|
||||
} else if (rootACPIPath == "\\_PR_.") {
|
||||
// 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_") {
|
||||
outlineName = B_TRANSLATE("ACPI System Indicator");
|
||||
} else {
|
||||
|
@ -67,7 +67,8 @@ DevicePCI::InitFromAttributes()
|
||||
|
||||
// Fetch ClassInfo
|
||||
char classInfo[64];
|
||||
get_class_info(fClassBaseId, fClassSubId, fClassApiId, classInfo, sizeof(classInfo));
|
||||
get_class_info(fClassBaseId, fClassSubId, fClassApiId, classInfo,
|
||||
sizeof(classInfo));
|
||||
|
||||
// Fetch ManufacturerName
|
||||
BString ManufacturerName;
|
||||
@ -86,7 +87,8 @@ DevicePCI::InitFromAttributes()
|
||||
BString DeviceName;
|
||||
const char *devShort;
|
||||
const char *devFull;
|
||||
get_device_info(fVendorId, fDeviceId, fSubsystemVendorId, fSubSystemId, &devShort, &devFull);
|
||||
get_device_info(fVendorId, fDeviceId, fSubsystemVendorId, fSubSystemId,
|
||||
&devShort, &devFull);
|
||||
if (!devShort && !devFull) {
|
||||
DeviceName << "Unknown";
|
||||
} else if (devShort && devFull) {
|
||||
|
@ -50,8 +50,8 @@ PropertyList::PropertyList(const char* name)
|
||||
AddColumn(nameColumn = new BStringColumn(B_TRANSLATE("Name"), 150, 50, 500,
|
||||
B_TRUNCATE_MIDDLE),
|
||||
kNameColumn);
|
||||
AddColumn(new BStringColumn(B_TRANSLATE("Value"), 150, 50, 500, B_TRUNCATE_END),
|
||||
kValueColumn);
|
||||
AddColumn(new BStringColumn(B_TRANSLATE("Value"), 150, 50, 500,
|
||||
B_TRUNCATE_END), kValueColumn);
|
||||
SetSortColumn(nameColumn, false, true);
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
|
||||
|
||||
// Includes ------------------------------------------------------------------------------------------ //
|
||||
// Includes ------------------------------------------------------------------
|
||||
#include <Box.h>
|
||||
#include <Catalog.h>
|
||||
#include <Screen.h>
|
||||
@ -184,18 +184,19 @@ RangeItem::Compare(const void *firstArg, const void *secondArg)
|
||||
}
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ResourceUsageWindow - Constructor
|
||||
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);
|
||||
CenterOnScreen();
|
||||
Show();
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ResourceUsageWindow - Destructor
|
||||
@ -203,7 +204,7 @@ ResourceUsageWindow::~ResourceUsageWindow()
|
||||
{
|
||||
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ResourceUsageWindow::InitWindow -- Initialization Commands here
|
||||
@ -225,23 +226,29 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
||||
rtab.InsetBy(5,5);
|
||||
|
||||
// Create the ListViews
|
||||
BListView *IRQListView = new BListView(rlist, "IRQListView", B_SINGLE_SELECTION_LIST,
|
||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
||||
BListView *DMAListView = new BListView(rlist, "DMAListView", B_SINGLE_SELECTION_LIST,
|
||||
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW | B_NAVIGABLE);
|
||||
BListView *IORangeListView = new BListView(rlist, "IORangeListView", 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);
|
||||
BListView *IRQListView = new BListView(rlist, "IRQListView",
|
||||
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||
B_WILL_DRAW | B_NAVIGABLE);
|
||||
BListView *DMAListView = new BListView(rlist, "DMAListView",
|
||||
B_SINGLE_SELECTION_LIST, B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||
B_WILL_DRAW | B_NAVIGABLE);
|
||||
BListView *IORangeListView = new BListView(rlist, "IORangeListView",
|
||||
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,
|
||||
0, false, true, B_FANCY_BORDER);
|
||||
BScrollView *DMAScrollView = new BScrollView("scroll_list2", DMAListView, 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,
|
||||
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);
|
||||
BScrollView *IRQScrollView = new BScrollView("scroll_list1", IRQListView,
|
||||
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, 0, false, true, B_FANCY_BORDER);
|
||||
BScrollView *IORangeScrollView = new BScrollView("scroll_list3",
|
||||
IORangeListView, B_FOLLOW_LEFT|B_FOLLOW_TOP, 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();
|
||||
tabView->AddTab(IRQScrollView, tab);
|
||||
@ -267,14 +274,16 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||
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++) {
|
||||
get_nth_resource_descriptor_of_type(current, k, B_IRQ_RESOURCE,
|
||||
&r, sizeof(resource_descriptor));
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -297,14 +306,16 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||
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++) {
|
||||
get_nth_resource_descriptor_of_type(current, k, B_DMA_RESOURCE,
|
||||
&r, sizeof(resource_descriptor));
|
||||
get_nth_resource_descriptor_of_type(current, k,
|
||||
B_DMA_RESOURCE, &r, sizeof(resource_descriptor));
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -322,11 +333,12 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
||||
struct device_configuration *current = deviceInfo->GetCurrent();
|
||||
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++) {
|
||||
get_nth_resource_descriptor_of_type(current, k, B_IO_PORT_RESOURCE,
|
||||
&r, sizeof(resource_descriptor));
|
||||
get_nth_resource_descriptor_of_type(current, k,
|
||||
B_IO_PORT_RESOURCE, &r, sizeof(resource_descriptor));
|
||||
|
||||
IORangeListView->AddItem(new RangeItem(r.d.r.minbase,
|
||||
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();
|
||||
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++) {
|
||||
get_nth_resource_descriptor_of_type(current, k, B_MEMORY_RESOURCE,
|
||||
@ -362,7 +375,7 @@ void ResourceUsageWindow::InitWindow(BList &list)
|
||||
AddChild(background);
|
||||
background->AddChild(tabView);
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
// ResourceUsageWindow::MessageReceived -- receives messages
|
||||
@ -376,4 +389,4 @@ ResourceUsageWindow::MessageReceived (BMessage *message)
|
||||
break;
|
||||
}
|
||||
}
|
||||
// -------------------------------------------------------------------------------------------------- //
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user