1) Devices application localization support reordered to let more translated
values be handled. Partialy fixes #7245; 2) Support for localization some still not handled parameters in ProcessController. Pointed out by Diver. Thanks. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40586 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -7,10 +7,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "DeviceACPI.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "DeviceACPI.h"
|
#include <Catalog.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "DeviceACPI"
|
||||||
|
|
||||||
|
|
||||||
DeviceACPI::DeviceACPI(Device* parent)
|
DeviceACPI::DeviceACPI(Device* parent)
|
||||||
@@ -84,8 +89,16 @@ DeviceACPI::GetBusAttributes()
|
|||||||
BString
|
BString
|
||||||
DeviceACPI::GetBusStrings()
|
DeviceACPI::GetBusStrings()
|
||||||
{
|
{
|
||||||
BString str("Class Info:\t\t\t\t: %classInfo%");
|
BString str(B_TRANSLATE("Class Info:\t\t\t\t: %classInfo%"));
|
||||||
str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]);
|
str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BString
|
||||||
|
DeviceACPI::GetBusTabName()
|
||||||
|
{
|
||||||
|
return B_TRANSLATE("ACPI Information");
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Device.h"
|
#include "Device.h"
|
||||||
#include <Catalog.h>
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
|
||||||
#define B_TRANSLATE_CONTEXT "DeviceACPI"
|
|
||||||
|
|
||||||
class DeviceACPI : public Device {
|
class DeviceACPI : public Device {
|
||||||
public:
|
public:
|
||||||
@@ -22,9 +19,8 @@ public:
|
|||||||
virtual Attributes GetBusAttributes();
|
virtual Attributes GetBusAttributes();
|
||||||
virtual BString GetBusStrings();
|
virtual BString GetBusStrings();
|
||||||
virtual void InitFromAttributes();
|
virtual void InitFromAttributes();
|
||||||
|
virtual BString GetBusTabName();
|
||||||
virtual BString GetBusTabName()
|
|
||||||
{ return B_TRANSLATE("ACPI Information"); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* DEVICEACPI_H */
|
#endif /* DEVICEACPI_H */
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,15 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "DevicePCI.h"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "DevicePCI.h"
|
#include <Catalog.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "DevicePCI"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "dm_wrapper.h"
|
#include "dm_wrapper.h"
|
||||||
@@ -128,3 +133,11 @@ DevicePCI::GetBusStrings()
|
|||||||
str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]);
|
str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BString
|
||||||
|
DevicePCI::GetBusTabName()
|
||||||
|
{
|
||||||
|
return B_TRANSLATE("PCI Information");
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,10 +10,6 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Device.h"
|
#include "Device.h"
|
||||||
#include <Catalog.h>
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
|
||||||
#define B_TRANSLATE_CONTEXT "DevicePCI"
|
|
||||||
|
|
||||||
class DevicePCI : public Device {
|
class DevicePCI : public Device {
|
||||||
public:
|
public:
|
||||||
@@ -22,9 +18,7 @@ public:
|
|||||||
virtual Attributes GetBusAttributes();
|
virtual Attributes GetBusAttributes();
|
||||||
virtual BString GetBusStrings();
|
virtual BString GetBusStrings();
|
||||||
virtual void InitFromAttributes();
|
virtual void InitFromAttributes();
|
||||||
|
virtual BString GetBusTabName();
|
||||||
virtual BString GetBusTabName()
|
|
||||||
{ return B_TRANSLATE("PCI Information"); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
uint16 fClassBaseId;
|
uint16 fClassBaseId;
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ DevicesApplication::AboutRequested()
|
|||||||
void
|
void
|
||||||
DevicesApplication::ShowAbout()
|
DevicesApplication::ShowAbout()
|
||||||
{
|
{
|
||||||
BAlert* alert = new BAlert("about", B_TRANSLATE("Devices\n"
|
BAlert* alert = new BAlert(B_TRANSLATE("About"), B_TRANSLATE("Devices\n"
|
||||||
"\twritten by Pieter Panman\n"
|
"\twritten by Pieter Panman\n"
|
||||||
"\n"
|
"\n"
|
||||||
"\tBased on listdev by Jérôme Duval\n"
|
"\tBased on listdev by Jérôme Duval\n"
|
||||||
|
|||||||
@@ -84,19 +84,11 @@ DoCatalogs Devices :
|
|||||||
DevicePCI.cpp
|
DevicePCI.cpp
|
||||||
PropertyList.cpp
|
PropertyList.cpp
|
||||||
PropertyListPlain.cpp
|
PropertyListPlain.cpp
|
||||||
|
DeviceACPI.cpp
|
||||||
|
Device.cpp
|
||||||
;
|
;
|
||||||
|
|
||||||
Includes [ FGristFiles DevicesInfo.cpp ] : [ FGristFiles isapnpids.h usbdevs.h
|
Includes [ FGristFiles DevicesInfo.cpp ] : [ FGristFiles isapnpids.h usbdevs.h
|
||||||
usbdevs_data.h ] ;
|
usbdevs_data.h ] ;
|
||||||
Includes [ FGristFiles ConfigurationWindow.cpp ] : [ FGristFiles pcihdr.h ] ;
|
Includes [ FGristFiles ConfigurationWindow.cpp ] : [ FGristFiles pcihdr.h ] ;
|
||||||
|
|
||||||
DoCatalogs Devices :
|
|
||||||
x-vnd.Haiku-Devices
|
|
||||||
:
|
|
||||||
DevicesApplication.cpp
|
|
||||||
DevicesView.cpp
|
|
||||||
DevicePCI.h
|
|
||||||
DeviceACPI.h
|
|
||||||
Device.cpp
|
|
||||||
PropertyList.h
|
|
||||||
;
|
|
||||||
|
|||||||
@@ -8,8 +8,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "PropertyList.h"
|
#include "PropertyList.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <ColumnTypes.h>
|
#include <ColumnTypes.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "PropertyList"
|
||||||
|
|
||||||
//#include <stdio.h>
|
//#include <stdio.h>
|
||||||
|
|
||||||
PropertyRow::PropertyRow(const char* name, const char* value)
|
PropertyRow::PropertyRow(const char* name, const char* value)
|
||||||
|
|||||||
@@ -13,10 +13,6 @@
|
|||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
#include "Device.h"
|
#include "Device.h"
|
||||||
#include <Catalog.h>
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
|
||||||
#define B_TRANSLATE_CONTEXT "PropertyList"
|
|
||||||
|
|
||||||
struct Attribute;
|
struct Attribute;
|
||||||
|
|
||||||
@@ -43,7 +39,7 @@ private:
|
|||||||
|
|
||||||
class PropertyList : public BColumnListView {
|
class PropertyList : public BColumnListView {
|
||||||
public:
|
public:
|
||||||
PropertyList(const char* name = B_TRANSLATE("Properties"));
|
PropertyList(const char* name);
|
||||||
virtual ~PropertyList();
|
virtual ~PropertyList();
|
||||||
void RemoveAll();
|
void RemoveAll();
|
||||||
void AddAttributes(const Attributes& attributes);
|
void AddAttributes(const Attributes& attributes);
|
||||||
@@ -52,3 +48,4 @@ protected:
|
|||||||
};
|
};
|
||||||
|
|
||||||
#endif /* PROPERTYLIST_H*/
|
#endif /* PROPERTYLIST_H*/
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "ProcessController"
|
||||||
|
|
||||||
|
|
||||||
KernelMemoryBarMenuItem::KernelMemoryBarMenuItem(system_info& systemInfo)
|
KernelMemoryBarMenuItem::KernelMemoryBarMenuItem(system_info& systemInfo)
|
||||||
: BMenuItem("System resources & caches" B_UTF8_ELLIPSIS, NULL)
|
: BMenuItem("System resources & caches" B_UTF8_ELLIPSIS, NULL)
|
||||||
@@ -81,8 +86,10 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
|
|||||||
cadre.InsetBy(1, 1);
|
cadre.InsetBy(1, 1);
|
||||||
BRect r = cadre;
|
BRect r = cadre;
|
||||||
|
|
||||||
float grenze1 = cadre.left + (cadre.right - cadre.left) * fCachedMemory / fPhysicalMemory;
|
float grenze1 = cadre.left + (cadre.right - cadre.left)
|
||||||
float grenze2 = cadre.left + (cadre.right - cadre.left) * fCommittedMemory / fPhysicalMemory;
|
* fCachedMemory / fPhysicalMemory;
|
||||||
|
float grenze2 = cadre.left + (cadre.right - cadre.left)
|
||||||
|
* fCommittedMemory / fPhysicalMemory;
|
||||||
if (grenze1 > cadre.right)
|
if (grenze1 > cadre.right)
|
||||||
grenze1 = cadre.right;
|
grenze1 = cadre.right;
|
||||||
if (grenze2 > cadre.right)
|
if (grenze2 > cadre.right)
|
||||||
@@ -145,11 +152,11 @@ KernelMemoryBarMenuItem::DrawBar(bool force)
|
|||||||
menu->SetHighColor(kBlack);
|
menu->SetHighColor(kBlack);
|
||||||
|
|
||||||
char infos[128];
|
char infos[128];
|
||||||
sprintf(infos, "%.1f MB", fCachedMemory / 1024.f);
|
sprintf(infos, B_TRANSLATE("%.1f MB"), fCachedMemory / 1024.f);
|
||||||
BPoint loc(cadre.left - kMargin - gMemoryTextWidth / 2 - menu->StringWidth(infos),
|
BPoint loc(cadre.left, cadre.bottom + 1);
|
||||||
cadre.bottom + 1);
|
loc.x -= kMargin + gMemoryTextWidth / 2 + menu->StringWidth(infos);
|
||||||
menu->DrawString(infos, loc);
|
menu->DrawString(infos, loc);
|
||||||
sprintf(infos, "%.1f MB", fCommittedMemory / 1024.f);
|
sprintf(infos, B_TRANSLATE("%.1f MB"), fCommittedMemory / 1024.f);
|
||||||
loc.x = cadre.left - kMargin - menu->StringWidth(infos);
|
loc.x = cadre.left - kMargin - menu->StringWidth(infos);
|
||||||
menu->DrawString(infos, loc);
|
menu->DrawString(infos, loc);
|
||||||
fLastSum = sum;
|
fLastSum = sum;
|
||||||
@@ -166,3 +173,4 @@ KernelMemoryBarMenuItem::GetContentSize(float* _width, float* _height)
|
|||||||
|
|
||||||
*_width += 20 + kBarWidth + kMargin + gMemoryTextWidth;
|
*_width += 20 + kBarWidth + kMargin + gMemoryTextWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user