55
55
static ParamNotebookPage * makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext);
57
57
ParamNotebookPage(const gchar * name,
58
const gchar * guitext,
60
const Parameter::_scope_t scope,
62
const gchar * gui_tip,
59
const gchar * description,
63
61
Inkscape::Extension::Extension * ext,
64
62
Inkscape::XML::Node * xml);
65
63
~ParamNotebookPage(void);
67
65
Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
68
66
void paramString (std::list <std::string> &list);
69
gchar * get_guitext (void) {return _text;};
67
gchar * get_text (void) {return _text;};
70
68
Parameter * get_param (const gchar * name);
71
69
}; /* class ParamNotebookPage */
74
72
ParamNotebookPage::ParamNotebookPage(const gchar * name,
75
const gchar * guitext,
77
const Parameter::_scope_t scope,
79
const gchar * gui_tip,
74
const gchar * description,
80
76
Inkscape::Extension::Extension * ext,
81
77
Inkscape::XML::Node * xml)
82
: Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, /*indent*/ 0, ext)
78
: Parameter(name, text, description, hidden, /*indent*/ 0, ext)
151
147
ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext)
153
149
const char * name;
154
const char * guitext;
156
const char * scope_str;
157
Parameter::_scope_t scope = Parameter::SCOPE_USER;
158
bool gui_hidden = false;
159
const char * gui_hide;
160
const char * gui_tip;
151
const char * description;
162
155
name = in_repr->attribute("name");
163
guitext = in_repr->attribute("gui-text");
165
guitext = in_repr->attribute("_gui-text");
166
gui_tip = in_repr->attribute("gui-tip");
168
gui_tip = in_repr->attribute("_gui-tip");
169
desc = in_repr->attribute("gui-description");
171
desc = in_repr->attribute("_gui-description");
172
scope_str = in_repr->attribute("scope");
173
gui_hide = in_repr->attribute("gui-hidden");
174
if (gui_hide != NULL) {
175
if (strcmp(gui_hide, "1") == 0 ||
176
strcmp(gui_hide, "true") == 0) {
156
text = in_repr->attribute("gui-text");
158
text = in_repr->attribute("_gui-text");
159
description = in_repr->attribute("gui-description");
160
if (description == NULL)
161
description = in_repr->attribute("_gui-description");
162
hide = in_repr->attribute("gui-hidden");
164
if (strcmp(hide, "1") == 0 ||
165
strcmp(hide, "true") == 0) {
179
168
/* else stays false */
187
if (scope_str != NULL) {
188
if (!strcmp(scope_str, "user")) {
189
scope = Parameter::SCOPE_USER;
190
} else if (!strcmp(scope_str, "document")) {
191
scope = Parameter::SCOPE_DOCUMENT;
192
} else if (!strcmp(scope_str, "node")) {
193
scope = Parameter::SCOPE_NODE;
197
ParamNotebookPage * page = new ParamNotebookPage(name, guitext, desc, scope, gui_hidden, gui_tip, in_ext, in_repr);
176
ParamNotebookPage * page = new ParamNotebookPage(name, text, description, hidden, in_ext, in_repr);
199
178
/* Note: page could equal NULL */
233
212
gchar const * tip = param->get_tooltip();
235
widg->set_tooltip_text(_(tip));
214
widg->set_tooltip_text(tip);
237
216
widg->set_tooltip_text("");
238
217
widg->set_has_tooltip(false);
249
228
ParamNotebook::ParamNotebook(const gchar * name,
250
const gchar * guitext,
252
const Parameter::_scope_t scope,
254
const gchar * gui_tip,
230
const gchar * description,
256
233
Inkscape::Extension::Extension * ext,
257
234
Inkscape::XML::Node * xml)
258
: Parameter(name, guitext, desc, scope, gui_hidden, gui_tip, indent, ext)
235
: Parameter(name, text, description, hidden, indent, ext)
460
437
ParamNotebookPage * page = reinterpret_cast<ParamNotebookPage *>(list->data);
461
438
Gtk::Widget * widg = page->get_widget(doc, node, changeSignal);
462
nb->append_page(*widg, _(page->get_guitext()));
439
nb->append_page(*widg, _(page->get_text()));
463
440
if (!strcmp(_value, page->name())) {
464
441
pagenr = i; // this is the page to be displayed?