Author: siarzhuk Date: 2011-02-20 19:45:23 +0100 (Sun, 20 Feb 2011) New Revision: 40586 Changeset: http://dev.haiku-os.org/changeset/40586 Ticket: http://dev.haiku-os.org/ticket/7245 Modified: haiku/trunk/src/apps/devices/DeviceACPI.cpp haiku/trunk/src/apps/devices/DeviceACPI.h haiku/trunk/src/apps/devices/DevicePCI.cpp haiku/trunk/src/apps/devices/DevicePCI.h haiku/trunk/src/apps/devices/DevicesApplication.cpp haiku/trunk/src/apps/devices/Jamfile haiku/trunk/src/apps/devices/PropertyList.cpp haiku/trunk/src/apps/devices/PropertyList.h haiku/trunk/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp Log: 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. Modified: haiku/trunk/src/apps/devices/DeviceACPI.cpp =================================================================== --- haiku/trunk/src/apps/devices/DeviceACPI.cpp 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/DeviceACPI.cpp 2011-02-20 18:45:23 UTC (rev 40586) @@ -7,12 +7,17 @@ */ +#include "DeviceACPI.h" + #include <sstream> #include <stdlib.h> -#include "DeviceACPI.h" +#include <Catalog.h> +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "DeviceACPI" + DeviceACPI::DeviceACPI(Device* parent) : Device(parent) @@ -84,8 +89,16 @@ BString 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"]); return str; } + + +BString +DeviceACPI::GetBusTabName() +{ + return B_TRANSLATE("ACPI Information"); +} + Modified: haiku/trunk/src/apps/devices/DeviceACPI.h =================================================================== --- haiku/trunk/src/apps/devices/DeviceACPI.h 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/DeviceACPI.h 2011-02-20 18:45:23 UTC (rev 40586) @@ -10,10 +10,7 @@ #include "Device.h" -#include <Catalog.h> -#undef B_TRANSLATE_CONTEXT -#define B_TRANSLATE_CONTEXT "DeviceACPI" class DeviceACPI : public Device { public: @@ -22,9 +19,8 @@ virtual Attributes GetBusAttributes(); virtual BString GetBusStrings(); virtual void InitFromAttributes(); - - virtual BString GetBusTabName() - { return B_TRANSLATE("ACPI Information"); } + virtual BString GetBusTabName(); }; #endif /* DEVICEACPI_H */ + Modified: haiku/trunk/src/apps/devices/DevicePCI.cpp =================================================================== --- haiku/trunk/src/apps/devices/DevicePCI.cpp 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/DevicePCI.cpp 2011-02-20 18:45:23 UTC (rev 40586) @@ -7,11 +7,16 @@ */ +#include "DevicePCI.h" + #include <sstream> #include <stdlib.h> -#include "DevicePCI.h" +#include <Catalog.h> +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "DevicePCI" + extern "C" { #include "dm_wrapper.h" #include "pcihdr.h" @@ -128,3 +133,11 @@ str.ReplaceFirst("%classInfo%", fAttributeMap["Class Info"]); return str; } + + +BString +DevicePCI::GetBusTabName() +{ + return B_TRANSLATE("PCI Information"); +} + Modified: haiku/trunk/src/apps/devices/DevicePCI.h =================================================================== --- haiku/trunk/src/apps/devices/DevicePCI.h 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/DevicePCI.h 2011-02-20 18:45:23 UTC (rev 40586) @@ -10,11 +10,7 @@ #include "Device.h" -#include <Catalog.h> -#undef B_TRANSLATE_CONTEXT -#define B_TRANSLATE_CONTEXT "DevicePCI" - class DevicePCI : public Device { public: DevicePCI(Device* parent); @@ -22,9 +18,7 @@ virtual Attributes GetBusAttributes(); virtual BString GetBusStrings(); virtual void InitFromAttributes(); - - virtual BString GetBusTabName() - { return B_TRANSLATE("PCI Information"); } + virtual BString GetBusTabName(); private: uint16 fClassBaseId; Modified: haiku/trunk/src/apps/devices/DevicesApplication.cpp =================================================================== --- haiku/trunk/src/apps/devices/DevicesApplication.cpp 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/DevicesApplication.cpp 2011-02-20 18:45:23 UTC (rev 40586) @@ -53,7 +53,7 @@ void 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" "\n" "\tBased on listdev by Jérôme Duval\n" Modified: haiku/trunk/src/apps/devices/Jamfile =================================================================== --- haiku/trunk/src/apps/devices/Jamfile 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/Jamfile 2011-02-20 18:45:23 UTC (rev 40586) @@ -84,19 +84,11 @@ DevicePCI.cpp PropertyList.cpp PropertyListPlain.cpp + DeviceACPI.cpp + Device.cpp ; Includes [ FGristFiles DevicesInfo.cpp ] : [ FGristFiles isapnpids.h usbdevs.h usbdevs_data.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 -; Modified: haiku/trunk/src/apps/devices/PropertyList.cpp =================================================================== --- haiku/trunk/src/apps/devices/PropertyList.cpp 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/PropertyList.cpp 2011-02-20 18:45:23 UTC (rev 40586) @@ -8,8 +8,13 @@ #include "PropertyList.h" + +#include <Catalog.h> #include <ColumnTypes.h> +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "PropertyList" + //#include <stdio.h> PropertyRow::PropertyRow(const char* name, const char* value) Modified: haiku/trunk/src/apps/devices/PropertyList.h =================================================================== --- haiku/trunk/src/apps/devices/PropertyList.h 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/devices/PropertyList.h 2011-02-20 18:45:23 UTC (rev 40586) @@ -13,11 +13,7 @@ #include <String.h> #include "Device.h" -#include <Catalog.h> -#undef B_TRANSLATE_CONTEXT -#define B_TRANSLATE_CONTEXT "PropertyList" - struct Attribute; enum { @@ -43,7 +39,7 @@ class PropertyList : public BColumnListView { public: - PropertyList(const char* name = B_TRANSLATE("Properties")); + PropertyList(const char* name); virtual ~PropertyList(); void RemoveAll(); void AddAttributes(const Attributes& attributes); @@ -52,3 +48,4 @@ }; #endif /* PROPERTYLIST_H*/ + Modified: haiku/trunk/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp =================================================================== --- haiku/trunk/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp 2011-02-20 17:25:43 UTC (rev 40585) +++ haiku/trunk/src/apps/processcontroller/KernelMemoryBarMenuItem.cpp 2011-02-20 18:45:23 UTC (rev 40586) @@ -26,7 +26,12 @@ #include <stdio.h> +#include <Catalog.h> +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "ProcessController" + + KernelMemoryBarMenuItem::KernelMemoryBarMenuItem(system_info& systemInfo) : BMenuItem("System resources & caches" B_UTF8_ELLIPSIS, NULL) { @@ -81,8 +86,10 @@ cadre.InsetBy(1, 1); BRect r = cadre; - float grenze1 = cadre.left + (cadre.right - cadre.left) * fCachedMemory / fPhysicalMemory; - float grenze2 = cadre.left + (cadre.right - cadre.left) * fCommittedMemory / fPhysicalMemory; + float grenze1 = cadre.left + (cadre.right - cadre.left) + * fCachedMemory / fPhysicalMemory; + float grenze2 = cadre.left + (cadre.right - cadre.left) + * fCommittedMemory / fPhysicalMemory; if (grenze1 > cadre.right) grenze1 = cadre.right; if (grenze2 > cadre.right) @@ -145,11 +152,11 @@ menu->SetHighColor(kBlack); char infos[128]; - sprintf(infos, "%.1f MB", fCachedMemory / 1024.f); - BPoint loc(cadre.left - kMargin - gMemoryTextWidth / 2 - menu->StringWidth(infos), - cadre.bottom + 1); + sprintf(infos, B_TRANSLATE("%.1f MB"), fCachedMemory / 1024.f); + BPoint loc(cadre.left, cadre.bottom + 1); + loc.x -= kMargin + gMemoryTextWidth / 2 + menu->StringWidth(infos); 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); menu->DrawString(infos, loc); fLastSum = sum; @@ -166,3 +173,4 @@ *_width += 20 + kBarWidth + kMargin + gMemoryTextWidth; } +