diff options
| author | Matthew Petroff <matthew@mpetroff.net> | 2013-07-17 00:42:12 +0000 |
|---|---|---|
| committer | Matthew Petroff <matthew@mpetroff.net> | 2013-07-17 00:42:12 +0000 |
| commit | 64bc8cf145b55d33469ef1b84e18ca8df580eda8 (patch) | |
| tree | d6d0b74922631e991bccc052edeb7b42b908bbda /src/widgets/measure-toolbar.cpp | |
| parent | Added new UnitTracker class. (diff) | |
| download | inkscape-64bc8cf145b55d33469ef1b84e18ca8df580eda8.tar.gz inkscape-64bc8cf145b55d33469ef1b84e18ca8df580eda8.zip | |
Removed unused unit includes.
(bzr r12380.1.10)
Diffstat (limited to 'src/widgets/measure-toolbar.cpp')
| -rw-r--r-- | src/widgets/measure-toolbar.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/widgets/measure-toolbar.cpp b/src/widgets/measure-toolbar.cpp index 387dbbeae..c72cb8fa3 100644 --- a/src/widgets/measure-toolbar.cpp +++ b/src/widgets/measure-toolbar.cpp @@ -52,13 +52,12 @@ #include "../xml/repr.h" #include "ui/uxmanager.h" #include "../ui/icon-names.h" -#include "../helper/unit-menu.h" -#include "../helper/units.h" -#include "../helper/unit-tracker.h" #include "../pen-context.h" #include "../sp-namedview.h" +#include "ui/widget/unit-tracker.h" -using Inkscape::UnitTracker; +using Inkscape::UI::Widget::UnitTracker; +using Inkscape::Util::Unit; using Inkscape::UI::UXManager; using Inkscape::DocumentUndo; using Inkscape::UI::ToolboxFactory; @@ -83,15 +82,20 @@ sp_measure_fontsize_value_changed(GtkAdjustment *adj, GObject *tbl) static void measure_unit_changed(GtkAction* /*act*/, GObject* tbl) { UnitTracker* tracker = reinterpret_cast<UnitTracker*>(g_object_get_data(tbl, "tracker")); - SPUnit const *unit = tracker->getActiveUnit(); + Glib::ustring const unit = tracker->getActiveUnit().abbr; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - prefs->setInt("/tools/measure/unitid", unit->unit_id); + prefs->setString("/tools/measure/unit", unit); } void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, GObject* holder) { - UnitTracker* tracker = new UnitTracker( SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE ); - //tracker->setActiveUnit( sp_desktop_namedview(desktop)->doc_units ); + UnitTracker* tracker = new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + tracker->setActiveUnitByAbbr(prefs->getString("/tools/measure/unit").c_str()); + + //tracker->setUnitType(UNIT_TYPE_LINEAR); + //tracker->setUnit("px"); + g_object_set_data( holder, "tracker", tracker ); EgeAdjustmentAction *eact = 0; @@ -121,8 +125,10 @@ void sp_measure_toolbox_prep(SPDesktop * desktop, GtkActionGroup* mainActions, G // units menu { GtkAction* act = tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") ); + //EgeOutputAction* act = ege_output_action_new( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements"), 0 ); g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(measure_unit_changed), holder ); gtk_action_group_add_action( mainActions, act ); + //gtk_action_group_add_action( mainActions, GTK_ACTION( act ) ); } } // end of sp_measure_toolbox_prep() |
