summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c213f5d)
raw | patch | inline | side by side (parent: c213f5d)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Wed, 29 Mar 2006 05:41:48 +0000 (05:41 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Wed, 29 Mar 2006 05:41:48 +0000 (05:41 +0000) |
Allowing for a default selected extension. This will then adjust
everytime a new one is selected.
everytime a new one is selected.
src/ui/dialog/extension-editor.cpp | patch | blob | history | |
src/ui/dialog/extension-editor.h | patch | blob | history |
index fdb203d8af4eff93a139640392506b383dbc2829..e20ac4592f496416bfff8c4c228e90c5f094abea 100644 (file)
Inkscape::Extension::db.foreach(dbfunc, this);
- _page_list_model->foreach_iter(sigc::mem_fun(*this, &ExtensionEditor::defaultExtension));
+ gchar const * defaultext = prefs_get_string_attribute("dialogs.extensioneditor", "selected-extension");
+ if (defaultext == NULL) defaultext = "org.inkscape.input.svg";
+ this->setExtension(defaultext);
show_all_children();
}
{
}
+void
+ExtensionEditor::setExtension(Glib::ustring extension_id) {
+ _selection_search = extension_id;
+ _page_list_model->foreach_iter(sigc::mem_fun(*this, &ExtensionEditor::setExtensionIter));
+ return;
+}
+
bool
-ExtensionEditor::defaultExtension(const Gtk::TreeModel::iterator &iter)
+ExtensionEditor::setExtensionIter(const Gtk::TreeModel::iterator &iter)
{
- Glib::ustring desired = "org.inkscape.input.svg";
Gtk::TreeModel::Row row = *iter;
- if (row[_page_list_columns._col_id] == desired) {
+ if (row[_page_list_columns._col_id] == _selection_search) {
_page_list.get_selection()->select(iter);
return true;
}
_page_frame.remove();
Gtk::TreeModel::Row row = *iter;
// _current_page = row[_page_list_columns._col_page];
- // prefs_set_string_attribute("dialogs.extensioneditor", "selected", row[_page_list_columns._col_id].c_str());
_page_title.set_markup("<span size='large'><b>" + row[_page_list_columns._col_name] + "</b></span>");
// _page_frame.add(*_current_page);
// _current_page->show();
+ Glib::ustring id = row[_page_list_columns._col_id];
+ prefs_set_string_attribute("dialogs.extensioneditor", "selected-extension", id.c_str());
}
return;
index 0a182958cec26c354fa4c17a3cb974657acb3f76..aebe35049ebe0e58c1561390abc03e3adc98e947 100644 (file)
Gtk::TreeModel::Path _path_shapes;
private:
+ Glib::ustring _selection_search;
+
ExtensionEditor(ExtensionEditor const &d);
ExtensionEditor& operator=(ExtensionEditor const &d);
void on_pagelist_selection_changed(void);
static void dbfunc (Inkscape::Extension::Extension * in_plug, gpointer in_data);
Gtk::TreeModel::iterator add_extension (Inkscape::Extension::Extension * ext);
- bool defaultExtension(const Gtk::TreeModel::iterator &iter);
+ bool setExtensionIter(const Gtk::TreeModel::iterator &iter);
+public:
+ void setExtension(Glib::ustring extension_id);
};
} // namespace Dialog