index 7cbde9e1fd92a2b7f9aa2403c82c58102894ae43..d26e05f0795b00f1938c467250fc8bc84b9072b2 100644 (file)
#include "extension-editor.h"
#include "verbs.h"
#include "prefs-utils.h"
+#include "interface.h"
#include "extension/extension.h"
#include "extension/db.h"
a new extension is selected, the notebooks are changed appropriately.
*/
ExtensionEditor::ExtensionEditor()
- : Dialog ("dialogs.extensioneditor", SP_VERB_DIALOG_EXTENSIONEDITOR)
+ : UI::Widget::Panel ("", "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());
hbox_list_page->set_border_width(12);
hbox_list_page->set_spacing(12);
- this->get_vbox()->add(*hbox_list_page);
+ _getContents()->add(*hbox_list_page);
//Pagelist
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();
+
+ Inkscape::Extension::Extension * ext = Inkscape::Extension::db.get(id.c_str());
+
+ /* 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 */
+ if (info != NULL) {
+ _notebook_info.add(*info);
+ }
+ if (help != NULL) {
+ _notebook_help.add(*help);
+ }
+ if (params != NULL) {
+ _notebook_params.add(*params);
+ }
+
}
return;
void
ExtensionEditor::dbfunc (Inkscape::Extension::Extension * in_plug, gpointer in_data)
{
- ExtensionEditor * ee = reinterpret_cast<ExtensionEditor *>(in_data);
+ ExtensionEditor * ee = static_cast<ExtensionEditor *>(in_data);
ee->add_extension(in_plug);
return;
}
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;
return iter;
}