Code

noop: add emacs/vim footer to ui/dialog/livepatheffect-editor.cpp
[inkscape.git] / src / ui / dialog / inkscape-preferences.cpp
index 453d3812a0b2d067f85981767888caec10fc1c98..e179f1581ed15db73203358a13d18df485ebd13c 100644 (file)
@@ -106,6 +106,7 @@ InkscapePreferences::InkscapePreferences()
     initPageImportExport();
     initPageCMS();
     initPageGrids();
+    initPageSVGOutput();
     initPageMisc();
 
     signalPresent().connect(sigc::mem_fun(*this, &InkscapePreferences::_presentPages));
@@ -340,10 +341,10 @@ void InkscapePreferences::initPageTools()
     _path_tools = _page_list.get_model()->get_path(iter_tools);
 
     _page_tools.add_group_header( _("Bounding box to use:"));
-    _t_bbox_visual.init ( _("Visual bounding box"), "tools", "bounding_box", "visual", false, 0);
+    _t_bbox_visual.init ( _("Visual bounding box"), "tools", "bounding_box", "0", false, 0); // 0 means visual
     _page_tools.add_line( true, "", _t_bbox_visual, "",
                             _("This bounding box includes stroke width, markers, filter margins, etc."));
-    _t_bbox_geometric.init ( _("Geometric bounding box"), "tools", "bounding_box", "geometric", true, &_t_bbox_visual);
+    _t_bbox_geometric.init ( _("Geometric bounding box"), "tools", "bounding_box", "1", true, &_t_bbox_visual); // 1 means geometric
     _page_tools.add_line( true, "", _t_bbox_geometric, "",
                             _("This bounding box includes only the bare path"));
 
@@ -351,6 +352,9 @@ void InkscapePreferences::initPageTools()
     _t_cvg_keep_objects.init ( _("Keep objects after conversion to guides"), "tools", "cvg_keep_objects", false);
     _page_tools.add_line( true, "", _t_cvg_keep_objects, "",
                             _("When converting an object to guides, don't delete the object after the conversion."));
+    _t_cvg_convert_whole_groups.init ( _("Treat groups as a single object"), "tools", "cvg_convert_whole_groups", false);
+    _page_tools.add_line( true, "", _t_cvg_convert_whole_groups, "",
+                            _("Treat groups as a single object during conversion to guides rather than converting each child separately."));
 
     _calligrapy_use_abs_size.init ( _("Width is in absolute units"), "tools.calligraphic", "abs_width", false);
     _calligrapy_keep_selected.init ( _("Select new path"), "tools.calligraphic", "keep_selected", true);
@@ -446,6 +450,8 @@ void InkscapePreferences::initPageTools()
     this->AddPage(_page_paintbucket, _("Paint Bucket"), iter_tools, PREFS_PAGE_TOOLS_PAINTBUCKET);
     this->AddSelcueCheckbox(_page_paintbucket, "tools.paintbucket", false);
     this->AddNewObjectsStyle(_page_paintbucket, "tools.paintbucket");
+    //Calligraphy
+    this->AddPage(_page_eraser, _("Eraser"), iter_tools, PREFS_PAGE_TOOLS_ERASER);
     //Text
     this->AddPage(_page_text, _("Text"), iter_tools, PREFS_PAGE_TOOLS_TEXT);
     this->AddSelcueCheckbox(_page_text, "tools.text", true);
@@ -481,11 +487,6 @@ void InkscapePreferences::initPageWindows()
     _win_ontop_normal.init ( _("Normal"), "options.transientpolicy", "value", 1, true, &_win_ontop_none);
     _win_ontop_agressive.init ( _("Aggressive"), "options.transientpolicy", "value", 2, false, &_win_ontop_none);
 
-// FIXME: Temporary Win32 special code to enable transient dialogs
-#ifdef WIN32
-    _win_ontop_win32.init ( _("Dialogs stay on top (experimental!)"), "options.dialogsontopwin32", "value", false);
-#endif
-
     _page_windows.add_group_header( _("Saving window geometry (size and position):"));
     _page_windows.add_line( false, "", _win_save_geom_off, "",
                             _("Let the window manager determine placement of all windows"));
@@ -500,17 +501,15 @@ void InkscapePreferences::initPageWindows()
     _page_windows.add_line( true, "", _win_floating, "",
                             _("Floating"));
 
-    _page_windows.add_group_header( _("Dialogs on top:"));
-#ifndef WIN32 // FIXME: Temporary Win32 special code to enable transient dialogs
+#ifndef WIN32 // non-Win32 special code to enable transient dialogs
+       _page_windows.add_group_header( _("Dialogs on top:"));
+
     _page_windows.add_line( true, "", _win_ontop_none, "",
                             _("Dialogs are treated as regular windows"));
     _page_windows.add_line( true, "", _win_ontop_normal, "",
                             _("Dialogs stay on top of document windows"));
     _page_windows.add_line( true, "", _win_ontop_agressive, "",
                             _("Same as Normal but may work better with some window managers"));
-#else
-    _page_windows.add_line( false, "", _win_ontop_win32, "",
-                            _("Whether dialogs should stay on top of document windows. Read the ReleaseNotes on this issue! (Rightclick the taskbar button and press 'Restore' to bring back a minimized document window)"));
 #endif
 
     _page_windows.add_group_header( _("Miscellaneous:"));
@@ -891,6 +890,43 @@ void InkscapePreferences::initPageGrids()
     this->AddPage(_page_grids, _("Grids"), PREFS_PAGE_GRIDS);
 }
 
+void InkscapePreferences::initPageSVGOutput()
+{
+    _svgoutput_usenamedcolors.init( _("Use named colors"), "options.svgoutput", "usenamedcolors", false);
+    _page_svgoutput.add_line( false, "", _svgoutput_usenamedcolors, "", _("If set, write the CSS name of the color instead of it's numeric value."), false);
+
+    _page_svgoutput.add_group_header( _("XML looks"));
+
+    _svgoutput_inlineattrs.init( _("Inline attributes"), "options.svgoutput", "inlineattrs", false);
+    _page_svgoutput.add_line( false, "", _svgoutput_inlineattrs, "", _("Inline the XML attributes"), false);
+
+    _svgoutput_indent.init("options.svgoutput", "indent", 0.0, 1000.0, 1.0, 2.0, 2.0, true, false);
+    _page_svgoutput.add_line( false, _("Indent spaces"), _svgoutput_indent, "", _("The number of spaces to use for indentation."), false);
+
+    _page_svgoutput.add_group_header( _("Path string"));
+
+    _svgoutput_allowrelativecoordinates.init( _("Allow relative coordinates"), "options.svgoutput", "allowrelativecoordinates", true);
+    _page_svgoutput.add_line( false, "", _svgoutput_allowrelativecoordinates, "", _("If set, relative coordinates may be used in path data"), false);
+
+    /* seems this is never used in Inkscape code
+    _svgoutput_allowshorthands.init( _("Allow shorthands"), "options.svgoutput", "allowshorthands", true);
+    _page_svgoutput.add_line( false, "", _svgoutput_allowshorthands, "", _(""), false);
+    */
+
+    _svgoutput_forcerepeatcommands.init( _("Force repeat commands"), "options.svgoutput", "forcerepeatcommands", false);
+    _page_svgoutput.add_line( false, "", _svgoutput_forcerepeatcommands, "", _("If set, force repeating of the same command (i.e. output 'L 1,2 L 3,4' instead of 'L 1,2 3,4')."), false);
+
+    _page_svgoutput.add_group_header( _("Numeric data"));
+
+    _svgoutput_numericprecision.init("options.svgoutput", "numericprecision", 0.0, 1000.0, 1.0, 2.0, 8.0, true, false);
+    _page_svgoutput.add_line( false, _("Numeric precision"), _svgoutput_numericprecision, "", _("The number of digits to use behind the comma."), false);
+
+    _svgoutput_minimumexponent.init("options.svgoutput", "minimumexponent", -100.0, 100.0, 1.0, 2.0, -8.0, true, false);
+    _page_svgoutput.add_line( false, _("Minimum exponent"), _svgoutput_minimumexponent, "", _("The minimum size of a number (10 to the power of this exponent), smaller numbers will be written as zero."), false);
+
+    this->AddPage(_page_svgoutput, _("SVG Output"), PREFS_PAGE_SVGOUTPUT);
+}
+
 void InkscapePreferences::initPageMisc()
 {
     _misc_comment.init( _("Add label comments to printing output"), "printing.debug", "show-label-comments", false);
@@ -903,28 +939,61 @@ void InkscapePreferences::initPageMisc()
 
     _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);
-    int const num_items = 5;
-    Glib::ustring labels[num_items] = {_("None"), _("2x2"), _("4x4"), _("8x8"), _("16x16")};
-    int values[num_items] = {0, 1, 2, 3, 4};
-    _misc_overs_bitmap.set_size_request(_sb_width);
-    _misc_overs_bitmap.init("options.bitmapoversample", "value", labels, values, num_items, 1);
-    _page_misc.add_line( false, _("Oversample bitmaps:"), _misc_overs_bitmap, "", "", false);
+    {
+        Glib::ustring labels[] = {_("None"), _("2x2"), _("4x4"), _("8x8"), _("16x16")};
+        int values[] = {0, 1, 2, 3, 4};
+        _misc_overs_bitmap.set_size_request(_sb_width);
+        _misc_overs_bitmap.init("options.bitmapoversample", "value", labels, values, G_N_ELEMENTS(values), 1);
+        _page_misc.add_line( false, _("Oversample bitmaps:"), _misc_overs_bitmap, "", "", false);
+    }
 
 
     // consider moving this to an UI tab:
-    _misc_small_toolbar.init( _("Make the commands toolbar icons smaller"), "toolbox", "small", true);
-    _page_misc.add_line( false, "", _misc_small_toolbar, "",
-                           _("Make the commands toolbar use the 'secondary' toolbar size (requires restart)"), true);
 
-    _misc_small_tools.init( _("Make the main toolbar icons smaller"), "toolbox.tools", "small", true);
-    _page_misc.add_line( false, "", _misc_small_tools, "",
-                           _("Make the main tools use the 'secondary' toolbar size (requires restart)"), true);
+    Glib::ustring sizeLabels[] = {_("Normal"), _("Medium"), _("Small")};
+    int sizeValues[] = {0, 1, 2};
+
+    _misc_small_toolbar.init( "toolbox", "small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 );
+    _page_misc.add_line( false, _("Commands bar icon size"), _misc_small_toolbar, "",
+                           _("Set the size for the commands toolbar to use (requires restart)"), false);
+
+    _misc_small_secondary.init( "toolbox", "secondary", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 1 );
+    _page_misc.add_line( false, _("Tool controls bar icon size"), _misc_small_secondary, "",
+                           _("Set the size for the secondary toolbar to use (requires restart)"), false);
+
+    _misc_small_tools.init( "toolbox.tools", "small", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), 0 );
+    _page_misc.add_line( false, _("Main toolbar icon size"), _misc_small_tools, "",
+                           _("Set the size for the main tools to use (requires restart)"), false);
 
     _misc_recent.init("options.maxrecentdocuments", "value", 0.0, 1000.0, 1.0, 1.0, 1.0, true, false);
     _page_misc.add_line( false, _("Maximum number of recent documents:"), _misc_recent, "",
                            _("The maximum length of the Open Recent list in the File menu"), false);
     _misc_simpl.init("options.simplifythreshold", "value", 0.0001, 1.0, 0.0001, 0.0010, 0.0010, false, false);
 
+
+    // -----------
+
+    _misc_bitmap_autoreload.init(_("Automatically reload bitmaps"), "options.bitmapautoreload", "value", true);
+    _page_misc.add_line( false, "", _misc_bitmap_autoreload, "",
+                           _("Enbles automatic reload of linked images when changed on disk."));
+    gchar const *choices = prefs_get_string_attribute("options.bitmapeditor", "choices");
+    if ( choices && choices[0] ) {
+        gchar** splits = g_strsplit(choices, ",", 0);
+        gint numIems = g_strv_length(splits);
+
+        Glib::ustring labels[numIems];
+        int values[numIems];
+        for ( gint i = 0; i < numIems; i++) {
+            values[i] = i;
+            labels[i] = splits[i];
+        }
+        _misc_bitmap_editor.init("options.bitmapeditor", "value", labels, values, numIems, 0);
+        _page_misc.add_line( false, _("Bitmap editor:"), _misc_bitmap_editor, "", "", false);
+
+        g_strfreev(splits);
+    }
+
+
     this->AddPage(_page_misc, _("Misc"), PREFS_PAGE_MISC);
 }