23 #include "rocsversion.h"
26 #include <QtGui/QCloseEvent>
27 #include <QtGui/QComboBox>
28 #include <QtGui/QGraphicsView>
29 #include <QtGui/QLabel>
30 #include <QtGui/QLayout>
31 #include <QtGui/QSplitter>
32 #include <QtGui/QStackedWidget>
33 #include <QtGui/QToolBar>
34 #include <QtGui/QVBoxLayout>
35 #include <QToolButton>
37 #include <QGridLayout>
41 #include <KActionCollection>
42 #include <KRecentFilesAction>
43 #include <KActionMenu>
44 #include <KApplication>
47 #include <KPushButton>
49 #include <KTextBrowser>
50 #include <KMessageBox>
51 #include <KLocalizedString>
52 #include <KConfigDialog>
53 #include <KFileDialog>
54 #include <KInputDialog>
61 #include "GraphVisualEditor.h"
70 #include "Scene/GraphicsLayout.h"
74 #include "DataStructure.h"
80 #include "Actions/AbstractAction.h"
81 #include "Actions/AlignAction.h"
82 #include "Actions/ZoomAction.h"
83 #include "Actions/DeleteAction.h"
84 #include "Actions/PropertiesDialogAction.h"
86 #include <KNS3/DownloadDialog>
87 #include <knewstuff3/uploaddialog.h>
90 #include "QtScriptBackend.h"
91 #include <kstandarddirs.h>
92 #include <ktexteditor/view.h>
93 #include <ktexteditor/editor.h>
94 #include <ktexteditor/document.h>
95 #include <QActionGroup>
96 #include <QMutexLocker>
97 #include <QFormLayout>
98 #include <QScriptEngineDebugger>
99 #include <boost/concept_check.hpp>
102 #include <IncludeManager.h>
104 #include <DataStructureBackendInterface.h>
105 #include <DataStructureBackendManager.h>
106 #include "DocumentManager.h"
107 #include "Tools/ToolManager.h"
115 setObjectName(
"RocsMainWindow");
119 setupGUI(ToolBar | Keys | Save | Create);
122 setupToolsPluginsAction();
123 setupDSPluginsAction();
125 connect(&DocumentManager::self(), SIGNAL(activateDocument()),
127 connect(&DocumentManager::self(), SIGNAL(deactivateDocument(Document*)),
129 connect(&DocumentManager::self(), SIGNAL(documentRemoved(Document*)),
145 foreach(KActionCollection* ac, KActionCollection::allCollections()) {
146 if (ac->action(
"file_save")) {
147 ac->removeAction(ac->action(
"file_save"));
161 _recentProjects->saveEntries(
Settings::self()->config()->group(
"RecentFiles"));
177 void MainWindow::setupWidgets()
180 QWidget *sidePanel = setupSidePanel();
181 _graphVisualEditor = GraphVisualEditor::self();
182 QWidget *scriptPanel = setupScriptPanel();
187 _vSplitter->
addWidget(_graphVisualEditor);
205 if (panelWidth == 0) {
212 setCentralWidget(_hSplitter);
215 void MainWindow::setupToolbars()
221 kDebug() <<
"Apply new default settings for toolbars";
224 bar = toolBar(
"main");
225 bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
226 bar->setOrientation(Qt::Vertical);
227 addToolBar(Qt::LeftToolBarArea, bar);
229 bar = toolBar(
"align");
230 bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
231 bar->setOrientation(Qt::Vertical);
232 addToolBar(Qt::LeftToolBarArea, bar);
236 void MainWindow::downloadNewExamples()
242 void MainWindow::uploadScript()
248 KUrl str = _codeEditor->
document()->url();
251 str = KFileDialog::getOpenFileName(
QString(), i18n(
"*.js|Script files"),
252 this, i18n(
"Rocs Script Files"));
262 KTar tar = KTar(local);
263 tar.open(QIODevice::WriteOnly);
264 tar.addLocalFile(str.toLocalFile(), str.fileName());
266 dialog->setUploadFile(local);
268 dialog->setUploadName(_codeEditor->
document()->documentName());
269 dialog->setDescription(i18n(
"Add your description here."));
278 QWidget* MainWindow::setupScriptPanel()
287 KToolBar *executeCommands =
new KToolBar(
this);
288 executeCommands->setToolButtonStyle(Qt::ToolButtonTextUnderIcon);
289 executeCommands->setOrientation(Qt::Vertical);
290 _runScript =
new KAction(KIcon(
"media-playback-start"), i18nc(
"@action:intoolbar Script Execution",
"Run"),
this);
291 _stepRunScript =
new KAction(KIcon(
"go-next"), i18nc(
"@action:intoolbar Script Execution",
"One Step"),
this);
292 _stopScript =
new KAction(KIcon(
"process-stop"), i18nc(
"@action:intoolbar Script Execution",
"Stop"),
this);
293 _stopScript->setEnabled(
false);
294 executeCommands->addAction(_runScript);
295 executeCommands->addAction(_stepRunScript);
297 actionCollection()->addAction(
"_runScript", _runScript);
298 actionCollection()->addAction(
"_stepRunScript", _stepRunScript);
299 actionCollection()->addAction(
"_stopScript", _stopScript);
302 _debugMenu =
new KActionMenu(KIcon(
"debug-run"), i18nc(
"@title:menu Debug execution",
"Debug"),
this);
303 _debugScript =
new KAction(KIcon(
"debug-run"), i18nc(
"@action:inmenu Debug execution",
"Debug run"), _debugMenu);
304 _interruptScript =
new KAction(KIcon(
"debug-run-cursor"), i18nc(
"@action:inmenu Debug execution",
"Interrupt at first line"), _debugMenu);
305 _debugMenu->addAction(_debugScript);
306 _debugMenu->addAction(_interruptScript);
307 executeCommands->addWidget(_debugMenu->createWidget(executeCommands));
308 executeCommands->addAction(_stopScript);
309 actionCollection()->addAction(
"_debugScript", _debugScript);
310 actionCollection()->addAction(
"_interruptScript", _interruptScript);
316 connect(_runScript, SIGNAL(triggered()),
this, SLOT(executeScriptFull()));
317 connect(_stepRunScript, SIGNAL(triggered()),
this, SLOT(executeScriptOneStep()));
318 connect(_debugScript, SIGNAL(triggered()),
this, SLOT(debugScript()));
319 connect(_interruptScript, SIGNAL(triggered()),
this, SLOT(debugScript()));
320 connect(_stopScript, SIGNAL(triggered()),
this, SLOT(stopScript()));
322 _hScriptSplitter->
addWidget(_codeEditor);
323 _hScriptSplitter->
addWidget(_outputWidget);
330 return scriptInterface;
333 QWidget* MainWindow::setupSidePanel()
341 addToolBar(Qt::RightToolBarArea, sideDock->
toolbar());
347 connect(&DocumentManager::self(), SIGNAL(activateDocument()), documentTypesWidget, SLOT(updateDocument()));
348 sideDock->
addDock(documentTypesWidget, i18n(
"Element Types"), KIcon(
"document-properties"));
352 sideDock->
addDock(_journalWidget, i18nc(
"@title",
"Journal"), KIcon(
"story-editor"));
356 sideDock->
addDock(documentation, i18nc(
"@title",
"Handbook"), KIcon(
"help-contents"));
360 sideDock->
addDock(apiDoc, i18nc(
"@title",
"Scripting API"), KIcon(
"documentation"));
365 void MainWindow::setupActions()
367 kDebug() <<
"create and connect actions";
368 KStandardAction::quit(
this, SLOT(quit()), actionCollection());
369 KStandardAction::preferences(
this, SLOT(showSettings()), actionCollection());
372 _graphVisualEditor->setupActions(actionCollection());
375 createAction(
"document-new", i18nc(
"@action:inmenu",
"New Project"),
"new-project", QKeySequence::New, SLOT(createNewProject()),
this);
376 createAction(
"document-save", i18nc(
"@action:inmenu",
"Save Project"),
"save-project", QKeySequence::Save, SLOT(saveProject()),
this);
377 createAction(
"document-open", i18nc(
"@action:inmenu",
"Open Project"),
"open-project", QKeySequence::Open, SLOT(openProject()),
this);
379 _recentProjects =
new KRecentFilesAction(KIcon (
"document-open"), i18nc(
"@action:inmenu",
"Recent Projects"),
this);
380 connect(_recentProjects, SIGNAL(urlSelected(KUrl)),
this, SLOT(openProject(KUrl)));
381 actionCollection()->addAction(
"recent-project", _recentProjects);
383 _recentProjects->loadEntries(
Settings::self()->config()->group(
"RecentFiles"));
384 createAction(
"document-save-as", i18nc(
"@action:inmenu",
"Save Project as"),
"save-project-as", SLOT(saveProjectAs()),
this);
385 createAction(
"document-new", i18nc(
"@action:inmenu",
"New Graph Document"),
"new-graph", SLOT(newGraph()),
this);
386 createAction(
"document-new", i18nc(
"@action:inmenu",
"New Script File"),
"new-script", SLOT(newScript()),
this);
387 createAction(
"document-import", i18nc(
"@action:inmenu",
"Import Graph"),
"import-graph", SLOT(importGraphFile()),
this);
389 createAction(
"document-export", i18nc(
"@action:inmenu",
"Export Graph as"),
"export-graph-as", SLOT(exportGraphFile()),
this);
390 createAction(
"get-hot-new-stuff", i18nc(
"@action:inmenu",
"Download Examples"),
"download", SLOT(downloadNewExamples()),
this);
391 createAction(
"get-hot-new-stuff", i18nc(
"@action:inmenu",
"Upload project"),
"upload", SLOT(uploadScript()),
this);
393 createAction(
"help-hint", i18nc(
"@action:inmenu",
"Possible Includes"),
"possible_includes", SLOT(showPossibleIncludes()),
this);
394 createAction(
"document-import", i18nc(
"@action:inmenu",
"Import Script"),
"add-script", SLOT(importScript()),
this);
396 createAction(
"document-export", i18nc(
"@action:inmenu",
"Export Script as"),
"export-script-as", SLOT(saveActiveScriptAs()), _codeEditor);
397 createAction(
"", i18nc(
"@action:inmenu",
"Loaded Plugins"),
"loaded-plugins", SLOT(showLoadedPlugins()),
this);
398 createAction(
"", i18nc(
"@action:inmenu",
"Configure Code Editor..."),
"config-code-editor", SLOT(showCodeEditorConfig()),
this);
404 KAction* action =
new KAction(KIcon(iconName), actionTitle, parent);
405 action->setShortcut(shortcut);
406 action->setShortcutContext(Qt::ApplicationShortcut);
407 actionCollection()->addAction(actionName, action);
408 connect(action, SIGNAL(triggered(
bool)), parent, slot);
412 const char* slot,
QObject *parent)
414 KAction* action =
new KAction(KIcon(iconName), actionTitle, parent);
415 actionCollection()->addAction(actionName, action);
416 connect(action, SIGNAL(triggered(
bool)), parent, slot);
419 void MainWindow::showSettings()
426 dialog->addPage(set, i18nc(
"@title:tab",
"Include Manager"),
QString(), i18nc(
"@title:tab",
"Include Manager"),
true);
427 dialog->addPage(defaultProperties, i18nc(
"@title:tab",
"Default Settings"),
QString(), i18nc(
"@title:tab",
"Default Settings"),
true);
431 connect(set, SIGNAL(changed(
bool)), dialog, SLOT(enableButtonApply(
bool)));
432 connect(dialog, SIGNAL(applyClicked()), set, SLOT(saveSettings()));
433 connect(dialog, SIGNAL(okClicked()), set, SLOT(saveSettings()));
435 connect(defaultProperties, SIGNAL(showExecuteModeDebugChanged(
bool)),
437 connect(defaultProperties, SIGNAL(showExecuteModeOneStepChanged(
bool)),
443 void MainWindow::setupToolsPluginsAction()
446 createToolsPluginsAction();
449 foreach(
QAction* action, _toolsPlugins) {
450 ToolsPluginInterface *plugin = ToolManager::self().plugins().at(action->
data().
toInt());
452 DocumentManager::self().activeDocument() &&
453 plugin->supportedDataStructures().contains(DocumentManager::self().activeDocument()->backend()->internalName())
458 void MainWindow::createToolsPluginsAction(){
462 foreach(ToolsPluginInterface * plugin, availablePlugins) {
463 action =
new KAction(plugin->displayName(),
this);
465 connect(action, SIGNAL(triggered(
bool)),
this, SLOT(
runToolPlugin()));
466 _toolsPlugins << action;
468 unplugActionList(
"tools_plugins");
469 plugActionList(
"tools_plugins", _toolsPlugins);
472 void MainWindow::setupDSPluginsAction()
476 QStringList backends = DataStructureBackendManager::self().backends();
480 unplugActionList(
"DS_plugins");
483 foreach(
const QString& identifier, backends) {
484 DataStructureBackendInterface *plugin = DataStructureBackendManager::self().backend(identifier);
485 action =
new KAction(plugin->name(),
this);
487 if (plugin->internalName() == DataStructureBackendManager::self().activeBackend()->internalName()) {
492 connect(action, SIGNAL(triggered(
bool)), mapper, SLOT(
map()));
494 pluginList.
append(action);
497 &DataStructureBackendManager::self(), SLOT(setBackend(
QString)));
499 plugActionList(
"DS_plugins", pluginList);
506 unplugActionList(
"Doc_List");
509 foreach(Document * doc, DocumentManager::self().documentList()) {
510 action =
new KAction(doc->name(),
this);
513 if (doc == DocumentManager::self().activeDocument()) {
517 connect(action, SIGNAL(triggered(
bool)), &DocumentManager::self(), SLOT(changeDocument()));
518 pluginList.
append(action);
521 plugActionList(
"Doc_List", pluginList);
526 kDebug() <<
"Setting the document in the main window";
527 Document *activeDocument = DocumentManager::self().activeDocument();
530 QtScriptBackend *engine = activeDocument->engineBackend();
534 _graphVisualEditor->setActiveDocument();
539 activeDocument->setModified(
false);
540 setupToolsPluginsAction();
551 d->engineBackend()->stop();
552 d->engineBackend()->disconnect(
this);
553 _graphVisualEditor->releaseDocument();
556 void MainWindow::addEmptyGraphDocument()
558 _currentProject->addGraphFileNew(
559 DocumentManager::self().newDocument()
563 void MainWindow::importScript()
566 if (!_currentProject->isTemporary()) {
567 startDirectory = KUrl::fromPath(_currentProject->projectDirectory());
570 QString fileUrl = KFileDialog::getOpenFileName( startDirectory,
573 i18nc(
"@title:window",
"Add Existing Script File to Project"));
578 _currentProject->addCodeFile(fileUrl);
583 void MainWindow::loadDocument(
const QString& name)
586 KMessageBox::sorry(
this, i18nc(
"@info",
"This does not seem to be a graph file."), i18nc(
"@title:window",
"Invalid File"));
590 DocumentManager::self().openDocument(KUrl::fromLocalFile(name));
593 void MainWindow::createNewProject()
600 DocumentManager::self().closeAllDocuments();
602 delete _currentProject;
603 _currentProject =
new Project();
604 _currentProject->addCodeFileNew(_codeEditor->
newScript());
605 _currentProject->addGraphFileNew(DocumentManager::self().newDocument());
607 _currentProject->setModified(
false);
612 void MainWindow::newProjectAssistant()
617 void MainWindow::saveProject(
bool saveAs)
622 if (_currentProject->isTemporary() || saveAs) {
623 startDirectory = KUrl::fromPath(_currentProject->projectDirectory());
624 QString file = KFileDialog::getSaveFileName(startDirectory,
625 i18n(
"*.rocs|Rocs project files\n*.rocsz|Compressed Rocs project files\n*|All files"),
627 i18nc(
"@title:window",
"Save Project"));
629 if (file.isEmpty()) {
630 kDebug() <<
"Filename is empty and no script file was created.";
633 _currentProject->setProjectFile(KUrl::fromLocalFile(file));
638 _currentProject->exportProject(KUrl::fromLocalFile(file));
643 _currentProject->writeProjectFile(file);
649 if (_currentProject->projectFile().fileName().endsWith(
QLatin1String(
"rocsz"))){
650 _currentProject->exportProject(_currentProject->projectFile());
652 _currentProject->writeProjectFile();
659 void MainWindow::saveProjectAs()
664 _recentProjects->addUrl(_currentProject->projectFile().path(KUrl::RemoveTrailingSlash));
667 void MainWindow::openProject(
const KUrl& fileName)
674 KUrl file = fileName;
677 file = KFileDialog::getOpenUrl(startDirectory,
678 i18n(
"*rocs *.rocsz|All Rocs files\n*.rocs|Rocs project files\n*.rocsz|Compressed Rocs project files\n*|All files"),
680 i18nc(
"@title:window",
"Open Project Files"));
682 if (file.isEmpty()) {
687 DocumentManager::self().activeDocument()->engineBackend()->stop();
688 DocumentManager::self().closeAllDocuments();
690 delete _currentProject;
694 if (file.fileName().endsWith(
QLatin1String(
"rocsz"), Qt::CaseInsensitive)){
695 _currentProject =
new Project(file, file.directory(KUrl::AppendTrailingSlash));
696 foreach(
const KUrl& graphFile, _currentProject->graphFiles()) {
697 DocumentManager::self().openDocument(graphFile);
700 _currentProject =
new Project(file);
701 foreach(
const KUrl& graphFile, _currentProject->graphFiles()) {
702 DocumentManager::self().openDocument(graphFile);
705 if (_currentProject->graphFiles().count() == 0) {
706 _currentProject->addGraphFileNew(DocumentManager::self().newDocument());
708 foreach(
const KUrl& codeFile, _currentProject->codeFiles()) {
712 if (_currentProject->codeFiles().count() == 0) {
713 _currentProject->addCodeFileNew(_codeEditor->
newScript());
718 _recentProjects->addUrl(file.path(KUrl::RemoveTrailingSlash));
723 void MainWindow::updateCaption()
725 if (!_currentProject) {
730 if (!_currentProject->name().isEmpty()) {
731 caption.
append(_currentProject->name());
733 else if (_currentProject->isTemporary()) {
734 caption.
append(i18nc(
"caption text for temporary project",
"[ untitled ]"));
736 caption.
append(_currentProject->projectFile().toLocalFile());
743 QString basePath = _currentProject->projectDirectory();
744 QString fullSuffix =
"." + suffix;
745 QString fullPrefix = basePrefix;
747 if (fullPrefix.
isNull()) {
748 fullPrefix = _currentProject->projectFile().fileName().remove(
QRegExp(
".rocsz*$"));
749 }
else if (fullPrefix.
endsWith(fullSuffix)) {
753 targetFile.
setFileName(basePath + fullPrefix + fullSuffix);
754 for(
int i = 1; targetFile.
exists(); i++) {
761 void MainWindow::saveScripts()
763 foreach (KTextEditor::Document * textDocument, _currentProject->codeFilesNew()) {
764 QString basePrefix = KInputDialog::getText(i18n(
"ScriptName"), i18n(
"Enter the name of your new script"));
765 QString fileName = uniqueFilename(basePrefix,
"js");
767 textDocument->saveAs(KUrl::fromLocalFile(fileName));
768 _currentProject->saveCodeFileNew(textDocument, fileName);
774 void MainWindow::newScript()
776 if (!_currentProject->isTemporary()) {
777 QString basePrefix = KInputDialog::getText(i18n(
"ScriptName"), i18n(
"Enter the name of your new script"));
778 if (basePrefix.
isNull()) {
779 kDebug() <<
"Filename is empty and no script file was created.";
781 QString fileName = uniqueFilename(basePrefix,
"js");
783 KTextEditor::Document *document = _codeEditor->
newScript(KUrl::fromLocalFile(fileName));
784 _currentProject->addCodeFileNew(document);
785 _currentProject->saveCodeFileNew(document, KUrl::fromLocalFile(fileName));
789 if (!_currentProject->isTemporary()) {
795 void MainWindow::saveGraph(Document* document)
798 document = DocumentManager::self().activeDocument();
801 if (document->fileUrl().isEmpty()) {
802 saveGraphAs(document);
808 void MainWindow::saveAllGraphs()
810 foreach(Document * document, DocumentManager::self().documentList()) {
811 if (document->fileUrl().isEmpty()) {
812 _currentProject->saveGraphFileAs(document,
813 _currentProject->projectFile().toLocalFile().remove(
QRegExp(
".rocsz*$"))
815 }
else if (document->isModified()) {
821 void MainWindow::saveGraphAs()
823 saveGraphAs(DocumentManager::self().activeDocument());
827 void MainWindow::saveGraphAs(Document* document)
830 document = DocumentManager::self().activeDocument();
834 i18n(
"*.graph|Rocs graph documents\n*|All files"),
836 i18nc(
"@title:window",
"Save Graph Document"));
837 _currentProject->saveGraphFileAs(document, file);
840 void MainWindow::newGraph()
842 QString file = KInputDialog::getText(i18n(
"Graph name"), i18n(
"Enter the name of the Graph"));
844 kDebug() <<
"Filename is empty and no script file was created.";
850 DocumentManager::self().openDocument(KUrl::fromLocalFile(file));
851 _currentProject->addGraphFile(file);
856 if (!_currentProject) {
861 bool anyGraphDocumentModified =
false;
862 foreach(Document * document, DocumentManager::self().documentList()) {
863 if (document->isModified()) {
864 anyGraphDocumentModified =
true;
869 if (_currentProject->isModified()
871 || anyGraphDocumentModified
874 const int btnCode = KMessageBox::warningYesNoCancel(
this, i18nc(
876 "Changes on your project are unsaved. Do you want to save your changes?"));
877 if (btnCode == KMessageBox::Yes) {
881 if (btnCode == KMessageBox::No) {
891 void MainWindow::quit()
898 void MainWindow::importGraphFile()
901 Document * gd = importer.importFile();
906 DocumentManager::self().addDocument(gd);
908 if (importer.hasDialog()) {
909 importer.dialogExec();
913 void MainWindow::exportGraphFile()
917 exp.exportFile(DocumentManager::self().activeDocument());
920 void MainWindow::showPossibleIncludes()
926 void MainWindow::showLoadedPlugins()
932 void MainWindow::showCodeEditorConfig()
934 KTextEditor::Editor *editor = _codeEditor->
editor();
935 if (editor->configDialogSupported()) {
936 editor->configDialog(
this);
937 editor->writeConfig();
948 if (ToolsPluginInterface *plugin = ToolManager::self().plugins().value(action->
data().
toInt())) {
949 plugin->run(DocumentManager::self().activeDocument());
953 void MainWindow::executeScriptFull(
const QString& text)
960 Q_ASSERT(_outputWidget);
962 _outputWidget->
clear();
970 QtScriptBackend *engine = DocumentManager::self().activeDocument()->engineBackend();
971 if (engine->isRunning()) {
992 _scriptDbg->
attachTo(engine->engine());
994 _scriptDbg->
action(QScriptEngineDebugger::InterruptAction)->
trigger();
997 script = engine->includeManager().include(script,
998 scriptPath.
isEmpty() ? scriptPath : scriptPath.
section(
'/', 0, -2),
999 _codeEditor->
document()->documentName());
1003 engine->setScript(script, DocumentManager::self().activeDocument());
1010 void MainWindow::executeScriptOneStep(
const QString& text)
1012 Q_ASSERT(_outputWidget);
1014 QtScriptBackend *engine = DocumentManager::self().activeDocument()->engineBackend();
1018 if (!engine->isRunning()) {
1020 _outputWidget->
clear();
1026 script = inc.include(script,
1027 scriptPath.
isEmpty() ? scriptPath : scriptPath.
section(
'/', 0, -2),
1028 _codeEditor->
document()->documentName());
1030 engine->setScript(script, DocumentManager::self().activeDocument());
1031 engine->executeStep();
1034 engine->continueExecutionStep();
1037 void MainWindow::stopScript()
1039 QtScriptBackend *engine = DocumentManager::self().activeDocument()->engineBackend();
1044 void MainWindow::debugScript()
1047 if (action == _interruptScript) {
1056 _stopScript->setEnabled(
true);
1061 _stopScript->setEnabled(
false);
1066 _debugMenu->setVisible(visible);
1071 _stepRunScript->setVisible(visible);
void showExecutionButtonDebug(bool visible)
Show button to execute script in debug mode.
void setAutoShowStandardWindow(bool autoShow)
KTextEditor::Document * document() const
void setupDocumentsList()
setup documents list.
QString & append(QChar ch)
void setSizes(const QList< int > &list)
void openScript(const KUrl &fileUrl)
static void setHScriptSplitterSizeLeft(int v)
Set hScriptSplitterSizeLeft.
static void setVersion(const QString &v)
Set version.
bool remove(const QString &fileName)
bool isModified() const
This method gives modification state of code-editor texts.
void closeEvent(QCloseEvent *event)
void setFileName(const QString &name)
static int dataEdgeDisplay()
Get Position where name and value of an edge shall be shown.
static QStringList includePath()
Get Path where include manager seek for includes.
static int hScriptSplitterSizeRight()
Get hScriptSplitterSizeRight.
QString & remove(int position, int n)
static QString lastOpenedDirectory()
Get lastOpenedDirectory.
void setOrientation(Qt::Orientation)
static int dataNodeDisplay()
Get Position where name and value of a node shall be shown.
void setMapping(QObject *sender, int id)
QString number(int n, int base)
void append(const T &value)
static int hSplitterSizeRight()
Get hSplitterSizeRight.
static int vSplitterSizeTop()
Get vSplitterSizeTop.
QList< int > sizes() const
int toInt(bool *ok) const
static bool executionModeOneStepVisible()
Get Specifies whether execution button for stepped execution shall be shown.
static int hSplitterSizeLeft()
Get hSplitterSizeLeft.
static void setHSplitterSizeLeft(int v)
Set hSplitterSizeLeft.
bool endsWith(const QString &s, Qt::CaseSensitivity cs) const
QFuture< void > map(Sequence &sequence, MapFunction function)
KTextEditor::Document * newScript()
Creates new script.
static void setVSplitterSizeBottom(int v)
Set vSplitterSizeBottom.
static void setVSplitterSizeTop(int v)
Set vSplitterSizeTop.
static void setLastOpenedDirectory(const QString &v)
Set lastOpenedDirectory.
void showExecutionButtonOneStep(bool visible)
Show button to exectue script for one command.
void setData(const QVariant &userData)
void setActiveDocument()
Sets the current active document given by.
virtual bool queryClose()
Reimplemented method KMainWindow::queryClose().
void attachTo(QScriptEngine *engine)
KTextEditor::Editor * editor() const
static int vSplitterSizeBottom()
Get vSplitterSizeBottom.
static void setHScriptSplitterSizeRight(int v)
Set hScriptSplitterSizeRight.
void setActionGroup(QActionGroup *group)
static bool executionModeDebugVisible()
Get Specifies whether execution button for debug execution shall be shown.
QString absoluteFilePath(const QString &fileName) const
static int hScriptSplitterSizeLeft()
Get hScriptSplitterSizeLeft.
QString section(QChar sep, int start, int end, QFlags< QString::SectionFlag > flags) const
static void setHSplitterSizeRight(int v)
Set hSplitterSizeRight.
static QString version()
Get version.
QAction * action(DebuggerAction action) const
int compare(const QString &other) const
void releaseDocument(Document *d)
QFuture< T > mapped(const Sequence &sequence, MapFunction function)