diff options
| author | Ted Gould <ted@gould.cx> | 2006-03-29 05:42:22 +0000 |
|---|---|---|
| committer | gouldtj <gouldtj@users.sourceforge.net> | 2006-03-29 05:42:22 +0000 |
| commit | 48543cb2cb7f440c9a36ac6d66ebd00053e7f657 (patch) | |
| tree | 347e0575404d3423b68072253edddae328bae831 /src/ui/dialog/extension-editor.cpp | |
| parent | r10986@tres: ted | 2006-02-27 21:19:52 -0800 (diff) | |
| download | inkscape-48543cb2cb7f440c9a36ac6d66ebd00053e7f657.tar.gz inkscape-48543cb2cb7f440c9a36ac6d66ebd00053e7f657.zip | |
r10987@tres: ted | 2006-02-28 01:06:37 -0800
The leg bone is connected to the knee bone
The extension bone is connected to the extension-editor bone
(bzr r351)
Diffstat (limited to 'src/ui/dialog/extension-editor.cpp')
| -rw-r--r-- | src/ui/dialog/extension-editor.cpp | 65 |
1 files changed, 59 insertions, 6 deletions
diff --git a/src/ui/dialog/extension-editor.cpp b/src/ui/dialog/extension-editor.cpp index 7cbde9e1f..ed9d020c7 100644 --- a/src/ui/dialog/extension-editor.cpp +++ b/src/ui/dialog/extension-editor.cpp @@ -24,6 +24,7 @@ #include "extension-editor.h" #include "verbs.h" #include "prefs-utils.h" +#include "interface.h" #include "extension/extension.h" #include "extension/db.h" @@ -44,6 +45,9 @@ namespace Dialog { ExtensionEditor::ExtensionEditor() : Dialog ("dialogs.extensioneditor", SP_VERB_DIALOG_EXTENSIONEDITOR) { + _notebook_info.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + _notebook_help.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); + _notebook_params.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC); //Main HBox Gtk::HBox* hbox_list_page = Gtk::manage(new Gtk::HBox()); @@ -125,14 +129,61 @@ ExtensionEditor::on_pagelist_selection_changed (void) Glib::RefPtr<Gtk::TreeSelection> selection = _page_list.get_selection(); Gtk::TreeModel::iterator iter = selection->get_selected(); if (iter) { - // _page_frame.remove(); + /* Get the row info */ Gtk::TreeModel::Row row = *iter; - // _current_page = row[_page_list_columns._col_page]; - // _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]; + Glib::ustring name = row[_page_list_columns._col_name]; + + /* Set the selection in the preferences */ prefs_set_string_attribute("dialogs.extensioneditor", "selected-extension", id.c_str()); + + /* Adjust the dialog's title */ + gchar title[500]; + sp_ui_dialog_title_string (Inkscape::Verb::get(SP_VERB_DIALOG_EXTENSIONEDITOR), title); + Glib::ustring utitle(title); + set_title(utitle + ": " + name); + + /* Clear the notbook pages */ + _notebook_info.remove(); + _notebook_help.remove(); + _notebook_params.remove(); + + /* Make sure we have all the widges */ + Gtk::Widget * info; + info = row[_page_list_columns._col_info]; + if (info == NULL) { + info = Inkscape::Extension::db.get(id.c_str())->get_info_widget(); + row[_page_list_columns._col_info] = info; + //info->ref(); + } + + Gtk::Widget * help; + help = row[_page_list_columns._col_help]; + if (help == NULL) { + help = Inkscape::Extension::db.get(id.c_str())->get_help_widget(); + row[_page_list_columns._col_help] = help; + //help->ref(); + } + + Gtk::Widget * params; + params = row[_page_list_columns._col_params]; + if (params == NULL) { + params = Inkscape::Extension::db.get(id.c_str())->get_params_widget(); + row[_page_list_columns._col_params] = params; + //params->ref(); + } + + /* Place them in the pages */ + if (info != NULL) { + _notebook_info.add(*info); + } + if (help != NULL) { + _notebook_help.add(*help); + } + if (params != NULL) { + _notebook_params.add(*params); + } + } return; @@ -174,7 +225,9 @@ ExtensionEditor::add_extension (Inkscape::Extension::Extension * ext) Gtk::TreeModel::Row row = *iter; row[_page_list_columns._col_name] = ext->get_name(); row[_page_list_columns._col_id] = ext->get_id(); - row[_page_list_columns._col_page] = NULL; + row[_page_list_columns._col_info] = NULL; + row[_page_list_columns._col_help] = NULL; + row[_page_list_columns._col_params] = NULL; return iter; } |
