Rev 2622 | Rev 3216 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1718 | craig | 1 | #ifndef SCRIPTERCORE_H |
2 | #define SCRIPTERCORE_H |
||
1467 | cbradney | 3 | |
4 | #include "cmdvar.h" |
||
5 | |||
1718 | craig | 6 | #include "qmap.h" |
7 | #include "qguardedptr.h" |
||
1467 | cbradney | 8 | |
1718 | craig | 9 | #include "menumanager.h" |
10 | #include "pconsole.h" |
||
11 | |||
12 | class ScrAction; |
||
13 | class MenuManager; |
||
14 | |||
2503 | subik | 15 | |
1467 | cbradney | 16 | class ScripterCore : public QObject |
17 | { |
||
1718 | craig | 18 | Q_OBJECT |
1467 | cbradney | 19 | |
20 | public: |
||
1718 | craig | 21 | ScripterCore(QWidget* parent); |
22 | ~ScripterCore(); |
||
23 | |||
1467 | cbradney | 24 | public slots: |
2622 | craig | 25 | void runScriptDialog(); |
1718 | craig | 26 | void StdScript(QString filebasename); |
27 | void RecentScript(QString fn); |
||
1752 | craig | 28 | void slotRunScriptFile(QString fileName, bool inMainInterpreter = false); |
1718 | craig | 29 | QString slotRunScript(QString Script); |
30 | void slotInteractiveScript(bool); |
||
31 | void slotExecute(); |
||
32 | void aboutScript(); |
||
2706 | craig | 33 | /** Does setup for the main interpreter, particularly the interactive console. True for success. */ |
34 | bool setupMainInterpreter(); |
||
2503 | subik | 35 | /** Sets up the plugin for extension scripts, if enabled */ |
1752 | craig | 36 | void initExtensionScripts(); |
2503 | subik | 37 | /** Runs the startup script, if enabled */ |
1752 | craig | 38 | void runStartupScript(); |
2226 | cbradney | 39 | void languageChange(); |
1718 | craig | 40 | |
41 | protected: |
||
42 | // Private helper functions |
||
43 | void FinishScriptRun(); |
||
44 | void ReadPlugPrefs(); |
||
45 | void SavePlugPrefs(); |
||
46 | void rebuildRecentScriptsMenu(); |
||
47 | void buildScribusScriptsMenu(); |
||
48 | void buildRecentScriptsMenu(); |
||
49 | void rebuildScribusScriptsMenu(); |
||
50 | |||
2503 | subik | 51 | //Internal members |
52 | //! Reference to the "IDE" widget |
||
53 | PythonConsole *pcon; |
||
1718 | craig | 54 | int cons; |
55 | int about; |
||
56 | QStringList SavedRecentScripts; |
||
57 | QStringList RecentScripts; |
||
58 | MenuManager *menuMgr; |
||
59 | QMap<QString, QGuardedPtr<ScrAction> > scrScripterActions; |
||
60 | QMap<QString, QGuardedPtr<ScrAction> > scrRecentScriptActions; |
||
1752 | craig | 61 | |
62 | // Preferences |
||
2503 | subik | 63 | /** pref: Enable access to main interpreter and 'extension scripts' */ |
1752 | craig | 64 | bool enableExtPython; |
2503 | subik | 65 | /** pref: Run 'from scribus import *' at scripter startup */ |
1752 | craig | 66 | bool importAllNames; |
2503 | subik | 67 | /** pref: Load this script on startup */ |
1752 | craig | 68 | QString startupScript; |
1467 | cbradney | 69 | }; |
70 | |||
71 | #endif |