Code

Hide the Image filter effect primitive from the filter effects dialog. Files containi...
authornicholasbishop <nicholasbishop@users.sourceforge.net>
Thu, 17 Jan 2008 19:26:04 +0000 (19:26 +0000)
committernicholasbishop <nicholasbishop@users.sourceforge.net>
Thu, 17 Jan 2008 19:26:04 +0000 (19:26 +0000)
src/ui/dialog/filter-effects-dialog.cpp
src/ui/widget/combo-enums.h

index 2073a3ea43105ef97afd8f6fe9288e07003f9d57..d5e1181375094aa9d2834feacc7b50eebd0f8b2d 100644 (file)
@@ -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);
index 405e82e04d7ef468cbd2079bcfebeb5f62bfa534..c77c2f5a89a80090cc9e8fd57b2df9e0735665d1 100644 (file)
@@ -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<E>* 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();