organizes script editors, independent on their appearance (docked or window-style)
More...
|
void | removeScriptDockWidget (ScriptDockWidget *widget) |
| signal emitted if macro (filename) should be debugged in python
|
|
void | dockScriptTab (ScriptDockWidget *widget, int index, bool closeDockIfEmpty=false) |
| slot invoked if tab, defined by its index, if the given widget should be docked
|
|
void | undockScriptTab (ScriptDockWidget *widget, int index, bool undockToNewScriptWindow=false, bool closeDockIfEmpty=false) |
| slot invoked if tab, defined by its index, in the given widget should be undocked
|
|
RetVal | openNewScriptWindow (bool docked, ItomSharedSemaphore *semaphore=NULL) |
| slot invoked if empty new script window should be created and displayed
|
|
RetVal | newScript (ItomSharedSemaphore *semaphore=NULL) |
| slot, invoked if new script should be opened
|
|
RetVal | openScript (const QString &filename, ItomSharedSemaphore *semaphore=NULL, int visibleLineNr=-1, bool errorMessageClick=false, bool showSelectedCallstackLine=false) |
| slot, invoked if python macro file should be opened as new tab in active script editor window
|
|
ScriptDockWidget * | openScriptRequested (const QString &filename, ScriptDockWidget *widget) |
| slot invoked if a file open command has been executed in any script window.
|
|
void | pythonRunFileRequested (QString filename) |
| slot invoked if someone wants to run a python file with filename.
|
|
void | pythonDebugFileRequested (QString filename) |
| slot invoked if someone wants to debug a python file with filename.
|
|
void | pythonDebugPositionChanged (QString filename, int lineNo) |
| slot invoked if line in python debugging process has been changed
|
|
void | fileOpenedOrSaved (const QString &filename) |
| This slot is called if a file is saved or stored in any widget.
|
|
|
void | addScriptDockWidgetToMainWindow (AbstractDockWidget *dockWidget, Qt::DockWidgetArea area) |
| maximum number of entries in the go back navigation history.
|
|
void | removeScriptDockWidgetFromMainWindow (AbstractDockWidget *dockWidget) |
| signal emitted if dockWidget should be added to docking area in main window
|
|
void | pythonRunFile (QString filename) |
| signal emitted if dockWidget should be removed from main window
|
|
void | pythonDebugFile (QString filename) |
| signal emitted if macro (filename) should be executed in python
|
|
|
void | widgetFocusChanged (QWidget *old, QWidget *now) |
| slot is connected to signal "focusChanged" of QApplication and indicates every change in the active widget.
|
|
void | onAddGoBackNavigationItem (const GoBackNavigationItem &item) |
|
void | onGotoBookmark (const BookmarkItem &item) |
|
void | mnuNavigateForward () |
|
void | mnuNavigateBackward () |
|
void | mnuNavigateBackwardItem (int index) |
|
organizes script editors, independent on their appearance (docked or window-style)
◆ ScriptEditorOrganizer()
ito::ScriptEditorOrganizer::ScriptEditorOrganizer |
( |
bool | dockAvailable | ) |
|
constructor
setups connections to python engine and to get a notification about focus changes.
- Parameters
-
dockAvailable | true if dock functionality is available |
◆ ~ScriptEditorOrganizer()
ito::ScriptEditorOrganizer::~ScriptEditorOrganizer |
( |
| ) |
|
destructor
disconnections remaining connections to python engine and deletes remaining ScriptDockWidgets (should no occur)
◆ closeAllScripts()
RetVal ito::ScriptEditorOrganizer::closeAllScripts |
( |
bool | saveFirst | ) |
|
tries to close all opened script.
long description
- Parameters
-
saveFirst | indicates whether unsaved or new scripts should be saved first. |
- Returns
- retOk if all scripts could be closed, else retError
< copy since m_scriptDockElements will change its size during closing
◆ createEmptyScriptDock()
ScriptDockWidget * ito::ScriptEditorOrganizer::createEmptyScriptDock |
( |
bool | docked, |
|
|
Qt::DockWidgetArea | area = Qt::TopDockWidgetArea, |
|
|
const QString & | objectName = QString() ) |
|
protected |
creates new ScriptDockWidget without any script editor tab.
Since there should only be one docked widget, docked will be set to false if there exists already a docked widget. Setups connections between the new ScriptDockWidget and this organizer or the python engine.
- Parameters
-
docked | true, if widget should be docked in main window, else false (new on-top window) |
- Returns
- reference to new ScriptDockWidget
< setup signal/slot-connection to python thread
◆ dockScriptTab
void ito::ScriptEditorOrganizer::dockScriptTab |
( |
ScriptDockWidget * | widget, |
|
|
int | index, |
|
|
bool | closeDockIfEmpty = false ) |
|
slot |
slot invoked if tab, defined by its index, if the given widget should be docked
The script editor which should be docked is given by its ScriptDockWidget container, named widget, and its tab index. If there exists at least one docked ScriptDockWidget, widget will be docked there, otherwise a new docked ScriptDockWidget is opened first. If the source ScriptDockWidget does not contain any other tabs and if closeDockIfEmpty is set, the source widget will be closed.
- Parameters
-
widget | ScriptDockWidget container, which contains the tab |
index | tab-index of the tab |
closeDockIfEmpty | see method description |
◆ fileOpenedOrSaved
void ito::ScriptEditorOrganizer::fileOpenedOrSaved |
( |
const QString & | filename | ) |
|
|
slot |
This slot is called if a file is saved or stored in any widget.
This function is used to manage the "last used files" list. It stores all used files in the list and keeps it up to date. If the list is longer than 10 elements, the last ones are deleted.
- Parameters
-
filename | filename of a saved or loaded file is insert into the list at first position |
◆ getActiveDockWidget()
◆ getFirstDockedElement()
returns first ScriptDockWidget of the widget-list which is docked. This is also the last activated docked widget.
- Returns
- docked ScriptDockWidget or NULL, if no such widget exists.
◆ getFirstUndockedElement()
ScriptDockWidget * ito::ScriptEditorOrganizer::getFirstUndockedElement |
( |
| ) |
const |
|
private |
◆ newScript
slot, invoked if new script should be opened
- Parameters
-
waitCond | ItomSharedSemaphore which will be waked up if process is finished. Use NULL if nothing should happen |
- Returns
- retOk if success, else retError
◆ openNewScriptWindow
slot invoked if empty new script window should be created and displayed
long description
- Parameters
-
docked | indicates whether script window should be docked in MainWindow or not |
waitCond | ItomSharedSemaphore which will be waked up if process is finished. Use NULL if nothing should happen |
◆ openScript
RetVal ito::ScriptEditorOrganizer::openScript |
( |
const QString & | filename, |
|
|
ItomSharedSemaphore * | semaphore = NULL, |
|
|
int | visibleLineNr = -1, |
|
|
bool | errorMessageClick = false, |
|
|
bool | showSelectedCallstackLine = false ) |
|
slot |
slot, invoked if python macro file should be opened as new tab in active script editor window
- Parameters
-
filename | Filename of the python macro |
semaphore | ItomSharedSemaphore which will be woken up if opening process is finished. Use NULL if nothing should happen |
visibleLineNr | is the line number that should be visible and where the cursor should be positioned (default: -1, no cursor positioning) |
errorMessageClick | if true, the entire line will be marked with the "error line" background indicator |
showSelectedCallstackLine | if true, the callstackIcon (green arrow) will be added to the breakpoint panel of the script editor |
- Returns
- retOk if success, else retError
◆ openScriptRequested
slot invoked if a file open command has been executed in any script window.
Checks if filename already has been opened in another script window. If yes only activates this tab, else opens the script in the given widget (if NULL opens a new script window)
- Parameters
-
filename | Filename of the python macro which should be opened |
widget | ScriptDockWidget where this macro should appear as new tab. If NULL, new script window will be created |
- See also
- ScriptDockWidget
◆ pythonDebugFileRequested
void ito::ScriptEditorOrganizer::pythonDebugFileRequested |
( |
QString | filename | ) |
|
|
slot |
slot invoked if someone wants to debug a python file with filename.
Before signaling the debug command, checks that every opened script already having a filename is saved.
- Parameters
-
filename | Filename of the python script where the debugging should start |
◆ pythonDebugPositionChanged
void ito::ScriptEditorOrganizer::pythonDebugPositionChanged |
( |
QString | filename, |
|
|
int | lineNo ) |
|
slot |
slot invoked if line in python debugging process has been changed
Checks, if filename is already opened in one script editor. If yes, activates this script editor. If no, opens this the specified script in a new tab.
- Parameters
-
filename | Filename of actual executed python macro |
lineNo | line number in file (here not used) |
◆ pythonRunFileRequested
void ito::ScriptEditorOrganizer::pythonRunFileRequested |
( |
QString | filename | ) |
|
|
slot |
slot invoked if someone wants to run a python file with filename.
Before signaling the execution command, checks that every opened script already having a filename is saved.
- Parameters
-
filename | Filename of the python script where the execution should start |
◆ removeScriptDockWidget
void ito::ScriptEditorOrganizer::removeScriptDockWidget |
( |
ScriptDockWidget * | widget | ) |
|
|
slot |
signal emitted if macro (filename) should be debugged in python
slot invoked by ScriptDockWidget close event method. The given widget should be closed and removed from the m_scriptDockElements-list
Disconnects many connections between the ScriptDockWidget and the ScriptEditorOrganizer or the PythonEngine. Emits signal to equally remove the widget from the docking area in main window.
- Parameters
-
◆ saveAllScripts()
RetVal ito::ScriptEditorOrganizer::saveAllScripts |
( |
bool | askFirst = true, |
|
|
bool | ignoreNewScripts = false, |
|
|
int * | saveScriptState = NULL ) |
saves all opened scripts, if changes exist
- Parameters
-
askFirst | true if user can decide whether to save the script or not |
ignoreNewScripts | true if scripts which do not have a filename should be ignored |
saveScriptState | is the possibility to remember this action for the next time: NULL -> don't show a checkbox to remember this, else: pointer to value: 0: show message box and let user decide, 1: automatically save all changed files, 2: do not save unchanged files |
- Returns
- retOk if everything done, else retError (e.g. user cancellation)
◆ undockScriptTab
void ito::ScriptEditorOrganizer::undockScriptTab |
( |
ScriptDockWidget * | widget, |
|
|
int | index, |
|
|
bool | undockToNewScriptWindow = false, |
|
|
bool | closeDockIfEmpty = false ) |
|
slot |
slot invoked if tab, defined by its index, in the given widget should be undocked
The script editor which should be undocked is given by its ScriptDockWidget container, named widget, and its tab index. If the active ScriptDockWidget is already undocked, widget will be docked there, otherwise a new undocked ScriptDockWidget is opened first. If the source ScriptDockWidget does not contain any other tabs and if closeDockIfEmpty is set, the source widget will be closed.
- Parameters
-
widget | ScriptDockWidget container, which contains the tab |
index | tab-index of the tab |
closeDockIfEmpty | see method description |
◆ widgetFocusChanged
void ito::ScriptEditorOrganizer::widgetFocusChanged |
( |
QWidget * | old, |
|
|
QWidget * | now ) |
|
privateslot |
slot is connected to signal "focusChanged" of QApplication and indicates every change in the active widget.
This slot is evaluated in order to check, whether a ScriptDockWidget has been activated (has got the focus). If so, this ScriptDockWidget will be moved on top of the m_scriptDockElements-list, since the first element should always be the active one. Write action to m_scriptDockElements is protected by scriptStackMutex.
- Parameters
-
now | widget which just got the focus |
◆ m_goBackNavigationIndex
int ito::ScriptEditorOrganizer::m_goBackNavigationIndex |
|
private |
history of go back navigation items. Newer items are at the end of the list. The list is limited to a number of maximum items.
◆ m_recentlyUsedFiles
QStringList ito::ScriptEditorOrganizer::m_recentlyUsedFiles |
|
private |
mutex locking any changes to m_scriptDockElements. This mutex can also be changed in const methods
◆ m_usedObjectNames
QSet<QString> ito::ScriptEditorOrganizer::m_usedObjectNames |
|
private |
list with references to all ScriptDockWidgets (docked or windows-style)
◆ MaxGoBackNavigationEntries
const int ito::ScriptEditorOrganizer::MaxGoBackNavigationEntries = 20 |
|
staticprivate |
current position of script editors in goBackNavigationHistory. If equal to m_goBackNavigationHistory.size(), the current position is at the end.
The documentation for this class was generated from the following files:
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/Qitom/organizer/scriptEditorOrganizer.h
- C:/Workspace/itom_development_VS2019_Qt5.15.2_x64/itomProject/itom/Qitom/organizer/scriptEditorOrganizer.cpp