View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001629 | Scribus | Scripter | public | 2005-02-03 09:14 | 2014-06-05 21:39 |
Reporter | sjc | Assigned To | cbradney | ||
Priority | low | Severity | feature | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | 1.3.1cvs | ||||
Summary | 0001629: A need to run menu items from the scriptor for automation purposes | ||||
Description | When writing scripts it is currently not possible to access any of the items available from the menus. This would be a desirable feature for automation purposes. | ||||
Additional Information | Possibly include a "macro recorder" too that could automatically record a set of user actions and build a basic script for the user to edit further or use. Consider how any of this be handled when menu text can be in different languages. The menu items would be tricky to call by name if the menu names cannot always be guaranteed to be consistent, unless the underlying menu functions had their own scriptor name. Otherwise we would end up with scripts that would only run in their originating language. | ||||
Tags | No tags attached. | ||||
Patch | |||||
child of | 0003813 | acknowledged | Metabug: Scripter |
|
This should be reasonably easy to do using Craig Bradney's QAction conversion work. Never say easy until it's done ... I know, I know. Language will not be an issue, as the internal QAction name will be used not its translated name. I'm pretty sure functions could be provided to discover the available actions, what menus they're in, etc. Macro recording is in my opinion a separate issue and I don't intend to address it here. Something like that could be built on Tsoots undo framework, and I think there may already be plans in that direction. |
|
also see bug 0001630: A macro recorder to build a script automatically from users actions |
|
In theory, you should be able to do something like: qt.qApp.mainWidget().queryList("QObject", "fileSaveAs")[0] from PyQt. In reality, this returns a QObject (rather than the QAction it should, given that QAction is the lowest known base class of ScrAction) which is essentially useless, since you can't dynamic_cast it. It's possible to trigger the action, but you must do it by building an object, connecting a slot on the returned QObject to a signal on your temporary object, then firing that signal. Tedious, huh? That said, with Craig Bradney's work on actions it should be possible to trigger any action from the scripter using a little bit of C++ code. I'm not sure how useful this is without the ability to move the mouse (or trigger fake events) etc though. |
|
Actually with newer PyQt/sip-snapshots (starting from july) casting objects works as expected. Now you can do action = qt.qApp.mainWidget().queryList("QAction", "helpAboutScribus")[0] action.activate() It works really great. |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-02-03 09:14 | sjc | New Issue | |
2005-02-03 10:58 |
|
Status | new => assigned |
2005-02-03 10:58 |
|
Assigned To | => ringerc |
2005-02-03 11:07 |
|
Note Added: 0003599 | |
2005-02-03 11:57 | sjc | Note Added: 0003600 | |
2005-04-08 01:58 |
|
Priority | normal => low |
2005-04-08 01:58 |
|
Product Version | => 1.3.0cvs |
2005-07-05 15:27 |
|
Note Added: 0005398 | |
2005-07-05 19:04 | h_a_j_s | Note Added: 0005400 | |
2005-07-10 02:40 |
|
Product Version | 1.3.0cvs => 1.3.1cvs |
2006-05-13 21:33 | christoph_s | Relationship added | child of 0003813 |
2008-03-14 06:59 |
|
Assigned To | ringerc => |
2008-03-14 06:59 |
|
Status | assigned => acknowledged |
2014-06-05 21:39 | cbradney | Status | acknowledged => closed |
2014-06-05 21:39 | cbradney | Assigned To | => cbradney |
2014-06-05 21:39 | cbradney | Resolution | open => no change required |