From a58cc7dd1d1a3d51450085cb3674864c0bc1d609 Mon Sep 17 00:00:00 2001 From: nicholasbishop Date: Thu, 17 Jan 2008 19:26:04 +0000 Subject: [PATCH] Hide the Image filter effect primitive from the filter effects dialog. Files containing that filter will still show the filter in the dialog, but the settings area warns that the filter is not yet implemented in Inkscape. --- src/ui/dialog/filter-effects-dialog.cpp | 12 ++++++++++++ src/ui/widget/combo-enums.h | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 2073a3ea4..d5e118137 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -597,6 +597,13 @@ public: _current_type = t; } + void add_notimplemented() + { + Gtk::Label* lbl = Gtk::manage(new Gtk::Label("This SVG filter effect is not yet implemented in Inkscape.")); + + add_widget(lbl, ""); + } + // LightSource LightSourceControl* add_lightsource(); @@ -1874,6 +1881,8 @@ FilterEffectsDialog::FilterEffectsDialog() NR_FILTER_ENDPRIMITIVETYPE); _sizegroup = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL); _sizegroup->set_ignore_hidden(); + + _add_primitive_type.remove_row(NR_FILTER_IMAGE); // Initialize widget hierarchy Gtk::HPaned* hpaned = Gtk::manage(new Gtk::HPaned); @@ -1993,6 +2002,9 @@ void FilterEffectsDialog::init_settings_widgets() _settings->add_combo(SP_ATTR_OPERATOR, _("Operator"), MorphologyOperatorConverter); _settings->add_dualspinslider(SP_ATTR_RADIUS, _("Radius"), 0, 100, 1, 0.01, 1); + _settings->type(NR_FILTER_IMAGE); + _settings->add_notimplemented(); + _settings->type(NR_FILTER_OFFSET); _settings->add_spinslider(SP_ATTR_DX, _("Delta X"), -100, 100, 1, 0.01, 1); _settings->add_spinslider(SP_ATTR_DY, _("Delta Y"), -100, 100, 1, 0.01, 1); diff --git a/src/ui/widget/combo-enums.h b/src/ui/widget/combo-enums.h index 405e82e04..c77c2f5a8 100644 --- a/src/ui/widget/combo-enums.h +++ b/src/ui/widget/combo-enums.h @@ -77,6 +77,20 @@ public: row[_columns.label] = s; } + void remove_row(E id) { + Gtk::TreeModel::iterator i; + + for(i = _model->children().begin(); i != _model->children().end(); ++i) { + const Util::EnumData* data = (*i)[_columns.data]; + + if(data->id == id) + break; + } + + if(i != _model->children().end()) + _model->erase(i); + } + void set_active_by_id(E id) { setProgrammatically = true; for(Gtk::TreeModel::iterator i = _model->children().begin(); -- 2.30.2