• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

rocs/App

  • sources
  • kde-4.12
  • kdeedu
  • rocs
  • App
  • Ui
MainWindow.cpp
Go to the documentation of this file.
1 /*
2  This file is part of Rocs.
3  Copyright 2008-2011 Tomaz Canabrava <tomaz.canabrava@gmail.com>
4  Copyright 2008 Ugo Sangiori <ugorox@gmail.com>
5  Copyright 2010-2011 Wagner Reck <wagner.reck@gmail.com>
6  Copyright 2011-2013 Andreas Cord-Landwehr <cordlandwehr@kde.org>
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of
11  the License, or (at your option) any later version.
12 
13  This program is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
22 #include "MainWindow.h"
23 #include "rocsversion.h"
24 
25 //Qt related includes
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>
36 #include <QPointer>
37 #include <QGridLayout>
38 #include <QFile>
39 
40 // KDE Related Includes
41 #include <KActionCollection>
42 #include <KRecentFilesAction>
43 #include <KActionMenu>
44 #include <KApplication>
45 #include <KDebug>
46 #include <KIcon>
47 #include <KPushButton>
48 #include <KTar>
49 #include <KTextBrowser>
50 #include <KMessageBox>
51 #include <KLocalizedString>
52 #include <KConfigDialog>
53 #include <KFileDialog>
54 #include <KInputDialog>
55 #include <KMenu>
56 #include <KToolBar>
57 #include <KComboBox>
58 
59 // UI RELATED INCLUDES
60 #include "DocumentTypesWidget.h"
61 #include "GraphVisualEditor.h"
62 #include "Ui/CodeEditor.h"
63 #include "Ui/ScriptOutputWidget.h"
64 #include "Ui/PossibleIncludes.h"
65 #include "Ui/LoadedPluginsDialog.h"
66 #include "Ui/SideDockWidget.h"
67 #include "Ui/JournalEditorWidget.h"
68 #include "Ui/DocumentationWidget.h"
69 #include "InterfacePlugins/ApiDoc/ApiDocWidget.h"
70 #include "Scene/GraphicsLayout.h"
71 
72 // Graph Related Includes
73 #include "Document.h"
74 #include "DataStructure.h"
75 #include "Project.h"
76 
77 #include "settings.h"
78 
79 // Action Related Includes
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"
85 
86 #include <KNS3/DownloadDialog>
87 #include <knewstuff3/uploaddialog.h>
88 
89 // backends
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>
100 #include "IncludeManagerSettings.h"
101 #include "ConfigureDefaultProperties.h"
102 #include <IncludeManager.h>
103 #include "ImporterExporterManager.h"
104 #include <DataStructureBackendInterface.h>
105 #include <DataStructureBackendManager.h>
106 #include "DocumentManager.h"
107 #include "Tools/ToolManager.h"
108 
109 
110 MainWindow::MainWindow()
111  : KXmlGuiWindow()
112  , _currentProject(0)
113  , _scriptDbg(0)
114 {
115  setObjectName("RocsMainWindow");
116 
117  setupWidgets();
118  setupActions();
119  setupGUI(ToolBar | Keys | Save | Create);
120 
121  setupToolbars();
122  setupToolsPluginsAction();
123  setupDSPluginsAction();
124 
125  connect(&DocumentManager::self(), SIGNAL(activateDocument()),
126  this, SLOT(setActiveDocument()));
127  connect(&DocumentManager::self(), SIGNAL(deactivateDocument(Document*)),
128  this, SLOT(releaseDocument(Document*)));
129  connect(&DocumentManager::self(), SIGNAL(documentRemoved(Document*)),
130  this, SLOT(releaseDocument(Document*)));
131 
132  // TODO: use welcome widget instead of creating default empty project
133  createNewProject();
134  updateCaption();
135 
136  GraphicsLayout::self()->setViewStyleDataNode(Settings::dataNodeDisplay());
137  GraphicsLayout::self()->setViewStyleDataEdge(Settings::dataEdgeDisplay());
138 
139  // update rocs config version
140  Settings::setVersion(ROCS_VERSION_STR);
141 
142  // disable save action from kpart, since we take care for the editor by global save action
143  // here "file_save" is the action identifier from katepartui.rc
144  // note that we may not use that name for our own actions
145  foreach(KActionCollection* ac, KActionCollection::allCollections()) {
146  if (ac->action("file_save")) {
147  ac->removeAction(ac->action("file_save"));
148  break; // we only expect that action once
149  }
150  }
151 }
152 
153 MainWindow::~MainWindow()
154 {
155  Settings::setVSplitterSizeTop(_vSplitter->sizes() [0]);
156  Settings::setVSplitterSizeBottom(_vSplitter->sizes() [1]);
157  Settings::setHSplitterSizeLeft(_hSplitter->sizes() [0]);
158  Settings::setHSplitterSizeRight(_hSplitter->sizes() [1]);
159  Settings::setHScriptSplitterSizeLeft(_hScriptSplitter->sizes() [0]);
160  Settings::setHScriptSplitterSizeRight(_hScriptSplitter->sizes() [1]);
161  _recentProjects->saveEntries(Settings::self()->config()->group("RecentFiles"));
162 
163  Settings::self()->writeConfig();
164 }
165 
166 void MainWindow::closeEvent(QCloseEvent *event)
167 {
168  if (queryClose() == true) {
169  event->accept();
170  return;
171  } else {
172  event->ignore();
173  return;
174  }
175 }
176 
177 void MainWindow::setupWidgets()
178 {
179  // setup main widgets
180  QWidget *sidePanel = setupSidePanel();
181  _graphVisualEditor = GraphVisualEditor::self();
182  QWidget *scriptPanel = setupScriptPanel();
183 
184  // splits the main window horizontal
185  _vSplitter = new QSplitter(this);
186  _vSplitter->setOrientation(Qt::Vertical);
187  _vSplitter->addWidget(_graphVisualEditor);
188  _vSplitter->addWidget(scriptPanel);
189 
190  // horizontal arrangement
191  _hSplitter = new QSplitter(this);
192  _hSplitter->setOrientation(Qt::Horizontal);
193  _hSplitter->addWidget(_vSplitter);
194  _hSplitter->addWidget(sidePanel);
195 
196  // set sizes for script panel
197  _hScriptSplitter->setSizes(QList<int>() << Settings::hScriptSplitterSizeLeft() << Settings::hScriptSplitterSizeRight() << 80);
198 
199  // set sizes for vertical splitter
200  _vSplitter->setSizes(QList<int>() << Settings::vSplitterSizeTop() << Settings::vSplitterSizeBottom());
201 
202  // set sizes for side panel
203  // the following solves the setting of the panel width if it was closed at previous session
204  int panelWidth = Settings::hSplitterSizeRight();
205  if (panelWidth == 0) {
206  //FIXME this is only a workaround
207  // that fixes the wrong saving of hSplitterSizeRight
208  panelWidth = 400;
209  }
210  _hSplitter->setSizes(QList<int>() << Settings::hSplitterSizeLeft() << panelWidth);
211 
212  setCentralWidget(_hSplitter);
213 }
214 
215 void MainWindow::setupToolbars()
216 {
217  // If current version in settings file is less than demanded version
218  // perform operations.
219  QString configVersion = Settings::version();
220  if (configVersion.compare(QString("1.7.70")) < 0) {
221  kDebug() << "Apply new default settings for toolbars";
222  KToolBar* bar;
223 
224  bar = toolBar("main");
225  bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
226  bar->setOrientation(Qt::Vertical);
227  addToolBar(Qt::LeftToolBarArea, bar);
228 
229  bar = toolBar("align");
230  bar->setToolButtonStyle(Qt::ToolButtonIconOnly);
231  bar->setOrientation(Qt::Vertical);
232  addToolBar(Qt::LeftToolBarArea, bar);
233  }
234 }
235 
236 void MainWindow::downloadNewExamples()
237 {
238  QPointer<KNS3::DownloadDialog> dialog = new KNS3::DownloadDialog("rocs.knsrc", this);
239  dialog->exec();
240 }
241 
242 void MainWindow::uploadScript()
243 {
244 
245  QPointer<KNS3::UploadDialog> dialog = new KNS3::UploadDialog(this);
246 
247 //First select the opened doc.
248  KUrl str = _codeEditor->document()->url();
249  if (str.isEmpty()) {
250  //... then try to open
251  str = KFileDialog::getOpenFileName(QString(), i18n("*.js|Script files"),
252  this, i18n("Rocs Script Files"));
253  if (str.isEmpty())
254  return;
255  }
256 //Compress the file to a temp file (How it can be made in KDE way ? )
257  QString local = QDir::temp().absoluteFilePath(str.fileName());
258  local.chop(3);
259  local.append(".tar.gz");
260 
261 //create compressed file and set to dialog.
262  KTar tar = KTar(local);
263  tar.open(QIODevice::WriteOnly);
264  tar.addLocalFile(str.toLocalFile(), str.fileName());
265  tar.close();
266  dialog->setUploadFile(local);
267 
268  dialog->setUploadName(_codeEditor->document()->documentName());
269  dialog->setDescription(i18n("Add your description here."));
270 
271  dialog->exec();
272 
273 //Remove compressed file..
274  QDir::temp().remove(local);
275 }
276 
277 
278 QWidget* MainWindow::setupScriptPanel()
279 {
280  _hScriptSplitter = new QSplitter(this);
281  _hScriptSplitter->setOrientation(Qt::Horizontal);
282 
283  _codeEditor = new CodeEditor(this);
284  _outputWidget = new ScriptOutputWidget(this);
285  _outputWidget->setConsoleInterface(new ConsoleModule(_outputWidget));
286 
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);
296  // add actions to action collection to be able to set shortcuts on them in the ui
297  actionCollection()->addAction("_runScript", _runScript);
298  actionCollection()->addAction("_stepRunScript", _stepRunScript);
299  actionCollection()->addAction("_stopScript", _stopScript);
300 
301  // debug controls submenu
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);
311 
312  // set toolbar visibility defaults
313  showExecutionButtonDebug(Settings::executionModeDebugVisible());
314  showExecutionButtonOneStep(Settings::executionModeOneStepVisible());
315 
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()));
321 
322  _hScriptSplitter->addWidget(_codeEditor);
323  _hScriptSplitter->addWidget(_outputWidget);
324 
325  QWidget *scriptInterface = new QWidget(this);
326  scriptInterface->setLayout(new QHBoxLayout);
327  scriptInterface->layout()->addWidget(_hScriptSplitter);
328  scriptInterface->layout()->addWidget(executeCommands);
329 
330  return scriptInterface;
331 }
332 
333 QWidget* MainWindow::setupSidePanel()
334 {
335  QWidget *panel = new QWidget(this);
336  panel->setLayout(new QVBoxLayout);
337  panel->setVisible(false);
338 
339  // add sidebar
340  SideDockWidget* sideDock = new SideDockWidget(panel);
341  addToolBar(Qt::RightToolBarArea, sideDock->toolbar());
342  panel->layout()->addWidget(sideDock);
343 
344  // add widgets to dock
345  // document property widgets
346  DocumentTypesWidget* documentTypesWidget = new DocumentTypesWidget(this);
347  connect(&DocumentManager::self(), SIGNAL(activateDocument()), documentTypesWidget, SLOT(updateDocument()));
348  sideDock->addDock(documentTypesWidget, i18n("Element Types"), KIcon("document-properties"));
349 
350  // Project Journal
351  _journalWidget = new JournalEditorWidget(panel);
352  sideDock->addDock(_journalWidget, i18nc("@title", "Journal"), KIcon("story-editor"));
353 
354  // Rocs handbook
355  DocumentationWidget* documentation = new DocumentationWidget(panel);
356  sideDock->addDock(documentation, i18nc("@title", "Handbook"), KIcon("help-contents"));
357 
358  // Rocs scripting API documentation
359  ApiDocWidget* apiDoc = new ApiDocWidget(panel);
360  sideDock->addDock(apiDoc, i18nc("@title", "Scripting API"), KIcon("documentation"));
361 
362  return panel;
363 }
364 
365 void MainWindow::setupActions()
366 {
367  kDebug() << "create and connect actions";
368  KStandardAction::quit(this, SLOT(quit()), actionCollection());
369  KStandardAction::preferences(this, SLOT(showSettings()), actionCollection());
370 
371  // setup graph visual editor actions and add them to mainwindow action collection
372  _graphVisualEditor->setupActions(actionCollection());
373 
374  // Menu actions
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);
378 
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);
382 
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);
388 // createAction("document-save", i18nc("@action:inmenu", "Save Graph"), "save-graph", SLOT(saveGraph()), 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);
392 
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);
395 // createAction("document-save", i18nc("@action:inmenu", "Save Script"), "save-script", SLOT(saveActiveScript()), _codeEditor);
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);
399 }
400 
401 void MainWindow::createAction(const QByteArray& iconName, const QString& actionTitle, const QString& actionName,
402  const QKeySequence& shortcut, const char* slot, QObject *parent)
403 {
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);
409 }
410 
411 void MainWindow::createAction(const QByteArray& iconName, const QString& actionTitle, const QString& actionName,
412  const char* slot, QObject *parent)
413 {
414  KAction* action = new KAction(KIcon(iconName), actionTitle, parent);
415  actionCollection()->addAction(actionName, action);
416  connect(action, SIGNAL(triggered(bool)), parent, slot);
417 }
418 
419 void MainWindow::showSettings()
420 {
421  QPointer<KConfigDialog> dialog = new KConfigDialog(this, "settings", Settings::self());
422 
423  IncludeManagerSettings * set = new IncludeManagerSettings(dialog);
424  ConfigureDefaultProperties * defaultProperties = new ConfigureDefaultProperties(dialog);
425 
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);
428 
429  // TODO port include manager to kcfg_ elements and remove signals
430  // since then everything is handled by KConfigDialog
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()));
434 
435  connect(defaultProperties, SIGNAL(showExecuteModeDebugChanged(bool)),
436  this, SLOT(showExecutionButtonDebug(bool)));
437  connect(defaultProperties, SIGNAL(showExecuteModeOneStepChanged(bool)),
438  this, SLOT(showExecutionButtonOneStep(bool)));
439 
440  dialog->exec();
441 }
442 
443 void MainWindow::setupToolsPluginsAction()
444 {
445  if (_toolsPlugins.isEmpty()) {
446  createToolsPluginsAction();
447  }
448 
449  foreach(QAction* action, _toolsPlugins) {
450  ToolsPluginInterface *plugin = ToolManager::self().plugins().at(action->data().toInt());
451  action->setEnabled(
452  DocumentManager::self().activeDocument() &&
453  plugin->supportedDataStructures().contains(DocumentManager::self().activeDocument()->backend()->internalName())
454  );
455  }
456 }
457 
458 void MainWindow::createToolsPluginsAction(){
459  QAction *action = 0;
460  QList<ToolsPluginInterface*> availablePlugins = ToolManager::self().plugins();
461  int count = 0;
462  foreach(ToolsPluginInterface * plugin, availablePlugins) {
463  action = new KAction(plugin->displayName(), this);
464  action->setData(count++);
465  connect(action, SIGNAL(triggered(bool)), this, SLOT(runToolPlugin()));
466  _toolsPlugins << action;
467  }
468  unplugActionList("tools_plugins");
469  plugActionList("tools_plugins", _toolsPlugins);
470 }
471 
472 void MainWindow::setupDSPluginsAction()
473 {
474  QList <QAction*> pluginList;
475  QActionGroup* group = new QActionGroup(this);
476  QStringList backends = DataStructureBackendManager::self().backends();
477 
478  // reset values
479  QAction* action = 0;
480  unplugActionList("DS_plugins");
481  // create actions and associate them to signal mapper
482  QSignalMapper* mapper = new QSignalMapper(this);
483  foreach(const QString& identifier, backends) {
484  DataStructureBackendInterface *plugin = DataStructureBackendManager::self().backend(identifier);
485  action = new KAction(plugin->name(), this);
486  action->setCheckable(true);
487  if (plugin->internalName() == DataStructureBackendManager::self().activeBackend()->internalName()) {
488  action->setChecked(true);
489  }
490  action->setActionGroup(group);
491 
492  connect(action, SIGNAL(triggered(bool)), mapper, SLOT(map()));
493  mapper->setMapping(action, identifier);
494  pluginList.append(action);
495  }
496  connect(mapper, SIGNAL(mapped(QString)),
497  &DataStructureBackendManager::self(), SLOT(setBackend(QString)));
498 
499  plugActionList("DS_plugins", pluginList);
500 }
501 
502 void MainWindow::setupDocumentsList()
503 {
504  QList<QAction*> pluginList;
505  QAction* action = 0;
506  unplugActionList("Doc_List");
507  QActionGroup * group = new QActionGroup(this);
508  int count = 0;
509  foreach(Document * doc, DocumentManager::self().documentList()) {
510  action = new KAction(doc->name(), this);
511  action->setData(count++);
512  action->setCheckable(true);
513  if (doc == DocumentManager::self().activeDocument()) {
514  action->setChecked(true);
515  }
516  action->setActionGroup(group);
517  connect(action, SIGNAL(triggered(bool)), &DocumentManager::self(), SLOT(changeDocument()));
518  pluginList.append(action);
519  }
520 
521  plugActionList("Doc_List", pluginList);
522 }
523 
524 void MainWindow::setActiveDocument()
525 {
526  kDebug() << "Setting the document in the main window";
527  Document *activeDocument = DocumentManager::self().activeDocument();
528 
529  // create engine and interface objects to UI plugins
530  QtScriptBackend *engine = activeDocument->engineBackend();
531  engine->engine();
532 
533  // finally set active
534  _graphVisualEditor->setActiveDocument();
535 
536  // Update engine toolbar
537  connect(engine, SIGNAL(finished()), this, SLOT(disableStopAction()));
538 
539  activeDocument->setModified(false);
540  setupToolsPluginsAction();
541 }
542 
543 void MainWindow::releaseDocument(Document* d)
544 {
545  if (d == 0) {
546  return;
547  }
548  d->disconnect(this);
549  disconnect(d);
550 
551  d->engineBackend()->stop();
552  d->engineBackend()->disconnect(this);
553  _graphVisualEditor->releaseDocument();
554 }
555 
556 void MainWindow::addEmptyGraphDocument()
557 {
558  _currentProject->addGraphFileNew(
559  DocumentManager::self().newDocument()
560  );
561 }
562 
563 void MainWindow::importScript()
564 {
565  KUrl startDirectory = Settings::lastOpenedDirectory();
566  if (!_currentProject->isTemporary()) {
567  startDirectory = KUrl::fromPath(_currentProject->projectDirectory());
568  }
569 
570  QString fileUrl = KFileDialog::getOpenFileName( startDirectory,
571  QString(),
572  this,
573  i18nc("@title:window", "Add Existing Script File to Project"));
574  if (fileUrl.isEmpty()) {
575  return;
576  }
577 
578  _currentProject->addCodeFile(fileUrl);
579  _codeEditor->openScript(fileUrl);
580  Settings::setLastOpenedDirectory(startDirectory.toLocalFile());
581 }
582 
583 void MainWindow::loadDocument(const QString& name)
584 {
585  if (!name.isEmpty() && !name.endsWith(QLatin1String(".graph"))) {
586  KMessageBox::sorry(this, i18nc("@info", "This does not seem to be a graph file."), i18nc("@title:window", "Invalid File"));
587  return;
588  }
589 
590  DocumentManager::self().openDocument(KUrl::fromLocalFile(name));
591 }
592 
593 void MainWindow::createNewProject()
594 {
595  if (!queryClose()) {
596  return;
597  }
598 
599  _codeEditor->closeAllScripts();
600  DocumentManager::self().closeAllDocuments();
601 
602  delete _currentProject;
603  _currentProject = new Project();
604  _currentProject->addCodeFileNew(_codeEditor->newScript());
605  _currentProject->addGraphFileNew(DocumentManager::self().newDocument());
606  _journalWidget->openJournal(_currentProject);
607  _currentProject->setModified(false);
608 
609  updateCaption();
610 }
611 
612 void MainWindow::newProjectAssistant()
613 {
614  //TODO needs to be implemented
615 }
616 
617 void MainWindow::saveProject(bool saveAs)
618 {
619  // save graphs and scripts
620 
621  KUrl startDirectory = Settings::lastOpenedDirectory();
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"),
626  this,
627  i18nc("@title:window", "Save Project"));
628 
629  if (file.isEmpty()) {
630  kDebug() << "Filename is empty and no script file was created.";
631  return;
632  }
633  _currentProject->setProjectFile(KUrl::fromLocalFile(file));
634  saveAllGraphs();
635  saveScripts();
636  _journalWidget->saveJournal();
637  if (file.endsWith(QLatin1String("rocsz"))){
638  _currentProject->exportProject(KUrl::fromLocalFile(file));
639  }else {
640 
641  // we need to set project directory first to allow correcte relative paths
642  // save files and finally write project to file
643  _currentProject->writeProjectFile(file);
644  }
645  } else {
646  saveAllGraphs();
647  saveScripts();
648  _journalWidget->saveJournal();
649  if (_currentProject->projectFile().fileName().endsWith(QLatin1String("rocsz"))){
650  _currentProject->exportProject(_currentProject->projectFile());
651  }else{
652  _currentProject->writeProjectFile();
653  }
654  }
655  updateCaption();
656  Settings::setLastOpenedDirectory(_currentProject->projectFile().path());
657 }
658 
659 void MainWindow::saveProjectAs()
660 {
661  saveProject(true);
662 
663  // add project to recently opened projects
664  _recentProjects->addUrl(_currentProject->projectFile().path(KUrl::RemoveTrailingSlash));
665 }
666 
667 void MainWindow::openProject(const KUrl& fileName)
668 {
669  if (!queryClose()) {
670  return;
671  }
672 
673  KUrl startDirectory = Settings::lastOpenedDirectory();
674  KUrl file = fileName;
675  if (file.isEmpty()){
676  // show open dialog
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"),
679  this,
680  i18nc("@title:window", "Open Project Files"));
681 
682  if (file.isEmpty()) {
683  return;
684  }
685  }
686  // import project specified: close everything and delete old project
687  DocumentManager::self().activeDocument()->engineBackend()->stop();
688  DocumentManager::self().closeAllDocuments();
689  _codeEditor->closeAllScripts();
690  delete _currentProject;
691 
692  // extract and open new project
693  // at the end of this _currentProject must exist
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);
698  }
699  } else {
700  _currentProject = new Project(file);
701  foreach(const KUrl& graphFile, _currentProject->graphFiles()) {
702  DocumentManager::self().openDocument(graphFile);
703  }
704  }
705  if (_currentProject->graphFiles().count() == 0) {
706  _currentProject->addGraphFileNew(DocumentManager::self().newDocument());
707  }
708  foreach(const KUrl& codeFile, _currentProject->codeFiles()) {
709  _codeEditor->openScript(codeFile);
710  //TODO set curser line
711  }
712  if (_currentProject->codeFiles().count() == 0) {
713  _currentProject->addCodeFileNew(_codeEditor->newScript());
714  }
715  _journalWidget->openJournal(_currentProject);
716 
717  updateCaption();
718  _recentProjects->addUrl(file.path(KUrl::RemoveTrailingSlash));
719  Settings::setLastOpenedDirectory(file.path());
720 }
721 
722 
723 void MainWindow::updateCaption()
724 {
725  if (!_currentProject) {
726  return;
727  }
728 
729  QString caption = "";
730  if (!_currentProject->name().isEmpty()) {
731  caption.append(_currentProject->name());
732  }
733  else if (_currentProject->isTemporary()) {
734  caption.append(i18nc("caption text for temporary project", "[ untitled ]"));
735  } else {
736  caption.append(_currentProject->projectFile().toLocalFile());
737  }
738  setCaption(caption);
739 }
740 
741 QString MainWindow::uniqueFilename(const QString &basePrefix, const QString &suffix) {
742  QFile targetFile;
743  QString basePath = _currentProject->projectDirectory();
744  QString fullSuffix = "." + suffix;
745  QString fullPrefix = basePrefix;
746 
747  if (fullPrefix.isNull()) {
748  fullPrefix = _currentProject->projectFile().fileName().remove(QRegExp(".rocsz*$"));
749  } else if (fullPrefix.endsWith(fullSuffix)) {
750  fullPrefix.remove(QRegExp(fullSuffix + "$"));
751  }
752 
753  targetFile.setFileName(basePath + fullPrefix + fullSuffix);
754  for(int i = 1; targetFile.exists(); i++) {
755  targetFile.setFileName(basePath + fullPrefix + QString::number(i) + fullSuffix);
756  }
757 
758  return targetFile.fileName();
759 }
760 
761 void MainWindow::saveScripts()
762 {
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");
766 
767  textDocument->saveAs(KUrl::fromLocalFile(fileName));
768  _currentProject->saveCodeFileNew(textDocument, fileName);
769  }
770 
771  _codeEditor->saveAllScripts();
772 }
773 
774 void MainWindow::newScript()
775 {
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.";
780  } else {
781  QString fileName = uniqueFilename(basePrefix, "js");
782 
783  KTextEditor::Document *document = _codeEditor->newScript(KUrl::fromLocalFile(fileName));
784  _currentProject->addCodeFileNew(document);
785  _currentProject->saveCodeFileNew(document, KUrl::fromLocalFile(fileName));
786  }
787  } else {
788  saveProject(true);
789  if (!_currentProject->isTemporary()) {
790  newScript();
791  }
792  }
793 }
794 
795 void MainWindow::saveGraph(Document* document)
796 {
797  if (document == 0) {
798  document = DocumentManager::self().activeDocument();
799  }
800  Q_ASSERT(document);
801  if (document->fileUrl().isEmpty()) {
802  saveGraphAs(document);
803  } else {
804  document->save();
805  }
806 }
807 
808 void MainWindow::saveAllGraphs()
809 {
810  foreach(Document * document, DocumentManager::self().documentList()) {
811  if (document->fileUrl().isEmpty()) {
812  _currentProject->saveGraphFileAs(document,
813  _currentProject->projectFile().toLocalFile().remove(QRegExp(".rocsz*$"))
814  + ".graph");
815  } else if (document->isModified()) {
816  document->save();
817  }
818  }
819 }
820 
821 void MainWindow::saveGraphAs()
822 {
823  saveGraphAs(DocumentManager::self().activeDocument());
824 }
825 
826 
827 void MainWindow::saveGraphAs(Document* document)
828 {
829  if (document == 0) {
830  document = DocumentManager::self().activeDocument();
831  }
832  Q_ASSERT(document);
833  QString file = KFileDialog::getSaveFileName(QString(),
834  i18n("*.graph|Rocs graph documents\n*|All files"),
835  this,
836  i18nc("@title:window", "Save Graph Document"));
837  _currentProject->saveGraphFileAs(document, file);
838 }
839 
840 void MainWindow::newGraph()
841 {
842  QString file = KInputDialog::getText(i18n("Graph name"), i18n("Enter the name of the Graph"));
843  if (file.isEmpty()) {
844  kDebug() << "Filename is empty and no script file was created.";
845  return;
846  }
847  if (!file.endsWith(QLatin1String(".graph"))){
848  file.append(".graph");
849  }
850  DocumentManager::self().openDocument(KUrl::fromLocalFile(file));
851  _currentProject->addGraphFile(file);
852 }
853 
854 bool MainWindow::queryClose()
855 {
856  if (!_currentProject) {
857  return true;
858  }
859 
860  //TODO move modification information to project
861  bool anyGraphDocumentModified = false;
862  foreach(Document * document, DocumentManager::self().documentList()) {
863  if (document->isModified()) {
864  anyGraphDocumentModified = true;
865  break;
866  }
867  }
868 
869  if (_currentProject->isModified()
870  || _journalWidget->isModified()
871  || anyGraphDocumentModified
872  || _codeEditor->isModified())
873  {
874  const int btnCode = KMessageBox::warningYesNoCancel(this, i18nc(
875  "@info",
876  "Changes on your project are unsaved. Do you want to save your changes?"));
877  if (btnCode == KMessageBox::Yes) {
878  saveProject();
879  return true;
880  }
881  if (btnCode == KMessageBox::No) {
882  return true;
883  }
884  // do not close
885  return false;
886  }
887  // save to close project: no changes
888  return true;
889 }
890 
891 void MainWindow::quit()
892 {
893  if (queryClose()) {
894  kapp->quit();
895  }
896 }
897 
898 void MainWindow::importGraphFile()
899 {
900  ImporterExporterManager importer(this);
901  Document * gd = importer.importFile();
902  if (gd == 0) {
903  return;
904  }
905 
906  DocumentManager::self().addDocument(gd);
907 
908  if (importer.hasDialog()) {
909  importer.dialogExec();
910  }
911 }
912 
913 void MainWindow::exportGraphFile()
914 {
915  ImporterExporterManager exp(this);
916 
917  exp.exportFile(DocumentManager::self().activeDocument());
918 }
919 
920 void MainWindow::showPossibleIncludes()
921 {
922  QPointer<PossibleIncludes> dialog = new PossibleIncludes(this);
923  dialog->exec();
924 }
925 
926 void MainWindow::showLoadedPlugins()
927 {
928  QPointer<LoadedPluginsDialog> dialog = new LoadedPluginsDialog(this);
929  dialog->exec();
930 }
931 
932 void MainWindow::showCodeEditorConfig()
933 {
934  KTextEditor::Editor *editor = _codeEditor->editor();
935  if (editor->configDialogSupported()) {
936  editor->configDialog(this);
937  editor->writeConfig();
938  }
939 }
940 
941 void MainWindow::runToolPlugin()
942 {
943  QAction *action = qobject_cast<QAction *> (sender());
944 
945  if (! action) {
946  return;
947  }
948  if (ToolsPluginInterface *plugin = ToolManager::self().plugins().value(action->data().toInt())) {
949  plugin->run(DocumentManager::self().activeDocument());
950  }
951 }
952 
953 void MainWindow::executeScriptFull(const QString& text)
954 {
955  executeScript(MainWindow::Execute, text);
956 }
957 
958 void MainWindow::executeScript(const MainWindow::ScriptMode mode, const QString& text)
959 {
960  Q_ASSERT(_outputWidget);
961  if (_outputWidget->isOutputClearEnabled()) {
962  _outputWidget->clear();
963  }
964 
965  // set script
966  QString script = text.isEmpty() ? _codeEditor->text() : text;
967  QString scriptPath = _codeEditor->document()->url().path();
968 
969  // prepare engine
970  QtScriptBackend *engine = DocumentManager::self().activeDocument()->engineBackend();
971  if (engine->isRunning()) {
972  engine->stop();
973  }
974 
975  // set console
976  // TODO this should part of a plugin interface to for setting up all engine modules
977  engine->registerGlobalObject(_outputWidget->consoleInterface(), "Console");
978 
979  connect(engine, SIGNAL(scriptError(QString)), _outputWidget->consoleInterface(), SLOT(error(QString)));
980  connect(engine, SIGNAL(scriptInfo(QString)), _outputWidget->consoleInterface(), SLOT(log(QString)));
981  connect(engine, SIGNAL(sendDebug(QString)), _outputWidget->consoleInterface(), SLOT(debug(QString)));
982  connect(engine, SIGNAL(sendOutput(QString)), _outputWidget->consoleInterface(), SLOT(log(QString)));
983 
984  if (_scriptDbg) {
985  _scriptDbg->detach();
986  _scriptDbg->deleteLater();
987  _scriptDbg = 0;
988  }
989  if (mode != Execute) {
990  _scriptDbg = new QScriptEngineDebugger(this);
991  _scriptDbg->setAutoShowStandardWindow(true);
992  _scriptDbg->attachTo(engine->engine());
993  if (mode == MainWindow::DebugMode)
994  _scriptDbg->action(QScriptEngineDebugger::InterruptAction)->trigger();
995  }
996  engine->includeManager().initialize(Settings::includePath());
997  script = engine->includeManager().include(script,
998  scriptPath.isEmpty() ? scriptPath : scriptPath.section('/', 0, -2),
999  _codeEditor->document()->documentName());
1000 
1001  enableStopAction();
1002 
1003  engine->setScript(script, DocumentManager::self().activeDocument());
1004  engine->execute();
1005 
1006  // disconnect console listener
1007  engine->disconnect(_outputWidget->consoleInterface());
1008 }
1009 
1010 void MainWindow::executeScriptOneStep(const QString& text)
1011 {
1012  Q_ASSERT(_outputWidget);
1013 
1014  QtScriptBackend *engine = DocumentManager::self().activeDocument()->engineBackend();
1015 
1016  //TODO disable start action
1017  enableStopAction();
1018  if (!engine->isRunning()) {
1019  if (_outputWidget->isOutputClearEnabled()) {
1020  _outputWidget->clear();
1021  }
1022  QString script = text.isEmpty() ? _codeEditor->text() : text;
1023  QString scriptPath = _codeEditor->document()->url().path();
1024  IncludeManager inc;
1025 
1026  script = inc.include(script,
1027  scriptPath.isEmpty() ? scriptPath : scriptPath.section('/', 0, -2),
1028  _codeEditor->document()->documentName());
1029 
1030  engine->setScript(script, DocumentManager::self().activeDocument());
1031  engine->executeStep();
1032  return;
1033  }
1034  engine->continueExecutionStep();
1035 }
1036 
1037 void MainWindow::stopScript()
1038 {
1039  QtScriptBackend *engine = DocumentManager::self().activeDocument()->engineBackend();
1040  disableStopAction();
1041  engine->stop();
1042 }
1043 
1044 void MainWindow::debugScript()
1045 {
1046  QAction *action = qobject_cast<QAction *> (sender());
1047  if (action == _interruptScript) {
1048  executeScript(DebugMode);
1049  } else {
1050  executeScript(DebugOnlyInCaseOfError);
1051  }
1052 }
1053 
1054 void MainWindow::enableStopAction()
1055 {
1056  _stopScript->setEnabled(true);
1057 }
1058 
1059 void MainWindow::disableStopAction()
1060 {
1061  _stopScript->setEnabled(false);
1062 }
1063 
1064 void MainWindow::showExecutionButtonDebug(bool visible)
1065 {
1066  _debugMenu->setVisible(visible);
1067 }
1068 
1069 void MainWindow::showExecutionButtonOneStep(bool visible)
1070 {
1071  _stepRunScript->setVisible(visible);
1072 }
ImporterExporterManager
Definition: ImporterExporterManager.h:27
MainWindow::showExecutionButtonDebug
void showExecutionButtonDebug(bool visible)
Show button to execute script in debug mode.
Definition: MainWindow.cpp:1064
CodeEditor::document
KTextEditor::Document * document() const
Definition: CodeEditor.h:51
MainWindow::setupDocumentsList
void setupDocumentsList()
setup documents list.
Definition: MainWindow.cpp:502
SideDockWidget::toolbar
QToolBar * toolbar() const
Definition: SideDockWidget.cpp:201
MainWindow::ScriptMode
ScriptMode
Definition: MainWindow.h:70
SideDockWidget.h
CodeEditor::openScript
void openScript(const KUrl &fileUrl)
Definition: CodeEditor.cpp:158
Settings::setHScriptSplitterSizeLeft
static void setHScriptSplitterSizeLeft(int v)
Set hScriptSplitterSizeLeft.
Definition: settings.h:153
PossibleIncludes.h
CodeEditor.h
ScriptOutputWidget
This widget displays output and debug messages from a ConsoleInterface object.
Definition: ScriptOutputWidget.h:33
Settings::setVersion
static void setVersion(const QString &v)
Set version.
Definition: settings.h:39
QWidget
CodeEditor::isModified
bool isModified() const
This method gives modification state of code-editor texts.
Definition: CodeEditor.cpp:255
MainWindow::closeEvent
void closeEvent(QCloseEvent *event)
Definition: MainWindow.cpp:166
ScriptOutputWidget.h
Settings::dataEdgeDisplay
static int dataEdgeDisplay()
Get Position where name and value of an edge shall be shown.
Definition: settings.h:258
Settings::includePath
static QStringList includePath()
Get Path where include manager seek for includes.
Definition: settings.h:220
JournalEditorWidget.h
MainWindow.h
Settings::hScriptSplitterSizeRight
static int hScriptSplitterSizeRight()
Get hScriptSplitterSizeRight.
Definition: settings.h:182
Settings::lastOpenedDirectory
static QString lastOpenedDirectory()
Get lastOpenedDirectory.
Definition: settings.h:201
ConfigureDefaultProperties
Definition: ConfigureDefaultProperties.h:29
QObject
Settings::dataNodeDisplay
static int dataNodeDisplay()
Get Position where name and value of a node shall be shown.
Definition: settings.h:239
Settings::self
static Settings * self()
Definition: settings.cpp:17
SideDockWidget::addDock
void addDock(QWidget *dock, const QString &title, const KIcon &icon)
Definition: SideDockWidget.cpp:134
JournalEditorWidget::saveJournal
void saveJournal()
Writes current journal content to file as specified by its project.
Definition: JournalEditorWidget.cpp:70
Settings::hSplitterSizeRight
static int hSplitterSizeRight()
Get hSplitterSizeRight.
Definition: settings.h:144
CodeEditor::text
QString text() const
Definition: CodeEditor.cpp:249
Settings::vSplitterSizeTop
static int vSplitterSizeTop()
Get vSplitterSizeTop.
Definition: settings.h:87
KXmlGuiWindow
DocumentTypesWidget
This widget allows direct access to the data and pointer types of the currently activated document...
Definition: DocumentTypesWidget.h:40
ScriptOutputWidget::consoleInterface
ConsoleModule * consoleInterface() const
Definition: ScriptOutputWidget.cpp:60
Settings::executionModeOneStepVisible
static bool executionModeOneStepVisible()
Get Specifies whether execution button for stepped execution shall be shown.
Definition: settings.h:296
ScriptOutputWidget::clear
void clear()
Definition: ScriptOutputWidget.cpp:75
Settings::hSplitterSizeLeft
static int hSplitterSizeLeft()
Get hSplitterSizeLeft.
Definition: settings.h:125
Settings::setHSplitterSizeLeft
static void setHSplitterSizeLeft(int v)
Set hSplitterSizeLeft.
Definition: settings.h:115
MainWindow::disableStopAction
void disableStopAction()
Definition: MainWindow.cpp:1059
CodeEditor::newScript
KTextEditor::Document * newScript()
Creates new script.
Definition: CodeEditor.cpp:106
Settings::setVSplitterSizeBottom
static void setVSplitterSizeBottom(int v)
Set vSplitterSizeBottom.
Definition: settings.h:96
DocumentTypesWidget.h
CodeEditor
Definition: CodeEditor.h:38
JournalEditorWidget::openJournal
void openJournal(Project *project)
Loads journal from specified project project.
Definition: JournalEditorWidget.cpp:42
JournalEditorWidget::isModified
bool isModified() const
Definition: JournalEditorWidget.cpp:97
Settings::setVSplitterSizeTop
static void setVSplitterSizeTop(int v)
Set vSplitterSizeTop.
Definition: settings.h:77
Settings::setLastOpenedDirectory
static void setLastOpenedDirectory(const QString &v)
Set lastOpenedDirectory.
Definition: settings.h:191
MainWindow::showExecutionButtonOneStep
void showExecutionButtonOneStep(bool visible)
Show button to exectue script for one command.
Definition: MainWindow.cpp:1069
LoadedPluginsDialog
Definition: LoadedPluginsDialog.h:24
MainWindow::setActiveDocument
void setActiveDocument()
Sets the current active document given by.
Definition: MainWindow.cpp:524
MainWindow::queryClose
virtual bool queryClose()
Reimplemented method KMainWindow::queryClose().
Definition: MainWindow.cpp:854
DocumentationWidget
Definition: DocumentationWidget.h:27
MainWindow::DebugMode
Definition: MainWindow.h:72
CodeEditor::closeAllScripts
void closeAllScripts()
Definition: CodeEditor.cpp:58
MainWindow::enableStopAction
void enableStopAction()
Definition: MainWindow.cpp:1054
ConfigureDefaultProperties.h
JournalEditorWidget
This class contains a UI to edit a project's journal file.
Definition: JournalEditorWidget.h:34
CodeEditor::editor
KTextEditor::Editor * editor() const
Definition: CodeEditor.h:48
MainWindow::MainWindow
MainWindow()
Definition: MainWindow.cpp:110
CodeEditor::saveAllScripts
void saveAllScripts()
Definition: CodeEditor.cpp:218
SideDockWidget
Docking widget for side panel.
Definition: SideDockWidget.h:54
settings.h
Settings::vSplitterSizeBottom
static int vSplitterSizeBottom()
Get vSplitterSizeBottom.
Definition: settings.h:106
Settings::setHScriptSplitterSizeRight
static void setHScriptSplitterSizeRight(int v)
Set hScriptSplitterSizeRight.
Definition: settings.h:172
Settings::executionModeDebugVisible
static bool executionModeDebugVisible()
Get Specifies whether execution button for debug execution shall be shown.
Definition: settings.h:277
ApiDocWidget
This Widget loads API information about all script interfaces and displays them.
Definition: ApiDocWidget.h:32
Settings::hScriptSplitterSizeLeft
static int hScriptSplitterSizeLeft()
Get hScriptSplitterSizeLeft.
Definition: settings.h:163
LoadedPluginsDialog.h
MainWindow::~MainWindow
~MainWindow()
Definition: MainWindow.cpp:153
Settings::setHSplitterSizeRight
static void setHSplitterSizeRight(int v)
Set hSplitterSizeRight.
Definition: settings.h:134
MainWindow::Execute
Definition: MainWindow.h:71
DocumentationWidget.h
Settings::version
static QString version()
Get version.
Definition: settings.h:49
ScriptOutputWidget::isOutputClearEnabled
bool isOutputClearEnabled() const
Definition: ScriptOutputWidget.cpp:81
ScriptOutputWidget::setConsoleInterface
void setConsoleInterface(ConsoleModule *console)
Definition: ScriptOutputWidget.cpp:51
MainWindow::DebugOnlyInCaseOfError
Definition: MainWindow.h:73
ApiDocWidget.h
MainWindow::releaseDocument
void releaseDocument(Document *d)
Definition: MainWindow.cpp:543
IncludeManagerSettings.h
ImporterExporterManager.h
IncludeManagerSettings
Definition: IncludeManagerSettings.h:27
PossibleIncludes
Definition: PossibleIncludes.h:26
MainWindow::runToolPlugin
void runToolPlugin()
Definition: MainWindow.cpp:941
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:42:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

rocs/App

Skip menu "rocs/App"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal