From d622704efbe803d7e271bc41655dc4432a1d556e Mon Sep 17 00:00:00 2001 From: Nicolas Dufour Date: Thu, 22 Mar 2012 20:19:09 +0100 Subject: UI. Patch for Bug #666370 (Not all units in the Object Transform dialog are translatable) by Fernando Lucchesi. Fixed bugs: - https://launchpad.net/bugs/666370 (bzr r11116) --- share/ui/units.txt | 2 +- share/ui/units.xml | 2 +- src/ui/dialog/guides.cpp | 6 +++--- src/ui/dialog/transformation.cpp | 2 +- src/util/units.h | 2 ++ 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/share/ui/units.txt b/share/ui/units.txt index a82cec529..55fd68577 100644 --- a/share/ui/units.txt +++ b/share/ui/units.txt @@ -13,7 +13,7 @@ centimeter centimeters cm LINEAR 35.43307 N Centimeters (10 mm/cm) meter meters m LINEAR 3543.307 N Meters (100 cm/m) foot feet ft LINEAR 1080 N Feet (12 in/ft) - degree degrees deg RADIAL 1.00 Y Degrees + degree degrees ° RADIAL 1.00 Y Degrees radian radians rad RADIAL 57.296 N Radians (57.296 deg/rad) font-height font-heights em FONT_HEIGHT 1.00 Y Font height x-height x-heights ex FONT_HEIGHT 0.50 N Height of letter 'x' diff --git a/share/ui/units.xml b/share/ui/units.xml index e4a07fe06..69d78565d 100644 --- a/share/ui/units.xml +++ b/share/ui/units.xml @@ -66,7 +66,7 @@ degree degrees - deg + ° 1.00 Degrees diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 61b4fe389..088290b6f 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -54,7 +54,7 @@ GuidelinePropertiesDialog::GuidelinePropertiesDialog(SPGuide *guide, SPDesktop * } bool GuidelinePropertiesDialog::_relative_toggle_status = false; // initialize relative checkbox status for when this dialog is opened for first time -Glib::ustring GuidelinePropertiesDialog::_angle_unit_status = "deg"; // initialize angle unit status +Glib::ustring GuidelinePropertiesDialog::_angle_unit_status = DEG; // initialize angle unit status GuidelinePropertiesDialog::~GuidelinePropertiesDialog() { // save current status @@ -87,7 +87,7 @@ void GuidelinePropertiesDialog::_modeChanged() _spin_button_x.setValue(0); } else { // absolute - _spin_angle.setValueKeepUnit(_oldangle, "deg"); + _spin_angle.setValueKeepUnit(_oldangle, DEG); _spin_button_x.setValueKeepUnit(_oldpos[Geom::X], "px"); _spin_button_y.setValueKeepUnit(_oldpos[Geom::Y], "px"); @@ -96,7 +96,7 @@ void GuidelinePropertiesDialog::_modeChanged() void GuidelinePropertiesDialog::_onApply() { - double deg_angle = _spin_angle.getValue("deg"); + double deg_angle = _spin_angle.getValue(DEG); if (!_mode) deg_angle += _oldangle; Geom::Point normal; diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 9b65c1f68..1951dc92a 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -724,7 +724,7 @@ void Transformation::applyPageScale(Inkscape::Selection *selection) void Transformation::applyPageRotate(Inkscape::Selection *selection) { - double angle = _scalar_rotate.getValue("deg"); + double angle = _scalar_rotate.getValue(DEG); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); if (prefs->getBool("/dialogs/transformation/applyseparately")) { diff --git a/src/util/units.h b/src/util/units.h index d45109a8f..b22bdb1f2 100644 --- a/src/util/units.h +++ b/src/util/units.h @@ -32,6 +32,8 @@ enum UnitType { UNIT_TYPE_NONE = -1 }; +const char DEG[] = "°"; + class Unit { public: Glib::ustring name; -- cgit v1.2.3