diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2018-12-07 17:20:05 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2018-12-07 17:20:05 +0000 |
| commit | dbc26e64c62b757cb0c41658d37bee016367e1d4 (patch) | |
| tree | 315e3251bded0cb3027ab625a617a0ea95fb2155 /src/ui | |
| parent | desktop-widget: Make canvas private (diff) | |
| parent | Add some SVG 2 fallbacks: (diff) | |
| download | inkscape-dbc26e64c62b757cb0c41658d37bee016367e1d4.tar.gz inkscape-dbc26e64c62b757cb0c41658d37bee016367e1d4.zip | |
Merge branch 'master' of gitlab.com:inkscape/inkscape
Diffstat (limited to 'src/ui')
| -rw-r--r-- | src/ui/dialog/filedialogimpl-gtkmm.cpp | 16 | ||||
| -rw-r--r-- | src/ui/dialog/filedialogimpl-gtkmm.h | 10 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 22 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.h | 13 |
4 files changed, 56 insertions, 5 deletions
diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index a3ff0cf35..8652be3a8 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -540,13 +540,19 @@ void FileDialogBaseGtk::internalSetup() // Open executable file dialogs don't need the preview panel if (_dialogType != EXE_TYPES) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - bool enablePreview = prefs->getBool(preferenceBase + "/enable_preview", true); + bool enablePreview = prefs->getBool(preferenceBase + "/enable_preview", true); + bool enableSVGExport = prefs->getBool(preferenceBase + "/enable_svgexport", false); previewCheckbox.set_label(Glib::ustring(_("Enable preview"))); previewCheckbox.set_active(enablePreview); previewCheckbox.signal_toggled().connect(sigc::mem_fun(*this, &FileDialogBaseGtk::_previewEnabledCB)); + svgexportCheckbox.set_label(Glib::ustring(_("Export as SVG 1.1 per settings in Preference Dialog."))); + svgexportCheckbox.set_active(enableSVGExport); + + svgexportCheckbox.signal_toggled().connect(sigc::mem_fun(*this, &FileDialogBaseGtk::_svgexportEnabledCB)); + // Catch selection-changed events, so we can adjust the text widget signal_update_preview().connect(sigc::mem_fun(*this, &FileDialogBaseGtk::_updatePreviewCallback)); @@ -581,6 +587,13 @@ void FileDialogBaseGtk::_previewEnabledCB() } } +void FileDialogBaseGtk::_svgexportEnabledCB() +{ + bool enabled = svgexportCheckbox.get_active(); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); + prefs->setBool(preferenceBase + "/enable_svgexport", enabled); +} + /** @@ -931,6 +944,7 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk(Gtk::Window &parentWindow, const Gl childBox.pack_end(fileTypeComboBox); checksBox.pack_start(fileTypeCheckbox); checksBox.pack_start(previewCheckbox); + checksBox.pack_start(svgexportCheckbox); set_extra_widget(childBox); diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index 82f56d311..9a351ff36 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -189,9 +189,10 @@ protected: SVGPreview svgPreview; /** - * Child widgets - */ + * Child widgets + */ Gtk::CheckButton previewCheckbox; + Gtk::CheckButton svgexportCheckbox; private: void internalSetup(); @@ -205,6 +206,11 @@ private: * Callback for seeing if the preview needs to be drawn */ void _updatePreviewCallback(); + + /** + * Callback to for SVG 2 to SVG 1.1 export. + */ + void _svgexportEnabledCB(); }; diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index ec630dcb3..c301f724b 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1265,6 +1265,28 @@ void InkscapePreferences::initPageIO() this->AddPage(_page_svgoutput, _("SVG output"), iter_io, PREFS_PAGE_IO_SVGOUTPUT); + // SVG Export Options ========================================== + + // SVG 2 Fallbacks + _page_svgexport.add_group_header( _("SVG 2")); + _svgexport_insert_text_fallback.init( _("Insert SVG 1.1 fallback in text."), "/options/svgexport/text_insertfallback", true ); + _svgexport_insert_mesh_polyfill.init( _("Insert Mesh Gradient JavaScript polyfill."), "/options/svgexport/mesh_insertpolyfill", true ); + + _page_svgexport.add_line( false, "", _svgexport_insert_text_fallback, "", _("Adds fallback options for non-SVG 2 renderers."), false); + _page_svgexport.add_line( false, "", _svgexport_insert_mesh_polyfill, "", _("Adds JavaScript polyfill to render meshes (only fill."), false); + + // SVG Export Options (SVG 2 -> SVG 1) + _page_svgexport.add_group_header( _("SVG 2 to SVG 1.1")); + + _svgexport_remove_marker_auto_start_reverse.init( _("Replace markers with 'auto_start_reverse'."), "/options/svgexport/marker_autostartreverse", false); + _svgexport_remove_marker_context_paint.init( _("Replace markers using 'context_paint' or 'context_fill'."), "/options/svgexport/marker_contextpaint", false); + + _page_svgexport.add_line( false, "", _svgexport_remove_marker_auto_start_reverse, "", _("SVG 2 allows markers to automatically be reversed at start of path."), false); + _page_svgexport.add_line( false, "", _svgexport_remove_marker_context_paint, "", _("SVG 2 allows markers to automatically match stroke color."), false); + + this->AddPage(_page_svgexport, _("SVG export"), iter_io, PREFS_PAGE_IO_SVGEXPORT); + + // CMS options Inkscape::Preferences *prefs = Inkscape::Preferences::get(); int const numIntents = 4; diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index ee3d8daa4..124b29139 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -85,6 +85,7 @@ enum { PREFS_PAGE_IO, PREFS_PAGE_IO_MOUSE, PREFS_PAGE_IO_SVGOUTPUT, + PREFS_PAGE_IO_SVGEXPORT, PREFS_PAGE_IO_CMS, PREFS_PAGE_IO_AUTOSAVE, PREFS_PAGE_IO_OPENCLIPART, @@ -178,6 +179,7 @@ protected: UI::Widget::DialogPage _page_io; UI::Widget::DialogPage _page_mouse; UI::Widget::DialogPage _page_svgoutput; + UI::Widget::DialogPage _page_svgexport; UI::Widget::DialogPage _page_cms; UI::Widget::DialogPage _page_autosave; UI::Widget::DialogPage _page_openclipart; @@ -474,9 +476,16 @@ protected: UI::Widget::PrefCheckButton _svgoutput_check_editing; UI::Widget::PrefCheckButton _svgoutput_check_writing; + // SVG Output export: + UI::Widget::PrefCheckButton _svgexport_insert_text_fallback; + UI::Widget::PrefCheckButton _svgexport_insert_mesh_polyfill; + UI::Widget::PrefCheckButton _svgexport_remove_marker_auto_start_reverse; + UI::Widget::PrefCheckButton _svgexport_remove_marker_context_paint; + + UI::Widget::PrefEntryButtonHBox _importexport_ocal_url; - UI::Widget::PrefEntry _importexport_ocal_username; - UI::Widget::PrefEntry _importexport_ocal_password; + UI::Widget::PrefEntry _importexport_ocal_username; + UI::Widget::PrefEntry _importexport_ocal_password; /* * Keyboard shortcut members |
