Mantis Issue Tracking for Scribus
· Hosting provided by Anduin.net / Øverby Consulting ·

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001629ScribusScripterpublic05-Feb-03 10:1414-Jun-05 23:39
Reportersjc 
Assigned Tocbradney 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product Version1.3.1cvs 
Target VersionFixed in Version 
Summary0001629: A need to run menu items from the scriptor for automation purposes
DescriptionWhen 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 InformationPossibly 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.

TagsNo tags attached.
Attached Files

- Relationships
child of 0003813acknowledged Metabug: Scripter 

-  Notes
(0003599)
ringerc (administrator)
05-Feb-03 12:07

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.
(0003600)
sjc (developer)
05-Feb-03 12:57

also see bug 0001630: A macro recorder to build a script automatically from users actions
(0005398)
ringerc (administrator)
05-Jul-05 17:27

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.
(0005400)
h_a_j_s (developer)
05-Jul-05 21:04

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.

- Issue History
Date Modified Username Field Change
05-Feb-03 10:14 sjc New Issue
05-Feb-03 11:58 ringerc Status new => assigned
05-Feb-03 11:58 ringerc Assigned To => ringerc
05-Feb-03 12:07 ringerc Note Added: 0003599
05-Feb-03 12:57 sjc Note Added: 0003600
05-Apr-08 03:58 ringerc Priority normal => low
05-Apr-08 03:58 ringerc Product Version => 1.3.0cvs
05-Jul-05 17:27 ringerc Note Added: 0005398
05-Jul-05 21:04 h_a_j_s Note Added: 0005400
05-Jul-10 04:40 ringerc Product Version 1.3.0cvs => 1.3.1cvs
06-May-13 23:33 christoph_s Relationship added child of 0003813
08-Mar-14 07:59 ringerc Assigned To ringerc =>
08-Mar-14 07:59 ringerc Status assigned => acknowledged
14-Jun-05 23:39 cbradney Status acknowledged => closed
14-Jun-05 23:39 cbradney Assigned To => cbradney
14-Jun-05 23:39 cbradney Resolution open => no change required



Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker