Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

ScripterCore Class Reference

#include <scriptercore.h>

Collaboration diagram for ScripterCore:

Collaboration graph
[legend]

List of all members.

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

PythonConsolepcon
 Reference to the "IDE" widget.
QStringList SavedRecentScripts
QStringList RecentScripts
MenuManagermenuMgr
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  ) 

ScripterCore::~ScripterCore (  ) 

Definition at line 60 of file scriptercore.cpp.

References pcon, and SavePlugPrefs().


Member Function Documentation

void ScripterCore::addToMainWindowMenu ( ScribusMainWindow mw  ) 

void ScripterCore::runScriptDialog (  )  [slot]

void ScripterCore::StdScript ( QString  filebasename  )  [slot]

void ScripterCore::RecentScript ( QString  fn  )  [slot]

void ScripterCore::slotRunScriptFile ( QString  fileName,
bool  inMainInterpreter = false 
) [slot]

void ScripterCore::slotRunScript ( const QString  Script  )  [slot]

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]

Definition at line 589 of file scriptercore.cpp.

References m_startupScript.

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]

void ScripterCore::ReadPlugPrefs (  )  [protected]

void ScripterCore::SavePlugPrefs (  )  [protected]

void ScripterCore::rebuildRecentScriptsMenu (  )  [protected]

void ScripterCore::buildScribusScriptsMenu (  )  [protected]

void ScripterCore::buildRecentScriptsMenu (  )  [protected]

void ScripterCore::rebuildScribusScriptsMenu (  )  [protected]


Member Data Documentation

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().

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().

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]

QMap<QString, QPointer<ScrAction> > ScripterCore::scrScripterActions [protected]

QMap<QString, QPointer<ScrAction> > ScripterCore::scrRecentScriptActions [protected]

Definition at line 77 of file scriptercore.h.

Referenced by buildRecentScriptsMenu(), rebuildRecentScriptsMenu(), and ScripterCore().

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().

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:
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.