X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fui%2Fdialog%2Fextension-editor.cpp;h=3a62cb14481b317edda67427a18685b570c273f0;hb=11a7559367dd1824198fe3b75e6d6ceb208ea1b7;hp=d642805c18f5a132bd001676b146b3c04bc8b83c;hpb=663e35ea00a2d338983732808b5e043124f093cc;p=inkscape.git diff --git a/src/ui/dialog/extension-editor.cpp b/src/ui/dialog/extension-editor.cpp index d642805c1..3a62cb144 100644 --- a/src/ui/dialog/extension-editor.cpp +++ b/src/ui/dialog/extension-editor.cpp @@ -42,8 +42,8 @@ namespace Dialog { about the selected extension. A handler is set up so that when a new extension is selected, the notebooks are changed appropriately. */ -ExtensionEditor::ExtensionEditor() - : Dialog ("dialogs.extensioneditor", SP_VERB_DIALOG_EXTENSIONEDITOR) +ExtensionEditor::ExtensionEditor(Behavior::BehaviorFactory behavior_factory) + : Dialog (behavior_factory, "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); @@ -148,35 +148,17 @@ ExtensionEditor::on_pagelist_selection_changed (void) _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->reference(); - } else { - info->unparent(); - } + Inkscape::Extension::Extension * ext = Inkscape::Extension::db.get(id.c_str()); - 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->reference(); - } else { - help->unparent(); - } - - 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->reference(); - } else { - params->unparent(); + /* Make sure we have all the widges */ + Gtk::Widget * info = NULL; + Gtk::Widget * help = NULL; + Gtk::Widget * params = NULL; + + if (ext != NULL) { + info = ext->get_info_widget(); + help = ext->get_help_widget(); + params = ext->get_params_widget(); } /* Place them in the pages */ @@ -209,7 +191,7 @@ ExtensionEditor::on_pagelist_selection_changed (void) void ExtensionEditor::dbfunc (Inkscape::Extension::Extension * in_plug, gpointer in_data) { - ExtensionEditor * ee = reinterpret_cast(in_data); + ExtensionEditor * ee = static_cast(in_data); ee->add_extension(in_plug); return; } @@ -231,9 +213,6 @@ 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_info] = NULL; - row[_page_list_columns._col_help] = NULL; - row[_page_list_columns._col_params] = NULL; return iter; }