From 1c31310676b12bd4fd5e477192bf7bd9fffabf83 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Sat, 9 Sep 2017 06:28:03 +0200 Subject: Fix a bug when creating a cloned LPE with fill between many --- src/ui/dialog/livepatheffect-editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 98789f7b2..02f76dbbb 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -473,7 +473,7 @@ LivePathEffectEditor::onAdd() item = NULL; // run sp_selection_clone_original_path_lpe - sel->cloneOriginalPathLPE(); + sel->cloneOriginalPathLPE(true); SPItem *new_item = sel->singleItem(); // Check that the cloning was successful. We don't want to change the ID of the original referenced path! -- cgit v1.2.3 From 1da36c2be7f64ba0aed75ecad4a5cbb1e972f261 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Fri, 15 Sep 2017 21:33:13 +0200 Subject: Add default extension for native win32 file save dialog. We manually appended an extension already (so functionality does not change), however GetSaveFileNameW also adds the chosen name (which was the name without extension before) to the list of recently used documents which resulted in unusable links. --- src/ui/dialog/filedialogimpl-win32.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index 4fb8089ee..7f0bf58c5 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -1781,6 +1781,7 @@ void FileSaveDialogImplWin32::GetSaveFileName_thread() ofn.lpstrFilter = _filter; ofn.nFilterIndex = _filter_index; ofn.lpfnHook = GetSaveFileName_hookproc; + ofn.lpstrDefExt = L"svg\0"; ofn.lCustData = (LPARAM)this; _result = GetSaveFileNameW(&ofn) != 0; -- cgit v1.2.3 From a474159bf7130e9b46a8da1efaf32e9eac4c55b7 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Date: Thu, 21 Sep 2017 23:12:27 +0200 Subject: Fix for bug #1715433 Clone original LPE can no longer be used to fill a powerstroke path --- src/ui/dialog/livepatheffect-editor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 02f76dbbb..28a42929b 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -206,9 +206,11 @@ LivePathEffectEditor::showParams(LivePathEffect::Effect& effect) if (defaultswidget) { Gtk::Expander * expander = NULL; std::vector childs = dynamic_cast (effectwidget)->get_children(); - std::vector childs_default = dynamic_cast (childs[childs.size()-1])->get_children(); - if ((expander = dynamic_cast(childs_default[childs_default.size()-1]))){ - expanderopen = expander->get_expanded(); + if (childs.size()) { + std::vector childs_default = dynamic_cast (childs[childs.size()-1])->get_children(); + if ((expander = dynamic_cast(childs_default[childs_default.size()-1]))){ + expanderopen = expander->get_expanded(); + } } } effectcontrol_vbox.remove(*effectwidget); -- cgit v1.2.3 From 6a03015b016c177e0657fc6274a571db16e48b64 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Sat, 23 Sep 2017 10:02:16 +0200 Subject: Remove unused parameter in SPItem::doWriteTransform --- src/ui/dialog/grid-arrange-tab.cpp | 2 +- src/ui/dialog/layers.cpp | 4 ++-- src/ui/dialog/polar-arrange-tab.cpp | 2 +- src/ui/dialog/transformation.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index 3cbc1b6e9..6e08645cf 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -329,7 +329,7 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h Geom::Point move = Geom::Point(new_x - min[Geom::X], min[Geom::Y] - new_y); Geom::Affine const affine = Geom::Affine(Geom::Translate(move)); item->set_i2d_affine(item->i2dt_affine() * affine); - item->doWriteTransform(repr, item->transform, NULL); + item->doWriteTransform(item->transform); SP_OBJECT (current_row->data)->updateRepr(); cnt +=1; } diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 3c99d1461..4a381a565 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -713,12 +713,12 @@ void LayersPanel::_doTreeMove( ) { if (_dnd_source && _dnd_source->getRepr() ) { if(!_dnd_target){ - _dnd_source->doWriteTransform(_dnd_source->getRepr(), _dnd_source->i2doc_affine() * _dnd_source->document->getRoot()->i2doc_affine().inverse()); + _dnd_source->doWriteTransform(_dnd_source->i2doc_affine() * _dnd_source->document->getRoot()->i2doc_affine().inverse()); }else{ SPItem* parent = _dnd_into ? _dnd_target : dynamic_cast(_dnd_target->parent); if(parent){ Geom::Affine move = _dnd_source->i2doc_affine() * parent->i2doc_affine().inverse(); - _dnd_source->doWriteTransform(_dnd_source->getRepr(), move); + _dnd_source->doWriteTransform(move); } } _dnd_source->moveTo(_dnd_target, _dnd_into); diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index 2b4550d20..75e1a56b8 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -140,7 +140,7 @@ static void rotateAround(SPItem *item, Geom::Point center, Geom::Rotate const &r center = item->getCenter(); item->set_i2d_affine(item->i2dt_affine() * affine); - item->doWriteTransform(item->getRepr(), item->transform); + item->doWriteTransform(item->transform); if(item->isCenterSet()) { diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index 5ad1b9ec5..8713e6ddc 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -727,7 +727,7 @@ void Transformation::applyPageScale(Inkscape::Selection *selection) Geom::Affine scaler = get_scale_transform_for_variable_stroke (*bbox_pref, *bbox_geom, transform_stroke, preserve, x0, y0, x1, y1); item->set_i2d_affine(item->i2dt_affine() * scaler); - item->doWriteTransform(item->getRepr(), item->transform); + item->doWriteTransform(item->transform); } } } else { -- cgit v1.2.3 From 4ced018164553d115a24947ec74dace836e99732 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sat, 30 Sep 2017 02:25:47 +0200 Subject: Hunted every GList to the last (except in libnrtype and libcroco) --- src/ui/dialog/clonetiler.cpp | 7 +++---- src/ui/dialog/inkscape-preferences.cpp | 18 +++++++----------- 2 files changed, 10 insertions(+), 15 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index ad13ed8c4..5c9b31fb1 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -2639,11 +2639,10 @@ void CloneTiler::reset_recursive(GtkWidget *w) } if (GTK_IS_CONTAINER(w)) { - GList *ch = gtk_container_get_children (GTK_CONTAINER(w)); - for (GList *i = ch; i != NULL; i = i->next) { - reset_recursive (GTK_WIDGET(i->data)); + std::vector c = Glib::wrap(GTK_CONTAINER(w))->get_children(); + for ( auto i : c ) { + reset_recursive(i->gobj()); } - g_list_free (ch); } } diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 13729cf0f..d87a3d94a 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include "preferences.h" #include "verbs.h" @@ -2057,21 +2059,15 @@ bool InkscapePreferences::PresentPage(const Gtk::TreeModel::iterator& iter) void InkscapePreferences::on_reset_open_recent_clicked() { - GtkRecentManager* manager = gtk_recent_manager_get_default(); - GList* recent_list = gtk_recent_manager_get_items(manager); - GList* element; - GError* error; + Glib::RefPtr manager = Gtk::RecentManager::get_default(); + std::vector< Glib::RefPtr< Gtk::RecentInfo > > recent_list = manager->get_items(); //Remove only elements that were added by Inkscape - for (element = g_list_first(recent_list); element; element = g_list_next(element)){ - error = NULL; - GtkRecentInfo* info = (GtkRecentInfo*) element->data; - if (gtk_recent_info_has_application(info, g_get_prgname())){ - gtk_recent_manager_remove_item(manager, gtk_recent_info_get_uri(info), &error); + for (auto e : recent_list) { + if (e->has_application(g_get_prgname())) { + manager->remove_item(e->get_uri()); } - gtk_recent_info_unref (info); } - g_list_free(recent_list); } void InkscapePreferences::on_pagelist_selection_changed() -- cgit v1.2.3 From e0957537cd0938313803c290a2f3922a3889e6f1 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 1 Oct 2017 17:49:26 +0200 Subject: Removed all GSList occurences in .h files --- src/ui/dialog/spellcheck.cpp | 87 +++++++++++++++----------------------------- src/ui/dialog/spellcheck.h | 11 ++++-- src/ui/dialog/symbols.cpp | 46 ++++++++++------------- src/ui/dialog/symbols.h | 12 +++--- 4 files changed, 62 insertions(+), 94 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp index 4f7657f4f..3318b5e6b 100644 --- a/src/ui/dialog/spellcheck.cpp +++ b/src/ui/dialog/spellcheck.cpp @@ -50,8 +50,6 @@ namespace Dialog { SpellCheck::SpellCheck (void) : UI::Widget::Panel ("", "/dialogs/spellcheck/", SP_VERB_DIALOG_SPELLCHECK), - _rects(NULL), - _seen_objects(NULL), _text(NULL), _layout(NULL), _stops(0), @@ -196,12 +194,11 @@ void SpellCheck::setTargetDesktop(SPDesktop *desktop) void SpellCheck::clearRects() { - for (GSList *it = _rects; it; it = it->next) { - sp_canvas_item_hide(SP_CANVAS_ITEM(it->data)); - sp_canvas_item_destroy(SP_CANVAS_ITEM(it->data)); + for(auto t : _rects) { + sp_canvas_item_hide(t); + sp_canvas_item_destroy(t); } - g_slist_free(_rects); - _rects = NULL; + _rects.clear(); } void SpellCheck::disconnect() @@ -214,47 +211,39 @@ void SpellCheck::disconnect() } } -GSList *SpellCheck::allTextItems (SPObject *r, GSList *l, bool hidden, bool locked) +void SpellCheck::allTextItems (SPObject *r, std::vector &l, bool hidden, bool locked) { if (!desktop) - return l; // no desktop to check + return; // no desktop to check if (SP_IS_DEFS(r)) - return l; // we're not interested in items in defs + return; // we're not interested in items in defs if (!strcmp(r->getRepr()->name(), "svg:metadata")) { - return l; // we're not interested in metadata + return; // we're not interested in metadata } for (auto& child: r->children) { if (SP_IS_ITEM (&child) && !child.cloned && !desktop->isLayer(SP_ITEM(&child))) { if ((hidden || !desktop->itemIsHidden(SP_ITEM(&child))) && (locked || !SP_ITEM(&child)->isLocked())) { if (SP_IS_TEXT(&child) || SP_IS_FLOWTEXT(&child)) - l = g_slist_prepend (l, &child); + l.push_back(static_cast(&child)); } } - l = allTextItems (&child, l, hidden, locked); + allTextItems (&child, l, hidden, locked); } - return l; + return; } bool SpellCheck::textIsValid (SPObject *root, SPItem *text) { - GSList *l = NULL; - l = allTextItems (root, l, false, true); - for (GSList *i = l; i; i = i->next) { - SPItem *item = static_cast(i->data); - if (item == text) { - g_slist_free (l); - return true; - } - } - g_slist_free (l); - return false; + std::vector l; + allTextItems (root, l, false, true); + return (std::find(l.begin(), l.end(), text) != l.end()); } -gint SpellCheck::compareTextBboxes (gconstpointer a, gconstpointer b) +bool SpellCheck::compareTextBboxes (gconstpointer a, gconstpointer b)//returns adesktopVisualBounds(); Geom::OptRect bbox2 = i2->desktopVisualBounds(); if (!bbox1 || !bbox2) { - return 0; + return false; } // vector between top left corners Geom::Point diff = Geom::Point(bbox2->min()[Geom::X], bbox2->max()[Geom::Y]) - Geom::Point(bbox1->min()[Geom::X], bbox1->max()[Geom::Y]); - // sort top to bottom, left to right, but: - // if i2 is higher only 0.2 or less times it is righter than i1, put i1 first - if (diff[Geom::Y] > 0.2 * diff[Geom::X]) - return 1; - else - return -1; - - return 0; + return diff[Geom::Y] == 0 ? (diff[Geom::X] < 0) : (diff[Geom::Y] < 0); } // We regenerate and resort the list every time, because user could have changed it while the // dialog was waiting SPItem *SpellCheck::getText (SPObject *root) { - GSList *l = NULL; - l = allTextItems (root, l, false, true); - l = g_slist_sort(l, (GCompareFunc)SpellCheck::compareTextBboxes); - - for (GSList *i = l; i; i = i->next) { - SPItem *item = static_cast(i->data); - if (!g_slist_find (_seen_objects, item)) { - _seen_objects = g_slist_prepend(_seen_objects, item); - g_slist_free(l); + std::vector l; + allTextItems (root, l, false, true); + std::sort(l.begin(),l.end(),SpellCheck::compareTextBboxes); + + for (auto item:l) { + if(_seen_objects.insert(item).second) return item; - } } - - g_slist_free(l); return NULL; } @@ -402,8 +378,7 @@ SpellCheck::init(SPDesktop *d) _root = desktop->getDocument()->getRoot(); // empty the list of objects we've checked - g_slist_free (_seen_objects); - _seen_objects = NULL; + _seen_objects.clear(); // grab first text nextText(); @@ -456,8 +431,7 @@ SpellCheck::finished () g_free(label); } - g_slist_free(_seen_objects); - _seen_objects = NULL; + _seen_objects.clear(); desktop = NULL; _root = NULL; @@ -615,7 +589,7 @@ SpellCheck::nextWord() curve->lineto(area.corner(0)); sp_canvas_bpath_set_bpath(SP_CANVAS_BPATH(rect), curve); sp_canvas_item_show(rect); - _rects = g_slist_prepend(_rects, rect); + _rects.push_back(rect); // scroll to make it all visible Geom::Point const center = desktop->get_display_area().midpoint(); @@ -707,10 +681,10 @@ SpellCheck::nextWord() void SpellCheck::deleteLastRect () { - if (_rects) { - sp_canvas_item_hide(SP_CANVAS_ITEM(_rects->data)); - sp_canvas_item_destroy(SP_CANVAS_ITEM(_rects->data)); - _rects = _rects->next; // pop latest-prepended rect + if (!_rects.empty()) { + sp_canvas_item_hide(_rects.back()); + sp_canvas_item_destroy(_rects.back()); + _rects.pop_back(); // pop latest-prepended rect } } @@ -861,7 +835,6 @@ SpellCheck::onStart () } } - /* Local Variables: mode:c++ diff --git a/src/ui/dialog/spellcheck.h b/src/ui/dialog/spellcheck.h index 834f23c24..e7563ad1e 100644 --- a/src/ui/dialog/spellcheck.h +++ b/src/ui/dialog/spellcheck.h @@ -16,6 +16,9 @@ # include #endif +#include +#include + #include #include #include @@ -68,7 +71,7 @@ private: /** * Returns a list of all the text items in the SPObject */ - GSList *allTextItems (SPObject *r, GSList *l, bool hidden, bool locked); + void allTextItems (SPObject *r, std::vector &l, bool hidden, bool locked); /** * Is text inside the SPOject's tree @@ -78,7 +81,7 @@ private: /** * Compare the visual bounds of 2 SPItems referred to by a and b */ - static gint compareTextBboxes (gconstpointer a, gconstpointer b); + static bool compareTextBboxes (gconstpointer a, gconstpointer b); SPItem *getText (SPObject *root); void nextText (); @@ -165,12 +168,12 @@ private: /** * list of canvasitems (currently just rects) that mark misspelled things on canvas */ - GSList *_rects; + std::vector _rects; /** * list of text objects we have already checked in this session */ - GSList *_seen_objects; + std::set _seen_objects; /** * the object currently being checked diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index b876fa98c..558b0b19e 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -617,52 +617,48 @@ void SymbolsDialog::get_symbols() { } } -GSList* SymbolsDialog::symbols_in_doc_recursive (SPObject *r, GSList *l) +void SymbolsDialog::symbols_in_doc_recursive (SPObject *r, std::vector &l) { - g_return_val_if_fail(r != NULL, l); + if(!r) return; // Stop multiple counting of same symbol if ( dynamic_cast(r) ) { - return l; + return; } if ( dynamic_cast(r) ) { - l = g_slist_prepend (l, r); + l.push_back(dynamic_cast(r)); } for (auto& child: r->children) { - l = symbols_in_doc_recursive( &child, l ); + symbols_in_doc_recursive( &child, l ); } - - return l; } -GSList* SymbolsDialog::symbols_in_doc( SPDocument* symbolDocument ) { +std::vector SymbolsDialog::symbols_in_doc( SPDocument* symbolDocument ) +{ - GSList *l = NULL; - l = symbols_in_doc_recursive (symbolDocument->getRoot(), l ); - l = g_slist_reverse( l ); + std::vector l; + symbols_in_doc_recursive (symbolDocument->getRoot(), l ); return l; } -GSList* SymbolsDialog::use_in_doc_recursive (SPObject *r, GSList *l) +void SymbolsDialog::use_in_doc_recursive (SPObject *r, std::vector &l) { if ( dynamic_cast(r) ) { - l = g_slist_prepend (l, r); + l.push_back(dynamic_cast(r)); } for (auto& child: r->children) { - l = use_in_doc_recursive( &child, l ); + use_in_doc_recursive( &child, l ); } - - return l; } -GSList* SymbolsDialog::use_in_doc( SPDocument* useDocument ) { +std::vector SymbolsDialog::use_in_doc( SPDocument* useDocument ) { - GSList *l = NULL; - l = use_in_doc_recursive (useDocument->getRoot(), l ); + std::vector l; + use_in_doc_recursive (useDocument->getRoot(), l); return l; } @@ -671,10 +667,8 @@ GSList* SymbolsDialog::use_in_doc( SPDocument* useDocument ) { gchar const* SymbolsDialog::style_from_use( gchar const* id, SPDocument* document) { gchar const* style = 0; - GSList* l = use_in_doc( document ); - for( ; l != NULL; l = l->next ) { - SPObject *obj = reinterpret_cast(l->data); - SPUse *use = dynamic_cast(obj); + std::vector l = use_in_doc( document ); + for( auto use:l ) { if ( use ) { gchar const *href = use->getRepr()->attribute("xlink:href"); if( href ) { @@ -693,10 +687,8 @@ gchar const* SymbolsDialog::style_from_use( gchar const* id, SPDocument* documen void SymbolsDialog::add_symbols( SPDocument* symbolDocument ) { - GSList* l = symbols_in_doc( symbolDocument ); - for( ; l != NULL; l = l->next ) { - SPObject *obj = reinterpret_cast(l->data); - SPSymbol *symbol = dynamic_cast(obj); + std::vector l = symbols_in_doc( symbolDocument ); + for(auto symbol:l) { if (symbol) { add_symbol( symbol ); } diff --git a/src/ui/dialog/symbols.h b/src/ui/dialog/symbols.h index 5dc1e3cad..747e5c6c9 100644 --- a/src/ui/dialog/symbols.h +++ b/src/ui/dialog/symbols.h @@ -14,10 +14,10 @@ #define INKSCAPE_UI_DIALOG_SYMBOLS_H #include "display/drawing.h" - #include "ui/dialog/desktop-tracker.h" - #include "ui/widget/panel.h" +#include "sp-symbol.h" +#include "sp-use.h" #include @@ -85,10 +85,10 @@ private: void add_symbol( SPObject* symbol_document ); SPDocument* symbols_preview_doc(); - GSList* symbols_in_doc_recursive(SPObject *r, GSList *l); - GSList* symbols_in_doc( SPDocument* document ); - GSList* use_in_doc_recursive(SPObject *r, GSList *l); - GSList* use_in_doc( SPDocument* document ); + void symbols_in_doc_recursive(SPObject *r, std::vector &l); + std::vector symbols_in_doc( SPDocument* document ); + void use_in_doc_recursive(SPObject *r, std::vector &l); + std::vector use_in_doc( SPDocument* document ); gchar const* style_from_use( gchar const* id, SPDocument* document); Glib::RefPtr draw_symbol(SPObject *symbol); -- cgit v1.2.3 From c20891fabc8c3ee2251e0545878e06545b6f0cdd Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Sun, 1 Oct 2017 23:57:52 +0200 Subject: First batch --- src/ui/dialog/clonetiler.cpp | 8 +++----- src/ui/dialog/grid-arrange-tab.cpp | 10 ++++------ src/ui/dialog/tags.cpp | 8 -------- 3 files changed, 7 insertions(+), 19 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index 5c9b31fb1..71edcf259 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -1993,18 +1993,16 @@ void CloneTiler::remove(bool do_undo/* = true*/) SPObject *parent = obj->parent; // remove old tiling - GSList *to_delete = NULL; + std::vector to_delete; for (auto& child: parent->children) { if (is_a_clone_of (&child, obj)) { - to_delete = g_slist_prepend (to_delete, &child); + to_delete.push_back(&child); } } - for (GSList *i = to_delete; i; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for (auto obj:to_delete) { g_assert(obj != NULL); obj->deleteObject(); } - g_slist_free (to_delete); change_selection (selection); diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index 6e08645cf..c16e60c5f 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -298,15 +298,14 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h std::vector::iterator it = sorted.begin(); for (row_cnt=0; ((it != sorted.end()) && (row_cnt current_row; col_cnt = 0; for(;it!=sorted.end()&&col_cntnext) { - SPItem *item=SP_ITEM(current_row->data); + for (auto item:current_row) { Inkscape::XML::Node *repr = item->getRepr(); Geom::OptRect b = item->documentVisualBounds(); Geom::Point min; @@ -330,10 +329,9 @@ g_print("\n row = %f col = %f selection x= %f selection y = %f", total_row_h Geom::Affine const affine = Geom::Affine(Geom::Translate(move)); item->set_i2d_affine(item->i2dt_affine() * affine); item->doWriteTransform(item->transform); - SP_OBJECT (current_row->data)->updateRepr(); + item->updateRepr(); cnt +=1; } - g_slist_free (current_row); } DocumentUndo::done(desktop->getDocument(), SP_VERB_SELECTION_ARRANGE, diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index 176719995..5a5417eb5 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -1103,14 +1103,6 @@ void TagsPanel::setDesktop( SPDesktop* desktop ) setDocument(_desktop, _desktop->doc()); } } -/* - GSList const *layers = _desktop->doc()->getResourceList( "layer" ); - g_message( "layers list starts at %p", layers ); - for ( GSList const *iter=layers ; iter ; iter = iter->next ) { - SPObject *layer=static_cast(iter->data); - g_message(" {%s} [%s]", layer->id, layer->label() ); - } -*/ deskTrack.setBase(desktop); } -- cgit v1.2.3 From 525c6c0c7ea39c6bdb0013c546d08b6e94e51e61 Mon Sep 17 00:00:00 2001 From: Andrey Mozzhuhin Date: Fri, 6 Oct 2017 00:46:14 +0300 Subject: Rename get_group0_keyval to get_latin_keyval --- src/ui/dialog/dialog.cpp | 2 +- src/ui/dialog/knot-properties.cpp | 2 +- src/ui/dialog/layer-properties.cpp | 2 +- src/ui/dialog/layers.cpp | 2 +- src/ui/dialog/lpe-powerstroke-properties.cpp | 2 +- src/ui/dialog/objects.cpp | 2 +- src/ui/dialog/tags.cpp | 2 +- src/ui/dialog/xml-tree.cpp | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 9037e8377..e50824c7b 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -257,7 +257,7 @@ bool Dialog::_onEvent(GdkEvent *event) switch (event->type) { case GDK_KEY_PRESS: { - switch (Inkscape::UI::Tools::get_group0_keyval (&event->key)) { + switch (Inkscape::UI::Tools::get_latin_keyval (&event->key)) { case GDK_KEY_Escape: { _defocus(); ret = true; diff --git a/src/ui/dialog/knot-properties.cpp b/src/ui/dialog/knot-properties.cpp index b094dc0e7..29e1cb2bb 100644 --- a/src/ui/dialog/knot-properties.cpp +++ b/src/ui/dialog/knot-properties.cpp @@ -151,7 +151,7 @@ KnotPropertiesDialog::_close() bool KnotPropertiesDialog::_handleKeyEvent(GdkEventKey * /*event*/) { - /*switch (get_group0_keyval(event)) { + /*switch (get_latin_keyval(event)) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: { _apply(); diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index 562484022..4ab6e130e 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -290,7 +290,7 @@ SPObject* LayerPropertiesDialog::_selectedLayer() bool LayerPropertiesDialog::_handleKeyEvent(GdkEventKey *event) { - switch (Inkscape::UI::Tools::get_group0_keyval(event)) { + switch (Inkscape::UI::Tools::get_latin_keyval(event)) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: { _strategy->perform(*this); diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 4a381a565..6223bd627 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -542,7 +542,7 @@ void LayersPanel::_toggled( Glib::ustring const& str, int targetCol ) bool LayersPanel::_handleKeyEvent(GdkEventKey *event) { - switch (Inkscape::UI::Tools::get_group0_keyval(event)) { + switch (Inkscape::UI::Tools::get_latin_keyval(event)) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: case GDK_KEY_F2: { diff --git a/src/ui/dialog/lpe-powerstroke-properties.cpp b/src/ui/dialog/lpe-powerstroke-properties.cpp index 9bd98c7c0..e66229dcd 100644 --- a/src/ui/dialog/lpe-powerstroke-properties.cpp +++ b/src/ui/dialog/lpe-powerstroke-properties.cpp @@ -146,7 +146,7 @@ PowerstrokePropertiesDialog::_close() bool PowerstrokePropertiesDialog::_handleKeyEvent(GdkEventKey * /*event*/) { - /*switch (get_group0_keyval(event)) { + /*switch (get_latin_keyval(event)) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: { _apply(); diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 1e0ab9604..49ffa38f5 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -735,7 +735,7 @@ bool ObjectsPanel::_handleKeyEvent(GdkEventKey *event) // handle events for the treeview bool empty = _desktop->selection->isEmpty(); - switch (Inkscape::UI::Tools::get_group0_keyval(event)) { + switch (Inkscape::UI::Tools::get_latin_keyval(event)) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: { diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index 5a5417eb5..d804e1f68 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -522,7 +522,7 @@ void TagsPanel::_checkTreeSelection() bool TagsPanel::_handleKeyEvent(GdkEventKey *event) { - switch (Inkscape::UI::Tools::get_group0_keyval(event)) { + switch (Inkscape::UI::Tools::get_latin_keyval(event)) { case GDK_KEY_Return: case GDK_KEY_KP_Enter: case GDK_KEY_F2: { diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp index 83c0de45b..c245890bc 100644 --- a/src/ui/dialog/xml-tree.cpp +++ b/src/ui/dialog/xml-tree.cpp @@ -856,7 +856,7 @@ void XmlTree::on_document_uri_set(gchar const * /*uri*/, SPDocument * /*document gboolean XmlTree::quit_on_esc (GtkWidget *w, GdkEventKey *event, GObject */*tbl*/) { - switch (Inkscape::UI::Tools::get_group0_keyval (event)) { + switch (Inkscape::UI::Tools::get_latin_keyval (event)) { case GDK_KEY_Escape: // defocus gtk_widget_destroy(w); return TRUE; -- cgit v1.2.3 From 5433ac0513099a4a12caba0cda8a2a9d30e13a22 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Fri, 13 Oct 2017 19:03:28 +0200 Subject: Remove deprecated GNOME VFS Just use Gio::File when access to non-local files is needed. --- src/ui/dialog/export.cpp | 10 +------ src/ui/dialog/filedialogimpl-gtkmm.cpp | 50 +++++++++++----------------------- 2 files changed, 17 insertions(+), 43 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp index 56f3a29c0..d878b50a4 100644 --- a/src/ui/dialog/export.cpp +++ b/src/ui/dialog/export.cpp @@ -27,10 +27,6 @@ #include #include -#ifdef WITH_GNOME_VFS -# include // gnome_vfs_initialized -#endif - #include #include @@ -1300,11 +1296,7 @@ void Export::onBrowse () _("_Save"), GTK_RESPONSE_ACCEPT, NULL ); -#ifdef WITH_GNOME_VFS - if (gnome_vfs_initialized()) { - gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(fs), false); - } -#endif + gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(fs), false); sp_transientize (fs); diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index b69e9ce97..64f6c98c6 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -31,10 +31,6 @@ #include "path-prefix.h" #include "preferences.h" -#ifdef WITH_GNOME_VFS -#include -#endif - #include #include @@ -663,11 +659,9 @@ void FileDialogBaseGtk::_updatePreviewCallback() Glib::ustring fileName = get_preview_filename(); bool enabled = previewCheckbox.get_active(); -#ifdef WITH_GNOME_VFS - if (fileName.empty() && gnome_vfs_initialized()) { + if (fileName.empty()) { fileName = get_preview_uri(); } -#endif if (enabled && !fileName.empty()) { svgPreview.set(fileName, _dialogType); @@ -698,11 +692,7 @@ FileOpenDialogImplGtk::FileOpenDialogImplGtk(Gtk::Window &parentWindow, const Gl set_select_multiple(true); } -#ifdef WITH_GNOME_VFS - if (gnome_vfs_initialized()) { - set_local_only(false); - } -#endif + set_local_only(false); /* Initalize to Autodetect */ extension = NULL; @@ -883,10 +873,11 @@ bool FileOpenDialogImplGtk::show() extension = extensionMap[gtk_file_filter_get_name(filter)]; } myFilename = get_filename(); -#ifdef WITH_GNOME_VFS - if (myFilename.empty() && gnome_vfs_initialized()) + + if (myFilename.empty()) { myFilename = get_uri(); -#endif + } + cleanup(true); return true; } else { @@ -928,10 +919,10 @@ std::vector FileOpenDialogImplGtk::getFilenames() for (auto it : result_tmp) result.push_back(it); -#ifdef WITH_GNOME_VFS - if (result.empty() && gnome_vfs_initialized()) + if (result.empty()) { result = get_uris(); -#endif + } + return result; } @@ -963,11 +954,7 @@ FileSaveDialogImplGtk::FileSaveDialogImplGtk(Gtk::Window &parentWindow, const Gl /* One file at a time */ set_select_multiple(false); -#ifdef WITH_GNOME_VFS - if (gnome_vfs_initialized()) { - set_local_only(false); - } -#endif + set_local_only(false); /* Initalize to Autodetect */ extension = NULL; @@ -1310,11 +1297,11 @@ void FileSaveDialogImplGtk::updateNameAndExtension() { // Pick up any changes the user has typed in. Glib::ustring tmp = get_filename(); -#ifdef WITH_GNOME_VFS - if (tmp.empty() && gnome_vfs_initialized()) { + + if (tmp.empty()) { tmp = get_uri(); } -#endif + if (!tmp.empty()) { myFilename = tmp; } @@ -1449,11 +1436,7 @@ FileExportDialogImpl::FileExportDialogImpl(Gtk::Window &parentWindow, const Glib /* One file at a time */ set_select_multiple(false); -#ifdef WITH_GNOME_VFS - if (gnome_vfs_initialized()) { - set_local_only(false); - } -#endif + set_local_only(false); /* Initalize to Autodetect */ extension = NULL; @@ -1634,11 +1617,10 @@ bool FileExportDialogImpl::show() extension = type.extension; } myFilename = get_filename(); -#ifdef WITH_GNOME_VFS - if (myFilename.empty() && gnome_vfs_initialized()) { + + if (myFilename.empty()) { myFilename = get_uri(); } -#endif /* -- cgit v1.2.3 From 8ef37560aeca3d38db6603ca573929b19ea90105 Mon Sep 17 00:00:00 2001 From: Jan Lingscheid Date: Mon, 16 Oct 2017 13:28:28 +0200 Subject: Replace boost::scoped_ptr This replaces all usage of boost::scoped_ptr with std::unique_ptr. Also removes the corresponding includes. --- src/ui/dialog/icon-preview.cpp | 1 - src/ui/dialog/objects.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 991139aa8..f9cd8929a 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -18,7 +18,6 @@ #endif #include -#include #include #include diff --git a/src/ui/dialog/objects.h b/src/ui/dialog/objects.h index b7fd1b4f8..8ad1b15ef 100644 --- a/src/ui/dialog/objects.h +++ b/src/ui/dialog/objects.h @@ -16,7 +16,6 @@ # include #endif -#include #include #include #include @@ -168,7 +167,7 @@ private: Gtk::Box _blur_vbox; Gtk::Dialog _colorSelectorDialog; - boost::scoped_ptr _selectedColor; + std::unique_ptr _selectedColor; //Methods: -- cgit v1.2.3 From 41b862f1c4eaea48bdd0d546e2bb31907f15857b Mon Sep 17 00:00:00 2001 From: Jan Lingscheid Date: Wed, 18 Oct 2017 16:03:34 +0200 Subject: Refactor Util::ptr_shared Util::ptr_shared was only used in its specialization, so it is now refactored into a non-template class. Using it with arbitary classes was dangerous anyway. --- src/ui/dialog/objects.cpp | 4 ++-- src/ui/dialog/styledialog.cpp | 12 ++++++------ src/ui/dialog/tags.cpp | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 49ffa38f5..b50d68239 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -148,8 +148,8 @@ public: _pnl->_objectsChanged( _obj ); } } - virtual void notifyContentChanged( Node &/*node*/, Util::ptr_shared /*old_content*/, Util::ptr_shared /*new_content*/ ) {} - virtual void notifyAttributeChanged( Node &/*node*/, GQuark name, Util::ptr_shared /*old_value*/, Util::ptr_shared /*new_value*/ ) { + virtual void notifyContentChanged( Node &/*node*/, Util::ptr_shared /*old_content*/, Util::ptr_shared /*new_content*/ ) {} + virtual void notifyAttributeChanged( Node &/*node*/, GQuark name, Util::ptr_shared /*old_value*/, Util::ptr_shared /*new_value*/ ) { if ( _pnl && _obj ) { if ( name == _lockedAttr || name == _labelAttr || name == _highlightAttr || name == _groupAttr || name == _styleAttr || name == _clipAttr || name == _maskAttr ) { _pnl->_updateObject(_obj, name == _highlightAttr); diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index aa453e8e8..60138fa89 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -56,8 +56,8 @@ public: }; virtual void notifyContentChanged(Inkscape::XML::Node &node, - Inkscape::Util::ptr_shared old_content, - Inkscape::Util::ptr_shared new_content); + Inkscape::Util::ptr_shared old_content, + Inkscape::Util::ptr_shared new_content); StyleDialog * _styleDialog; }; @@ -66,8 +66,8 @@ public: void StyleDialog::NodeObserver::notifyContentChanged( Inkscape::XML::Node &/*node*/, - Inkscape::Util::ptr_shared /*old_content*/, - Inkscape::Util::ptr_shared /*new_content*/ ) { + Inkscape::Util::ptr_shared /*old_content*/, + Inkscape::Util::ptr_shared /*new_content*/ ) { #ifdef DEBUG_STYLEDIALOG std::cout << "StyleDialog::NodeObserver::notifyContentChanged" << std::endl; @@ -111,8 +111,8 @@ public: virtual void notifyAttributeChanged( Inkscape::XML::Node &node, GQuark qname, - Util::ptr_shared /*old_value*/, - Util::ptr_shared /*new_value*/ ) { + Util::ptr_shared /*old_value*/, + Util::ptr_shared /*new_value*/ ) { if ( _styleDialog && _repr ) { // For the moment only care about attributes that are directly used in selectors. diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp index d804e1f68..ae45654a7 100644 --- a/src/ui/dialog/tags.cpp +++ b/src/ui/dialog/tags.cpp @@ -106,8 +106,8 @@ public: _pnl->_objectsChanged( _obj ); } } - virtual void notifyContentChanged( Node &/*node*/, Util::ptr_shared /*old_content*/, Util::ptr_shared /*new_content*/ ) {} - virtual void notifyAttributeChanged( Node &/*node*/, GQuark name, Util::ptr_shared /*old_value*/, Util::ptr_shared /*new_value*/ ) { + virtual void notifyContentChanged( Node &/*node*/, Util::ptr_shared /*old_content*/, Util::ptr_shared /*new_content*/ ) {} + virtual void notifyAttributeChanged( Node &/*node*/, GQuark name, Util::ptr_shared /*old_value*/, Util::ptr_shared /*new_value*/ ) { if ( _pnl && _obj ) { if ( name == _labelAttr ) { _pnl->_updateObject( _obj); -- cgit v1.2.3 From 935c7b7808cb7c0e2d9952fda8962359d63781a2 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Tue, 17 Oct 2017 22:27:43 +0200 Subject: Remove all unused makefile.in --- src/ui/dialog/makefile.in | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 src/ui/dialog/makefile.in (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/makefile.in b/src/ui/dialog/makefile.in deleted file mode 100644 index 805c48aef..000000000 --- a/src/ui/dialog/makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -# Convenience stub makefile to call the real Makefile. - -@SET_MAKE@ - -OBJEXT = @OBJEXT@ - -# Explicit so that it's the default rule. -all: - cd ../.. && $(MAKE) ui/dialog/all - -clean %.a %.$(OBJEXT): - cd ../.. && $(MAKE) ui/dialog/$@ - -.PHONY: all clean - -.SUFFIXES: -.SUFFIXES: .a .$(OBJEXT) -- cgit v1.2.3 From c419daf4e13efc020401b3bcbbe8b6116bb3cdd7 Mon Sep 17 00:00:00 2001 From: Stefano Facchini Date: Wed, 18 Oct 2017 22:08:15 +0200 Subject: Drop obsolete wrapper around Glib::file_open_tmp --- src/ui/dialog/print.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 4d248fd09..532a8c364 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -26,7 +26,6 @@ #include "util/units.h" #include "helper/png-write.h" #include "svg/svg-color.h" -#include "io/sys.h" #include @@ -52,7 +51,7 @@ static void draw_page(GtkPrintOperation *, std::string tmp_base = "inkscape-print-png-XXXXXX"; int tmp_fd; - if ( (tmp_fd = Inkscape::IO::file_open_tmp (tmp_png, tmp_base)) >= 0) { + if ( (tmp_fd = Glib::file_open_tmp(tmp_png, tmp_base)) >= 0) { close(tmp_fd); guint32 bgcolor = 0x00000000; -- cgit v1.2.3 From 75444920325ba8a134eb16c4844f7fa15f34dd55 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Fri, 20 Oct 2017 22:59:35 +0200 Subject: Add preference to load additional fonts from 'fonts' directories - 'use_fontsdir_system' for /share/inkscape/fonts - 'use_fontsdir_user' for /inkscape/fonts in user config (both activated by default) --- src/ui/dialog/inkscape-preferences.cpp | 8 +++++++- src/ui/dialog/inkscape-preferences.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index d87a3d94a..5ceacd7b8 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -460,11 +460,17 @@ void InkscapePreferences::initPageTools() _page_text.add_group_header( _("Text units")); _font_unit_type.init( "/options/font/unitType", sizeLabels, sizeValues, G_N_ELEMENTS(sizeLabels), SP_CSS_UNIT_PT ); - _page_text.add_line( false, _("Text size unit type:"), _font_unit_type, "", + _page_text.add_line( true, _("Text size unit type:"), _font_unit_type, "", _("Set the type of unit used in the text toolbar and text dialogs"), false); _font_output_px.init ( _("Always output text size in pixels (px)"), "/options/font/textOutputPx", true); // _page_text.add_line( false, "", _font_output_px, "", _("Always convert the text size units above into pixels (px) before saving to file")); + _page_text.add_group_header( _("Font directories")); + _font_fontsdir_system.init( _("Use Inkscape's fonts directory"), "/options/font/use_fontsdir_system", true); + _page_text.add_line( true, "", _font_fontsdir_system, "", _("Load additional fonts from \"fonts\" directory located in Inkscape's global \"share\" directory")); + _font_fontsdir_user.init( _("Use user's fonts directory"), "/options/font/use_fontsdir_user", true); + _page_text.add_line( true, "", _font_fontsdir_user, "", _("Load additional fonts from \"fonts\" directory located in Inkscape's user configuration directory")); + this->AddNewObjectsStyle(_page_text, "/tools/text"); //Spray diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index e6ba4e4b2..38b622095 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -328,6 +328,8 @@ protected: UI::Widget::PrefCheckButton _font_dialog; UI::Widget::PrefCombo _font_unit_type; UI::Widget::PrefCheckButton _font_output_px; + UI::Widget::PrefCheckButton _font_fontsdir_system; + UI::Widget::PrefCheckButton _font_fontsdir_user; UI::Widget::PrefCheckButton _misc_comment; UI::Widget::PrefCheckButton _misc_default_metadata; -- cgit v1.2.3 From 2dc0f89864fded681d8ece1d077d6ff5c77bbe97 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sat, 21 Oct 2017 18:25:18 +0200 Subject: Add preference to load additional fonts from custom directories 'custom_fontdirs' is a list of paths to search for fonts --- src/ui/dialog/inkscape-preferences.cpp | 3 +++ src/ui/dialog/inkscape-preferences.h | 1 + 2 files changed, 4 insertions(+) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 5ceacd7b8..ae013a27b 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -470,6 +470,9 @@ void InkscapePreferences::initPageTools() _page_text.add_line( true, "", _font_fontsdir_system, "", _("Load additional fonts from \"fonts\" directory located in Inkscape's global \"share\" directory")); _font_fontsdir_user.init( _("Use user's fonts directory"), "/options/font/use_fontsdir_user", true); _page_text.add_line( true, "", _font_fontsdir_user, "", _("Load additional fonts from \"fonts\" directory located in Inkscape's user configuration directory")); + _font_fontdirs_custom.init("/options/font/custom_fontdirs", 50); + _page_text.add_line(true, _("Additional font directories"), _font_fontdirs_custom, "", _("Load additional fonts from custom locations (one path per line)"), true); + this->AddNewObjectsStyle(_page_text, "/tools/text"); diff --git a/src/ui/dialog/inkscape-preferences.h b/src/ui/dialog/inkscape-preferences.h index 38b622095..531533cee 100644 --- a/src/ui/dialog/inkscape-preferences.h +++ b/src/ui/dialog/inkscape-preferences.h @@ -330,6 +330,7 @@ protected: UI::Widget::PrefCheckButton _font_output_px; UI::Widget::PrefCheckButton _font_fontsdir_system; UI::Widget::PrefCheckButton _font_fontsdir_user; + UI::Widget::PrefMultiEntry _font_fontdirs_custom; UI::Widget::PrefCheckButton _misc_comment; UI::Widget::PrefCheckButton _misc_default_metadata; -- cgit v1.2.3 From e6919ea013dc0c926e049a1e7b1188829060baac Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 22 Oct 2017 17:21:09 +0200 Subject: Preferences: Simplify code from 9f2c9d85b73ff773e6181d700678f28757714992 --- src/ui/dialog/inkscape-preferences.cpp | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index ae013a27b..bd4f5c75e 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1930,12 +1930,7 @@ void InkscapePreferences::initPageSpellcheck() 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"; } @@ -2000,22 +1995,12 @@ void InkscapePreferences::initPageSystem() _sys_systemdata_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); _page_system.add_line(true, _("System data: "), _sys_systemdata_scroll, "", _("Locations of system data"), true); - { - tmp = ""; - gchar** paths = 0; - gint count = 0; - gtk_icon_theme_get_search_path(gtk_icon_theme_get_default(), &paths, &count); - if (count > 0) { - tmp += paths[0]; - tmp += "\n"; - for (int i = 1; i < count; i++) { - tmp += " "; - tmp += paths[i]; - tmp += "\n"; - } - } - } - + tmp = ""; + gchar** paths = 0; + gint count = 0; + gtk_icon_theme_get_search_path(gtk_icon_theme_get_default(), &paths, &count); + appendList( tmp, paths ); + g_strfreev(paths); _sys_icon.get_buffer()->insert(_sys_icon.get_buffer()->end(), tmp); } _sys_icon.set_editable(false); -- cgit v1.2.3 From 8059f2c4d9751a531a1b672699508ccd2cc3c53b Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 22 Oct 2017 17:21:38 +0200 Subject: Preferences: Minor consistency fixes for UI --- src/ui/dialog/inkscape-preferences.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index bd4f5c75e..351eb0845 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1991,9 +1991,10 @@ void InkscapePreferences::initPageSystem() _sys_systemdata.get_buffer()->insert(_sys_systemdata.get_buffer()->end(), tmp); _sys_systemdata.set_editable(false); _sys_systemdata_scroll.add(_sys_systemdata); - _sys_systemdata_scroll.set_size_request(0, 80); + _sys_systemdata_scroll.set_size_request(100, 80); _sys_systemdata_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - _page_system.add_line(true, _("System data: "), _sys_systemdata_scroll, "", _("Locations of system data"), true); + _sys_systemdata_scroll.set_shadow_type(Gtk::SHADOW_IN); + _page_system.add_line(true, _("System data: "), _sys_systemdata_scroll, "", _("Locations of system data"), true); tmp = ""; gchar** paths = 0; @@ -2005,8 +2006,9 @@ void InkscapePreferences::initPageSystem() } _sys_icon.set_editable(false); _sys_icon_scroll.add(_sys_icon); - _sys_icon_scroll.set_size_request(0, 80); + _sys_icon_scroll.set_size_request(100, 80); _sys_icon_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + _sys_icon_scroll.set_shadow_type(Gtk::SHADOW_IN); _page_system.add_line(true, _("Icon theme: "), _sys_icon_scroll, "", _("Locations of icon themes"), true); this->AddPage(_page_system, _("System"), PREFS_PAGE_SYSTEM); -- cgit v1.2.3 From f63768018051ac3213df44bb086aea1024df070a Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 22 Oct 2017 17:25:13 +0200 Subject: Preferences: cleanup --- src/ui/dialog/inkscape-preferences.cpp | 97 ++++++++++++++++------------------ 1 file changed, 46 insertions(+), 51 deletions(-) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index 351eb0845..09ba06720 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -1946,64 +1946,59 @@ void InkscapePreferences::initPageSystem() _page_system.add_line( false, "", _misc_namedicon_delay, "", _("When on, named icons will be rendered before displaying the ui. This is for working around bugs in GTK+ named icon notification"), true); + Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - { - // TRANSLATORS: following strings are paths in Inkscape preferences - Misc - System info - - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - - _page_system.add_group_header( _("System info")); + _page_system.add_group_header( _("System info")); - _sys_user_config.set_text((char const *)Inkscape::IO::Resource::profile_path("")); - _sys_user_config.set_editable(false); - _page_system.add_line(true, _("User config: "), _sys_user_config, "", _("Location of users configuration"), true); + _sys_user_config.set_text((char const *)Inkscape::IO::Resource::profile_path("")); + _sys_user_config.set_editable(false); + _page_system.add_line(true, _("User config: "), _sys_user_config, "", _("Location of users configuration"), true); - _sys_user_prefs.set_text(prefs->getPrefsFilename()); - _sys_user_prefs.set_editable(false); - _page_system.add_line(true, _("User preferences: "), _sys_user_prefs, "", _("Location of the users preferences file"), true); + _sys_user_prefs.set_text(prefs->getPrefsFilename()); + _sys_user_prefs.set_editable(false); + _page_system.add_line(true, _("User preferences: "), _sys_user_prefs, "", _("Location of the users preferences file"), true); - _sys_user_extension_dir.set_text((char const *)IO::Resource::get_path(IO::Resource::USER, IO::Resource::EXTENSIONS, "")); - _sys_user_extension_dir.set_editable(false); - _page_system.add_line(true, _("User extensions: "), _sys_user_extension_dir, "", _("Location of the users extensions"), true); + _sys_user_extension_dir.set_text((char const *)IO::Resource::get_path(IO::Resource::USER, IO::Resource::EXTENSIONS, "")); + _sys_user_extension_dir.set_editable(false); + _page_system.add_line(true, _("User extensions: "), _sys_user_extension_dir, "", _("Location of the users extensions"), true); - _sys_user_cache.set_text(g_get_user_cache_dir()); - _sys_user_cache.set_editable(false); - _page_system.add_line(true, _("User cache: "), _sys_user_cache, "", _("Location of users cache"), true); + _sys_user_cache.set_text(g_get_user_cache_dir()); + _sys_user_cache.set_editable(false); + _page_system.add_line(true, _("User cache: "), _sys_user_cache, "", _("Location of users cache"), true); - Glib::ustring tmp_dir = prefs->getString("/options/autosave/path"); - if (tmp_dir.empty()) { - tmp_dir = Glib::get_tmp_dir(); - } - _sys_tmp_files.set_text(tmp_dir); - _sys_tmp_files.set_editable(false); - _page_system.add_line(true, _("Temporary files: "), _sys_tmp_files, "", _("Location of the temporary files used for autosave"), true); - - _sys_data.set_text( INKSCAPE_DATADIR ); - _sys_data.set_editable(false); - _page_system.add_line(true, _("Inkscape data: "), _sys_data, "", _("Location of Inkscape data"), true); - - _sys_extension_dir.set_text(INKSCAPE_EXTENSIONDIR); - _sys_extension_dir.set_editable(false); - _page_system.add_line(true, _("Inkscape extensions: "), _sys_extension_dir, "", _("Location of the Inkscape extensions"), true); - - Glib::ustring tmp; - appendList( tmp, g_get_system_data_dirs() ); - _sys_systemdata.get_buffer()->insert(_sys_systemdata.get_buffer()->end(), tmp); - _sys_systemdata.set_editable(false); - _sys_systemdata_scroll.add(_sys_systemdata); - _sys_systemdata_scroll.set_size_request(100, 80); - _sys_systemdata_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); - _sys_systemdata_scroll.set_shadow_type(Gtk::SHADOW_IN); - _page_system.add_line(true, _("System data: "), _sys_systemdata_scroll, "", _("Locations of system data"), true); - - tmp = ""; - gchar** paths = 0; - gint count = 0; - gtk_icon_theme_get_search_path(gtk_icon_theme_get_default(), &paths, &count); - appendList( tmp, paths ); - g_strfreev(paths); - _sys_icon.get_buffer()->insert(_sys_icon.get_buffer()->end(), tmp); + Glib::ustring tmp_dir = prefs->getString("/options/autosave/path"); + if (tmp_dir.empty()) { + tmp_dir = Glib::get_tmp_dir(); } + _sys_tmp_files.set_text(tmp_dir); + _sys_tmp_files.set_editable(false); + _page_system.add_line(true, _("Temporary files: "), _sys_tmp_files, "", _("Location of the temporary files used for autosave"), true); + + _sys_data.set_text( INKSCAPE_DATADIR ); + _sys_data.set_editable(false); + _page_system.add_line(true, _("Inkscape data: "), _sys_data, "", _("Location of Inkscape data"), true); + + _sys_extension_dir.set_text(INKSCAPE_EXTENSIONDIR); + _sys_extension_dir.set_editable(false); + _page_system.add_line(true, _("Inkscape extensions: "), _sys_extension_dir, "", _("Location of the Inkscape extensions"), true); + + Glib::ustring tmp; + appendList( tmp, g_get_system_data_dirs() ); + _sys_systemdata.get_buffer()->insert(_sys_systemdata.get_buffer()->end(), tmp); + _sys_systemdata.set_editable(false); + _sys_systemdata_scroll.add(_sys_systemdata); + _sys_systemdata_scroll.set_size_request(100, 80); + _sys_systemdata_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + _sys_systemdata_scroll.set_shadow_type(Gtk::SHADOW_IN); + _page_system.add_line(true, _("System data: "), _sys_systemdata_scroll, "", _("Locations of system data"), true); + + tmp = ""; + gchar** paths = 0; + gint count = 0; + gtk_icon_theme_get_search_path(gtk_icon_theme_get_default(), &paths, &count); + appendList( tmp, paths ); + g_strfreev(paths); + _sys_icon.get_buffer()->insert(_sys_icon.get_buffer()->end(), tmp); _sys_icon.set_editable(false); _sys_icon_scroll.add(_sys_icon); _sys_icon_scroll.set_size_request(100, 80); -- cgit v1.2.3 From a00c71b8589567f01ae95ee7a1c8263f97126be9 Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Fri, 27 Oct 2017 10:51:47 +0200 Subject: Enable reopening of Prototype dialog on startup. --- src/ui/dialog/prototype.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/ui/dialog') diff --git a/src/ui/dialog/prototype.cpp b/src/ui/dialog/prototype.cpp index b3bf60aab..b7c9f7abf 100644 --- a/src/ui/dialog/prototype.cpp +++ b/src/ui/dialog/prototype.cpp @@ -22,6 +22,8 @@ namespace Inkscape { namespace UI { namespace Dialog { +// Note that in order for a dialog to be restored, it must be listed in SPDesktop::show_dialogs(). + Prototype::Prototype() : // UI::Widget::Panel("Prototype Label", "/dialogs/prototype", SP_VERB_DIALOG_PROTOTYPE, // "Prototype Apply Label", true), -- cgit v1.2.3