Code

until the freeze with precision<3 is fixed, raise the lower limit in the UI
[inkscape.git] / src / ui / dialog / inkscape-preferences.cpp
index dfca240703acb29b9f288479ad8f7dca6bb9dd42..3e202d61927c3a8df4476e99b2279d89b28781c5 100644 (file)
@@ -21,6 +21,8 @@
 #include <gtkmm/scrolledwindow.h>
 #include <gtkmm/alignment.h>
 
+#include <gtk/gtkicontheme.h>
+
 #include "preferences.h"
 #include "inkscape-preferences.h"
 #include "verbs.h"
@@ -41,6 +43,7 @@
 #include "color-profile-fns.h"
 #include "color-profile.h"
 #include "display/canvas-grid.h"
+#include "path-prefix.h"
 
 #ifdef HAVE_ASPELL
 # include <aspell.h>
@@ -216,17 +219,21 @@ void InkscapePreferences::initPageSnapping()
                              _("After snapping, a symbol is drawn at the point that has snapped"));
 
     _snap_delay.init("/options/snapdelay/value", 0, 1000, 50, 100, 300, 0);
-    _page_snapping.add_line( false, _("Delay (in msec):"), _snap_delay, "",
-                             _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate"), true);
+    _page_snapping.add_line( false, _("Delay (in ms):"), _snap_delay, "",
+                             _("Postpone snapping as long as the mouse is moving, and then wait an additional fraction of a second. This additional delay is specified here. When set to zero or to a very small number, snapping will be immediate."), true);
 
     _snap_closest_only.init( _("Only snap the node closest to the pointer"), "/options/snapclosestonly/value", false);
     _page_snapping.add_line( false, "", _snap_closest_only, "",
-                             _("Only try to snap the node that is initialy closest to the mouse pointer"));
+                             _("Only try to snap the node that is initially closest to the mouse pointer"));
 
     _snap_weight.init("/options/snapweight/value", 0, 1, 0.1, 0.2, 0.5, 1);
     _page_snapping.add_line( false, _("Weight factor:"), _snap_weight, "",
                              _("When multiple snap solutions are found, then Inkscape can either prefer the closest transformation (when set to 0), or prefer the node that was initially the closest to the pointer (when set to 1)"), true);
 
+    _snap_mouse_pointer.init( _("Snap the mouse pointer when dragging a constrained knot"), "/options/snapmousepointer/value", false);
+    _page_snapping.add_line( false, "", _snap_mouse_pointer, "",
+                             _("When dragging a knot along a constraint line, then snap the position of the mouse pointer instead of snapping the projection of the knot onto the constraint line"));
+
     this->AddPage(_page_snapping, _("Snapping"), PREFS_PAGE_SNAPPING);
 }
 
@@ -318,7 +325,7 @@ void StyleFromSelectionToTool(Glib::ustring const &prefs_path, StyleSwatch *swat
     if (!css) return;
 
     // only store text style for the text tool
-    if (prefs_path == "/tools/text") {
+    if (prefs_path != "/tools/text") {
         css = sp_css_attr_unset_text (css);
     }
 
@@ -1030,7 +1037,7 @@ void InkscapePreferences::initPageSVGOutput()
 
     _page_svgoutput.add_group_header( _("Numbers"));
 
-    _svgoutput_numericprecision.init("/options/svgoutput/numericprecision", 1.0, 16.0, 1.0, 2.0, 8.0, true, false);
+    _svgoutput_numericprecision.init("/options/svgoutput/numericprecision", 3.0, 16.0, 1.0, 2.0, 8.0, true, false);
     _page_svgoutput.add_line( false, _("Numeric precision:"), _svgoutput_numericprecision, "", _("How many digits to write after the decimal dot"), false);
 
     _svgoutput_minimumexponent.init("/options/svgoutput/minimumexponent", -32.0, -1, 1.0, 2.0, -8.0, true, false);
@@ -1110,7 +1117,9 @@ void InkscapePreferences::initPageAutosave()
     _autosave_autosave_interval.init("/options/autosave/interval", 1.0, 10800.0, 1.0, 10.0, 10.0, true, false);
     _page_autosave.add_line(true, _("Interval (in minutes):"), _autosave_autosave_interval, "", _("Interval (in minutes) at which document will be autosaved"), false);
     _autosave_autosave_path.init("/options/autosave/path", true);
-    _page_autosave.add_line(true, _("Path:"), _autosave_autosave_path, "", _("The directory where autosaves will be written"), false);
+    //TRANSLATORS: only translate "string" in "context|string".
+    // For more details, see http://developer.gnome.org/doc/API/2.0/glib/glib-I18N.html#Q-:CAPS
+    _page_autosave.add_line(true, Q_("filesystem|Path:"), _autosave_autosave_path, "", _("The directory where autosaves will be written"), false);
     _autosave_autosave_max.init("/options/autosave/max", 1.0, 100.0, 1.0, 10.0, 10.0, true, false);
     _page_autosave.add_line(true, _("Maximum number of autosaves:"), _autosave_autosave_max, "", _("Maximum number of autosaved files; use this to limit the storage space used"), false);
 
@@ -1241,7 +1250,18 @@ void InkscapePreferences::initPageSpellcheck()
 #endif
 }
 
-
+static void appendList( Glib::ustring& tmp, const gchar* const*listing )
+{
+    bool first = true;
+    for (const gchar* const* ptr = listing; *ptr; ptr++) {
+        if (!first) {
+            tmp += "  ";
+        }
+        first = false;
+        tmp += *ptr;
+        tmp += "\n";
+    }
+}
 
 void InkscapePreferences::initPageMisc()
 {
@@ -1255,7 +1275,7 @@ void InkscapePreferences::initPageMisc()
 
     _misc_simpl.init("/options/simplifythreshold/value", 0.0001, 1.0, 0.0001, 0.0010, 0.0010, false, false);
     _page_misc.add_line( false, _("Simplification threshold:"), _misc_simpl, "",
-                           _("How strong is the Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."), false);
+                           _("How strong is the Node tool's Simplify command by default. If you invoke this command several times in quick succession, it will act more and more aggressively; invoking it again after a pause restores the default threshold."), false);
 
     _misc_latency_skew.init("/debug/latency/skew", 0.5, 2.0, 0.01, 0.10, 1.0, false, false);
     _page_misc.add_line( false, _("Latency skew:"), _misc_latency_skew, _("(requires restart)"),
@@ -1268,19 +1288,58 @@ void InkscapePreferences::initPageMisc()
 
     {
         Glib::ustring tmp;
-        tmp += "User config: ";
-        tmp += Glib::get_user_config_dir();
+        // TRANSLATORS: following strings are paths in Inkscape preferences - Misc - System info
+        tmp += _("User config: ");
+        tmp += g_get_user_config_dir();
+        tmp += "\n";
+
+        tmp += _("User data: ");
+        tmp += g_get_user_data_dir();
+        tmp += "\n";
+
+        tmp += _("User cache: ");
+        tmp += g_get_user_cache_dir();
+        tmp += "\n";
+
+        tmp += _("System config: ");
+        appendList( tmp, g_get_system_config_dirs() );
+
+        tmp += _("System data: ");
+        appendList( tmp, g_get_system_data_dirs() );
+
+        tmp += _("PIXMAP: ");
+        tmp += INKSCAPE_PIXMAPDIR;
         tmp += "\n";
 
-        tmp += "User data: ";
-        tmp += Glib::get_user_data_dir();
+        tmp += _("DATA: ");
+        tmp += INKSCAPE_DATADIR;
         tmp += "\n";
 
+        tmp += _("UI: ");
+        tmp += INKSCAPE_UIDIR;
+        tmp += "\n";
+
+        {
+            gchar** paths = 0;
+            gint count = 0;
+            gtk_icon_theme_get_search_path(gtk_icon_theme_get_default(), &paths, &count);
+            if (count > 0) {
+                tmp += _("Icon theme: ");
+                tmp += paths[0];
+                tmp += "\n";
+                for (int i = 1; i < count; i++) {
+                    tmp += "  ";
+                    tmp += paths[i];
+                    tmp += "\n";
+                }
+            }
+        }
+
         _misc_info.get_buffer()->insert(_misc_info.get_buffer()->end(), tmp);
     }
     _misc_info.set_editable(false);
     _misc_info_scroll.add(_misc_info);
-    _page_misc.add_line( false, "", _misc_info_scroll, "", _("General system information"), true);
+    _page_misc.add_line( false, _("System info"), _misc_info_scroll, "", _("General system information"), true);
 
     this->AddPage(_page_misc, _("Misc"), PREFS_PAGE_MISC);
 }