summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthew Petroff <matthew@mpetroff.net>2013-07-17 00:42:12 +0000
committerMatthew Petroff <matthew@mpetroff.net>2013-07-17 00:42:12 +0000
commit64bc8cf145b55d33469ef1b84e18ca8df580eda8 (patch)
treed6d0b74922631e991bccc052edeb7b42b908bbda /src
parentAdded new UnitTracker class. (diff)
downloadinkscape-64bc8cf145b55d33469ef1b84e18ca8df580eda8.tar.gz
inkscape-64bc8cf145b55d33469ef1b84e18ca8df580eda8.zip
Removed unused unit includes.
(bzr r12380.1.10)
Diffstat (limited to 'src')
-rw-r--r--src/widgets/arc-toolbar.cpp4
-rw-r--r--src/widgets/calligraphy-toolbar.cpp4
-rw-r--r--src/widgets/connector-toolbar.cpp4
-rw-r--r--src/widgets/dropper-toolbar.cpp4
-rw-r--r--src/widgets/erasor-toolbar.cpp4
-rw-r--r--src/widgets/measure-toolbar.cpp22
-rw-r--r--src/widgets/pencil-toolbar.cpp5
-rw-r--r--src/widgets/spiral-toolbar.cpp4
-rw-r--r--src/widgets/spray-toolbar.cpp4
-rw-r--r--src/widgets/star-toolbar.cpp4
-rw-r--r--src/widgets/tweak-toolbar.cpp4
-rw-r--r--src/widgets/zoom-toolbar.cpp4
12 files changed, 14 insertions, 53 deletions
diff --git a/src/widgets/arc-toolbar.cpp b/src/widgets/arc-toolbar.cpp
index 809050ad9..e3f3a8c79 100644
--- a/src/widgets/arc-toolbar.cpp
+++ b/src/widgets/arc-toolbar.cpp
@@ -56,14 +56,10 @@
#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-ellipse.h"
#include "../mod360.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/calligraphy-toolbar.cpp b/src/widgets/calligraphy-toolbar.cpp
index 4cb4813b5..7c2d6bf19 100644
--- a/src/widgets/calligraphy-toolbar.cpp
+++ b/src/widgets/calligraphy-toolbar.cpp
@@ -56,13 +56,9 @@
#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"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/connector-toolbar.cpp b/src/widgets/connector-toolbar.cpp
index 7c72f8e0c..293f1184d 100644
--- a/src/widgets/connector-toolbar.cpp
+++ b/src/widgets/connector-toolbar.cpp
@@ -55,9 +55,6 @@
#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 "../conn-avoid-ref.h"
@@ -66,7 +63,6 @@
#include "../sp-path.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/dropper-toolbar.cpp b/src/widgets/dropper-toolbar.cpp
index cf58aa507..054955d8f 100644
--- a/src/widgets/dropper-toolbar.cpp
+++ b/src/widgets/dropper-toolbar.cpp
@@ -54,13 +54,9 @@
#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 "../tools-switch.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/erasor-toolbar.cpp b/src/widgets/erasor-toolbar.cpp
index 2e074490d..44c79d5f3 100644
--- a/src/widgets/erasor-toolbar.cpp
+++ b/src/widgets/erasor-toolbar.cpp
@@ -55,13 +55,9 @@
#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"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
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()
diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp
index e0cf67bd0..e38b54b5d 100644
--- a/src/widgets/pencil-toolbar.cpp
+++ b/src/widgets/pencil-toolbar.cpp
@@ -67,15 +67,10 @@
//#include "../ui/tool/multi-path-manipulator.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 "../tools-switch.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/spiral-toolbar.cpp b/src/widgets/spiral-toolbar.cpp
index 08d26f3d1..48b509acc 100644
--- a/src/widgets/spiral-toolbar.cpp
+++ b/src/widgets/spiral-toolbar.cpp
@@ -53,13 +53,9 @@
#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-spiral.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/spray-toolbar.cpp b/src/widgets/spray-toolbar.cpp
index 06850d261..bdc700aa8 100644
--- a/src/widgets/spray-toolbar.cpp
+++ b/src/widgets/spray-toolbar.cpp
@@ -52,13 +52,9 @@
#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 "../spray-context.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/star-toolbar.cpp b/src/widgets/star-toolbar.cpp
index 8c07c6473..545256061 100644
--- a/src/widgets/star-toolbar.cpp
+++ b/src/widgets/star-toolbar.cpp
@@ -53,14 +53,10 @@
#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-star.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/tweak-toolbar.cpp b/src/widgets/tweak-toolbar.cpp
index beb527a17..e96418957 100644
--- a/src/widgets/tweak-toolbar.cpp
+++ b/src/widgets/tweak-toolbar.cpp
@@ -52,13 +52,9 @@
#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 "../tweak-context.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;
diff --git a/src/widgets/zoom-toolbar.cpp b/src/widgets/zoom-toolbar.cpp
index 7d7f2c774..9cdbc3d6a 100644
--- a/src/widgets/zoom-toolbar.cpp
+++ b/src/widgets/zoom-toolbar.cpp
@@ -51,14 +51,10 @@
#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 "../tweak-context.h"
-using Inkscape::UnitTracker;
using Inkscape::UI::UXManager;
using Inkscape::DocumentUndo;
using Inkscape::UI::ToolboxFactory;