View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015889 | Scribus | Scripter | public | 2019-10-30 13:35 | 2019-11-09 10:30 |
Reporter | ale | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Product Version | 1.5.6.svn | ||||
Summary | 0015889: Scripter: allow insertText, loadImage & co to act on items in a group | ||||
Description | from the gui we can act on item that are part of a group... this should also be possible from a scripter. | ||||
Tags | No tags attached. | ||||
Patch | No | ||||
|
i had a look at it but had stop... attached a partial patch for later use. scriter-group-items-partial.diff (1,082 bytes)
diff --git a/scribus/plugins/scriptplugin/cmdutil.cpp b/scribus/plugins/scriptplugin/cmdutil.cpp index a78521a56..984110f8e 100644 --- a/scribus/plugins/scriptplugin/cmdutil.cpp +++ b/scribus/plugins/scriptplugin/cmdutil.cpp @@ -120,13 +120,23 @@ PageItem* getPageItemByName(const QString& name) } for (int i = 0; i<ScCore->primaryMainWindow()->doc->Items->count(); i++) { - if (name==ScCore->primaryMainWindow()->doc->Items->at(i)->itemName()) - return ScCore->primaryMainWindow()->doc->Items->at(i); + auto item = ScCore->primaryMainWindow()->doc->Items->at(i) + if (name == item->itemName()) + return item; + else if (item->isGroup()) + return getPageItemInGroupByName(static_cast<PageItem_Group*>(item), name) } // for items PyErr_SetString(NoValidObjectError, QString("Object not found").toLocal8Bit().constData()); return nullptr; } +// private +PageItem* getPageItemInGroupByName(PageItem_Group* item, const QString& name) +{ + // TODO: implement this + return nullptr; +} + /*! * Checks to see if a pageItem named 'name' exists and return true |