ScripterCore Class Reference
#include <scriptercore.h>

Public Slots | |
| void | runScriptDialog () |
| void | StdScript (QString filebasename) |
| void | RecentScript (QString fn) |
| void | slotRunScriptFile (QString fileName, bool inMainInterpreter=false) |
| void | slotRunScript (const QString Script) |
| void | slotInteractiveScript (bool) |
| void | slotExecute () |
| void | aboutScript () |
| Show docstring of the script to the user. I don't know how to get docstring via e.g. pydoc because of it needs to run script => error cannot find scribus module. | |
| bool | setupMainInterpreter () |
| Does setup for the main interpreter, particularly the interactive console. True for success. | |
| void | initExtensionScripts () |
| Sets up the plugin for extension scripts, if enabled. | |
| void | runStartupScript () |
| Runs the startup script, if enabled. | |
| void | languageChange () |
| const QString & | startupScript () const |
| bool | extensionsEnabled () const |
| void | setStartupScript (const QString &newScript) |
| void | setExtensionsEnabled (bool enable) |
Public Member Functions | |
| ScripterCore (QWidget *parent) | |
| ~ScripterCore () | |
| void | addToMainWindowMenu (ScribusMainWindow *) |
Public Attributes | |
| QString | returnString |
| String representation of result returned by last python console command. | |
| QString | inValue |
| String representation of line of code to be passed to the Python interactive interpreter. | |
Protected Member Functions | |
| void | FinishScriptRun () |
| void | ReadPlugPrefs () |
| void | SavePlugPrefs () |
| void | rebuildRecentScriptsMenu () |
| void | buildScribusScriptsMenu () |
| void | buildRecentScriptsMenu () |
| void | rebuildScribusScriptsMenu () |
Protected Attributes | |
| PythonConsole * | pcon |
| Reference to the "IDE" widget. | |
| QStringList | SavedRecentScripts |
| QStringList | RecentScripts |
| MenuManager * | menuMgr |
| QMap< QString, QPointer < ScrAction > > | scrScripterActions |
| QMap< QString, QPointer < ScrAction > > | scrRecentScriptActions |
| bool | m_enableExtPython |
| pref: Enable access to main interpreter and 'extension scripts' | |
| bool | m_importAllNames |
| pref: Run 'from scribus import *' at scripter startup | |
| QString | m_startupScript |
| pref: Load this script on startup | |
Detailed Description
Definition at line 20 of file scriptercore.h.
Constructor & Destructor Documentation
| ScripterCore::ScripterCore | ( | QWidget * | parent | ) |
Definition at line 36 of file scriptercore.cpp.
References aboutScript(), pcon, ReadPlugPrefs(), returnString, runScriptDialog(), SavedRecentScripts, scrRecentScriptActions, scrScripterActions, slotExecute(), slotInteractiveScript(), and tr().
| ScripterCore::~ScripterCore | ( | ) |
Member Function Documentation
| void ScripterCore::addToMainWindowMenu | ( | ScribusMainWindow * | mw | ) |
Definition at line 66 of file scriptercore.cpp.
References MenuManager::addMenuItem(), MenuManager::addMenuSeparator(), MenuManager::addMenuToMenuBarBefore(), buildRecentScriptsMenu(), buildScribusScriptsMenu(), MenuManager::createMenu(), menuMgr, ScribusMainWindow::scrMenuMgr, scrScripterActions, and tr().
Referenced by ScriptPlugin::addToMainWindowMenu().
| void ScripterCore::runScriptDialog | ( | ) | [slot] |
Definition at line 204 of file scriptercore.cpp.
References FinishScriptRun(), m_enableExtPython, ScribusCore::primaryMainWindow(), rebuildRecentScriptsMenu(), RecentScripts, ScCore, and slotRunScriptFile().
Referenced by ScripterCore().
| void ScripterCore::StdScript | ( | QString | filebasename | ) | [slot] |
Definition at line 227 of file scriptercore.cpp.
References FinishScriptRun(), ScPaths::instance(), ScPaths::scriptDir(), and slotRunScriptFile().
Referenced by buildScribusScriptsMenu().
| void ScripterCore::RecentScript | ( | QString | fn | ) | [slot] |
Definition at line 240 of file scriptercore.cpp.
References FinishScriptRun(), rebuildRecentScriptsMenu(), RecentScripts, and slotRunScriptFile().
Referenced by buildRecentScriptsMenu(), and rebuildRecentScriptsMenu().
| void ScripterCore::slotRunScriptFile | ( | QString | fileName, | |
| bool | inMainInterpreter = false | |||
| ) | [slot] |
Definition at line 253 of file scriptercore.cpp.
References ScribusCore::closeSplash(), cp, initscribus(), ScribusCore::primaryMainWindow(), ScCore, ScribusMainWindow::ScriptRunning, state, and tr().
Referenced by RecentScript(), runScriptDialog(), runStartupScript(), and StdScript().
| void ScripterCore::slotRunScript | ( | const QString | Script | ) | [slot] |
Definition at line 368 of file scriptercore.cpp.
References initscribus(), inValue, ScribusCore::primaryMainWindow(), ScCore, ScribusMainWindow::ScriptRunning, and tr().
Referenced by slotExecute().
| void ScripterCore::slotInteractiveScript | ( | bool | visible | ) | [slot] |
Definition at line 426 of file scriptercore.cpp.
References pcon, scrScripterActions, and PythonConsole::setFonts().
Referenced by ScripterCore().
| void ScripterCore::slotExecute | ( | ) | [slot] |
Definition at line 437 of file scriptercore.cpp.
References PythonConsole::command(), FinishScriptRun(), pcon, returnString, and slotRunScript().
Referenced by ScripterCore().
| void ScripterCore::aboutScript | ( | ) | [slot] |
Show docstring of the script to the user. I don't know how to get docstring via e.g. pydoc because of it needs to run script => error cannot find scribus module.
Definition at line 491 of file scriptercore.cpp.
References ScribusMainWindow::CFileDialog(), fdNone, ScribusCore::primaryMainWindow(), ScCore, HelpBrowser::setText(), and tr().
Referenced by ScripterCore().
| bool ScripterCore::setupMainInterpreter | ( | ) | [slot] |
Does setup for the main interpreter, particularly the interactive console. True for success.
Definition at line 552 of file scriptercore.cpp.
References ScPaths::instance(), m_importAllNames, ScribusCore::primaryMainWindow(), ScCore, and tr().
Referenced by ScriptPlugin::initPlugin().
| void ScripterCore::initExtensionScripts | ( | ) | [slot] |
Sets up the plugin for extension scripts, if enabled.
Definition at line 521 of file scriptercore.cpp.
Referenced by ScriptPlugin::initPlugin().
| void ScripterCore::runStartupScript | ( | ) | [slot] |
Runs the startup script, if enabled.
Definition at line 526 of file scriptercore.cpp.
References m_enableExtPython, m_startupScript, and slotRunScriptFile().
Referenced by ScriptPlugin::initPlugin().
| void ScripterCore::languageChange | ( | ) | [slot] |
Definition at line 541 of file scriptercore.cpp.
References menuMgr, scrScripterActions, MenuManager::setText(), and tr().
Referenced by ScriptPlugin::languageChange().
| const QString & ScripterCore::startupScript | ( | ) | const [slot] |
| bool ScripterCore::extensionsEnabled | ( | ) | const [slot] |
Definition at line 594 of file scriptercore.cpp.
References m_enableExtPython.
Referenced by ScripterPrefsGui::ScripterPrefsGui().
| void ScripterCore::setStartupScript | ( | const QString & | newScript | ) | [slot] |
Definition at line 579 of file scriptercore.cpp.
References m_startupScript.
Referenced by ScripterPrefsGui::apply().
| void ScripterCore::setExtensionsEnabled | ( | bool | enable | ) | [slot] |
Definition at line 584 of file scriptercore.cpp.
References m_enableExtPython.
Referenced by ScripterPrefsGui::apply().
| void ScripterCore::FinishScriptRun | ( | ) | [protected] |
Definition at line 142 of file scriptercore.cpp.
References OutlinePalette::BuildTree(), Selection::count(), ScribusMainWindow::doc, ScribusView::DrawNew(), PageItem::emitAllToGUI(), ScribusMainWindow::HaveDoc, ScribusMainWindow::HaveNewDoc(), ScribusMainWindow::HaveNewSel(), Selection::itemAt(), PageItem::itemType, ScribusMainWindow::layerPalette, ScribusDoc::m_Selection, ScribusMainWindow::outlinePalette, ScribusMainWindow::pagePalette, ScribusCore::primaryMainWindow(), ScribusMainWindow::propertiesPalette, PagePalette::Rebuild(), ScribusDoc::RePos, ScCore, ScMW, OutlinePalette::setDoc(), LayerPalette::setDoc(), PropertiesPalette::setDoc(), PagePalette::setView(), and ScribusMainWindow::view.
Referenced by RecentScript(), runScriptDialog(), slotExecute(), and StdScript().
| void ScripterCore::ReadPlugPrefs | ( | ) | [protected] |
Definition at line 445 of file scriptercore.cpp.
References PrefsContext::get(), PrefsTable::get(), PrefsContext::getBool(), PrefsFile::getPluginContext(), PrefsTable::getRowCount(), PrefsContext::getTable(), PrefsManager::instance(), m_enableExtPython, m_importAllNames, m_startupScript, PrefsManager::prefsFile, and SavedRecentScripts.
Referenced by ScripterCore().
| void ScripterCore::SavePlugPrefs | ( | ) | [protected] |
Definition at line 469 of file scriptercore.cpp.
References PrefsFile::getPluginContext(), PrefsContext::getTable(), PrefsManager::instance(), m_enableExtPython, m_importAllNames, m_startupScript, PrefsManager::prefsFile, RecentScripts, PrefsContext::set(), and PrefsTable::set().
Referenced by ~ScripterCore().
| void ScripterCore::rebuildRecentScriptsMenu | ( | ) | [protected] |
Definition at line 103 of file scriptercore.cpp.
References MenuManager::addMenuItem(), PrefsManager::instance(), menuMgr, RecentScript(), ScrAction::RecentScript, RecentScripts, MenuManager::removeMenuItem(), and scrRecentScriptActions.
Referenced by RecentScript(), and runScriptDialog().
| void ScripterCore::buildScribusScriptsMenu | ( | ) | [protected] |
Definition at line 82 of file scriptercore.cpp.
References MenuManager::addMenuItem(), ScPaths::instance(), menuMgr, ScrAction::RecentScript, ScPaths::scriptDir(), scrScripterActions, and StdScript().
Referenced by addToMainWindowMenu().
| void ScripterCore::buildRecentScriptsMenu | ( | ) | [protected] |
Definition at line 120 of file scriptercore.cpp.
References MenuManager::addMenuItem(), PrefsManager::instance(), menuMgr, RecentScript(), ScrAction::RecentScript, RecentScripts, SavedRecentScripts, and scrRecentScriptActions.
Referenced by addToMainWindowMenu().
| void ScripterCore::rebuildScribusScriptsMenu | ( | ) | [protected] |
Member Data Documentation
| QString ScripterCore::returnString |
String representation of result returned by last python console command.
Definition at line 30 of file scriptercore.h.
Referenced by scribus_retval(), ScripterCore(), and slotExecute().
| QString ScripterCore::inValue |
String representation of line of code to be passed to the Python interactive interpreter.
Definition at line 32 of file scriptercore.h.
Referenced by scribus_getval(), and slotRunScript().
PythonConsole* ScripterCore::pcon [protected] |
Reference to the "IDE" widget.
Definition at line 72 of file scriptercore.h.
Referenced by ScripterCore(), slotExecute(), slotInteractiveScript(), and ~ScripterCore().
QStringList ScripterCore::SavedRecentScripts [protected] |
Definition at line 73 of file scriptercore.h.
Referenced by buildRecentScriptsMenu(), ReadPlugPrefs(), and ScripterCore().
QStringList ScripterCore::RecentScripts [protected] |
Definition at line 74 of file scriptercore.h.
Referenced by buildRecentScriptsMenu(), rebuildRecentScriptsMenu(), RecentScript(), runScriptDialog(), and SavePlugPrefs().
MenuManager* ScripterCore::menuMgr [protected] |
Definition at line 75 of file scriptercore.h.
Referenced by addToMainWindowMenu(), buildRecentScriptsMenu(), buildScribusScriptsMenu(), languageChange(), and rebuildRecentScriptsMenu().
QMap<QString, QPointer<ScrAction> > ScripterCore::scrScripterActions [protected] |
Definition at line 76 of file scriptercore.h.
Referenced by addToMainWindowMenu(), buildScribusScriptsMenu(), languageChange(), ScripterCore(), and slotInteractiveScript().
QMap<QString, QPointer<ScrAction> > ScripterCore::scrRecentScriptActions [protected] |
Definition at line 77 of file scriptercore.h.
Referenced by buildRecentScriptsMenu(), rebuildRecentScriptsMenu(), and ScripterCore().
bool ScripterCore::m_enableExtPython [protected] |
pref: Enable access to main interpreter and 'extension scripts'
Definition at line 81 of file scriptercore.h.
Referenced by extensionsEnabled(), ReadPlugPrefs(), runScriptDialog(), runStartupScript(), SavePlugPrefs(), and setExtensionsEnabled().
bool ScripterCore::m_importAllNames [protected] |
pref: Run 'from scribus import *' at scripter startup
Definition at line 83 of file scriptercore.h.
Referenced by ReadPlugPrefs(), SavePlugPrefs(), and setupMainInterpreter().
QString ScripterCore::m_startupScript [protected] |
pref: Load this script on startup
Definition at line 85 of file scriptercore.h.
Referenced by ReadPlugPrefs(), runStartupScript(), SavePlugPrefs(), setStartupScript(), and startupScript().
The documentation for this class was generated from the following files:
