changeset 14703:f86884be20fc gui

Renamed all source files of the gui to lowercase and .cc to be conform with the octave sources.
author Jacob Dawid <jacob.dawid@googlemail.com>
date Thu, 31 May 2012 20:53:56 +0200
parents 06abf71d9083
children 674740c44c09
files gui/src/FilesDockWidget.cpp gui/src/FilesDockWidget.h gui/src/HistoryDockWidget.cpp gui/src/HistoryDockWidget.h gui/src/MainWindow.cpp gui/src/MainWindow.h gui/src/OctaveGUI.cpp gui/src/ResourceManager.cpp gui/src/ResourceManager.h gui/src/SettingsDialog.cpp gui/src/SettingsDialog.h gui/src/SettingsDialog.ui gui/src/TerminalDockWidget.cpp gui/src/TerminalDockWidget.h gui/src/WelcomeWizard.cpp gui/src/WelcomeWizard.h gui/src/WelcomeWizard.ui gui/src/WorkspaceModel.cpp gui/src/WorkspaceModel.h gui/src/WorkspaceView.cpp gui/src/WorkspaceView.h gui/src/backend/OctaveLink.cpp gui/src/backend/OctaveLink.h gui/src/backend/OctaveMainThread.cpp gui/src/backend/OctaveMainThread.h gui/src/backend/SymbolInformation.h gui/src/backend/octavelink.cc gui/src/backend/octavelink.h gui/src/backend/octavemainthread.cc gui/src/backend/octavemainthread.h gui/src/backend/symbolinformation.h gui/src/editor/FileEditor.cpp gui/src/editor/FileEditor.h gui/src/editor/FileEditorInterface.h gui/src/editor/FileEditorTab.cpp gui/src/editor/FileEditorTab.h gui/src/editor/fileeditor.cc gui/src/editor/fileeditor.h gui/src/editor/fileeditorinterface.h gui/src/editor/fileeditortab.cc gui/src/editor/fileeditortab.h gui/src/editor/lexeroctavegui.cc gui/src/editor/lexeroctavegui.cpp gui/src/editor/lexeroctavegui.h gui/src/filesdockwidget.cc gui/src/filesdockwidget.h gui/src/historydockwidget.cc gui/src/historydockwidget.h gui/src/mainwindow.cc gui/src/mainwindow.h gui/src/octavegui.cc gui/src/resourcemanager.cc gui/src/resourcemanager.h gui/src/settingsdialog.cc gui/src/settingsdialog.h gui/src/settingsdialog.ui gui/src/src.pro gui/src/terminaldockwidget.cc gui/src/terminaldockwidget.h gui/src/welcomewizard.cc gui/src/welcomewizard.h gui/src/welcomewizard.ui gui/src/workspacemodel.cc gui/src/workspacemodel.h gui/src/workspaceview.cc gui/src/workspaceview.h
diffstat 66 files changed, 6446 insertions(+), 6446 deletions(-) [+]
line wrap: on
line diff
--- a/gui/src/FilesDockWidget.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,199 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ResourceManager.h"
-#include "FilesDockWidget.h"
-
-#include <QApplication>
-#include <QFileInfo>
-#include <QCompleter>
-#include <QSettings>
-#include <QProcess>
-#include <QDebug>
-
-FilesDockWidget::FilesDockWidget (QWidget *parent)
-  : QDockWidget (parent)
-{
-  setObjectName ("FilesDockWidget");
-  setWindowTitle (tr ("Current Directory"));
-  setWidget (new QWidget (this));
-
-  // Create a toolbar
-  m_navigationToolBar = new QToolBar ("", widget ());
-  m_navigationToolBar->setAllowedAreas (Qt::TopToolBarArea);
-  m_navigationToolBar->setMovable (false);
-  m_navigationToolBar->setIconSize (QSize (20, 20));
-
-  // Add a button to the toolbar with the QT standard icon for up-directory
-  // TODO: Maybe change this to be an up-directory icon that is OS specific???
-  QStyle *style = QApplication::style ();
-  m_directoryIcon = style->standardIcon (QStyle::SP_FileDialogToParent);
-  m_directoryUpAction = new QAction (m_directoryIcon, "", m_navigationToolBar);
-  m_directoryUpAction->setStatusTip (tr ("Move up one directory."));
-
-  m_currentDirectory = new QLineEdit (m_navigationToolBar);
-  m_currentDirectory->setStatusTip (tr ("Enter the path or filename."));
-
-  m_navigationToolBar->addAction (m_directoryUpAction);
-  m_navigationToolBar->addWidget (m_currentDirectory);
-  connect (m_directoryUpAction, SIGNAL (triggered ()), this,
-           SLOT (onUpDirectory ()));
-
-  // TODO: Add other buttons for creating directories
-
-  // Create the QFileSystemModel starting in the home directory
-  QString
-    homePath = QDir::homePath ();
-  // TODO: This should occur after Octave has been initialized and the startup directory of Octave is established
-
-  m_fileSystemModel = new QFileSystemModel (this);
-  m_fileSystemModel->setFilter (QDir::NoDotAndDotDot | QDir::AllEntries);
-  QModelIndex
-    rootPathIndex = m_fileSystemModel->setRootPath (homePath);
-
-  // Attach the model to the QTreeView and set the root index
-  m_fileTreeView = new QTreeView (widget ());
-  m_fileTreeView->setModel (m_fileSystemModel);
-  m_fileTreeView->setRootIndex (rootPathIndex);
-  m_fileTreeView->setSortingEnabled (true);
-  m_fileTreeView->setAlternatingRowColors (true);
-  m_fileTreeView->setAnimated (true);
-  m_fileTreeView->setColumnHidden (1, true);
-  m_fileTreeView->setColumnHidden (2, true);
-  m_fileTreeView->setColumnHidden (3, true);
-  m_fileTreeView->setStatusTip (tr ("Doubleclick a file to open it."));
-
-  setCurrentDirectory (m_fileSystemModel->fileInfo (rootPathIndex).
-                       absoluteFilePath ());
-
-  connect (m_fileTreeView, SIGNAL (doubleClicked (const QModelIndex &)), this,
-           SLOT (itemDoubleClicked (const QModelIndex &)));
-
-  // Layout the widgets vertically with the toolbar on top
-  QVBoxLayout *
-    layout = new QVBoxLayout ();
-  layout->setSpacing (0);
-  layout->addWidget (m_navigationToolBar);
-  layout->addWidget (m_fileTreeView);
-  layout->setMargin (1);
-  widget ()->setLayout (layout);
-  // TODO: Add right-click contextual menus for copying, pasting, deleting files (and others)
-
-  connect (m_currentDirectory, SIGNAL (returnPressed ()), this,
-           SLOT (currentDirectoryEntered ()));
-  QCompleter *
-    completer = new QCompleter (m_fileSystemModel, this);
-  m_currentDirectory->setCompleter (completer);
-
-  connect (this, SIGNAL (visibilityChanged(bool)), this, SLOT(handleVisibilityChanged(bool)));
-}
-
-void
-FilesDockWidget::itemDoubleClicked (const QModelIndex & index)
-{
-  // Retrieve the file info associated with the model index.
-  QFileInfo fileInfo = m_fileSystemModel->fileInfo (index);
-
-  // If it is a directory, cd into it.
-  if (fileInfo.isDir ())
-    {
-      m_fileSystemModel->setRootPath (fileInfo.absolutePath ());
-      m_fileTreeView->setRootIndex (index);
-      setCurrentDirectory (m_fileSystemModel->fileInfo (index).
-                           absoluteFilePath ());
-    }
-  // Otherwise attempt to open it.
-  else
-    {
-      // Check if the user wants to use a custom file editor.
-      QSettings *settings = ResourceManager::instance ()->settings ();
-      if (settings->value ("useCustomFileEditor").toBool ())
-        {
-          QString editor = settings->value ("customFileEditor").toString ();
-          QStringList arguments;
-          arguments << fileInfo.filePath ();
-          QProcess::startDetached (editor, arguments);
-        }
-      else
-        {
-          emit openFile (fileInfo.filePath ());
-        }
-    }
-}
-
-void
-FilesDockWidget::setCurrentDirectory (QString currentDirectory)
-{
-  m_currentDirectory->setText (currentDirectory);
-}
-
-void
-FilesDockWidget::onUpDirectory (void)
-{
-  QDir dir =
-    QDir (m_fileSystemModel->filePath (m_fileTreeView->rootIndex ()));
-  dir.cdUp ();
-  m_fileSystemModel->setRootPath (dir.absolutePath ());
-  m_fileTreeView->setRootIndex (m_fileSystemModel->
-                                index (dir.absolutePath ()));
-  setCurrentDirectory (dir.absolutePath ());
-}
-
-void
-FilesDockWidget::currentDirectoryEntered ()
-{
-  QFileInfo fileInfo (m_currentDirectory->text ());
-  if (fileInfo.isDir ())
-    {
-      m_fileTreeView->setRootIndex (m_fileSystemModel->
-                                    index (fileInfo.absolutePath ()));
-      m_fileSystemModel->setRootPath (fileInfo.absolutePath ());
-      setCurrentDirectory (fileInfo.absoluteFilePath ());
-    }
-  else
-    {
-      if (QFile::exists (fileInfo.absoluteFilePath ()))
-        emit openFile (fileInfo.absoluteFilePath ());
-    }
-}
-
-void
-FilesDockWidget::noticeSettings ()
-{
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  m_fileTreeView->setColumnHidden (0, !settings->value ("showFilenames").toBool ());
-  m_fileTreeView->setColumnHidden (1, !settings->value ("showFileSize").toBool ());
-  m_fileTreeView->setColumnHidden (2, !settings->value ("showFileType").toBool ());
-  m_fileTreeView->setColumnHidden (3, !settings->value ("showLastModified").toBool ());
-  m_fileTreeView->setAlternatingRowColors (settings->value ("useAlternatingRowColors").toBool ());
-  //if (settings.value ("showHiddenFiles").toBool ())
-  // TODO: React on option for hidden files.
-}
-
-void
-FilesDockWidget::handleVisibilityChanged (bool visible)
-{
-  if (visible)
-    emit activeChanged (true);
-}
-
-void
-FilesDockWidget::closeEvent (QCloseEvent *event)
-{
-  emit activeChanged (false);
-  QDockWidget::closeEvent (event);
-}
--- a/gui/src/FilesDockWidget.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,85 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef FILESDOCKWIDGET_H
-#define FILESDOCKWIDGET_H
-
-#include <QListView>
-#include <QDate>
-#include <QObject>
-#include <QWidget>
-#include <QListWidget>
-#include <QFileSystemModel>
-#include <QToolBar>
-#include <QToolButton>
-#include <QVBoxLayout>
-#include <QAction>
-#include <QTreeView>
-
-#include <QDockWidget>
-#include <QLineEdit>
-
-class FilesDockWidget : public QDockWidget
-{
-  Q_OBJECT
-public:
-  FilesDockWidget (QWidget *parent = 0);
-
-public slots:
-  /** Slot for handling a change in directory via double click. */
-  void itemDoubleClicked (const QModelIndex & index);
-
-  /** Slot for handling the up-directory button in the toolbar. */
-  void onUpDirectory ();
-
-  void setCurrentDirectory (QString currentDirectory);
-
-  void currentDirectoryEntered ();
-
-  /** Tells the widget to notice settings that are probably new. */
-  void noticeSettings ();
-  void handleVisibilityChanged (bool visible);
-
-signals:
-  void openFile (QString fileName);
-
-  /** Custom signal that tells if a user has clicke away that dock widget. */
-  void activeChanged (bool active);
-
-protected:
-  void closeEvent (QCloseEvent *event);
-
-private:
-  // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc
-
-    /** Toolbar for file and directory manipulation. */
-    QToolBar * m_navigationToolBar;
-
-    /** Variables for the up-directory action. */
-  QIcon m_directoryIcon;
-  QAction *m_directoryUpAction;
-  QToolButton *upDirectoryButton;
-
-    /** The file system model. */
-  QFileSystemModel *m_fileSystemModel;
-
-    /** The file system view. */
-  QTreeView *m_fileTreeView;
-  QLineEdit *m_currentDirectory;
-};
-
-#endif // FILESDOCKWIDGET_H
--- a/gui/src/HistoryDockWidget.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "HistoryDockWidget.h"
-#include <QVBoxLayout>
-
-HistoryDockWidget::HistoryDockWidget (QWidget * parent):QDockWidget (parent)
-{
-  setObjectName ("HistoryDockWidget");
-  construct ();
-}
-
-void
-HistoryDockWidget::construct ()
-{
-  m_sortFilterProxyModel.setSourceModel(OctaveLink::instance ()->historyModel());
-  m_historyListView = new QListView (this);
-  m_historyListView->setModel (&m_sortFilterProxyModel);
-  m_historyListView->setAlternatingRowColors (true);
-  m_historyListView->setEditTriggers (QAbstractItemView::NoEditTriggers);
-  m_historyListView->setStatusTip (tr ("Doubleclick a command to transfer it to the terminal."));
-  m_filterLineEdit = new QLineEdit (this);
-  m_filterLineEdit->setStatusTip (tr ("Enter text to filter the command history."));
-  QVBoxLayout *layout = new QVBoxLayout ();
-
-  setWindowTitle (tr ("Command History"));
-  setWidget (new QWidget ());
-
-  layout->addWidget (m_historyListView);
-  layout->addWidget (m_filterLineEdit);
-  layout->setMargin (2);
-
-  widget ()->setLayout (layout);
-
-  connect (m_filterLineEdit, SIGNAL (textEdited (QString)), &m_sortFilterProxyModel, SLOT (setFilterWildcard(QString)));
-  connect (m_historyListView, SIGNAL (doubleClicked (QModelIndex)), this, SLOT (handleDoubleClick (QModelIndex)));
-  connect (this, SIGNAL (visibilityChanged(bool)), this, SLOT(handleVisibilityChanged(bool)));
-}
-
-void
-HistoryDockWidget::handleDoubleClick (QModelIndex modelIndex)
-{
-  emit commandDoubleClicked (modelIndex.data().toString());
-}
-
-void
-HistoryDockWidget::handleVisibilityChanged (bool visible)
-{
-  if (visible)
-    emit activeChanged (true);
-}
-
-void
-HistoryDockWidget::closeEvent (QCloseEvent *event)
-{
-  emit activeChanged (false);
-  QDockWidget::closeEvent (event);
-}
--- a/gui/src/HistoryDockWidget.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef HISTORYDOCKWIDGET_H
-#define HISTORYDOCKWIDGET_H
-
-#include <QDockWidget>
-#include <QLineEdit>
-#include <QListView>
-#include <QSortFilterProxyModel>
-#include "OctaveLink.h"
-
-class HistoryDockWidget:public QDockWidget
-{
-Q_OBJECT
-public:
-  HistoryDockWidget (QWidget *parent = 0);
-  void updateHistory (QStringList history);
-
-public slots:
-  void handleVisibilityChanged (bool visible);
-
-signals:
-  void information (QString message);
-  void commandDoubleClicked (QString command);
-  /** Custom signal that tells if a user has clicked away that dock widget. */
-  void activeChanged (bool active);
-protected:
-  void closeEvent (QCloseEvent *event);
-private slots:
-  void handleDoubleClick (QModelIndex modelIndex);
-
-private:
-  void construct ();
-  QListView *m_historyListView;
-  QLineEdit *m_filterLineEdit;
-  QSortFilterProxyModel m_sortFilterProxyModel;
-};
-
-#endif // HISTORYDOCKWIDGET_H
--- a/gui/src/MainWindow.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,432 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <QMenuBar>
-#include <QMenu>
-#include <QAction>
-#include <QSettings>
-#include <QStyle>
-#include <QToolBar>
-#include <QDesktopServices>
-#include <QFileDialog>
-#include <QMessageBox>
-#include <QIcon>
-
-#include "MainWindow.h"
-#include "FileEditor.h"
-#include "SettingsDialog.h"
-
-MainWindow::MainWindow (QWidget * parent):QMainWindow (parent)
-{
-  // We have to set up all our windows, before we finally launch octave.
-  construct ();
-  OctaveLink::instance ()->launchOctave();
-}
-
-MainWindow::~MainWindow ()
-{
-}
-
-void
-MainWindow::newFile ()
-{
-  m_fileEditor->requestNewFile ();
-}
-
-void
-MainWindow::openFile ()
-{
-  m_fileEditor->requestOpenFile ();
-}
-
-void
-MainWindow::reportStatusMessage (QString statusMessage)
-{
-  m_statusBar->showMessage (statusMessage, 1000);
-}
-
-void
-MainWindow::handleSaveWorkspaceRequest ()
-{
-  QString selectedFile =
-      QFileDialog::getSaveFileName (this, tr ("Save Workspace"),
-                                    ResourceManager::instance ()->homePath ());
-  m_terminal->sendText (QString ("save \'%1\'\n").arg (selectedFile));
-  m_terminal->setFocus ();
-}
-
-void
-MainWindow::handleLoadWorkspaceRequest ()
-{
-  QString selectedFile =
-      QFileDialog::getOpenFileName (this, tr ("Load Workspace"),
-                                    ResourceManager::instance ()->homePath ());
-  if (!selectedFile.isEmpty ())
-    {
-      m_terminal->sendText (QString ("load \'%1\'\n").arg (selectedFile));
-      m_terminal->setFocus ();
-    }
-}
-
-void
-MainWindow::handleClearWorkspaceRequest ()
-{
-  m_terminal->sendText ("clear\n");
-  m_terminal->setFocus ();
-}
-
-void
-MainWindow::handleCommandDoubleClicked (QString command)
-{
-  m_terminal->sendText(command);
-  m_terminal->setFocus ();
-}
-
-void
-MainWindow::openBugTrackerPage ()
-{
-  QDesktopServices::openUrl (QUrl ("http://savannah.gnu.org/bugs/?group=octave"));
-}
-
-void
-MainWindow::openAgoraPage ()
-{
-  QDesktopServices::openUrl (QUrl ("http://agora.panocha.org.mx/"));
-}
-
-void
-MainWindow::openOctaveForgePage ()
-{
-  QDesktopServices::openUrl (QUrl ("http://octave.sourceforge.net/"));
-}
-
-void
-MainWindow::processSettingsDialogRequest ()
-{
-  SettingsDialog *settingsDialog = new SettingsDialog (this);
-  settingsDialog->exec ();
-  delete settingsDialog;
-  emit settingsChanged ();
-  ResourceManager::instance ()->updateNetworkSettings ();
-  noticeSettings();
-}
-
-void
-MainWindow::noticeSettings ()
-{
-  // Set terminal font:
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  QFont font = QFont();
-  font.setFamily(settings->value("terminal/fontName").toString());
-  font.setPointSize(settings->value("terminal/fontSize").toInt ());
-  m_terminal->setTerminalFont(font);
-}
-
-void
-MainWindow::prepareForQuit ()
-{
-  writeSettings ();
-}
-
-void
-MainWindow::resetWindows ()
-{
-  // TODO: Implement.
-}
-
-void
-MainWindow::updateCurrentWorkingDirectory (QString directory)
-{
-  if (m_currentDirectoryComboBox->count () > 31)
-    {
-      m_currentDirectoryComboBox->removeItem (0);
-    }
-  m_currentDirectoryComboBox->addItem (directory);
-  int index = m_currentDirectoryComboBox->findText (directory);
-  m_currentDirectoryComboBox->setCurrentIndex (index);
-}
-
-void
-MainWindow::changeCurrentWorkingDirectory ()
-{
-  QString selectedDirectory =
-      QFileDialog::getExistingDirectory(this, tr ("Set working direcotry"));
-
-  if (!selectedDirectory.isEmpty ())
-    {
-      m_terminal->sendText (QString ("cd \'%1\'\n").arg (selectedDirectory));
-      m_terminal->setFocus ();
-    }
-}
-
-void
-MainWindow::changeCurrentWorkingDirectory (QString directory)
-{
-  m_terminal->sendText (QString ("cd \'%1\'\n").arg (directory));
-  m_terminal->setFocus ();
-}
-
-void
-MainWindow::currentWorkingDirectoryUp ()
-{
-  m_terminal->sendText ("cd ..\n");
-  m_terminal->setFocus ();
-}
-
-void
-MainWindow::showAboutOctave ()
-{
-  QString message =
-      "GNU Octave\n"
-      "Copyright (C) 2009 John W. Eaton and others.\n"
-      "This is free software; see the source code for copying conditions."
-      "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or"
-      "FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.\n"
-      "\n"
-      "Octave was configured for \"x86_64-pc-linux-gnu\".\n"
-      "\n"
-      "Additional information about Octave is available at http://www.octave.org.\n"
-      "\n"
-      "Please contribute if you find this software useful."
-      "For more information, visit http://www.octave.org/help-wanted.html\n"
-      "\n"
-      "Report bugs to <bug@octave.org> (but first, please read"
-      "http://www.octave.org/bugs.html to learn how to write a helpful report).\n"
-      "\n"
-      "For information about changes from previous versions, type `news'.\n";
-
-  QMessageBox::about (this, tr ("About Octave"), message);
-}
-
-void
-MainWindow::closeEvent (QCloseEvent * closeEvent)
-{
-  reportStatusMessage (tr ("Saving data and shutting down."));
-  m_closing = true;  // inform editor window that whole application is closed
-  OctaveLink::instance ()->terminateOctave ();
-
-  QMainWindow::closeEvent (closeEvent);
-}
-
-void
-MainWindow::readSettings ()
-{
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
-  restoreState (settings->value ("MainWindow/windowState").toByteArray ());
-  emit settingsChanged ();
-}
-
-void
-MainWindow::writeSettings ()
-{
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  settings->setValue ("MainWindow/geometry", saveGeometry ());
-  settings->setValue ("MainWindow/windowState", saveState ());
-  settings->sync ();
-}
-
-void
-MainWindow::construct ()
-{
-  QStyle *style = QApplication::style ();
-  // TODO: Check this.
-  m_closing = false;   // flag for editor files when closed
-  setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Octave));
-
-  // Setup dockable widgets and the status bar.
-  m_workspaceView = new WorkspaceView (this);
-  m_workspaceView->setStatusTip (tr ("View the variables in the active workspace."));
-  m_historyDockWidget = new HistoryDockWidget (this);
-  m_historyDockWidget->setStatusTip (tr ("Browse and search the command history."));
-  m_filesDockWidget = new FilesDockWidget (this);
-  m_filesDockWidget->setStatusTip (tr ("Browse your files."));
-  m_statusBar = new QStatusBar (this);
-
-  m_currentDirectoryComboBox = new QComboBox (this);
-  m_currentDirectoryComboBox->setFixedWidth (300);
-  m_currentDirectoryComboBox->setEditable (true);
-  m_currentDirectoryComboBox->setInsertPolicy (QComboBox::InsertAtTop);
-  m_currentDirectoryComboBox->setMaxVisibleItems (14);
-
-  m_currentDirectoryToolButton = new QToolButton (this);
-  m_currentDirectoryToolButton->setIcon (style->standardIcon (QStyle::SP_DirOpenIcon));
-
-  m_currentDirectoryUpToolButton = new QToolButton (this);
-  m_currentDirectoryUpToolButton->setIcon (style->standardIcon (QStyle::SP_FileDialogToParent));
-
-  // Octave Terminal subwindow.
-  m_terminal = new QTerminal (this);
-  m_terminal->setObjectName ("OctaveTerminal");
-  m_terminalDockWidget = new TerminalDockWidget (m_terminal, this);
-
-  QWidget *dummyWidget = new QWidget ();
-  dummyWidget->setObjectName ("CentralDummyWidget");
-  dummyWidget->resize (10, 10);
-  dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
-  dummyWidget->hide ();
-  setCentralWidget (dummyWidget);
-
-  m_fileEditor = new FileEditor (m_terminal, this);
-
-  QMenu *fileMenu = menuBar ()->addMenu (tr ("&File"));
-  QAction *newFileAction
-    = fileMenu->addAction (QIcon::fromTheme ("document-new",
-      style->standardIcon (QStyle::SP_FileIcon)), tr ("New File"));
-
-  QAction *openFileAction
-      = fileMenu->addAction (QIcon::fromTheme ("document-open",
-        style->standardIcon (QStyle::SP_FileIcon)), tr ("Open File"));
-
-  QAction *settingsAction = fileMenu->addAction (tr ("Settings"));
-  fileMenu->addSeparator ();
-  QAction *exitAction = fileMenu->addAction (tr ("Exit"));
-
-  QMenu *editMenu = menuBar ()->addMenu (tr ("&Edit"));
-  QAction *cutAction
-      = editMenu->addAction (QIcon::fromTheme ("edit-cut",
-        style->standardIcon (QStyle::SP_FileIcon)), tr ("Cut"));
-  cutAction->setShortcut (QKeySequence::Cut);
-
-  QAction *copyAction
-      = editMenu->addAction (QIcon::fromTheme ("edit-copy",
-        style->standardIcon (QStyle::SP_FileIcon)), tr ("Copy"));
-  copyAction->setShortcut (QKeySequence::Copy);
-
-  QAction *pasteAction
-      = editMenu->addAction (QIcon::fromTheme ("edit-paste",
-        style->standardIcon (QStyle::SP_FileIcon)), tr ("Paste"));
-  pasteAction->setShortcut (QKeySequence::Paste);
-
-  QAction *undoAction
-      = editMenu->addAction (QIcon::fromTheme ("edit-undo",
-        style->standardIcon (QStyle::SP_FileIcon)), tr ("Undo"));
-  undoAction->setShortcut (QKeySequence::Undo);
-
-  QAction *redoAction
-      = editMenu->addAction (QIcon::fromTheme ("edit-redo",
-        style->standardIcon (QStyle::SP_FileIcon)), tr ("Redo"));
-  redoAction->setShortcut (QKeySequence::Redo);
-
-  //QMenu *debugMenu = menuBar ()->addMenu (tr ("De&bug"));
-  //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel"));
-
-  QMenu *desktopMenu = menuBar ()->addMenu (tr ("&Desktop"));
-  QAction *loadWorkspaceAction = desktopMenu->addAction (tr ("Load workspace"));
-  QAction *saveWorkspaceAction = desktopMenu->addAction (tr ("Save workspace"));
-  QAction *clearWorkspaceAction = desktopMenu->addAction (tr ("Clear workspace"));
-
-  // Window menu
-  QMenu *windowMenu = menuBar ()->addMenu (tr ("&Window"));
-  QAction *showCommandWindowAction = windowMenu->addAction (tr ("Command Window"));
-  showCommandWindowAction->setCheckable (true);
-  QAction *showWorkspaceAction = windowMenu->addAction (tr ("Workspace"));
-  showWorkspaceAction->setCheckable (true);
-  QAction *showHistoryAction = windowMenu->addAction (tr ("Command History"));
-  showHistoryAction->setCheckable (true);
-  QAction *showFileBrowserAction = windowMenu->addAction (tr ("Current Directory"));
-  showFileBrowserAction->setCheckable (true);
-  QAction *showEditorAction = windowMenu->addAction (tr ("Editor"));
-  showEditorAction->setCheckable (true);
-
-  windowMenu->addSeparator ();
-  QAction *resetWindowsAction = windowMenu->addAction (tr ("Reset Windows"));
-
-  // Help menu
-  QMenu *helpMenu = menuBar ()->addMenu (tr ("&Help"));
-  QAction *reportBugAction = helpMenu->addAction (tr ("Report Bug"));
-  QAction *agoraAction = helpMenu->addAction (tr ("Visit Agora"));
-  QAction *octaveForgeAction = helpMenu->addAction (tr ("Visit Octave Forge"));
-  helpMenu->addSeparator ();
-  QAction *aboutOctaveAction = helpMenu->addAction (tr ("About Octave"));
-
-  // Toolbars
-  QToolBar *mainToolBar = addToolBar ("Main");
-  mainToolBar->addAction (newFileAction);
-  mainToolBar->addAction (openFileAction);
-  mainToolBar->addSeparator ();
-  mainToolBar->addAction (cutAction);
-  mainToolBar->addAction (copyAction);
-  mainToolBar->addAction (pasteAction);
-  mainToolBar->addAction (undoAction);
-  mainToolBar->addAction (redoAction);
-  mainToolBar->addSeparator ();
-  mainToolBar->addWidget (new QLabel (tr ("Current Directory:")));
-  mainToolBar->addWidget (m_currentDirectoryComboBox);
-  mainToolBar->addWidget (m_currentDirectoryToolButton);
-  mainToolBar->addWidget (m_currentDirectoryUpToolButton);
-
-  connect (qApp, SIGNAL(aboutToQuit ()), this, SLOT (prepareForQuit ()));
-
-  connect (settingsAction, SIGNAL (triggered ()), this, SLOT (processSettingsDialogRequest ()));
-  connect (exitAction, SIGNAL (triggered ()), this, SLOT (close ()));
-  connect (newFileAction, SIGNAL (triggered ()), this, SLOT (newFile ()));
-  connect (openFileAction, SIGNAL (triggered ()), this, SLOT (openFile ()));
-  connect (reportBugAction, SIGNAL (triggered ()), this, SLOT (openBugTrackerPage ()));
-  connect (agoraAction, SIGNAL (triggered ()), this, SLOT (openAgoraPage ()));
-  connect (octaveForgeAction, SIGNAL (triggered ()), this, SLOT (openOctaveForgePage ()));
-  connect (aboutOctaveAction, SIGNAL (triggered ()), this, SLOT (showAboutOctave ()));
-
-  connect (showCommandWindowAction, SIGNAL (toggled (bool)), m_terminalDockWidget, SLOT (setShown (bool)));
-  connect (m_terminalDockWidget, SIGNAL (activeChanged (bool)), showCommandWindowAction, SLOT (setChecked (bool)));
-  connect (showWorkspaceAction, SIGNAL (toggled (bool)), m_workspaceView, SLOT (setShown (bool)));
-  connect (m_workspaceView, SIGNAL (activeChanged (bool)), showWorkspaceAction, SLOT (setChecked (bool)));
-  connect (showHistoryAction, SIGNAL (toggled (bool)), m_historyDockWidget, SLOT (setShown (bool)));
-  connect (m_historyDockWidget, SIGNAL (activeChanged (bool)), showHistoryAction, SLOT (setChecked (bool)));
-  connect (showFileBrowserAction, SIGNAL (toggled (bool)), m_filesDockWidget, SLOT (setShown (bool)));
-  connect (m_filesDockWidget, SIGNAL (activeChanged (bool)), showFileBrowserAction, SLOT (setChecked (bool)));
-  connect (showEditorAction, SIGNAL (toggled (bool)), m_fileEditor, SLOT (setShown (bool)));
-  connect (m_fileEditor, SIGNAL (activeChanged (bool)), showEditorAction, SLOT (setChecked (bool)));
-  connect (resetWindowsAction, SIGNAL (triggered ()), this, SLOT (resetWindows ()));
-  //connect (this, SIGNAL (settingsChanged ()), m_workspaceView, SLOT (noticeSettings ()));
-  //connect (this, SIGNAL (settingsChanged ()), m_historyDockWidget, SLOT (noticeSettings ()));
-  connect (this, SIGNAL (settingsChanged ()), m_filesDockWidget, SLOT (noticeSettings ()));
-  connect (this, SIGNAL (settingsChanged ()), this, SLOT (noticeSettings ()));
-
-  connect (m_filesDockWidget, SIGNAL (openFile (QString)), m_fileEditor, SLOT (requestOpenFile (QString)));
-  connect (m_historyDockWidget, SIGNAL (information (QString)), this, SLOT (reportStatusMessage (QString)));
-  connect (m_historyDockWidget, SIGNAL (commandDoubleClicked (QString)), this, SLOT (handleCommandDoubleClicked (QString)));
-  connect (saveWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleSaveWorkspaceRequest ()));
-  connect (loadWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleLoadWorkspaceRequest ()));
-  connect (clearWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleClearWorkspaceRequest ()));
-
-  connect (m_currentDirectoryToolButton, SIGNAL (clicked ()),
-           this, SLOT (changeCurrentWorkingDirectory ()));
-  connect (m_currentDirectoryUpToolButton, SIGNAL (clicked ()),
-           this, SLOT(currentWorkingDirectoryUp()));
-  connect (copyAction, SIGNAL (triggered()), m_terminal, SLOT(copyClipboard ()));
-  connect (pasteAction, SIGNAL (triggered()), m_terminal, SLOT(pasteClipboard ()));
-
-  connect (OctaveLink::instance (), SIGNAL (workingDirectoryChanged (QString)),
-           this, SLOT (updateCurrentWorkingDirectory (QString)));
-  connect (m_currentDirectoryComboBox, SIGNAL (activated (QString)),
-           this, SLOT (changeCurrentWorkingDirectory (QString)));
-
-  setWindowTitle ("Octave");
-
-  setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
-
-  addDockWidget (Qt::LeftDockWidgetArea, m_workspaceView);
-  addDockWidget (Qt::LeftDockWidgetArea, m_historyDockWidget);
-  addDockWidget (Qt::RightDockWidgetArea, m_filesDockWidget);
-  addDockWidget (Qt::RightDockWidgetArea, m_fileEditor);
-  addDockWidget (Qt::BottomDockWidgetArea, m_terminalDockWidget);
-  setStatusBar (m_statusBar);
-
-  readSettings ();
-}
-
--- a/gui/src/MainWindow.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MAINWINDOW_H
-#define MAINWINDOW_H
-
-// Qt includes
-#include <QtGui/QMainWindow>
-#include <QThread>
-#include <QTabWidget>
-#include <QMdiArea>
-#include <QStatusBar>
-#include <QToolBar>
-#include <QQueue>
-#include <QMdiSubWindow>
-#include <QCloseEvent>
-#include <QToolButton>
-#include <QComboBox>
-
-// Editor includes
-#include "FileEditorInterface.h"
-
-// QTerminal includes
-#include "QTerminal.h"
-
-// Own includes
-#include "ResourceManager.h"
-#include "OctaveLink.h"
-#include "WorkspaceView.h"
-#include "HistoryDockWidget.h"
-#include "FilesDockWidget.h"
-#include "TerminalDockWidget.h"
-
-/**
-  * \class MainWindow
-  *
-  * Represents the main window.
-  */
-class MainWindow:public QMainWindow
-{
-Q_OBJECT public:
-  MainWindow (QWidget * parent = 0);
-  ~MainWindow ();
-
-  QTerminal *terminalView ()
-  {
-    return m_terminal;
-  }
-
-  HistoryDockWidget *historyDockWidget ()
-  {
-    return m_historyDockWidget;
-  }
-  FilesDockWidget *filesDockWidget ()
-  {
-    return m_filesDockWidget;
-  }
-  bool closing ()
-  {
-    return m_closing;
-  }
-
-signals:
-  void settingsChanged ();
-
-public slots:
-  void reportStatusMessage (QString statusMessage);
-  void handleSaveWorkspaceRequest ();
-  void handleLoadWorkspaceRequest ();
-  void handleClearWorkspaceRequest ();
-  void handleCommandDoubleClicked (QString command);
-  void newFile ();
-  void openFile ();
-  void openBugTrackerPage ();
-  void openAgoraPage ();
-  void openOctaveForgePage ();
-  void processSettingsDialogRequest ();
-  void showAboutOctave ();
-  void noticeSettings ();
-  void prepareForQuit ();
-  void resetWindows ();
-  void updateCurrentWorkingDirectory (QString directory);
-  void changeCurrentWorkingDirectory ();
-  void changeCurrentWorkingDirectory (QString directory);
-  void currentWorkingDirectoryUp ();
-
-protected:
-  void closeEvent (QCloseEvent * closeEvent);
-  void readSettings ();
-  void writeSettings ();
-
-private:
-  void construct ();
-  void establishOctaveLink ();
-
-  QTerminal *m_terminal;
-  FileEditorInterface *m_fileEditor;
-
-  // Dock widgets.
-  WorkspaceView *m_workspaceView;
-  HistoryDockWidget *m_historyDockWidget;
-  FilesDockWidget *m_filesDockWidget;
-  TerminalDockWidget *m_terminalDockWidget;
-
-  // Toolbars.
-  QStatusBar *m_statusBar;
-
-  QComboBox *m_currentDirectoryComboBox;
-  QToolButton *m_currentDirectoryToolButton;
-  QToolButton *m_currentDirectoryUpToolButton;
-
-  // Flag for closing whole application
-  bool m_closing;
-};
-
-#endif // MAINWINDOW_H
--- a/gui/src/OctaveGUI.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <QtGui/QApplication>
-#include <QTranslator>
-#include <QSettings>
-#include "WelcomeWizard.h"
-#include "ResourceManager.h"
-#include "MainWindow.h"
-
-int
-main (int argc, char *argv[])
-{
-  QApplication application (argc, argv);
-  while (true)
-    {
-      if (ResourceManager::instance ()->isFirstRun ())
-        {
-          WelcomeWizard welcomeWizard;
-          int returnCode = welcomeWizard.exec ();
-
-          QSettings *settings = ResourceManager::instance ()->settings ();
-          settings->setValue ("connectOnStartup", true);
-          settings->setValue ("showMessageOfTheDay", true);
-          settings->setValue ("showTopic", true);
-          settings->setValue ("autoIdentification", false);
-          settings->setValue ("nickServPassword", "");
-          settings->setValue ("useCustomFileEditor", false);
-          settings->setValue ("customFileEditor", "emacs");
-          settings->setValue ("editor/showLineNumbers", true);
-          settings->setValue ("editor/highlightCurrentLine", true);
-          settings->setValue ("editor/codeCompletion", true);
-          settings->setValue ("editor/fontName", "Monospace");
-          settings->setValue ("editor/fontSize", 10);
-          settings->setValue ("editor/shortWindowTitle", true);
-          settings->setValue ("showFilenames", true);
-          settings->setValue ("showFileSize", false);
-          settings->setValue ("showFileType", false);
-          settings->setValue ("showLastModified", false);
-          settings->setValue ("showHiddenFiles", false);
-          settings->setValue ("useAlternatingRowColors", true);
-          settings->setValue ("useProxyServer", false);
-          settings->setValue ("proxyType", "Sock5Proxy");
-          settings->setValue ("proxyHostName", "none");
-          settings->setValue ("proxyPort", 8080);
-          settings->setValue ("proxyUserName", "");
-          settings->setValue ("proxyPassword", "");
-          settings->sync ();
-          ResourceManager::instance ()->reloadSettings ();
-
-          application.quit ();
-          // We are in an infinite loop, so everything else than a return
-          // will cause the application to restart from the very beginning.
-          if (returnCode == QDialog::Rejected)
-            return 0;
-        }
-      else
-        {
-          QSettings *settings = ResourceManager::instance ()->settings ();
-          QString language = settings->value ("language").toString ();
-
-          QString translatorFile = ResourceManager::instance ()->findTranslatorFile (language);
-          QTranslator translator;
-          translator.load (translatorFile);
-          application.installTranslator (&translator);
-
-          ResourceManager::instance ()->updateNetworkSettings ();
-          ResourceManager::instance ()->loadIcons ();
-
-          MainWindow w;
-          w.show ();
-          //w.activateWindow();
-          return application.exec ();
-        }
-    }
-}
--- a/gui/src/ResourceManager.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1687 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ResourceManager.h"
-#include <QFile>
-#include <QNetworkProxy>
-
-ResourceManager ResourceManager::m_singleton;
-
-ResourceManager::ResourceManager ()
-{
-  m_settings = 0;
-  reloadSettings ();
-}
-
-ResourceManager::~ResourceManager ()
-{
-  delete m_settings;
-}
-
-QSettings *
-ResourceManager::settings ()
-{
-  return m_settings;
-}
-
-QString
-ResourceManager::homePath ()
-{
-  return m_homePath;
-}
-
-void
-ResourceManager::reloadSettings ()
-{
-  QDesktopServices desktopServices;
-  m_homePath = desktopServices.storageLocation (QDesktopServices::HomeLocation);
-  setSettings(m_homePath + "/.config/octave-gui/settings");
-}
-
-void
-ResourceManager::setSettings (QString file)
-{
-  delete m_settings;
-
-  m_firstRun = false;
-  if (!QFile::exists (file))
-    m_firstRun = true;
-
-  // If the settings file does not exist, QSettings automatically creates it.
-  // Therefore we have to check if it exists before instantiating the settings object.
-  // That way we can detect if the user ran this application before.
-  m_settings = new QSettings (file, QSettings::IniFormat);
-}
-
-QString
-ResourceManager::findTranslatorFile (QString language)
-{
-  // TODO: Quick hack to be able to test language files.
-  return QString("../languages/%1.qm").arg(language);
-}
-
-QIcon
-ResourceManager::icon (Icon icon)
-{
-  if (m_icons.contains (icon))
-    {
-      return m_icons [icon];
-    }
-  return QIcon ();
-}
-
-bool
-ResourceManager::isFirstRun ()
-{
-  return m_firstRun;
-}
-
-void
-ResourceManager::updateNetworkSettings ()
-{
-  QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy;
-  if (m_settings->value ("useProxyServer").toBool ())
-    {
-      QString proxyTypeString = m_settings->value ("proxyType").toString ();
-      if (proxyTypeString == "Socks5Proxy")
-        {
-          proxyType = QNetworkProxy::Socks5Proxy;
-        }
-      else if (proxyTypeString == "HttpProxy")
-        {
-          proxyType = QNetworkProxy::HttpProxy;
-        }
-    }
-
-  QNetworkProxy proxy;
-  proxy.setType (proxyType);
-  proxy.setHostName (m_settings->value ("proxyHostName").toString ());
-  proxy.setPort (m_settings->value ("proxyPort").toInt ());
-  proxy.setUser (m_settings->value ("proxyUserName").toString ());
-  proxy.setPassword (m_settings->value ("proxyPassword").toString ());
-  QNetworkProxy::setApplicationProxy (proxy);
-}
-
-void
-ResourceManager::loadIcons ()
-{
-  m_icons [ResourceManager::Octave] = QIcon ("../media/logo.png");
-  m_icons [ResourceManager::Terminal] = QIcon ("../media/terminal.png");
-  m_icons [ResourceManager::Documentation] = QIcon ("../media/help_index.png");
-  m_icons [ResourceManager::Chat] = QIcon ("../media/chat.png");
-  m_icons [ResourceManager::ChatNewMessage] = QIcon ("../media/jabber_protocol.png");
-}
-
-const char*
-ResourceManager::octaveKeywords ()
-{
-  return
-      ".nargin. "
-      "EDITOR "
-      "EXEC_PATH "
-      "F_DUPFD "
-      "F_GETFD "
-      "F_GETFL "
-      "F_SETFD "
-      "F_SETFL "
-      "I "
-      "IMAGE_PATH "
-      "Inf "
-      "J "
-      "NA "
-      "NaN "
-      "OCTAVE_HOME "
-      "OCTAVE_VERSION "
-      "O_APPEND "
-      "O_ASYNC "
-      "O_CREAT "
-      "O_EXCL "
-      "O_NONBLOCK "
-      "O_RDONLY "
-      "O_RDWR "
-      "O_SYNC "
-      "O_TRUNC "
-      "O_WRONLY "
-      "PAGER "
-      "PAGER_FLAGS "
-      "PS1 "
-      "PS2 "
-      "PS4 "
-      "P_tmpdir "
-      "SEEK_CUR "
-      "SEEK_END "
-      "SEEK_SET "
-      "SIG "
-      "S_ISBLK "
-      "S_ISCHR "
-      "S_ISDIR "
-      "S_ISFIFO "
-      "S_ISLNK "
-      "S_ISREG "
-      "S_ISSOCK "
-      "WCONTINUE "
-      "WCOREDUMP "
-      "WEXITSTATUS "
-      "WIFCONTINUED "
-      "WIFEXITED "
-      "WIFSIGNALED "
-      "WIFSTOPPED "
-      "WNOHANG "
-      "WSTOPSIG "
-      "WTERMSIG "
-      "WUNTRACED "
-      "__accumarray_max__ "
-      "__accumarray_min__ "
-      "__accumarray_sum__ "
-      "__accumdim_sum__ "
-      "__all_opts__ "
-      "__builtins__ "
-      "__calc_dimensions__ "
-      "__contourc__ "
-      "__current_scope__ "
-      "__delaunayn__ "
-      "__dispatch__ "
-      "__display_tokens__ "
-      "__dsearchn__ "
-      "__dump_symtab_info__ "
-      "__end__ "
-      "__error_text__ "
-      "__finish__ "
-      "__fltk_ginput__ "
-      "__fltk_print__ "
-      "__fltk_uigetfile__ "
-      "__ftp__ "
-      "__ftp_ascii__ "
-      "__ftp_binary__ "
-      "__ftp_close__ "
-      "__ftp_cwd__ "
-      "__ftp_delete__ "
-      "__ftp_dir__ "
-      "__ftp_mget__ "
-      "__ftp_mkdir__ "
-      "__ftp_mode__ "
-      "__ftp_mput__ "
-      "__ftp_pwd__ "
-      "__ftp_rename__ "
-      "__ftp_rmdir__ "
-      "__get__ "
-      "__glpk__ "
-      "__gnuplot_drawnow__ "
-      "__gnuplot_get_var__ "
-      "__gnuplot_ginput__ "
-      "__gnuplot_has_feature__ "
-      "__gnuplot_open_stream__ "
-      "__gnuplot_print__ "
-      "__gnuplot_version__ "
-      "__go_axes__ "
-      "__go_axes_init__ "
-      "__go_close_all__ "
-      "__go_delete__ "
-      "__go_draw_axes__ "
-      "__go_draw_figure__ "
-      "__go_execute_callback__ "
-      "__go_figure__ "
-      "__go_figure_handles__ "
-      "__go_handles__ "
-      "__go_hggroup__ "
-      "__go_image__ "
-      "__go_line__ "
-      "__go_patch__ "
-      "__go_surface__ "
-      "__go_text__ "
-      "__go_uimenu__ "
-      "__gud_mode__ "
-      "__image_pixel_size__ "
-      "__init_fltk__ "
-      "__isa_parent__ "
-      "__keywords__ "
-      "__lexer_debug_flag__ "
-      "__lin_interpn__ "
-      "__list_functions__ "
-      "__magick_finfo__ "
-      "__magick_format_list__ "
-      "__magick_read__ "
-      "__magick_write__ "
-      "__makeinfo__ "
-      "__marching_cube__ "
-      "__next_line_color__ "
-      "__next_line_style__ "
-      "__operators__ "
-      "__parent_classes__ "
-      "__parser_debug_flag__ "
-      "__pathorig__ "
-      "__pchip_deriv__ "
-      "__plt_get_axis_arg__ "
-      "__print_parse_opts__ "
-      "__qp__ "
-      "__request_drawnow__ "
-      "__sort_rows_idx__ "
-      "__strip_html_tags__ "
-      "__token_count__ "
-      "__varval__ "
-      "__version_info__ "
-      "__voronoi__ "
-      "__which__ "
-      "abs "
-      "accumarray "
-      "accumdim "
-      "acos "
-      "acosd "
-      "acosh "
-      "acot "
-      "acotd "
-      "acoth "
-      "acsc "
-      "acscd "
-      "acsch "
-      "add_input_event_hook "
-      "addlistener "
-      "addpath "
-      "addproperty "
-      "addtodate "
-      "airy "
-      "all "
-      "allchild "
-      "allow_noninteger_range_as_index "
-      "amd "
-      "ancestor "
-      "and "
-      "angle "
-      "anova "
-      "ans "
-      "any "
-      "arch_fit "
-      "arch_rnd "
-      "arch_test "
-      "area "
-      "arg "
-      "argnames "
-      "argv "
-      "arma_rnd "
-      "arrayfun "
-      "asctime "
-      "asec "
-      "asecd "
-      "asech "
-      "asin "
-      "asind "
-      "asinh "
-      "assert "
-      "assignin "
-      "atan "
-      "atan2 "
-      "atand "
-      "atanh "
-      "atexit "
-      "autocor "
-      "autocov "
-      "autoload "
-      "autoreg_matrix "
-      "autumn "
-      "available_graphics_toolkits "
-      "axes "
-      "axis "
-      "balance "
-      "bar "
-      "barh "
-      "bartlett "
-      "bartlett_test "
-      "base2dec "
-      "beep "
-      "beep_on_error "
-      "bessel "
-      "besselh "
-      "besseli "
-      "besselj "
-      "besselk "
-      "bessely "
-      "beta "
-      "betacdf "
-      "betai "
-      "betainc "
-      "betainv "
-      "betaln "
-      "betapdf "
-      "betarnd "
-      "bicgstab "
-      "bicubic "
-      "bin2dec "
-      "bincoeff "
-      "binocdf "
-      "binoinv "
-      "binopdf "
-      "binornd "
-      "bitand "
-      "bitcmp "
-      "bitget "
-      "bitmax "
-      "bitor "
-      "bitpack "
-      "bitset "
-      "bitshift "
-      "bitunpack "
-      "bitxor "
-      "blackman "
-      "blanks "
-      "blkdiag "
-      "blkmm "
-      "bone "
-      "box "
-      "break "
-      "brighten "
-      "bsxfun "
-      "bug_report "
-      "builtin "
-      "bunzip2 "
-      "bzip2 "
-      "calendar "
-      "canonicalize_file_name "
-      "cart2pol "
-      "cart2sph "
-      "case "
-      "cast "
-      "cat "
-      "catch "
-      "cauchy_cdf "
-      "cauchy_inv "
-      "cauchy_pdf "
-      "cauchy_rnd "
-      "caxis "
-      "cbrt "
-      "ccolamd "
-      "cd "
-      "ceil "
-      "cell "
-      "cell2mat "
-      "cell2struct "
-      "celldisp "
-      "cellfun "
-      "cellidx "
-      "cellindexmat "
-      "cellslices "
-      "cellstr "
-      "center "
-      "cgs "
-      "char "
-      "chdir "
-      "chi2cdf "
-      "chi2inv "
-      "chi2pdf "
-      "chi2rnd "
-      "chisquare_test_homogeneity "
-      "chisquare_test_independence "
-      "chol "
-      "chol2inv "
-      "choldelete "
-      "cholinsert "
-      "cholinv "
-      "cholshift "
-      "cholupdate "
-      "chop "
-      "circshift "
-      "cla "
-      "clabel "
-      "class "
-      "clc "
-      "clear "
-      "clf "
-      "clg "
-      "clock "
-      "cloglog "
-      "close "
-      "closereq "
-      "colamd "
-      "colloc "
-      "colon "
-      "colorbar "
-      "colormap "
-      "colperm "
-      "colstyle "
-      "columns "
-      "comet "
-      "comet3 "
-      "comma "
-      "command_line_path "
-      "common_size "
-      "commutation_matrix "
-      "compan "
-      "compare_versions "
-      "compass "
-      "complement "
-      "completion_append_char "
-      "completion_matches "
-      "complex "
-      "computer "
-      "cond "
-      "condest "
-      "confirm_recursive_rmdir "
-      "conj "
-      "continue "
-      "contour "
-      "contour3 "
-      "contourc "
-      "contourf "
-      "contrast "
-      "conv "
-      "conv2 "
-      "convhull "
-      "convhulln "
-      "convn "
-      "cool "
-      "copper "
-      "copyfile "
-      "cor "
-      "cor_test "
-      "corrcoef "
-      "cos "
-      "cosd "
-      "cosh "
-      "cot "
-      "cotd "
-      "coth "
-      "cov "
-      "cplxpair "
-      "cputime "
-      "cquad "
-      "crash_dumps_octave_core "
-      "create_set "
-      "cross "
-      "csc "
-      "cscd "
-      "csch "
-      "cstrcat "
-      "csvread "
-      "csvwrite "
-      "csymamd "
-      "ctime "
-      "ctranspose "
-      "cummax "
-      "cummin "
-      "cumprod "
-      "cumsum "
-      "cumtrapz "
-      "curl "
-      "cut "
-      "cylinder "
-      "daspect "
-      "daspk "
-      "daspk_options "
-      "dasrt "
-      "dasrt_options "
-      "dassl "
-      "dassl_options "
-      "date "
-      "datenum "
-      "datestr "
-      "datetick "
-      "datevec "
-      "dbclear "
-      "dbcont "
-      "dbdown "
-      "dblquad "
-      "dbnext "
-      "dbquit "
-      "dbstack "
-      "dbstatus "
-      "dbstep "
-      "dbstop "
-      "dbtype "
-      "dbup "
-      "dbwhere "
-      "deal "
-      "deblank "
-      "debug "
-      "debug_on_error "
-      "debug_on_interrupt "
-      "debug_on_warning "
-      "dec2base "
-      "dec2bin "
-      "dec2hex "
-      "deconv "
-      "default_save_options "
-      "del2 "
-      "delaunay "
-      "delaunay3 "
-      "delaunayn "
-      "delete "
-      "dellistener "
-      "demo "
-      "det "
-      "detrend "
-      "diag "
-      "diary "
-      "diff "
-      "diffpara "
-      "diffuse "
-      "dir "
-      "discrete_cdf "
-      "discrete_inv "
-      "discrete_pdf "
-      "discrete_rnd "
-      "disp "
-      "dispatch "
-      "display "
-      "divergence "
-      "dlmread "
-      "dlmwrite "
-      "dmperm "
-      "dmult "
-      "do "
-      "do_braindead_shortcircuit_evaluation "
-      "do_string_escapes "
-      "doc "
-      "doc_cache_file "
-      "dos "
-      "dot "
-      "double "
-      "drawnow "
-      "dsearch "
-      "dsearchn "
-      "dump_prefs "
-      "dup2 "
-      "duplication_matrix "
-      "durbinlevinson "
-      "e "
-      "echo "
-      "echo_executing_commands "
-      "edit "
-      "edit_history "
-      "eig "
-      "eigs "
-      "ellipsoid "
-      "else "
-      "elseif "
-      "empirical_cdf "
-      "empirical_inv "
-      "empirical_pdf "
-      "empirical_rnd "
-      "end "
-      "end_try_catch "
-      "end_unwind_protect "
-      "endfor "
-      "endfunction "
-      "endgrent "
-      "endif "
-      "endpwent "
-      "endswitch "
-      "endwhile "
-      "eomday "
-      "eps "
-      "eq "
-      "erf "
-      "erfc "
-      "erfcx "
-      "erfinv "
-      "errno "
-      "errno_list "
-      "error "
-      "error_text "
-      "errorbar "
-      "etime "
-      "etree "
-      "etreeplot "
-      "eval "
-      "evalin "
-      "example "
-      "exec "
-      "exist "
-      "exit "
-      "exp "
-      "expcdf "
-      "expinv "
-      "expm "
-      "expm1 "
-      "exppdf "
-      "exprnd "
-      "eye "
-      "ezcontour "
-      "ezcontourf "
-      "ezmesh "
-      "ezmeshc "
-      "ezplot "
-      "ezplot3 "
-      "ezpolar "
-      "ezsurf "
-      "ezsurfc "
-      "f_test_regression "
-      "factor "
-      "factorial "
-      "fail "
-      "false "
-      "fcdf "
-      "fclear "
-      "fclose "
-      "fcntl "
-      "fdisp "
-      "feather "
-      "feof "
-      "ferror "
-      "feval "
-      "fflush "
-      "fft "
-      "fft2 "
-      "fftconv "
-      "fftfilt "
-      "fftn "
-      "fftshift "
-      "fftw "
-      "fgetl "
-      "fgets "
-      "fieldnames "
-      "figure "
-      "file_in_loadpath "
-      "file_in_path "
-      "fileattrib "
-      "filemarker "
-      "fileparts "
-      "fileread "
-      "filesep "
-      "fill "
-      "filter "
-      "filter2 "
-      "find "
-      "find_dir_in_path "
-      "findall "
-      "findobj "
-      "findstr "
-      "finite "
-      "finv "
-      "fix "
-      "fixed_point_format "
-      "flag "
-      "flipdim "
-      "fliplr "
-      "flipud "
-      "floor "
-      "fminbnd "
-      "fminunc "
-      "fmod "
-      "fnmatch "
-      "fopen "
-      "for "
-      "fork "
-      "format "
-      "formula "
-      "fpdf "
-      "fplot "
-      "fprintf "
-      "fputs "
-      "fractdiff "
-      "fread "
-      "freport "
-      "freqz "
-      "freqz_plot "
-      "frewind "
-      "frnd "
-      "fscanf "
-      "fseek "
-      "fskipl "
-      "fsolve "
-      "fstat "
-      "ftell "
-      "full "
-      "fullfile "
-      "func2str "
-      "function "
-      "functions "
-      "fwrite "
-      "fzero "
-      "gamcdf "
-      "gaminv "
-      "gamma "
-      "gammai "
-      "gammainc "
-      "gammaln "
-      "gampdf "
-      "gamrnd "
-      "gca "
-      "gcbf "
-      "gcbo "
-      "gcd "
-      "gcf "
-      "ge "
-      "gen_doc_cache "
-      "genpath "
-      "genvarname "
-      "geocdf "
-      "geoinv "
-      "geopdf "
-      "geornd "
-      "get "
-      "get_first_help_sentence "
-      "get_help_text "
-      "get_help_text_from_file "
-      "getappdata "
-      "getegid "
-      "getenv "
-      "geteuid "
-      "getfield "
-      "getgid "
-      "getgrent "
-      "getgrgid "
-      "getgrnam "
-      "gethostname "
-      "getpgrp "
-      "getpid "
-      "getppid "
-      "getpwent "
-      "getpwnam "
-      "getpwuid "
-      "getrusage "
-      "getuid "
-      "ginput "
-      "givens "
-      "glob "
-      "global "
-      "glpk "
-      "glpkmex "
-      "gls "
-      "gmap40 "
-      "gmres "
-      "gmtime "
-      "gnuplot_binary "
-      "gplot "
-      "gradient "
-      "graphics_toolkit "
-      "gray "
-      "gray2ind "
-      "grid "
-      "griddata "
-      "griddata3 "
-      "griddatan "
-      "gt "
-      "gtext "
-      "gunzip "
-      "gzip "
-      "hadamard "
-      "hamming "
-      "hankel "
-      "hanning "
-      "help "
-      "hess "
-      "hex2dec "
-      "hex2num "
-      "hggroup "
-      "hidden "
-      "hilb "
-      "hist "
-      "histc "
-      "history "
-      "history_control "
-      "history_file "
-      "history_size "
-      "history_timestamp_format_string "
-      "hold "
-      "home "
-      "horzcat "
-      "hot "
-      "hotelling_test "
-      "hotelling_test_2 "
-      "housh "
-      "hsv "
-      "hsv2rgb "
-      "hurst "
-      "hygecdf "
-      "hygeinv "
-      "hygepdf "
-      "hygernd "
-      "hypot "
-      "i "
-      "idivide "
-      "if "
-      "ifelse "
-      "ifft "
-      "ifft2 "
-      "ifftn "
-      "ifftshift "
-      "ignore_function_time_stamp "
-      "imag "
-      "image "
-      "imagesc "
-      "imfinfo "
-      "imread "
-      "imshow "
-      "imwrite "
-      "ind2gray "
-      "ind2rgb "
-      "ind2sub "
-      "index "
-      "inf "
-      "inferiorto "
-      "info "
-      "info_file "
-      "info_program "
-      "inline "
-      "inpolygon "
-      "input "
-      "inputname "
-      "int16 "
-      "int2str "
-      "int32 "
-      "int64 "
-      "int8 "
-      "interp1 "
-      "interp1q "
-      "interp2 "
-      "interp3 "
-      "interpft "
-      "interpn "
-      "intersect "
-      "intmax "
-      "intmin "
-      "intwarning "
-      "inv "
-      "inverse "
-      "invhilb "
-      "ipermute "
-      "iqr "
-      "is_absolute_filename "
-      "is_duplicate_entry "
-      "is_global "
-      "is_leap_year "
-      "is_rooted_relative_filename "
-      "is_valid_file_id "
-      "isa "
-      "isalnum "
-      "isalpha "
-      "isappdata "
-      "isargout "
-      "isascii "
-      "isbool "
-      "iscell "
-      "iscellstr "
-      "ischar "
-      "iscntrl "
-      "iscolumn "
-      "iscommand "
-      "iscomplex "
-      "isdebugmode "
-      "isdefinite "
-      "isdeployed "
-      "isdigit "
-      "isdir "
-      "isempty "
-      "isequal "
-      "isequalwithequalnans "
-      "isfield "
-      "isfigure "
-      "isfinite "
-      "isfloat "
-      "isglobal "
-      "isgraph "
-      "ishandle "
-      "ishermitian "
-      "ishghandle "
-      "ishold "
-      "isieee "
-      "isindex "
-      "isinf "
-      "isinteger "
-      "iskeyword "
-      "isletter "
-      "islogical "
-      "islower "
-      "ismac "
-      "ismatrix "
-      "ismember "
-      "ismethod "
-      "isna "
-      "isnan "
-      "isnull "
-      "isnumeric "
-      "isobject "
-      "isocolors "
-      "isonormals "
-      "isosurface "
-      "ispc "
-      "isprime "
-      "isprint "
-      "isprop "
-      "ispunct "
-      "israwcommand "
-      "isreal "
-      "isrow "
-      "isscalar "
-      "issorted "
-      "isspace "
-      "issparse "
-      "issquare "
-      "isstr "
-      "isstrprop "
-      "isstruct "
-      "issymmetric "
-      "isunix "
-      "isupper "
-      "isvarname "
-      "isvector "
-      "isxdigit "
-      "j "
-      "jet "
-      "kbhit "
-      "kendall "
-      "keyboard "
-      "kill "
-      "kolmogorov_smirnov_cdf "
-      "kolmogorov_smirnov_test "
-      "kolmogorov_smirnov_test_2 "
-      "kron "
-      "kruskal_wallis_test "
-      "krylov "
-      "krylovb "
-      "kurtosis "
-      "laplace_cdf "
-      "laplace_inv "
-      "laplace_pdf "
-      "laplace_rnd "
-      "lasterr "
-      "lasterror "
-      "lastwarn "
-      "lchol "
-      "lcm "
-      "ldivide "
-      "le "
-      "legend "
-      "legendre "
-      "length "
-      "lgamma "
-      "license "
-      "lin2mu "
-      "line "
-      "link "
-      "linkprop "
-      "linspace "
-      "list "
-      "list_in_columns "
-      "list_primes "
-      "load "
-      "loadaudio "
-      "loadimage "
-      "loadobj "
-      "localtime "
-      "log "
-      "log10 "
-      "log1p "
-      "log2 "
-      "logical "
-      "logistic_cdf "
-      "logistic_inv "
-      "logistic_pdf "
-      "logistic_regression "
-      "logistic_rnd "
-      "logit "
-      "loglog "
-      "loglogerr "
-      "logm "
-      "logncdf "
-      "logninv "
-      "lognpdf "
-      "lognrnd "
-      "logspace "
-      "lookfor "
-      "lookup "
-      "lower "
-      "ls "
-      "ls_command "
-      "lsode "
-      "lsode_options "
-      "lsqnonneg "
-      "lstat "
-      "lt "
-      "lu "
-      "luinc "
-      "luupdate "
-      "magic "
-      "mahalanobis "
-      "make_absolute_filename "
-      "makeinfo_program "
-      "manova "
-      "mark_as_command "
-      "mark_as_rawcommand "
-      "mat2cell "
-      "mat2str "
-      "matlabroot "
-      "matrix_type "
-      "max "
-      "max_recursion_depth "
-      "mcnemar_test "
-      "md5sum "
-      "mean "
-      "meansq "
-      "median "
-      "menu "
-      "merge "
-      "mesh "
-      "meshc "
-      "meshgrid "
-      "meshz "
-      "methods "
-      "mex "
-      "mexext "
-      "mfilename "
-      "mgorth "
-      "min "
-      "minus "
-      "mislocked "
-      "missing_function_hook "
-      "mist "
-      "mkdir "
-      "mkfifo "
-      "mkoctfile "
-      "mkpp "
-      "mkstemp "
-      "mktime "
-      "mldivide "
-      "mlock "
-      "mod "
-      "mode "
-      "moment "
-      "more "
-      "most "
-      "movefile "
-      "mpoles "
-      "mpower "
-      "mrdivide "
-      "mtimes "
-      "mu2lin "
-      "munlock "
-      "namelengthmax "
-      "nan "
-      "nargchk "
-      "nargin "
-      "nargout "
-      "nargoutchk "
-      "native_float_format "
-      "nbincdf "
-      "nbininv "
-      "nbinpdf "
-      "nbinrnd "
-      "nchoosek "
-      "ndgrid "
-      "ndims "
-      "ne "
-      "newplot "
-      "news "
-      "nextpow2 "
-      "nfields "
-      "nnz "
-      "nonzeros "
-      "norm "
-      "normcdf "
-      "normest "
-      "norminv "
-      "normpdf "
-      "normrnd "
-      "not "
-      "now "
-      "nproc "
-      "nth_element "
-      "nthroot "
-      "ntsc2rgb "
-      "null "
-      "num2cell "
-      "num2hex "
-      "num2str "
-      "numel "
-      "nzmax "
-      "ocean "
-      "octave_config_info "
-      "octave_core_file_limit "
-      "octave_core_file_name "
-      "octave_core_file_options "
-      "octave_tmp_file_name "
-      "ols "
-      "onCleanup "
-      "onenormest "
-      "ones "
-      "optimget "
-      "optimize_subsasgn_calls "
-      "optimset "
-      "or "
-      "orderfields "
-      "orient "
-      "orth "
-      "otherwise "
-      "output_max_field_width "
-      "output_precision "
-      "pack "
-      "page_output_immediately "
-      "page_screen_output "
-      "paren "
-      "pareto "
-      "parseparams "
-      "pascal "
-      "patch "
-      "path "
-      "pathdef "
-      "pathsep "
-      "pause "
-      "pbaspect "
-      "pcg "
-      "pchip "
-      "pclose "
-      "pcolor "
-      "pcr "
-      "peaks "
-      "periodogram "
-      "perl "
-      "perms "
-      "permute "
-      "perror "
-      "persistent "
-      "pi "
-      "pie "
-      "pie3 "
-      "pink "
-      "pinv "
-      "pipe "
-      "pkg "
-      "planerot "
-      "playaudio "
-      "plot "
-      "plot3 "
-      "plotmatrix "
-      "plotyy "
-      "plus "
-      "poisscdf "
-      "poissinv "
-      "poisspdf "
-      "poissrnd "
-      "pol2cart "
-      "polar "
-      "poly "
-      "polyaffine "
-      "polyarea "
-      "polyder "
-      "polyderiv "
-      "polyfit "
-      "polygcd "
-      "polyint "
-      "polyout "
-      "polyreduce "
-      "polyval "
-      "polyvalm "
-      "popen "
-      "popen2 "
-      "postpad "
-      "pow2 "
-      "power "
-      "powerset "
-      "ppder "
-      "ppint "
-      "ppjumps "
-      "ppplot "
-      "ppval "
-      "pqpnonneg "
-      "prctile "
-      "prepad "
-      "primes "
-      "print "
-      "print_empty_dimensions "
-      "print_struct_array_contents "
-      "print_usage "
-      "printf "
-      "prism "
-      "probit "
-      "prod "
-      "program_invocation_name "
-      "program_name "
-      "prop_test_2 "
-      "putenv "
-      "puts "
-      "pwd "
-      "qp "
-      "qqplot "
-      "qr "
-      "qrdelete "
-      "qrinsert "
-      "qrshift "
-      "qrupdate "
-      "quad "
-      "quad_options "
-      "quadcc "
-      "quadgk "
-      "quadl "
-      "quadv "
-      "quantile "
-      "quit "
-      "quiver "
-      "quiver3 "
-      "qz "
-      "qzhess "
-      "rainbow "
-      "rand "
-      "rande "
-      "randg "
-      "randi "
-      "randn "
-      "randp "
-      "randperm "
-      "range "
-      "rank "
-      "ranks "
-      "rat "
-      "rats "
-      "rcond "
-      "rdivide "
-      "re_read_readline_init_file "
-      "read_readline_init_file "
-      "readdir "
-      "readlink "
-      "real "
-      "reallog "
-      "realmax "
-      "realmin "
-      "realpow "
-      "realsqrt "
-      "record "
-      "rectangle "
-      "rectint "
-      "refresh "
-      "refreshdata "
-      "regexp "
-      "regexpi "
-      "regexprep "
-      "regexptranslate "
-      "rehash "
-      "rem "
-      "remove_input_event_hook "
-      "rename "
-      "repelems "
-      "replot "
-      "repmat "
-      "reset "
-      "reshape "
-      "residue "
-      "resize "
-      "restoredefaultpath "
-      "rethrow "
-      "return "
-      "rgb2hsv "
-      "rgb2ind "
-      "rgb2ntsc "
-      "ribbon "
-      "rindex "
-      "rmappdata "
-      "rmdir "
-      "rmfield "
-      "rmpath "
-      "roots "
-      "rose "
-      "rosser "
-      "rot90 "
-      "rotdim "
-      "round "
-      "roundb "
-      "rows "
-      "rref "
-      "rsf2csf "
-      "run "
-      "run_count "
-      "run_history "
-      "run_test "
-      "rundemos "
-      "runlength "
-      "runtests "
-      "save "
-      "save_header_format_string "
-      "save_precision "
-      "saveas "
-      "saveaudio "
-      "saveimage "
-      "saveobj "
-      "savepath "
-      "saving_history "
-      "scanf "
-      "scatter "
-      "scatter3 "
-      "schur "
-      "sec "
-      "secd "
-      "sech "
-      "semicolon "
-      "semilogx "
-      "semilogxerr "
-      "semilogy "
-      "semilogyerr "
-      "set "
-      "setappdata "
-      "setaudio "
-      "setdiff "
-      "setenv "
-      "setfield "
-      "setgrent "
-      "setpwent "
-      "setstr "
-      "setxor "
-      "shading "
-      "shell_cmd "
-      "shg "
-      "shift "
-      "shiftdim "
-      "sighup_dumps_octave_core "
-      "sign "
-      "sign_test "
-      "sigterm_dumps_octave_core "
-      "silent_functions "
-      "sin "
-      "sinc "
-      "sind "
-      "sinetone "
-      "sinewave "
-      "single "
-      "sinh "
-      "size "
-      "size_equal "
-      "sizemax "
-      "sizeof "
-      "skewness "
-      "sleep "
-      "slice "
-      "sombrero "
-      "sort "
-      "sortrows "
-      "source "
-      "spalloc "
-      "sparse "
-      "sparse_auto_mutate "
-      "spatan2 "
-      "spaugment "
-      "spchol "
-      "spchol2inv "
-      "spcholinv "
-      "spconvert "
-      "spcumprod "
-      "spcumsum "
-      "spdet "
-      "spdiag "
-      "spdiags "
-      "spearman "
-      "spectral_adf "
-      "spectral_xdf "
-      "specular "
-      "speed "
-      "spencer "
-      "speye "
-      "spfind "
-      "spfun "
-      "sph2cart "
-      "sphcat "
-      "sphere "
-      "spinmap "
-      "spinv "
-      "spkron "
-      "splchol "
-      "spline "
-      "split "
-      "split_long_rows "
-      "splu "
-      "spmax "
-      "spmin "
-      "spones "
-      "spparms "
-      "spprod "
-      "spqr "
-      "sprand "
-      "sprandn "
-      "sprandsym "
-      "sprank "
-      "spring "
-      "sprintf "
-      "spstats "
-      "spsum "
-      "spsumsq "
-      "spvcat "
-      "spy "
-      "sqp "
-      "sqrt "
-      "sqrtm "
-      "squeeze "
-      "sscanf "
-      "stairs "
-      "stat "
-      "static "
-      "statistics "
-      "std "
-      "stderr "
-      "stdin "
-      "stdnormal_cdf "
-      "stdnormal_inv "
-      "stdnormal_pdf "
-      "stdnormal_rnd "
-      "stdout "
-      "stem "
-      "stem3 "
-      "stft "
-      "str2double "
-      "str2func "
-      "str2mat "
-      "str2num "
-      "strcat "
-      "strchr "
-      "strcmp "
-      "strcmpi "
-      "strerror "
-      "strfind "
-      "strftime "
-      "string_fill_char "
-      "strjust "
-      "strmatch "
-      "strncmp "
-      "strncmpi "
-      "strptime "
-      "strread "
-      "strrep "
-      "strsplit "
-      "strtok "
-      "strtrim "
-      "strtrunc "
-      "struct "
-      "struct2cell "
-      "struct_levels_to_print "
-      "structfun "
-      "strvcat "
-      "studentize "
-      "sub2ind "
-      "subplot "
-      "subsasgn "
-      "subsindex "
-      "subspace "
-      "subsref "
-      "substr "
-      "substruct "
-      "sum "
-      "summer "
-      "sumsq "
-      "superiorto "
-      "suppress_verbose_help_message "
-      "surf "
-      "surface "
-      "surfc "
-      "surfl "
-      "surfnorm "
-      "svd "
-      "svd_driver "
-      "svds "
-      "swapbytes "
-      "switch "
-      "syl "
-      "sylvester_matrix "
-      "symamd "
-      "symbfact "
-      "symlink "
-      "symrcm "
-      "symvar "
-      "synthesis "
-      "system "
-      "t_test "
-      "t_test_2 "
-      "t_test_regression "
-      "table "
-      "tan "
-      "tand "
-      "tanh "
-      "tar "
-      "tcdf "
-      "tempdir "
-      "tempname "
-      "terminal_size "
-      "test "
-      "test2 "
-      "test3 "
-      "text "
-      "textread "
-      "textscan "
-      "tic "
-      "tilde_expand "
-      "time "
-      "times "
-      "tinv "
-      "title "
-      "tmpfile "
-      "tmpnam "
-      "toascii "
-      "toc "
-      "toeplitz "
-      "tolower "
-      "toupper "
-      "tpdf "
-      "trace "
-      "transpose "
-      "trapz "
-      "treelayout "
-      "treeplot "
-      "tril "
-      "trimesh "
-      "triplequad "
-      "triplot "
-      "trisurf "
-      "triu "
-      "trnd "
-      "true "
-      "try "
-      "tsearch "
-      "tsearchn "
-      "type "
-      "typecast "
-      "typeinfo "
-      "u_test "
-      "uigetdir "
-      "uigetfile "
-      "uimenu "
-      "uint16 "
-      "uint32 "
-      "uint64 "
-      "uint8 "
-      "uiputfile "
-      "umask "
-      "uminus "
-      "uname "
-      "undo_string_escapes "
-      "unidcdf "
-      "unidinv "
-      "unidpdf "
-      "unidrnd "
-      "unifcdf "
-      "unifinv "
-      "unifpdf "
-      "unifrnd "
-      "unimplemented "
-      "union "
-      "unique "
-      "unix "
-      "unlink "
-      "unmark_command "
-      "unmark_rawcommand "
-      "unmkpp "
-      "unpack "
-      "untabify "
-      "untar "
-      "until "
-      "unwind_protect "
-      "unwind_protect_cleanup "
-      "unwrap "
-      "unzip "
-      "uplus "
-      "upper "
-      "urlread "
-      "urlwrite "
-      "usage "
-      "usleep "
-      "validatestring "
-      "values "
-      "vander "
-      "var "
-      "var_test "
-      "varargin "
-      "varargout "
-      "vec "
-      "vech "
-      "vectorize "
-      "ver "
-      "version "
-      "vertcat "
-      "view "
-      "voronoi "
-      "voronoin "
-      "waitforbuttonpress "
-      "waitpid "
-      "warning "
-      "warning_ids "
-      "warranty "
-      "wavread "
-      "wavwrite "
-      "wblcdf "
-      "wblinv "
-      "wblpdf "
-      "wblrnd "
-      "weekday "
-      "weibcdf "
-      "weibinv "
-      "weibpdf "
-      "weibrnd "
-      "welch_test "
-      "what "
-      "which "
-      "while "
-      "white "
-      "whitebg "
-      "who "
-      "whos "
-      "whos_line_format "
-      "wienrnd "
-      "wilcoxon_test "
-      "wilkinson "
-      "winter "
-      "xlabel "
-      "xlim "
-      "xor "
-      "yes_or_no "
-      "ylabel "
-      "ylim "
-      "yulewalker "
-      "z_test "
-      "z_test_2 "
-      "zeros "
-      "zip "
-      "zlabel "
-      "zlim ";
-  /*            "break case catch continue do else elseif end end_unwind_protect "
-              "endfor endfunction endif endswitch endwhile for function "
-              "global if otherwise persistent return switch try until "
-              "unwind_protect unwind_protect_cleanup while";
-  */
-}
--- a/gui/src/ResourceManager.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,67 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef RESOURCEMANAGER_H
-#define RESOURCEMANAGER_H
-
-#include <QSettings>
-#include <QDesktopServices>
-#include <QMap>
-#include <QIcon>
-
-class ResourceManager
-{
-public:
-  enum Icon
-  {
-    Octave,
-    Terminal,
-    Documentation,
-    Chat,
-    ChatNewMessage
-  };
-
-  ~ResourceManager ();
-
-  static ResourceManager *
-  instance ()
-  {
-    return &m_singleton;
-  }
-
-  QSettings *settings ();
-  QString homePath ();
-  void reloadSettings ();
-  void setSettings (QString file);
-  QString findTranslatorFile (QString language);
-  void updateNetworkSettings ();
-  void loadIcons ();
-  QIcon icon (Icon icon);
-  bool isFirstRun ();
-
-  const char *octaveKeywords ();
-private:
-  ResourceManager ();
-
-  QSettings *m_settings;
-  QString m_homePath;
-  QMap <Icon, QIcon> m_icons;
-  static ResourceManager m_singleton;
-  bool m_firstRun;
-};
-
-#endif // RESOURCEMANAGER_H
--- a/gui/src/SettingsDialog.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "ResourceManager.h"
-#include "SettingsDialog.h"
-#include "ui_SettingsDialog.h"
-#include <QSettings>
-
-SettingsDialog::SettingsDialog (QWidget * parent):
-QDialog (parent), ui (new Ui::SettingsDialog)
-{
-  ui->setupUi (this);
-
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor").toBool ());
-  ui->customFileEditor->setText (settings->value ("customFileEditor").toString ());
-  ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () );
-  ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine",true).toBool () );
-  ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion",true).toBool () );
-  ui->editor_fontName->setCurrentFont (QFont (settings->value ("editor/fontName","Courier").toString()) );
-  ui->editor_fontSize->setValue (settings->value ("editor/fontSize",10).toInt ());  
-  ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle",true).toBool ());
-  ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName","Courier").toString()) );
-  ui->terminal_fontSize->setValue (settings->value ("terminal/fontSize",10).toInt ());
-  ui->showFilenames->setChecked (settings->value ("showFilenames").toBool());
-  ui->showFileSize->setChecked (settings->value ("showFileSize").toBool());
-  ui->showFileType->setChecked (settings->value ("showFileType").toBool());
-  ui->showLastModified->setChecked (settings->value ("showLastModified").toBool());
-  ui->showHiddenFiles->setChecked (settings->value ("showHiddenFiles").toBool());
-  ui->useAlternatingRowColors->setChecked (settings->value ("useAlternatingRowColors").toBool());
-  ui->useProxyServer->setChecked (settings->value ("useProxyServer").toBool ());
-  ui->proxyHostName->setText (settings->value ("proxyHostName").toString ());
-
-  int currentIndex = 0;
-  QString proxyTypeString = settings->value ("proxyType").toString ();
-  while ( (currentIndex < ui->proxyType->count ()) && (ui->proxyType->currentText () != proxyTypeString))
-    {
-      currentIndex++;
-      ui->proxyType->setCurrentIndex (currentIndex);
-    }
-
-  ui->proxyPort->setText (settings->value ("proxyPort").toString ());
-  ui->proxyUserName->setText (settings->value ("proxyUserName").toString ());
-  ui->proxyPassword->setText (settings->value ("proxyPassword").toString ());
-}
-
-SettingsDialog::~SettingsDialog ()
-{
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ());
-  settings->setValue ("customFileEditor", ui->customFileEditor->text ());
-  settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ());
-  settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ());
-  settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ());
-  settings->setValue ("editor/fontName", ui->editor_fontName->currentFont().family());
-  settings->setValue ("editor/fontSize", ui->editor_fontSize->value());
-  settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked());
-  settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value());
-  settings->setValue ("terminal/fontName", ui->terminal_fontName->currentFont().family());
-  settings->setValue ("showFilenames", ui->showFilenames->isChecked ());
-  settings->setValue ("showFileSize", ui->showFileSize->isChecked ());
-  settings->setValue ("showFileType", ui->showFileType->isChecked ());
-  settings->setValue ("showLastModified", ui->showLastModified->isChecked ());
-  settings->setValue ("showHiddenFiles", ui->showHiddenFiles->isChecked ());
-  settings->setValue ("useAlternatingRowColors", ui->useAlternatingRowColors->isChecked ());
-  settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ());
-  settings->setValue ("proxyType", ui->proxyType->currentText ());
-  settings->setValue ("proxyHostName", ui->proxyHostName->text ());
-  settings->setValue ("proxyPort", ui->proxyPort->text ());
-  settings->setValue ("proxyUserName", ui->proxyUserName->text ());
-  settings->setValue ("proxyPassword", ui->proxyPassword->text ());
-  delete ui;
-}
--- a/gui/src/SettingsDialog.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *md5
-
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef SETTINGSDIALOG_H
-#define SETTINGSDIALOG_H
-
-#include <QDialog>
-
-namespace Ui
-{
-  class SettingsDialog;
-}
-
-class SettingsDialog:public QDialog
-{
-Q_OBJECT public:
-  explicit SettingsDialog (QWidget * parent);
-  ~SettingsDialog ();
-
-private:
-  Ui::SettingsDialog * ui;
-};
-
-#endif // SETTINGSDIALOG_H
--- a/gui/src/SettingsDialog.ui	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,668 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SettingsDialog</class>
- <widget class="QDialog" name="SettingsDialog">
-  <property name="windowModality">
-   <enum>Qt::ApplicationModal</enum>
-  </property>
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>600</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="minimumSize">
-   <size>
-    <width>600</width>
-    <height>400</height>
-   </size>
-  </property>
-  <property name="maximumSize">
-   <size>
-    <width>600</width>
-    <height>400</height>
-   </size>
-  </property>
-  <property name="windowTitle">
-   <string>Settings</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <item>
-    <widget class="QTabWidget" name="tabWidget">
-     <property name="currentIndex">
-      <number>0</number>
-     </property>
-     <widget class="QWidget" name="tab">
-      <attribute name="title">
-       <string>Editor</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_6">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout_5">
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_4">
-           <item>
-            <widget class="QLabel" name="label_8">
-             <property name="text">
-              <string>Font</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QFontComboBox" name="editor_fontName">
-             <property name="editable">
-              <bool>false</bool>
-             </property>
-             <property name="fontFilters">
-              <set>QFontComboBox::MonospacedFonts</set>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QLabel" name="label_9">
-             <property name="text">
-              <string>Font Size</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <widget class="QSpinBox" name="editor_fontSize">
-             <property name="minimum">
-              <number>2</number>
-             </property>
-             <property name="maximum">
-              <number>96</number>
-             </property>
-             <property name="value">
-              <number>10</number>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_4">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-          </layout>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="editor_showLineNumbers">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string>Show line numbers</string>
-           </property>
-           <property name="checked">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="editor_highlightCurrentLine">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string>Highlight current line</string>
-           </property>
-           <property name="checked">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="editor_codeCompletion">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string>Code completion</string>
-           </property>
-           <property name="checked">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QCheckBox" name="editor_longWindowTitle">
-           <property name="text">
-            <string>Show complete path in window title</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout">
-         <item>
-          <widget class="QCheckBox" name="useCustomFileEditor">
-           <property name="enabled">
-            <bool>true</bool>
-           </property>
-           <property name="text">
-            <string>Use custom file editor:</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QLineEdit" name="customFileEditor">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>emacs</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_5">
-      <attribute name="title">
-       <string>Terminal</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_5">
-         <item>
-          <widget class="QLabel" name="label_11">
-           <property name="text">
-            <string>Font</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QFontComboBox" name="terminal_fontName">
-           <property name="editable">
-            <bool>false</bool>
-           </property>
-           <property name="fontFilters">
-            <set>QFontComboBox::MonospacedFonts</set>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QLabel" name="label_12">
-           <property name="text">
-            <string>Font Size</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QSpinBox" name="terminal_fontSize">
-           <property name="minimum">
-            <number>2</number>
-           </property>
-           <property name="maximum">
-            <number>96</number>
-           </property>
-           <property name="value">
-            <number>10</number>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="horizontalSpacer_5">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-        </layout>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_3">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>321</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_2">
-      <attribute name="title">
-       <string>File Browser</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_3">
-       <item>
-        <widget class="QCheckBox" name="showFilenames">
-         <property name="text">
-          <string>Show filenames</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="showFileSize">
-         <property name="text">
-          <string>Show file size</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="showFileType">
-         <property name="text">
-          <string>Show file type</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="showLastModified">
-         <property name="text">
-          <string>Show date of last modification</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="showHiddenFiles">
-         <property name="text">
-          <string>Show hidden files</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <widget class="QCheckBox" name="useAlternatingRowColors">
-         <property name="text">
-          <string>Alternating row colors</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer_2">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>360</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="tab_3">
-      <attribute name="title">
-       <string>Network</string>
-      </attribute>
-      <layout class="QVBoxLayout" name="verticalLayout_4">
-       <item>
-        <widget class="QCheckBox" name="useProxyServer">
-         <property name="text">
-          <string>Use proxy server</string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <layout class="QFormLayout" name="formLayout">
-         <item row="0" column="0">
-          <widget class="QLabel" name="label_3">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Proxy Type:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="0" column="1">
-          <widget class="QComboBox" name="proxyType">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <item>
-            <property name="text">
-             <string>HttpProxy</string>
-            </property>
-           </item>
-           <item>
-            <property name="text">
-             <string>Socks5Proxy</string>
-            </property>
-           </item>
-          </widget>
-         </item>
-         <item row="1" column="0">
-          <widget class="QLabel" name="label_4">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Hostname:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="1" column="1">
-          <widget class="QLineEdit" name="proxyHostName">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="0">
-          <widget class="QLabel" name="label_5">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Port:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="2" column="1">
-          <widget class="QLineEdit" name="proxyPort">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="0">
-          <widget class="QLabel" name="label_6">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Username:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="3" column="1">
-          <widget class="QLineEdit" name="proxyUserName">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-          </widget>
-         </item>
-         <item row="4" column="0">
-          <widget class="QLabel" name="label_7">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="text">
-            <string>Password:</string>
-           </property>
-          </widget>
-         </item>
-         <item row="4" column="1">
-          <widget class="QLineEdit" name="proxyPassword">
-           <property name="enabled">
-            <bool>false</bool>
-           </property>
-           <property name="echoMode">
-            <enum>QLineEdit::Password</enum>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>label_4</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>69</x>
-     <y>122</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>label_3</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>59</x>
-     <y>91</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>label_5</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>44</x>
-     <y>152</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>proxyType</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>291</x>
-     <y>91</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>proxyHostName</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>291</x>
-     <y>124</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>proxyPort</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>364</x>
-     <y>154</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useCustomFileEditor</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>customFileEditor</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>111</x>
-     <y>62</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>343</x>
-     <y>63</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>label_7</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>67</x>
-     <y>212</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>editor_showLineNumbers</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>editor_showLineNumbers</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>87</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>249</x>
-     <y>87</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>editor_highlightCurrentLine</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>editor_highlightCurrentLine</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>112</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>249</x>
-     <y>112</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>proxyUserName</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>364</x>
-     <y>184</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>proxyPassword</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>364</x>
-     <y>214</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>useProxyServer</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>label_6</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>59</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>68</x>
-     <y>182</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>editor_codeCompletion</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>editor_codeCompletion</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>249</x>
-     <y>137</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>249</x>
-     <y>137</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
--- a/gui/src/TerminalDockWidget.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "TerminalDockWidget.h"
-
-TerminalDockWidget::TerminalDockWidget (QTerminal *terminal, QWidget *parent)
-  : QDockWidget (parent)
-{
-  setObjectName ("TerminalDockWidget");
-  setWindowTitle (tr ("Command Window"));
-  setWidget (terminal);
-
-  connect (this, SIGNAL (visibilityChanged (bool)), this, SLOT (handleVisibilityChanged (bool)));
-}
--- a/gui/src/TerminalDockWidget.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef TERMINALDOCKWIDGET_H
-#define TERMINALDOCKWIDGET_H
-
-#include <QDockWidget>
-#include "QTerminal.h"
-
-class TerminalDockWidget : public QDockWidget
-{
-  Q_OBJECT
-public:
-  TerminalDockWidget (QTerminal *terminal, QWidget *parent = 0);
-
-signals:
-    void activeChanged (bool active);
-
-public slots:
-    void handleVisibilityChanged (bool visible)
-    {
-      if (visible)
-        emit activeChanged (true);
-    }
-};
-
-#endif // TERMINALDOCKWIDGET_H
--- a/gui/src/WelcomeWizard.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WelcomeWizard.h"
-#include "ui_WelcomeWizard.h"
-
-WelcomeWizard::WelcomeWizard (QWidget *parent) :
-  QDialog (parent),
-  ui (new Ui::WelcomeWizard)
-{
-  ui->setupUi (this);
-  connect (ui->nextButton1, SIGNAL (clicked ()), this, SLOT (next ()));
-  connect (ui->nextButton2, SIGNAL (clicked ()), this, SLOT (next ()));
-  connect (ui->nextButton3, SIGNAL (clicked ()), this, SLOT (next ()));
-  connect (ui->nextButton4, SIGNAL (clicked ()), this, SLOT (next ()));
-
-  connect (ui->previousButton2, SIGNAL (clicked ()), this, SLOT (previous ()));
-  connect (ui->previousButton3, SIGNAL (clicked ()), this, SLOT (previous ()));
-  connect (ui->previousButton4, SIGNAL (clicked ()), this, SLOT (previous ()));
-  connect (ui->previousButton5, SIGNAL (clicked ()), this, SLOT (previous ()));
-}
-
-WelcomeWizard::~WelcomeWizard()
-{
-  delete ui;
-}
-
-void
-WelcomeWizard::next ()
-{
-  ui->stackedWidget->setCurrentIndex (ui->stackedWidget->currentIndex () + 1);
-}
-
-void
-WelcomeWizard::previous ()
-{
-  ui->stackedWidget->setCurrentIndex (ui->stackedWidget->currentIndex () - 1);
-}
-
--- a/gui/src/WelcomeWizard.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WELCOMEWIZARD_H
-#define WELCOMEWIZARD_H
-
-#include <QDialog>
-
-namespace Ui {
-class WelcomeWizard;
-}
-
-class WelcomeWizard : public QDialog
-{
-  Q_OBJECT
-
-public:
-  explicit WelcomeWizard(QWidget *parent = 0);
-  ~WelcomeWizard();
-
-public slots:
-  void next ();
-  void previous ();
-
-private:
-  Ui::WelcomeWizard *ui;
-};
-
-#endif // WELCOMEWIZARD_H
--- a/gui/src/WelcomeWizard.ui	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,354 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>WelcomeWizard</class>
- <widget class="QDialog" name="WelcomeWizard">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>647</width>
-    <height>400</height>
-   </rect>
-  </property>
-  <property name="minimumSize">
-   <size>
-    <width>647</width>
-    <height>400</height>
-   </size>
-  </property>
-  <property name="maximumSize">
-   <size>
-    <width>647</width>
-    <height>400</height>
-   </size>
-  </property>
-  <property name="windowTitle">
-   <string>Welcome to GNU Octave</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout_2">
-   <item>
-    <widget class="QStackedWidget" name="stackedWidget">
-     <property name="currentIndex">
-      <number>4</number>
-     </property>
-     <widget class="QWidget" name="page">
-      <layout class="QVBoxLayout" name="verticalLayout">
-       <item>
-        <widget class="QLabel" name="label">
-         <property name="text">
-          <string>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</string>
-         </property>
-         <property name="alignment">
-          <set>Qt::AlignJustify|Qt::AlignVCenter</set>
-         </property>
-         <property name="wordWrap">
-          <bool>true</bool>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer name="verticalSpacer">
-         <property name="orientation">
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" stdset="0">
-          <size>
-           <width>20</width>
-           <height>218</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <layout class="QHBoxLayout" name="horizontalLayout_2">
-         <item>
-          <spacer name="horizontalSpacer">
-           <property name="orientation">
-            <enum>Qt::Horizontal</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>40</width>
-             <height>20</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <widget class="QPushButton" name="nextButton1">
-           <property name="text">
-            <string>Next</string>
-           </property>
-          </widget>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="page_2">
-      <layout class="QVBoxLayout" name="verticalLayout_4">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout_3">
-         <item>
-          <spacer name="verticalSpacer_2">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>20</width>
-             <height>40</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout">
-           <item>
-            <widget class="QPushButton" name="previousButton2">
-             <property name="text">
-              <string>Previous</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_2">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QPushButton" name="nextButton2">
-             <property name="text">
-              <string>Next</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="page_3">
-      <layout class="QHBoxLayout" name="horizontalLayout_4">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout_5">
-         <item>
-          <spacer name="verticalSpacer_3">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>20</width>
-             <height>40</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_3">
-           <item>
-            <widget class="QPushButton" name="previousButton3">
-             <property name="text">
-              <string>Previous</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_3">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QPushButton" name="nextButton3">
-             <property name="text">
-              <string>Next</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="page_4">
-      <layout class="QHBoxLayout" name="horizontalLayout_6">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout_6">
-         <item>
-          <spacer name="verticalSpacer_4">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>20</width>
-             <height>40</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_5">
-           <item>
-            <widget class="QPushButton" name="previousButton4">
-             <property name="text">
-              <string>Previous</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_4">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QPushButton" name="nextButton4">
-             <property name="text">
-              <string>Next</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-     <widget class="QWidget" name="page_5">
-      <layout class="QHBoxLayout" name="horizontalLayout_8">
-       <item>
-        <layout class="QVBoxLayout" name="verticalLayout_7">
-         <item>
-          <widget class="QLabel" name="label_2">
-           <property name="font">
-            <font>
-             <pointsize>20</pointsize>
-            </font>
-           </property>
-           <property name="text">
-            <string>Welcome to Octave!</string>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QLabel" name="label_3">
-           <property name="text">
-            <string>This is the development version of Octave with the first official GUI.</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QLabel" name="label_4">
-           <property name="text">
-            <string>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI.</string>
-           </property>
-           <property name="wordWrap">
-            <bool>true</bool>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <spacer name="verticalSpacer_5">
-           <property name="orientation">
-            <enum>Qt::Vertical</enum>
-           </property>
-           <property name="sizeHint" stdset="0">
-            <size>
-             <width>20</width>
-             <height>40</height>
-            </size>
-           </property>
-          </spacer>
-         </item>
-         <item>
-          <layout class="QHBoxLayout" name="horizontalLayout_7">
-           <item>
-            <widget class="QPushButton" name="previousButton5">
-             <property name="enabled">
-              <bool>false</bool>
-             </property>
-             <property name="text">
-              <string>Previous</string>
-             </property>
-            </widget>
-           </item>
-           <item>
-            <spacer name="horizontalSpacer_5">
-             <property name="orientation">
-              <enum>Qt::Horizontal</enum>
-             </property>
-             <property name="sizeHint" stdset="0">
-              <size>
-               <width>40</width>
-               <height>20</height>
-              </size>
-             </property>
-            </spacer>
-           </item>
-           <item>
-            <widget class="QPushButton" name="finishButton">
-             <property name="text">
-              <string>Finish</string>
-             </property>
-            </widget>
-           </item>
-          </layout>
-         </item>
-        </layout>
-       </item>
-      </layout>
-     </widget>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>finishButton</sender>
-   <signal>clicked()</signal>
-   <receiver>WelcomeWizard</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>577</x>
-     <y>372</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>323</x>
-     <y>199</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
--- a/gui/src/WorkspaceModel.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,172 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WorkspaceModel.h"
-#include <QTreeWidget>
-#include <QTime>
-#include "OctaveLink.h"
-
-WorkspaceModel::WorkspaceModel(QObject *parent)
-  : QAbstractItemModel(parent)
-{
-  QList<QVariant> rootData;
-  rootData << tr ("Name") << tr ("Type") << tr ("Value");
-  _rootItem = new TreeItem(rootData);
-}
-
-WorkspaceModel::~WorkspaceModel()
-{
-  delete _rootItem;
-}
-
-QModelIndex
-WorkspaceModel::index(int row, int column, const QModelIndex &parent) const
-{
-  if (!hasIndex(row, column, parent))
-    return QModelIndex();
-
-  TreeItem *parentItem;
-
-  if (!parent.isValid())
-    parentItem = _rootItem;
-  else
-    parentItem = static_cast<TreeItem*>(parent.internalPointer());
-
-  TreeItem *childItem = parentItem->child(row);
-  if (childItem)
-    return createIndex(row, column, childItem);
-  else
-    return QModelIndex();
-}
-
-QModelIndex
-WorkspaceModel::parent(const QModelIndex &index) const
-{
-  if (!index.isValid())
-    return QModelIndex();
-
-  TreeItem *childItem = static_cast<TreeItem*>(index.internalPointer());
-  TreeItem *parentItem = childItem->parent();
-
-  if (parentItem == _rootItem)
-    return QModelIndex();
-
-  return createIndex(parentItem->row(), 0, parentItem);
-}
-
-int
-WorkspaceModel::rowCount(const QModelIndex &parent) const
-{
-  TreeItem *parentItem;
-  if (parent.column() > 0)
-    return 0;
-
-  if (!parent.isValid())
-    parentItem = _rootItem;
-  else
-    parentItem = static_cast<TreeItem*>(parent.internalPointer());
-
-  return parentItem->childCount();
-}
-
-int
-WorkspaceModel::columnCount(const QModelIndex &parent) const
-{
-  if (parent.isValid())
-    return static_cast<TreeItem*>(parent.internalPointer())->columnCount();
-  else
-    return _rootItem->columnCount();
-}
-
-void
-WorkspaceModel::insertTopLevelItem(int at, TreeItem *treeItem)
-{
-  _rootItem->insertChildItem(at, treeItem);
-}
-
-TreeItem *
-WorkspaceModel::topLevelItem (int at)
-{
-  return _rootItem->child(at);
-}
-
-Qt::ItemFlags
-WorkspaceModel::flags(const QModelIndex &index) const
-{
-  if (!index.isValid())
-    return 0;
-
-  return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
-}
-
-QVariant
-WorkspaceModel::headerData(int section, Qt::Orientation orientation, int role) const
-{
-  if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
-    return _rootItem->data(section);
-
-  return QVariant();
-}
-
-QVariant
-WorkspaceModel::data(const QModelIndex &index, int role) const
-{
-  if (!index.isValid())
-    return QVariant();
-
-  if (role != Qt::DisplayRole)
-    return QVariant();
-
-  TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
-
-  return item->data(index.column());
-}
-
-
-void
-WorkspaceModel::updateFromSymbolTable ()
-{
-  topLevelItem (0)->deleteChildItems ();
-  topLevelItem (1)->deleteChildItems ();
-  topLevelItem (2)->deleteChildItems ();
-  topLevelItem (3)->deleteChildItems ();
-
-  OctaveLink::instance ()-> acquireSymbolInformation();
-  const QList <SymbolInformation>& symbolInformation = OctaveLink::instance() ->symbolInformation ();
-
-  foreach (const SymbolInformation& s, symbolInformation)
-    {
-      TreeItem *child = new TreeItem ();
-
-      child->setData (0, s._symbol);
-      child->setData (1, s._type);
-      child->setData (2, s._value);
-
-      switch (s._scope)
-        {
-          case SymbolInformation::Local:       topLevelItem (0)->addChild (child); break;
-          case SymbolInformation::Global:      topLevelItem (1)->addChild (child); break;
-          case SymbolInformation::Persistent:  topLevelItem (2)->addChild (child); break;
-          case SymbolInformation::Hidden:      topLevelItem (3)->addChild (child); break;
-        }
-    }
-
-  OctaveLink::instance ()-> releaseSymbolInformation();
-
-  reset();
-  emit expandRequest();
-}
--- a/gui/src/WorkspaceModel.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,137 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WORKSPACEMODEL_H
-#define WORKSPACEMODEL_H
-
-// Qt includes
-#include <QAbstractItemModel>
-#include <QVector>
-#include <QSemaphore>
-
-class TreeItem
-{
-public:
-  TreeItem(const QList<QVariant> &data, TreeItem *parent = 0) {
-    _parentItem = parent;
-    _itemData = data;
-  }
-
-  TreeItem(QVariant data = QVariant(), TreeItem *parent = 0) {
-    QList<QVariant> variantList;
-    variantList << data << QVariant() << QVariant();
-    _parentItem = parent;
-    _itemData = variantList;
-  }
-
-  ~TreeItem() {
-     qDeleteAll(_childItems);
-  }
-
-  void insertChildItem(int at, TreeItem *item) {
-    item->_parentItem = this;
-    _childItems.insert(at, item);
-  }
-
-  void addChild(TreeItem *item) {
-    item->_parentItem = this;
-    _childItems.append(item);
-  }
-
-  void deleteChildItems() {
-      qDeleteAll(_childItems);
-      _childItems.clear();
-  }
-
-  void removeChild(TreeItem *item) {
-    _childItems.removeAll(item);
-  }
-
-  QVariant data(int column) const
-  {
-    return _itemData[column];
-  }
-
-  void setData(int column, QVariant data)
-  {
-    _itemData[column] = data;
-  }
-
-  TreeItem *child(int row) {
-    return _childItems[row];
-  }
-
-  int childCount() const {
-    return _childItems.count();
-  }
-
-  int columnCount() const
-  {
-    return _itemData.count();
-  }
-
-  int row() const {
-    if (_parentItem)
-      return _parentItem->_childItems.indexOf(const_cast<TreeItem*>(this));
-
-    return 0;
-  }
-
-  TreeItem *parent()
-  {
-    return _parentItem;
-  }
-
-private:
-  QList<TreeItem*> _childItems;
-  QList<QVariant> _itemData;
-  TreeItem *_parentItem;
-};
-
-class WorkspaceModel : public QAbstractItemModel
-{
-  Q_OBJECT
-
-public:
-  WorkspaceModel(QObject *parent = 0);
-  ~WorkspaceModel();
-
-  QVariant data(const QModelIndex &index, int role) const;
-  Qt::ItemFlags flags(const QModelIndex &index) const;
-  QVariant headerData(int section, Qt::Orientation orientation,
-                      int role = Qt::DisplayRole) const;
-  QModelIndex index(int row, int column,
-                    const QModelIndex &parent = QModelIndex()) const;
-  QModelIndex parent(const QModelIndex &index) const;
-  int rowCount(const QModelIndex &parent = QModelIndex()) const;
-  int columnCount(const QModelIndex &parent = QModelIndex()) const;
-
-  void insertTopLevelItem (int at, TreeItem *treeItem);
-  TreeItem *topLevelItem (int at);
-
-public slots:
-  void updateFromSymbolTable ();
-
-signals:
-  void expandRequest();
-
-private:
-
-  TreeItem *_rootItem;
-};
-
-#endif // WORKSPACEMODEL_H
--- a/gui/src/WorkspaceView.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "WorkspaceView.h"
-#include <QHBoxLayout>
-#include <QVBoxLayout>
-#include <QPushButton>
-
-WorkspaceView::WorkspaceView (QWidget * parent) : QDockWidget
-  (parent)
-{
-  setObjectName ("WorkspaceView");
-  setWindowTitle (tr ("Workspace"));
-
-  m_workspaceTreeView = new QTreeView (this);
-  m_workspaceTreeView->setHeaderHidden (false);
-  m_workspaceTreeView->setAlternatingRowColors (true);
-  m_workspaceTreeView->setAnimated (true);
-  m_workspaceTreeView->setModel(OctaveLink::instance()->workspaceModel());
-
-  setWidget (new QWidget (this));
-  QVBoxLayout *layout = new QVBoxLayout ();
-  layout->addWidget (m_workspaceTreeView);
-  layout->setMargin (2);
-  widget ()->setLayout (layout);
-
-  connect (this, SIGNAL (visibilityChanged (bool)),
-           this, SLOT(handleVisibilityChanged (bool)));
-
-  connect (OctaveLink::instance()->workspaceModel(), SIGNAL(expandRequest()),
-           m_workspaceTreeView, SLOT(expandAll()));
-}
-
-void
-WorkspaceView::handleVisibilityChanged (bool visible)
-{
-  if (visible)
-  emit activeChanged (true);
-}
-
-void
-WorkspaceView::closeEvent (QCloseEvent *event)
-{
-  emit activeChanged (false);
-  QDockWidget::closeEvent (event);
-}
--- a/gui/src/WorkspaceView.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef WORKSPACEVIEW_H
-#define WORKSPACEVIEW_H
-
-#include <QDockWidget>
-#include <QTreeView>
-#include <QSemaphore>
-#include "OctaveLink.h"
-
-class WorkspaceView:public QDockWidget
-{
-  Q_OBJECT
-public:
-  WorkspaceView (QWidget * parent = 0);
-
-public slots:
-  void handleVisibilityChanged (bool visible);
-
-signals:
-  /** Custom signal that tells if a user has clicke away that dock widget. */
-  void activeChanged (bool active);
-
-protected:
-  void closeEvent (QCloseEvent *event);
-
-private:
-  QTreeView *m_workspaceTreeView;
-};
-
-#endif // WORKSPACEVIEW_H
--- a/gui/src/backend/OctaveLink.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "OctaveLink.h"
-#include "load-path.h"
-#include "oct-env.h"
-#include <QDir>
-#include <QApplication>
-
-int octave_readline_hook ()
-{
-  OctaveLink::instance ()->triggerUpdateHistoryModel ();
-  OctaveLink::instance ()->buildSymbolInformation ();
-  OctaveLink::instance ()->updateCurrentWorkingDirectory ();
-  return 0;
-}
-
-void octave_exit_hook (int status)
-{
-  Q_UNUSED (status);
-  OctaveLink::instance ()->terminateOctave ();
-}
-
-OctaveLink OctaveLink::m_singleton;
-
-OctaveLink::OctaveLink ():QObject ()
-{
-  m_historyModel = new QStringListModel (this);
-  m_workspaceModel = new WorkspaceModel (this);
-
-  m_workspaceModel->insertTopLevelItem(0, new TreeItem ("Local"));
-  m_workspaceModel->insertTopLevelItem(1, new TreeItem ("Global"));
-  m_workspaceModel->insertTopLevelItem(2, new TreeItem ("Persistent"));
-  m_workspaceModel->insertTopLevelItem(3, new TreeItem ("Hidden"));
-
-  _updateWorkspaceModelTimer.setInterval (1000);
-  _updateWorkspaceModelTimer.setSingleShot (false);
-  connect(&_updateWorkspaceModelTimer, SIGNAL (timeout ()),
-    m_workspaceModel, SLOT (updateFromSymbolTable ()));
-
-  _symbolInformationSemaphore = new QSemaphore (1);
-  _currentWorkingDirectory = "";
-}
-
-OctaveLink::~OctaveLink ()
-{
-}
-
-void
-OctaveLink::launchOctave ()
-{
-  // Create both threads.
-  m_octaveMainThread = new OctaveMainThread (this);
-  command_editor::add_event_hook (octave_readline_hook);
-  octave_exit = octave_exit_hook;
-
-  // Start the first one.
-  m_octaveMainThread->start ();
-  _updateWorkspaceModelTimer.start ();
-}
-
-void
-OctaveLink::terminateOctave ()
-{
-  qApp->quit ();
-}
-
-void
-OctaveLink::triggerUpdateHistoryModel ()
-{
-  // Determine the client's (our) history length and the one of the server.
-  int clientHistoryLength = m_historyModel->rowCount ();
-  int serverHistoryLength = command_history::length ();
-
-  // If were behind the server, iterate through all new entries and add them to our history.
-  if (clientHistoryLength < serverHistoryLength)
-    {
-      for (int i = clientHistoryLength; i < serverHistoryLength; i++)
-        {
-          m_historyModel->insertRow (0);
-          m_historyModel->setData (m_historyModel->index (0), QString (command_history::get_entry (i).c_str ()));
-        }
-    }
-}
-
-void
-OctaveLink::updateCurrentWorkingDirectory ()
-{
-  QString _queriedWorkingDirectory = octave_env::get_current_directory ().c_str();
-  if (_currentWorkingDirectory != _queriedWorkingDirectory)
-    {
-      _currentWorkingDirectory = _queriedWorkingDirectory;
-      QDir::setCurrent (_currentWorkingDirectory);
-      emit workingDirectoryChanged (_currentWorkingDirectory);
-    }
-}
-
-void
-OctaveLink::acquireSymbolInformation ()
-{
-  _symbolInformationSemaphore->acquire (1);
-}
-
-void
-OctaveLink::releaseSymbolInformation ()
-{
-  _symbolInformationSemaphore->release (1);
-}
-
-void
-OctaveLink::buildSymbolInformation ()
-{
-  std::list < symbol_table::symbol_record > symbolTable = symbol_table::all_variables ();
-
-  acquireSymbolInformation ();
-  _symbolInformation.clear ();
-  for (std::list < symbol_table::symbol_record > ::iterator iterator = symbolTable.begin ();
-     iterator != symbolTable.end (); iterator++)
-  {
-    SymbolInformation symbolInformation;
-    symbolInformation.fromSymbolRecord (*iterator);
-    _symbolInformation.push_back (symbolInformation);
-  }
-  releaseSymbolInformation ();
-}
-
-const QList <SymbolInformation>&
-OctaveLink::symbolInformation () const
-{
-  return _symbolInformation;
-}
-
-QStringListModel *
-OctaveLink::historyModel ()
-{
-  return m_historyModel;
-}
-
-WorkspaceModel *
-OctaveLink::workspaceModel ()
-{
-  return m_workspaceModel;
-}
--- a/gui/src/backend/OctaveLink.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,127 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef OCTAVELINK_H
-#define OCTAVELINK_H
-
-// Octave includes
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_URL
-#include "octave/config.h"
-#include "octave/cmd-edit.h"
-#include "octave/error.h"
-#include "octave/file-io.h"
-#include "octave/input.h"
-#include "octave/lex.h"
-#include "octave/load-path.h"
-#include "octave/octave.h"
-#include "octave/oct-hist.h"
-#include "octave/oct-map.h"
-#include "octave/oct-obj.h"
-#include "octave/ops.h"
-#include "octave/ov.h"
-#include "octave/ov-usr-fcn.h"
-#include "octave/symtab.h"
-#include "octave/pt.h"
-#include "octave/pt-eval.h"
-#include "octave/config.h"
-#include "octave/Range.h"
-#include "octave/toplev.h"
-#include "octave/procstream.h"
-#include "octave/sighandlers.h"
-#include "octave/debug.h"
-#include "octave/sysdep.h"
-#include "octave/ov.h"
-#include "octave/unwind-prot.h"
-#include "octave/utils.h"
-#include "octave/variables.h"
-
-// Standard includes
-#include <iostream>
-#include <string>
-#include <vector>
-#include <readline/readline.h>
-
-// Qt includes
-#include <QMutexLocker>
-#include <QMutex>
-#include <QFileInfo>
-#include <QList>
-#include <QString>
-#include <QStringList>
-#include <QVector>
-#include <QSemaphore>
-#include <QObject>
-#include <QStringListModel>
-#include <QTimer>
-
-#include "WorkspaceModel.h"
-#include "OctaveMainThread.h"
-#include "SymbolInformation.h"
-
-/**
-  * \class OctaveLink
-  * Manages a link to an octave instance.
-  */
-class OctaveLink:public QObject
-{
-  Q_OBJECT
-public:
-  static OctaveLink *
-  instance ()
-  {
-    return &m_singleton;
-  }
-
-  void launchOctave ();
-  void terminateOctave ();
-  QStringListModel *historyModel ();
-  WorkspaceModel *workspaceModel ();
-
-  void triggerUpdateHistoryModel ();
-  void updateCurrentWorkingDirectory ();
-
-  void acquireSymbolInformation ();
-  void releaseSymbolInformation ();
-  void buildSymbolInformation ();
-  const QList <SymbolInformation>& symbolInformation () const;
-
-signals:
-  void workingDirectoryChanged (QString directory);
-
-private:
-  OctaveLink ();
-  ~OctaveLink ();
-
-  QStringListModel *m_historyModel;
-  WorkspaceModel *m_workspaceModel;
-
-  // Threads for running octave and managing the data interaction.
-  OctaveMainThread *m_octaveMainThread;
-  QTimer _updateWorkspaceModelTimer;
-
-  QSemaphore *_symbolInformationSemaphore;
-  QList <SymbolInformation> _symbolInformation;
-
-  QString _currentWorkingDirectory;
-  static OctaveLink m_singleton;
-};
-#endif // OCTAVELINK_H
--- a/gui/src/backend/OctaveMainThread.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "OctaveMainThread.h"
-#include "OctaveLink.h"
-
-OctaveMainThread::OctaveMainThread (QObject * parent):QThread (parent)
-{
-}
-
-void
-OctaveMainThread::run ()
-{
-  setlocale(LC_ALL, "en_US.UTF-8");
-  int argc = 1;
-  const char *argv[] = { "" };
-  emit ready();
-  octave_main (argc, (char **) argv, 0);
-}
--- a/gui/src/backend/OctaveMainThread.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef OCTAVEMAINTHREAD_H
-#define OCTAVEMAINTHREAD_H
-
-#include <QThread>
-class OctaveMainThread:public QThread
-{
-  Q_OBJECT
-public:
-  OctaveMainThread (QObject * parent);
-
-signals:
-  void ready();
-
-protected:
-  void run ();
-};
-
-#endif // OCTAVEMAINTHREAD_H
--- a/gui/src/backend/SymbolInformation.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,138 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef SYMBOLINFORMATION_H
-#define SYMBOLINFORMATION_H
-
-#include <QString>
-#include <QHash>
-
-// Octave includes
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#undef PACKAGE_URL
-#include "octave/config.h"
-#include "octave/cmd-edit.h"
-#include "octave/error.h"
-#include "octave/file-io.h"
-#include "octave/input.h"
-#include "octave/lex.h"
-#include "octave/load-path.h"
-#include "octave/octave.h"
-#include "octave/oct-hist.h"
-#include "octave/oct-map.h"
-#include "octave/oct-obj.h"
-#include "octave/ops.h"
-#include "octave/ov.h"
-#include "octave/ov-usr-fcn.h"
-#include "octave/symtab.h"
-#include "octave/pt.h"
-#include "octave/pt-eval.h"
-#include "octave/config.h"
-#include "octave/Range.h"
-#include "octave/toplev.h"
-#include "octave/procstream.h"
-#include "octave/sighandlers.h"
-#include "octave/debug.h"
-#include "octave/sysdep.h"
-#include "octave/ov.h"
-#include "octave/unwind-prot.h"
-#include "octave/utils.h"
-#include "octave/variables.h"
-
-typedef struct SymbolInformation
-{
-  enum Scope
-  {
-    Local       = 0,
-    Global      = 1,
-    Persistent  = 2,
-    Hidden      = 3
-  };
-
-  QString _symbol;
-  QString _type;
-  QString _value;
-  Scope   _scope;
-
-  int
-  hash () const
-  {
-    return qHash (_symbol) + qHash (_type) + qHash (_value) + (int)_scope;
-  }
-
-  bool
-  equals (const SymbolInformation& other) const
-  {
-    if (hash () == other.hash ())
-      {
-        return _symbol == other._symbol
-            && _type   == other._type
-            && _value  == other._value
-            && _scope  == other._scope;
-      }
-  }
-
-  bool
-  fromSymbolRecord (const symbol_table::symbol_record& symbolRecord)
-  {
-    if (symbolRecord.is_local () && !symbolRecord.is_global () && !symbolRecord.is_hidden ())
-      _scope = Local;
-    else if (symbolRecord.is_global ())
-      _scope = Global;
-    else if (symbolRecord.is_persistent ())
-      _scope = Persistent;
-    else if (symbolRecord.is_hidden ())
-      _scope = Hidden;
-
-    _symbol = QString (symbolRecord.name ().c_str ());
-    _type   = QString (symbolRecord.varval ().type_name ().c_str ());
-    octave_value octaveValue = symbolRecord.varval ();
-
-    // For every type, convert to a human readable string.
-    if (octaveValue.is_sq_string ())
-      _value = QString ("\'%1\'").arg (octaveValue.string_value ().c_str ());
-    else if (octaveValue.is_dq_string ())
-      _value = QString ("\"%1\"").arg (octaveValue.string_value ().c_str ());
-    else if (octaveValue.is_real_scalar ())
-      _value = QString ("%1").arg (octaveValue.scalar_value ());
-    else if (octaveValue.is_complex_scalar ())
-      _value = QString ("%1 + %2i").arg (octaveValue.scalar_value ())
-                                   .arg (octaveValue.complex_value ().imag ());
-    else if (octaveValue.is_range ())
-      _value =  QString ("%1 : %2 : %3").arg (octaveValue.range_value ().base ())
-                                        .arg (octaveValue.range_value ().inc ())
-                                        .arg (octaveValue.range_value ().limit ());
-    else if (octaveValue.is_real_matrix ())
-      _value = QString ("%1x%2").arg (octaveValue.rows ())
-                                .arg (octaveValue.columns ());
-    else if (octaveValue.is_complex_matrix ())
-      _value = QString ("%1x%2").arg (octaveValue.rows ())
-                                .arg (octaveValue.columns ());
-    else
-      _value = QString ("<Type not recognized>");
-
-    return true;
-  }
-} SymbolInformation;
-
-
-
-#endif // SYMBOLINFORMATION_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/backend/octavelink.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,157 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "octavelink.h"
+#include "load-path.h"
+#include "oct-env.h"
+#include <QDir>
+#include <QApplication>
+
+int octave_readline_hook ()
+{
+  OctaveLink::instance ()->triggerUpdateHistoryModel ();
+  OctaveLink::instance ()->buildSymbolInformation ();
+  OctaveLink::instance ()->updateCurrentWorkingDirectory ();
+  return 0;
+}
+
+void octave_exit_hook (int status)
+{
+  Q_UNUSED (status);
+  OctaveLink::instance ()->terminateOctave ();
+}
+
+OctaveLink OctaveLink::m_singleton;
+
+OctaveLink::OctaveLink ():QObject ()
+{
+  m_historyModel = new QStringListModel (this);
+  m_workspaceModel = new WorkspaceModel (this);
+
+  m_workspaceModel->insertTopLevelItem(0, new TreeItem ("Local"));
+  m_workspaceModel->insertTopLevelItem(1, new TreeItem ("Global"));
+  m_workspaceModel->insertTopLevelItem(2, new TreeItem ("Persistent"));
+  m_workspaceModel->insertTopLevelItem(3, new TreeItem ("Hidden"));
+
+  _updateWorkspaceModelTimer.setInterval (1000);
+  _updateWorkspaceModelTimer.setSingleShot (false);
+  connect(&_updateWorkspaceModelTimer, SIGNAL (timeout ()),
+    m_workspaceModel, SLOT (updateFromSymbolTable ()));
+
+  _symbolInformationSemaphore = new QSemaphore (1);
+  _currentWorkingDirectory = "";
+}
+
+OctaveLink::~OctaveLink ()
+{
+}
+
+void
+OctaveLink::launchOctave ()
+{
+  // Create both threads.
+  m_octaveMainThread = new OctaveMainThread (this);
+  command_editor::add_event_hook (octave_readline_hook);
+  octave_exit = octave_exit_hook;
+
+  // Start the first one.
+  m_octaveMainThread->start ();
+  _updateWorkspaceModelTimer.start ();
+}
+
+void
+OctaveLink::terminateOctave ()
+{
+  qApp->quit ();
+}
+
+void
+OctaveLink::triggerUpdateHistoryModel ()
+{
+  // Determine the client's (our) history length and the one of the server.
+  int clientHistoryLength = m_historyModel->rowCount ();
+  int serverHistoryLength = command_history::length ();
+
+  // If were behind the server, iterate through all new entries and add them to our history.
+  if (clientHistoryLength < serverHistoryLength)
+    {
+      for (int i = clientHistoryLength; i < serverHistoryLength; i++)
+        {
+          m_historyModel->insertRow (0);
+          m_historyModel->setData (m_historyModel->index (0), QString (command_history::get_entry (i).c_str ()));
+        }
+    }
+}
+
+void
+OctaveLink::updateCurrentWorkingDirectory ()
+{
+  QString _queriedWorkingDirectory = octave_env::get_current_directory ().c_str();
+  if (_currentWorkingDirectory != _queriedWorkingDirectory)
+    {
+      _currentWorkingDirectory = _queriedWorkingDirectory;
+      QDir::setCurrent (_currentWorkingDirectory);
+      emit workingDirectoryChanged (_currentWorkingDirectory);
+    }
+}
+
+void
+OctaveLink::acquireSymbolInformation ()
+{
+  _symbolInformationSemaphore->acquire (1);
+}
+
+void
+OctaveLink::releaseSymbolInformation ()
+{
+  _symbolInformationSemaphore->release (1);
+}
+
+void
+OctaveLink::buildSymbolInformation ()
+{
+  std::list < symbol_table::symbol_record > symbolTable = symbol_table::all_variables ();
+
+  acquireSymbolInformation ();
+  _symbolInformation.clear ();
+  for (std::list < symbol_table::symbol_record > ::iterator iterator = symbolTable.begin ();
+     iterator != symbolTable.end (); iterator++)
+  {
+    SymbolInformation symbolInformation;
+    symbolInformation.fromSymbolRecord (*iterator);
+    _symbolInformation.push_back (symbolInformation);
+  }
+  releaseSymbolInformation ();
+}
+
+const QList <SymbolInformation>&
+OctaveLink::symbolInformation () const
+{
+  return _symbolInformation;
+}
+
+QStringListModel *
+OctaveLink::historyModel ()
+{
+  return m_historyModel;
+}
+
+WorkspaceModel *
+OctaveLink::workspaceModel ()
+{
+  return m_workspaceModel;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/backend/octavelink.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,127 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 John P. Swensen, Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef OCTAVELINK_H
+#define OCTAVELINK_H
+
+// Octave includes
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_URL
+#include "octave/config.h"
+#include "octave/cmd-edit.h"
+#include "octave/error.h"
+#include "octave/file-io.h"
+#include "octave/input.h"
+#include "octave/lex.h"
+#include "octave/load-path.h"
+#include "octave/octave.h"
+#include "octave/oct-hist.h"
+#include "octave/oct-map.h"
+#include "octave/oct-obj.h"
+#include "octave/ops.h"
+#include "octave/ov.h"
+#include "octave/ov-usr-fcn.h"
+#include "octave/symtab.h"
+#include "octave/pt.h"
+#include "octave/pt-eval.h"
+#include "octave/config.h"
+#include "octave/Range.h"
+#include "octave/toplev.h"
+#include "octave/procstream.h"
+#include "octave/sighandlers.h"
+#include "octave/debug.h"
+#include "octave/sysdep.h"
+#include "octave/ov.h"
+#include "octave/unwind-prot.h"
+#include "octave/utils.h"
+#include "octave/variables.h"
+
+// Standard includes
+#include <iostream>
+#include <string>
+#include <vector>
+#include <readline/readline.h>
+
+// Qt includes
+#include <QMutexLocker>
+#include <QMutex>
+#include <QFileInfo>
+#include <QList>
+#include <QString>
+#include <QStringList>
+#include <QVector>
+#include <QSemaphore>
+#include <QObject>
+#include <QStringListModel>
+#include <QTimer>
+
+#include "workspacemodel.h"
+#include "octavemainthread.h"
+#include "symbolinformation.h"
+
+/**
+  * \class OctaveLink
+  * Manages a link to an octave instance.
+  */
+class OctaveLink:public QObject
+{
+  Q_OBJECT
+public:
+  static OctaveLink *
+  instance ()
+  {
+    return &m_singleton;
+  }
+
+  void launchOctave ();
+  void terminateOctave ();
+  QStringListModel *historyModel ();
+  WorkspaceModel *workspaceModel ();
+
+  void triggerUpdateHistoryModel ();
+  void updateCurrentWorkingDirectory ();
+
+  void acquireSymbolInformation ();
+  void releaseSymbolInformation ();
+  void buildSymbolInformation ();
+  const QList <SymbolInformation>& symbolInformation () const;
+
+signals:
+  void workingDirectoryChanged (QString directory);
+
+private:
+  OctaveLink ();
+  ~OctaveLink ();
+
+  QStringListModel *m_historyModel;
+  WorkspaceModel *m_workspaceModel;
+
+  // Threads for running octave and managing the data interaction.
+  OctaveMainThread *m_octaveMainThread;
+  QTimer _updateWorkspaceModelTimer;
+
+  QSemaphore *_symbolInformationSemaphore;
+  QList <SymbolInformation> _symbolInformation;
+
+  QString _currentWorkingDirectory;
+  static OctaveLink m_singleton;
+};
+#endif // OCTAVELINK_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/backend/octavemainthread.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,33 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "octavemainthread.h"
+#include "octavelink.h"
+
+OctaveMainThread::OctaveMainThread (QObject * parent):QThread (parent)
+{
+}
+
+void
+OctaveMainThread::run ()
+{
+  setlocale(LC_ALL, "en_US.UTF-8");
+  int argc = 1;
+  const char *argv[] = { "" };
+  emit ready();
+  octave_main (argc, (char **) argv, 0);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/backend/octavemainthread.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,35 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef OCTAVEMAINTHREAD_H
+#define OCTAVEMAINTHREAD_H
+
+#include <QThread>
+class OctaveMainThread:public QThread
+{
+  Q_OBJECT
+public:
+  OctaveMainThread (QObject * parent);
+
+signals:
+  void ready();
+
+protected:
+  void run ();
+};
+
+#endif // OCTAVEMAINTHREAD_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/backend/symbolinformation.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,138 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SYMBOLINFORMATION_H
+#define SYMBOLINFORMATION_H
+
+#include <QString>
+#include <QHash>
+
+// Octave includes
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef PACKAGE_URL
+#include "octave/config.h"
+#include "octave/cmd-edit.h"
+#include "octave/error.h"
+#include "octave/file-io.h"
+#include "octave/input.h"
+#include "octave/lex.h"
+#include "octave/load-path.h"
+#include "octave/octave.h"
+#include "octave/oct-hist.h"
+#include "octave/oct-map.h"
+#include "octave/oct-obj.h"
+#include "octave/ops.h"
+#include "octave/ov.h"
+#include "octave/ov-usr-fcn.h"
+#include "octave/symtab.h"
+#include "octave/pt.h"
+#include "octave/pt-eval.h"
+#include "octave/config.h"
+#include "octave/Range.h"
+#include "octave/toplev.h"
+#include "octave/procstream.h"
+#include "octave/sighandlers.h"
+#include "octave/debug.h"
+#include "octave/sysdep.h"
+#include "octave/ov.h"
+#include "octave/unwind-prot.h"
+#include "octave/utils.h"
+#include "octave/variables.h"
+
+typedef struct SymbolInformation
+{
+  enum Scope
+  {
+    Local       = 0,
+    Global      = 1,
+    Persistent  = 2,
+    Hidden      = 3
+  };
+
+  QString _symbol;
+  QString _type;
+  QString _value;
+  Scope   _scope;
+
+  int
+  hash () const
+  {
+    return qHash (_symbol) + qHash (_type) + qHash (_value) + (int)_scope;
+  }
+
+  bool
+  equals (const SymbolInformation& other) const
+  {
+    if (hash () == other.hash ())
+      {
+        return _symbol == other._symbol
+            && _type   == other._type
+            && _value  == other._value
+            && _scope  == other._scope;
+      }
+  }
+
+  bool
+  fromSymbolRecord (const symbol_table::symbol_record& symbolRecord)
+  {
+    if (symbolRecord.is_local () && !symbolRecord.is_global () && !symbolRecord.is_hidden ())
+      _scope = Local;
+    else if (symbolRecord.is_global ())
+      _scope = Global;
+    else if (symbolRecord.is_persistent ())
+      _scope = Persistent;
+    else if (symbolRecord.is_hidden ())
+      _scope = Hidden;
+
+    _symbol = QString (symbolRecord.name ().c_str ());
+    _type   = QString (symbolRecord.varval ().type_name ().c_str ());
+    octave_value octaveValue = symbolRecord.varval ();
+
+    // For every type, convert to a human readable string.
+    if (octaveValue.is_sq_string ())
+      _value = QString ("\'%1\'").arg (octaveValue.string_value ().c_str ());
+    else if (octaveValue.is_dq_string ())
+      _value = QString ("\"%1\"").arg (octaveValue.string_value ().c_str ());
+    else if (octaveValue.is_real_scalar ())
+      _value = QString ("%1").arg (octaveValue.scalar_value ());
+    else if (octaveValue.is_complex_scalar ())
+      _value = QString ("%1 + %2i").arg (octaveValue.scalar_value ())
+                                   .arg (octaveValue.complex_value ().imag ());
+    else if (octaveValue.is_range ())
+      _value =  QString ("%1 : %2 : %3").arg (octaveValue.range_value ().base ())
+                                        .arg (octaveValue.range_value ().inc ())
+                                        .arg (octaveValue.range_value ().limit ());
+    else if (octaveValue.is_real_matrix ())
+      _value = QString ("%1x%2").arg (octaveValue.rows ())
+                                .arg (octaveValue.columns ());
+    else if (octaveValue.is_complex_matrix ())
+      _value = QString ("%1x%2").arg (octaveValue.rows ())
+                                .arg (octaveValue.columns ());
+    else
+      _value = QString ("<Type not recognized>");
+
+    return true;
+  }
+} SymbolInformation;
+
+
+
+#endif // SYMBOLINFORMATION_H
--- a/gui/src/editor/FileEditor.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,470 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "FileEditor.h"
-#include <QVBoxLayout>
-#include <QApplication>
-#include <QFile>
-#include <QFont>
-#include <QFileDialog>
-#include <QMessageBox>
-#include <QStyle>
-#include <QTextStream>
-
-FileEditor::FileEditor (QTerminal *terminal, MainWindow *mainWindow)
-  : FileEditorInterface(terminal, mainWindow)
-{
-  construct ();
-
-  m_terminal = terminal;
-  m_mainWindow = mainWindow;
-  setVisible (false);
-}
-
-FileEditor::~FileEditor ()
-{
-}
-
-LexerOctaveGui *
-FileEditor::lexer ()
-{
-  return m_lexer;
-}
-
-QTerminal *
-FileEditor::terminal ()
-{
-  return m_terminal;
-}
-
-MainWindow *
-FileEditor::mainWindow ()
-{
-  return m_mainWindow;
-}
-
-void
-FileEditor::requestNewFile ()
-{
-  FileEditorTab *fileEditorTab = new FileEditorTab (this);
-  if (fileEditorTab)
-    {
-      addFileEditorTab (fileEditorTab);
-      fileEditorTab->newFile ();
-    }
-}
-
-void
-FileEditor::requestOpenFile ()
-{
-  FileEditorTab *fileEditorTab = new FileEditorTab (this);
-  if (fileEditorTab)
-    {
-      addFileEditorTab (fileEditorTab);
-      if (!fileEditorTab->openFile ())
-        {
-          // If no file was loaded, remove the tab again.
-          m_tabWidget->removeTab (m_tabWidget->indexOf (fileEditorTab));
-        }
-    }
-}
-
-void
-FileEditor::requestOpenFile (QString fileName)
-{
-  if (!isVisible ())
-    {
-      show ();
-    }
-
-  FileEditorTab *fileEditorTab = new FileEditorTab (this);
-  if (fileEditorTab)
-    {
-      addFileEditorTab (fileEditorTab);
-      fileEditorTab->loadFile (fileName);
-    }
-}
-
-void
-FileEditor::requestUndo ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->undo ();
-}
-
-void
-FileEditor::requestRedo ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->redo ();
-}
-
-void
-FileEditor::requestCopy ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->copy ();
-}
-
-void
-FileEditor::requestCut ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->cut ();
-}
-
-void
-FileEditor::requestPaste ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->paste ();
-}
-
-void
-FileEditor::requestSaveFile ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->saveFile ();
-}
-
-void
-FileEditor::requestSaveFileAs ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->saveFileAs ();
-}
-
-void
-FileEditor::requestRunFile ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->runFile ();
-}
-
-void
-FileEditor::requestToggleBookmark ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->toggleBookmark ();
-}
-
-void
-FileEditor::requestNextBookmark ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->nextBookmark ();
-}
-
-void
-FileEditor::requestPreviousBookmark ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->previousBookmark ();
-}
-
-void
-FileEditor::requestRemoveBookmark ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->removeBookmark ();
-}
-
-void
-FileEditor::requestCommentSelectedText ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->commentSelectedText ();
-}
-
-void
-FileEditor::requestUncommentSelectedText ()
-{
-  FileEditorTab *activeFileEditorTab = activeEditorTab ();
-  if (activeFileEditorTab)
-    activeFileEditorTab->uncommentSelectedText ();
-}
-
-void
-FileEditor::handleFileNameChanged (QString fileName)
-{
-  QObject *senderObject = sender ();
-  FileEditorTab *fileEditorTab = dynamic_cast<FileEditorTab*> (senderObject);
-  if (fileEditorTab)
-    {
-      for(int i = 0; i < m_tabWidget->count (); i++)
-        {
-          if (m_tabWidget->widget (i) == fileEditorTab)
-            {
-              m_tabWidget->setTabText (i, fileName);
-            }
-        }
-    }
-}
-
-void
-FileEditor::handleTabCloseRequest (int index)
-{
-  FileEditorTab *fileEditorTab = dynamic_cast <FileEditorTab*> (m_tabWidget->widget (index));
-  if (fileEditorTab)
-    if (fileEditorTab->close ())
-      {
-        m_tabWidget->removeTab (index);
-        delete fileEditorTab;
-      }
-}
-
-void
-FileEditor::handleTabCloseRequest ()
-{
-  FileEditorTab *fileEditorTab = dynamic_cast <FileEditorTab*> (sender ());
-  if (fileEditorTab)
-    if (fileEditorTab->close ())
-      {
-        m_tabWidget->removeTab (m_tabWidget->indexOf (fileEditorTab));
-        delete fileEditorTab;
-      }
-}
-
-void
-FileEditor::activeTabChanged (int index)
-{
-  Q_UNUSED (index);
-  handleEditorStateChanged ();
-}
-
-void
-FileEditor::handleEditorStateChanged ()
-{
-  FileEditorTab *fileEditorTab = activeEditorTab ();
-  if (fileEditorTab)
-    {
-      bool copyAvailable = fileEditorTab->copyAvailable ();
-      m_copyAction->setEnabled (copyAvailable);
-      m_cutAction->setEnabled (copyAvailable);
-    }
-}
-
-void
-FileEditor::construct ()
-{
-  QWidget *widget = new QWidget (this);
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  QStyle *style = QApplication::style ();
-
-  m_menuBar = new QMenuBar (widget);
-  m_toolBar = new QToolBar (widget);
-  m_tabWidget = new QTabWidget (widget);
-  m_tabWidget->setTabsClosable (true);
-
-  // Theme icons with QStyle icons as fallback
-  QAction *newAction = new QAction (
-        QIcon::fromTheme("document-new",style->standardIcon (QStyle::SP_FileIcon)),
-        tr("&New File"), m_toolBar);
-
-  QAction *openAction = new QAction (
-        QIcon::fromTheme("document-open",style->standardIcon (QStyle::SP_DirOpenIcon)),
-        tr("&Open File"), m_toolBar);
-
-  QAction *saveAction = new QAction (
-        QIcon::fromTheme("document-save",style->standardIcon (QStyle::SP_DriveHDIcon)),
-        tr("&Save File"), m_toolBar);
-
-  QAction *saveAsAction = new QAction (
-        QIcon::fromTheme("document-save-as",style->standardIcon (QStyle::SP_DriveFDIcon)),
-        tr("Save File &As"), m_toolBar);
-
-  QAction *undoAction = new QAction (
-        QIcon::fromTheme("edit-undo",style->standardIcon (QStyle::SP_ArrowLeft)),
-        tr("&Undo"), m_toolBar);
-
-  QAction *redoAction = new QAction (
-        QIcon::fromTheme("edit-redo",style->standardIcon (QStyle::SP_ArrowRight)),
-        tr("&Redo"), m_toolBar);
-
-  m_copyAction = new QAction (QIcon::fromTheme ("edit-copy"), tr ("&Copy"), m_toolBar);
-  m_cutAction = new QAction (QIcon::fromTheme ("edit-cut"), tr ("Cu&t"), m_toolBar);
-
-  QAction *pasteAction              = new QAction (QIcon::fromTheme ("edit-paste"), tr ("&Paste"),m_toolBar);
-  QAction *nextBookmarkAction       = new QAction (tr ("&Next Bookmark"),m_toolBar);
-  QAction *prevBookmarkAction       = new QAction (tr ("Pre&vious Bookmark"),m_toolBar);
-  QAction *toggleBookmarkAction     = new QAction (tr ("Toggle &Bookmark"),m_toolBar);
-  QAction *removeBookmarkAction     = new QAction (tr ("&Remove All Bookmarks"),m_toolBar);
-  QAction *commentSelectedAction    = new QAction (tr ("&Comment Selected Text"),m_toolBar);
-  QAction *uncommentSelectedAction  = new QAction (tr ("&Uncomment Selected Text"),m_toolBar);
-
-  QAction *runAction = new QAction (
-        QIcon::fromTheme ("media-play", style->standardIcon (QStyle::SP_MediaPlay)),
-        tr("&Run File"), m_toolBar);
-
-  // some actions are disabled from the beginning
-  m_copyAction->setEnabled(false);
-  m_cutAction->setEnabled(false);
-
-  // short cuts
-  newAction->setShortcut              (QKeySequence::New);
-  openAction->setShortcut             (QKeySequence::Open);
-  saveAction->setShortcut             (QKeySequence::Save);
-  saveAsAction->setShortcut           (QKeySequence::SaveAs);
-  undoAction->setShortcut             (QKeySequence::Undo);
-  redoAction->setShortcut             (QKeySequence::Redo);
-  m_copyAction->setShortcut           (QKeySequence::Copy);
-  m_cutAction->setShortcut            (QKeySequence::Cut);
-  pasteAction->setShortcut            (QKeySequence::Paste);
-  runAction->setShortcut              (Qt::Key_F5);
-  nextBookmarkAction->setShortcut     (Qt::Key_F2);
-  prevBookmarkAction->setShortcut     (Qt::SHIFT + Qt::Key_F2);
-  toggleBookmarkAction->setShortcut   (Qt::Key_F7);
-  commentSelectedAction->setShortcut  (Qt::CTRL + Qt::Key_R);
-  uncommentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_T);
-
-  // toolbar
-  m_toolBar->addAction (newAction);
-  m_toolBar->addAction (openAction);
-  m_toolBar->addAction (saveAction);
-  m_toolBar->addAction (saveAsAction);
-  m_toolBar->addSeparator ();
-  m_toolBar->addAction (undoAction);
-  m_toolBar->addAction (redoAction);
-  m_toolBar->addAction (m_copyAction);
-  m_toolBar->addAction (m_cutAction);
-  m_toolBar->addAction (pasteAction);
-  m_toolBar->addSeparator ();
-  m_toolBar->addAction (runAction);
-
-  // menu bar
-  QMenu *fileMenu = new QMenu (tr ("&File"), m_menuBar);
-  fileMenu->addAction (newAction);
-  fileMenu->addAction (openAction);
-  fileMenu->addAction (saveAction);
-  fileMenu->addAction (saveAsAction);
-  fileMenu->addSeparator ();
-  m_menuBar->addMenu (fileMenu);
-
-  QMenu *editMenu = new QMenu (tr ("&Edit"), m_menuBar);
-  editMenu->addAction (undoAction);
-  editMenu->addAction (redoAction);
-  editMenu->addSeparator ();
-  editMenu->addAction (m_copyAction);
-  editMenu->addAction (m_cutAction);
-  editMenu->addAction (pasteAction);
-  editMenu->addSeparator ();
-  editMenu->addAction (commentSelectedAction);
-  editMenu->addAction (uncommentSelectedAction);
-  editMenu->addSeparator ();
-  editMenu->addAction (toggleBookmarkAction);
-  editMenu->addAction (nextBookmarkAction);
-  editMenu->addAction (prevBookmarkAction);
-  editMenu->addAction (removeBookmarkAction);
-  m_menuBar->addMenu (editMenu);
-
-  QMenu *runMenu = new QMenu (tr ("&Run"), m_menuBar);
-  runMenu->addAction (runAction);
-  m_menuBar->addMenu (runMenu);
-
-  QVBoxLayout *layout = new QVBoxLayout ();
-  layout->addWidget (m_menuBar);
-  layout->addWidget (m_toolBar);
-  layout->addWidget (m_tabWidget);
-  layout->setMargin (0);
-  widget->setLayout (layout);
-  setWidget (widget);
-
-  connect (newAction,               SIGNAL (triggered ()), this, SLOT (requestNewFile ()));
-  connect (openAction,              SIGNAL (triggered ()), this, SLOT (requestOpenFile ()));
-  connect (undoAction,              SIGNAL (triggered ()), this, SLOT (requestUndo ()));
-  connect (redoAction,              SIGNAL (triggered ()), this, SLOT (requestRedo ()));
-  connect (m_copyAction,            SIGNAL (triggered ()), this, SLOT (requestCopy ()));
-  connect (m_cutAction,             SIGNAL (triggered ()), this, SLOT (requestCut ()));
-  connect (pasteAction,             SIGNAL (triggered ()), this, SLOT (requestPaste ()));
-  connect (saveAction,              SIGNAL (triggered ()), this, SLOT (requestSaveFile ()));
-  connect (saveAsAction,            SIGNAL (triggered ()), this, SLOT (requestSaveFileAs ()));
-  connect (runAction,               SIGNAL (triggered ()), this, SLOT (requestRunFile ()));
-  connect (toggleBookmarkAction,    SIGNAL (triggered ()), this, SLOT (requestToggleBookmark ()));
-  connect (nextBookmarkAction,      SIGNAL (triggered ()), this, SLOT (requestNextBookmark ()));
-  connect (prevBookmarkAction,      SIGNAL (triggered ()), this, SLOT (requestPreviousBookmark ()));
-  connect (removeBookmarkAction,    SIGNAL (triggered ()), this, SLOT (requestRemoveBookmark ()));
-  connect (commentSelectedAction,   SIGNAL (triggered ()), this, SLOT (requestCommentSelectedText ()));
-  connect (uncommentSelectedAction, SIGNAL (triggered ()), this, SLOT (requestUncommentSelectedText ()));
-  connect (m_tabWidget, SIGNAL (tabCloseRequested (int)), this, SLOT (handleTabCloseRequest (int)));
-  connect (m_tabWidget, SIGNAL (currentChanged(int)), this, SLOT (activeTabChanged (int)));
-
-  // this has to be done only once, not for each editor
-  m_lexer = new LexerOctaveGui ();
-
-  // Editor font (default or from settings)
-  m_lexer->setDefaultFont (QFont (
-                             settings->value ("editor/fontName","Courier").toString (),
-                             settings->value ("editor/fontSize",10).toInt ()));
-
-  // TODO: Autoindent not working as it should
-  m_lexer->setAutoIndentStyle (QsciScintilla::AiMaintain ||
-                               QsciScintilla::AiOpening  ||
-                               QsciScintilla::AiClosing);
-
-  // The API info that is used for auto completion
-  // TODO: Where to store a file with API info (raw or prepared?)?
-  // TODO: Also provide infos on octave-forge functions?
-  // TODO: Also provide infos on function parameters?
-  // By now, use the keywords-list from syntax highlighting
-  m_lexerAPI = new QsciAPIs (m_lexer);
-
-  QString keyword;
-  QStringList keywordList;
-  keyword = m_lexer->keywords (1);  // get whole string with all keywords
-  keywordList = keyword.split (QRegExp ("\\s+"));  // split into single strings
-  int i;
-  for (i = 0; i < keywordList.size (); i++)
-    {
-      m_lexerAPI->add (keywordList.at (i));  // add single strings to the API
-    }
-  m_lexerAPI->prepare ();           // prepare API info ... this make take some time
-  resize (500, 400);
-  setWindowIcon (QIcon::fromTheme ("accessories-text-editor", style->standardIcon (QStyle::SP_FileIcon)));
-  setWindowTitle ("Octave Editor");
-}
-
-void
-FileEditor::addFileEditorTab (FileEditorTab *fileEditorTab)
-{
-  m_tabWidget->addTab (fileEditorTab, "");
-  connect (fileEditorTab, SIGNAL (fileNameChanged(QString)),
-           this, SLOT(handleFileNameChanged(QString)));
-  connect (fileEditorTab, SIGNAL (editorStateChanged ()),
-           this, SLOT (handleEditorStateChanged ()));
-  connect (fileEditorTab, SIGNAL (closeRequest ()),
-           this, SLOT (handleTabCloseRequest ()));
-  m_tabWidget->setCurrentWidget (fileEditorTab);
-}
-
-FileEditorTab *
-FileEditor::activeEditorTab ()
-{
-  return dynamic_cast<FileEditorTab*> (m_tabWidget->currentWidget ());
-}
--- a/gui/src/editor/FileEditor.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef FILEEDITORMDISUBWINDOW_H
-#define FILEEDITORMDISUBWINDOW_H
-
-#include "MainWindow.h"
-#include "FileEditorInterface.h"
-#include "FileEditorTab.h"
-
-#include <QToolBar>
-#include <QAction>
-#include <QMenuBar>
-#include <QStatusBar>
-#include <QCloseEvent>
-#include <QTabWidget>
-#include <Qsci/qsciapis.h>
-// Not available in the Debian repos yet!
-// #include <Qsci/qscilexeroctave.h>
-#include "lexeroctavegui.h"
-
-const char UNNAMED_FILE[]     = "<unnamed>";
-const char SAVE_FILE_FILTER[] = "Octave Files (*.m);;All Files (*.*)";
-enum MARKER
-  {
-    MARKER_BOOKMARK,
-    MARKER_BREAKPOINT
-  };
-
-class FileEditor : public FileEditorInterface
-{
-Q_OBJECT
-
-public:
-  FileEditor (QTerminal *terminal, MainWindow *mainWindow);
-  ~FileEditor ();
-  void loadFile (QString fileName);
-  LexerOctaveGui *lexer ();
-  QTerminal *terminal ();
-  MainWindow *mainWindow ();
-
-public slots:
-  void requestNewFile ();
-  void requestOpenFile ();
-  void requestOpenFile (QString fileName);
-
-  void requestUndo ();
-  void requestRedo ();
-  void requestCopy ();
-  void requestCut ();
-  void requestPaste ();
-  void requestSaveFile ();
-  void requestSaveFileAs ();
-  void requestRunFile ();
-  void requestToggleBookmark ();
-  void requestNextBookmark ();
-  void requestPreviousBookmark ();
-  void requestRemoveBookmark ();
-  void requestCommentSelectedText ();
-  void requestUncommentSelectedText ();
-
-  void handleFileNameChanged (QString fileName);
-  void handleTabCloseRequest (int index);
-  void handleTabCloseRequest ();
-  void activeTabChanged (int index);
-  void handleEditorStateChanged ();
-
-private:
-  void construct ();
-  void addFileEditorTab(FileEditorTab *fileEditorTab);
-  FileEditorTab *activeEditorTab();
-
-  QMenuBar *m_menuBar;
-  QToolBar *m_toolBar;
-  QAction* m_copyAction;
-  QAction* m_cutAction;
-  QTabWidget *m_tabWidget;
-  int m_markerBookmark;
-
-  LexerOctaveGui *m_lexer;
-  QsciAPIs *m_lexerAPI;
-};
-
-#endif // FILEEDITORMDISUBWINDOW_H
--- a/gui/src/editor/FileEditorInterface.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,68 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef FILEEDITORINTERFACE_H
-#define FILEEDITORINTERFACE_H
-
-#include <QDockWidget>
-
-class QTerminal;
-class MainWindow;
-
-class FileEditorInterface : public QDockWidget
-{
-  Q_OBJECT
-
-  public:
-    FileEditorInterface (QTerminal *terminal, MainWindow *mainWindow)
-      : QDockWidget ((QWidget*)mainWindow) // QDockWidget constructor is explicit, hence the cast.
-    {
-      setObjectName ("FileEditor");
-      m_terminal = terminal;
-      m_mainWindow = mainWindow;
-
-      connect (this, SIGNAL (visibilityChanged (bool)), this, SLOT (handleVisibilityChanged (bool)));
-    }
-
-    virtual ~FileEditorInterface () { }
-  public slots:
-    virtual void requestNewFile () = 0;
-    virtual void requestOpenFile () = 0;
-    virtual void requestOpenFile (QString fileName) = 0;
-
-  signals:
-      void activeChanged (bool active);
-
-  protected:
-    QTerminal* m_terminal;
-    MainWindow* m_mainWindow;
-
-    void closeEvent (QCloseEvent *event)
-    {
-      emit activeChanged (false);
-      QDockWidget::closeEvent (event);
-    }
-
-  protected slots:
-    void handleVisibilityChanged (bool visible)
-    {
-      if (visible)
-        emit activeChanged (true);
-    }
-};
-
-#endif // FILEEDITORINTERFACE_H
--- a/gui/src/editor/FileEditorTab.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,514 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "FileEditorTab.h"
-#include "FileEditor.h"
-#include <QMessageBox>
-#include <QVBoxLayout>
-
-FileEditorTab::FileEditorTab(FileEditor *fileEditor)
-  : QWidget ((QWidget*)fileEditor)
-{
-  QSettings *settings = ResourceManager::instance ()->settings ();
-  m_fileEditor = fileEditor;
-  m_fileName = "";
-  m_editArea = new QsciScintilla (this);
-  m_editArea->setLexer (fileEditor->lexer ());
-
-  // markers
-  m_editArea->setMarginType (1, QsciScintilla::SymbolMargin);
-  m_editArea->setMarginSensitivity (1, true);
-  m_editArea->markerDefine (QsciScintilla::RightTriangle, MARKER_BOOKMARK);
-  connect (m_editArea, SIGNAL (marginClicked (int, int, Qt::KeyboardModifiers)),
-           this, SLOT (handleMarginClicked (int, int, Qt::KeyboardModifiers)));
-
-  // line numbers
-  m_editArea->setMarginsForegroundColor(QColor(96,96,96));
-  m_editArea->setMarginsBackgroundColor(QColor(232,232,220));
-  if (settings->value ("editor/showLineNumbers",true).toBool ())
-    {
-      QFont marginFont( settings->value ("editor/fontName","Courier").toString () ,
-                        settings->value ("editor/fontSize",10).toInt () );
-      m_editArea->setMarginsFont( marginFont );
-      QFontMetrics metrics(marginFont);
-      m_editArea->setMarginType (2, QsciScintilla::TextMargin);
-      m_editArea->setMarginWidth(2, metrics.width("99999"));
-      m_editArea->setMarginLineNumbers(2, true);
-    }
-
-  // code folding
-  m_editArea->setMarginType (3, QsciScintilla::SymbolMargin);
-  m_editArea->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3);
-
-  // other features
-  if (settings->value ("editor/highlightCurrentLine",true).toBool ())
-    {
-      m_editArea->setCaretLineVisible(true);
-      m_editArea->setCaretLineBackgroundColor(QColor(245,245,245));
-    }
-  m_editArea->setBraceMatching (QsciScintilla::StrictBraceMatch);
-  m_editArea->setAutoIndent (true);
-  m_editArea->setIndentationWidth (2);
-  m_editArea->setIndentationsUseTabs (false);
-  if (settings->value ("editor/codeCompletion",true).toBool ())
-    {
-      m_editArea->autoCompleteFromAll ();
-      m_editArea->setAutoCompletionSource(QsciScintilla::AcsAll);
-      m_editArea->setAutoCompletionThreshold (1);
-    }
-  m_editArea->setUtf8 (true);
-
-  QVBoxLayout *layout = new QVBoxLayout ();
-  layout->addWidget (m_editArea);
-  layout->setMargin (0);
-  setLayout (layout);
-
-  // connect modified signal
-  connect (m_editArea, SIGNAL (modificationChanged (bool)),
-           this, SLOT (newTitle (bool)));
-  connect (m_editArea, SIGNAL (copyAvailable (bool)),
-           this, SLOT (handleCopyAvailable (bool)));
-  connect (&m_fileSystemWatcher, SIGNAL (fileChanged (QString)),
-           this, SLOT (fileHasChanged (QString)));
-
-  m_fileName = "";
-  newTitle (false);
-}
-
-bool
-FileEditorTab::copyAvailable ()
-{
-  return m_copyAvailable;
-}
-
-void
-FileEditorTab::closeEvent (QCloseEvent *event)
-{
-  if (m_fileEditor->mainWindow ()->closing ())
-    {
-      // close whole application: save file or not if modified
-      checkFileModified ("Closing Octave", 0); // no cancel possible
-      event->accept ();
-    }
-  else
-    {
-      // ignore close event if file is not saved and user cancels closing this window
-      if (checkFileModified ("Close File", QMessageBox::Cancel) == QMessageBox::Cancel)
-        {
-          event->ignore ();
-        }
-      else
-        {
-          event->accept();
-        }
-    }
-}
-
-void
-FileEditorTab::setFileName (QString fileName)
-{
-  m_fileName = fileName;
-  updateTrackedFile ();
-}
-
-void
-FileEditorTab::handleMarginClicked(int margin, int line, Qt::KeyboardModifiers state)
-{
-  Q_UNUSED (state);
-  if (margin == 1)  // marker margin
-    {
-      unsigned int mask = m_editArea->markersAtLine (line);
-      if (mask && (1 << MARKER_BOOKMARK))
-        m_editArea->markerDelete(line,MARKER_BOOKMARK);
-      else
-        m_editArea->markerAdd(line,MARKER_BOOKMARK);
-    }
-}
-
-void
-FileEditorTab::commentSelectedText ()
-{
-  doCommentSelectedText (true);
-}
-
-void
-FileEditorTab::uncommentSelectedText ()
-{
-  doCommentSelectedText (false);
-}
-
-void
-FileEditorTab::doCommentSelectedText (bool comment)
-{
-  if ( m_editArea->hasSelectedText() )
-    {
-      int lineFrom, lineTo, colFrom, colTo, i;
-      m_editArea->getSelection (&lineFrom,&colFrom,&lineTo,&colTo);
-      if ( colTo == 0 )  // the beginning of last line is not selected
-        lineTo--;        // stop at line above
-      m_editArea->beginUndoAction ();
-      for ( i=lineFrom; i<=lineTo; i++ )
-        {
-          if ( comment )
-            m_editArea->insertAt("%",i,0);
-          else
-            {
-              QString line(m_editArea->text(i));
-              if ( line.startsWith("%") )
-                {
-                  m_editArea->setSelection(i,0,i,1);
-                  m_editArea->removeSelectedText();
-                }
-            }
-        }
-      m_editArea->endUndoAction ();
-    }
-}
-
-void
-FileEditorTab::newTitle(bool modified)
-{
-  QString title(m_fileName);
-  if ( !m_longTitle )
-    {
-      QFileInfo file(m_fileName);
-      title = file.fileName();
-    }
-
-  if ( modified )
-    {
-      emit fileNameChanged (title.prepend("* "));
-    }
-  else
-    emit fileNameChanged (title);
-}
-
-void
-FileEditorTab::handleCopyAvailable(bool enableCopy)
-{
-  m_copyAvailable = enableCopy;
-  emit editorStateChanged ();
-}
-
-void
-FileEditorTab::updateTrackedFile ()
-{
-  QStringList trackedFiles = m_fileSystemWatcher.files ();
-  if (!trackedFiles.isEmpty ())
-    m_fileSystemWatcher.removePaths (trackedFiles);
-
-  if (m_fileName != UNNAMED_FILE)
-    m_fileSystemWatcher.addPath (m_fileName);
-}
-
-int
-FileEditorTab::checkFileModified (QString msg, int cancelButton)
-{
-  int decision = QMessageBox::Yes;
-  if (m_editArea->isModified ())
-    {
-      // file is modified but not saved, aks user what to do
-      decision = QMessageBox::warning (this,
-                                       msg,
-                                       tr ("The file %1\n"
-                                           "has been modified. Do you want to save the changes?").
-                                       arg (m_fileName),
-                                       QMessageBox::Save, QMessageBox::Discard, cancelButton );
-      if (decision == QMessageBox::Save)
-        {
-          saveFile ();
-          if (m_editArea->isModified ())
-            {
-              // If the user attempted to save the file, but it's still
-              // modified, then probably something went wrong, so return cancel
-              // for cancel this operation or try to save files as if cancel not
-              // possible
-              if ( cancelButton )
-                return (QMessageBox::Cancel);
-              else
-                saveFileAs ();
-            }
-        }
-    }
-  return (decision);
-}
-
-void
-FileEditorTab::removeBookmark ()
-{
-  m_editArea->markerDeleteAll(MARKER_BOOKMARK);
-}
-
-void
-FileEditorTab::toggleBookmark ()
-{
-  int line,cur;
-  m_editArea->getCursorPosition(&line,&cur);
-  if ( m_editArea->markersAtLine (line) && (1 << MARKER_BOOKMARK) )
-    m_editArea->markerDelete(line,MARKER_BOOKMARK);
-  else
-    m_editArea->markerAdd(line,MARKER_BOOKMARK);
-}
-
-void
-FileEditorTab::nextBookmark ()
-{
-  int line,cur,nextline;
-  m_editArea->getCursorPosition(&line,&cur);
-  if ( m_editArea->markersAtLine(line) && (1 << MARKER_BOOKMARK) )
-    line++; // we have a bookmark here, so start search from next line
-  nextline = m_editArea->markerFindNext(line,(1 << MARKER_BOOKMARK));
-  m_editArea->setCursorPosition(nextline,0);
-}
-
-void
-FileEditorTab::previousBookmark ()
-{
-  int line,cur,prevline;
-  m_editArea->getCursorPosition(&line,&cur);
-  if ( m_editArea->markersAtLine(line) && (1 << MARKER_BOOKMARK) )
-    line--; // we have a bookmark here, so start search from prev line
-  prevline = m_editArea->markerFindPrevious(line,(1 << MARKER_BOOKMARK));
-  m_editArea->setCursorPosition(prevline,0);
-}
-
-void
-FileEditorTab::cut ()
-{
-  m_editArea->cut ();
-}
-
-void
-FileEditorTab::copy ()
-{
-  m_editArea->copy ();
-}
-
-void
-FileEditorTab::paste ()
-{
-  m_editArea->paste ();
-}
-
-void
-FileEditorTab::undo ()
-{
-  m_editArea->undo ();
-}
-
-void
-FileEditorTab::redo ()
-{
-  m_editArea->redo ();
-}
-
-void
-FileEditorTab::setModified (bool modified)
-{
-  m_editArea->setModified (modified);
-}
-
-bool
-FileEditorTab::openFile ()
-{
-  QString openFileName;
-  QFileDialog fileDialog(this);
-  fileDialog.setNameFilter(SAVE_FILE_FILTER);
-  fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
-  fileDialog.setViewMode(QFileDialog::Detail);
-  if (fileDialog.exec () == QDialog::Accepted)
-    {
-      openFileName = fileDialog.selectedFiles().at(0);
-      if (openFileName.isEmpty ())
-        return false;
-
-      loadFile(openFileName);
-      return true;
-    }
-  else
-    {
-      return false;
-    }
-}
-
-void
-FileEditorTab::loadFile (QString fileName)
-{
-  if (!m_fileEditor->isVisible ())
-    {
-      m_fileEditor->show ();
-    }
-
-  QFile file (fileName);
-  if (!file.open (QFile::ReadOnly))
-    {
-      QMessageBox::warning (this, tr ("Octave Editor"),
-                            tr ("Could not open file %1 for read:\n%2.").arg (fileName).
-                            arg (file.errorString ()));
-      return;
-    }
-
-  QTextStream in (&file);
-  QApplication::setOverrideCursor (Qt::WaitCursor);
-  m_editArea->setText (in.readAll ());
-  QApplication::restoreOverrideCursor ();
-
-  setFileName (fileName);
-  updateTrackedFile ();
-
-
-  newTitle (false); // window title (no modification)
-  m_editArea->setModified (false); // loaded file is not modified yet
-}
-
-void
-FileEditorTab::newFile ()
-{
-  if (!m_fileEditor->isVisible ())
-    {
-      m_fileEditor->show ();
-    }
-
-  setFileName (UNNAMED_FILE);
-  newTitle (false); // window title (no modification)
-  m_editArea->setText ("");
-  m_editArea->setModified (false); // new file is not modified yet
-}
-
-bool FileEditorTab::saveFile()
-{
-  return saveFile (m_fileName);
-}
-
-bool
-FileEditorTab::saveFile (QString saveFileName)
-{
-  // it is a new file with the name "<unnamed>" -> call saveFielAs
-  if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ())
-    {
-      return saveFileAs();
-    }
-
-  // open the file for writing
-  QFile file (saveFileName);
-  if (!file.open (QFile::WriteOnly))
-    {
-      QMessageBox::warning (this, tr ("Octave Editor"),
-                            tr ("Could not open file %1 for write:\n%2.").
-                            arg (saveFileName).arg (file.errorString ()));
-      return false;
-    }
-
-  // save the contents into the file
-  QTextStream out (&file);
-  QApplication::setOverrideCursor (Qt::WaitCursor);
-  out << m_editArea->text ();
-  QApplication::restoreOverrideCursor ();
-  setFileName (saveFileName);  // save file name for later use
-  newTitle (false);      // set the window title to actual file name (not modified)
-  m_editArea->setModified (false); // files is save -> not modified
-  return true;
-}
-
-bool
-FileEditorTab::saveFileAs ()
-{
-  QString saveFileName(m_fileName);
-  QFileDialog fileDialog(this);
-  if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ())
-    {
-      saveFileName = QDir::homePath ();
-      fileDialog.setDirectory (saveFileName);
-    }
-  else
-    {
-      fileDialog.selectFile (saveFileName);
-    }
-  fileDialog.setNameFilter (SAVE_FILE_FILTER);
-  fileDialog.setDefaultSuffix ("m");
-  fileDialog.setAcceptMode (QFileDialog::AcceptSave);
-  fileDialog.setViewMode (QFileDialog::Detail);
-
-  if (fileDialog.exec ())
-    {
-      saveFileName = fileDialog.selectedFiles ().at (0);
-      if (saveFileName.isEmpty ())
-        return false;
-
-      return saveFile (saveFileName);
-    }
-
-  return false;
-}
-
-void
-FileEditorTab::runFile ()
-{
-  if (m_editArea->isModified ())
-    saveFile(m_fileName);
-
-  m_fileEditor->terminal ()->sendText (QString ("run \'%1\'\n").arg (m_fileName));
-  m_fileEditor->terminal ()->setFocus ();
-}
-
-void
-FileEditorTab::fileHasChanged (QString fileName)
-{
-  Q_UNUSED (fileName);
-  if (QFile::exists (m_fileName))
-    {
-      // Prevent popping up multiple message boxes when the file has been changed multiple times.
-      static bool alreadyAsking = false;
-      if (!alreadyAsking)
-        {
-          alreadyAsking = true;
-
-          int decision =
-          QMessageBox::warning (this, tr ("Octave Editor"),
-                                tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?").
-                                arg (m_fileName), QMessageBox::Yes, QMessageBox::No);
-
-          if (decision == QMessageBox::Yes)
-            {
-              loadFile (m_fileName);
-            }
-
-          alreadyAsking = false;
-        }
-    }
-  else
-    {
-      int decision =
-      QMessageBox::warning (this, tr ("Octave Editor"),
-                            tr ("It seems that \'%1\' has been deleted or renamed. Do you want to save it now?").
-                            arg (m_fileName), QMessageBox::Save, QMessageBox::Close);
-      if (decision == QMessageBox::Save)
-        {
-          if (!saveFileAs ())
-            {
-              setFileName (UNNAMED_FILE);
-              newTitle (true); // window title (no modification)
-              setModified (true);
-              updateTrackedFile ();
-            }
-        }
-      else
-        {
-          emit closeRequest ();
-        }
-    }
-}
--- a/gui/src/editor/FileEditorTab.h	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef FILEEDITORTAB_H
-#define FILEEDITORTAB_H
-
-#include <Qsci/qsciscintilla.h>
-#include <QWidget>
-#include <QCloseEvent>
-#include <QFileSystemWatcher>
-
-class FileEditor;
-class FileEditorTab : public QWidget
-{
-  Q_OBJECT
-public:
-  FileEditorTab (FileEditor *fileEditor);
-  bool copyAvailable ();
-
-public slots:
-  void newTitle(bool modified);
-  void handleCopyAvailable(bool enableCopy);
-  void handleMarginClicked (int line, int margin, Qt::KeyboardModifiers state);
-  void commentSelectedText ();
-  void uncommentSelectedText ();
-  void removeBookmark ();
-  void toggleBookmark ();
-  void nextBookmark ();
-  void previousBookmark ();
-  void cut ();
-  void copy ();
-  void paste ();
-  void undo ();
-  void redo ();
-
-  void setModified (bool modified = true);
-
-  bool openFile();
-  void loadFile (QString fileName);
-  void newFile ();
-  bool saveFile ();
-  bool saveFile(QString saveFileName);
-  bool saveFileAs();
-  void runFile ();
-
-  void fileHasChanged (QString fileName);
-
-signals:
-  void fileNameChanged (QString fileName);
-  void editorStateChanged ();
-  void closeRequest ();
-
-protected:
-  void closeEvent (QCloseEvent *event);
-  void setFileName (QString fileName);
-
-private:
-  void updateTrackedFile ();
-  int checkFileModified (QString msg, int cancelButton);
-  void doCommentSelectedText (bool comment);
-
-  FileEditor *m_fileEditor;
-  QsciScintilla *m_editArea;
-
-  QString m_fileName;
-  QString m_fileNameShort;
-
-  bool m_longTitle;
-  bool m_copyAvailable;
-
-  QFileSystemWatcher m_fileSystemWatcher;
-};
-
-#endif // FILEEDITORTAB_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/editor/fileeditor.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,470 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "fileeditor.h"
+#include <QVBoxLayout>
+#include <QApplication>
+#include <QFile>
+#include <QFont>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QStyle>
+#include <QTextStream>
+
+FileEditor::FileEditor (QTerminal *terminal, MainWindow *mainWindow)
+  : FileEditorInterface(terminal, mainWindow)
+{
+  construct ();
+
+  m_terminal = terminal;
+  m_mainWindow = mainWindow;
+  setVisible (false);
+}
+
+FileEditor::~FileEditor ()
+{
+}
+
+LexerOctaveGui *
+FileEditor::lexer ()
+{
+  return m_lexer;
+}
+
+QTerminal *
+FileEditor::terminal ()
+{
+  return m_terminal;
+}
+
+MainWindow *
+FileEditor::mainWindow ()
+{
+  return m_mainWindow;
+}
+
+void
+FileEditor::requestNewFile ()
+{
+  FileEditorTab *fileEditorTab = new FileEditorTab (this);
+  if (fileEditorTab)
+    {
+      addFileEditorTab (fileEditorTab);
+      fileEditorTab->newFile ();
+    }
+}
+
+void
+FileEditor::requestOpenFile ()
+{
+  FileEditorTab *fileEditorTab = new FileEditorTab (this);
+  if (fileEditorTab)
+    {
+      addFileEditorTab (fileEditorTab);
+      if (!fileEditorTab->openFile ())
+        {
+          // If no file was loaded, remove the tab again.
+          m_tabWidget->removeTab (m_tabWidget->indexOf (fileEditorTab));
+        }
+    }
+}
+
+void
+FileEditor::requestOpenFile (QString fileName)
+{
+  if (!isVisible ())
+    {
+      show ();
+    }
+
+  FileEditorTab *fileEditorTab = new FileEditorTab (this);
+  if (fileEditorTab)
+    {
+      addFileEditorTab (fileEditorTab);
+      fileEditorTab->loadFile (fileName);
+    }
+}
+
+void
+FileEditor::requestUndo ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->undo ();
+}
+
+void
+FileEditor::requestRedo ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->redo ();
+}
+
+void
+FileEditor::requestCopy ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->copy ();
+}
+
+void
+FileEditor::requestCut ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->cut ();
+}
+
+void
+FileEditor::requestPaste ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->paste ();
+}
+
+void
+FileEditor::requestSaveFile ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->saveFile ();
+}
+
+void
+FileEditor::requestSaveFileAs ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->saveFileAs ();
+}
+
+void
+FileEditor::requestRunFile ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->runFile ();
+}
+
+void
+FileEditor::requestToggleBookmark ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->toggleBookmark ();
+}
+
+void
+FileEditor::requestNextBookmark ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->nextBookmark ();
+}
+
+void
+FileEditor::requestPreviousBookmark ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->previousBookmark ();
+}
+
+void
+FileEditor::requestRemoveBookmark ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->removeBookmark ();
+}
+
+void
+FileEditor::requestCommentSelectedText ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->commentSelectedText ();
+}
+
+void
+FileEditor::requestUncommentSelectedText ()
+{
+  FileEditorTab *activeFileEditorTab = activeEditorTab ();
+  if (activeFileEditorTab)
+    activeFileEditorTab->uncommentSelectedText ();
+}
+
+void
+FileEditor::handleFileNameChanged (QString fileName)
+{
+  QObject *senderObject = sender ();
+  FileEditorTab *fileEditorTab = dynamic_cast<FileEditorTab*> (senderObject);
+  if (fileEditorTab)
+    {
+      for(int i = 0; i < m_tabWidget->count (); i++)
+        {
+          if (m_tabWidget->widget (i) == fileEditorTab)
+            {
+              m_tabWidget->setTabText (i, fileName);
+            }
+        }
+    }
+}
+
+void
+FileEditor::handleTabCloseRequest (int index)
+{
+  FileEditorTab *fileEditorTab = dynamic_cast <FileEditorTab*> (m_tabWidget->widget (index));
+  if (fileEditorTab)
+    if (fileEditorTab->close ())
+      {
+        m_tabWidget->removeTab (index);
+        delete fileEditorTab;
+      }
+}
+
+void
+FileEditor::handleTabCloseRequest ()
+{
+  FileEditorTab *fileEditorTab = dynamic_cast <FileEditorTab*> (sender ());
+  if (fileEditorTab)
+    if (fileEditorTab->close ())
+      {
+        m_tabWidget->removeTab (m_tabWidget->indexOf (fileEditorTab));
+        delete fileEditorTab;
+      }
+}
+
+void
+FileEditor::activeTabChanged (int index)
+{
+  Q_UNUSED (index);
+  handleEditorStateChanged ();
+}
+
+void
+FileEditor::handleEditorStateChanged ()
+{
+  FileEditorTab *fileEditorTab = activeEditorTab ();
+  if (fileEditorTab)
+    {
+      bool copyAvailable = fileEditorTab->copyAvailable ();
+      m_copyAction->setEnabled (copyAvailable);
+      m_cutAction->setEnabled (copyAvailable);
+    }
+}
+
+void
+FileEditor::construct ()
+{
+  QWidget *widget = new QWidget (this);
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  QStyle *style = QApplication::style ();
+
+  m_menuBar = new QMenuBar (widget);
+  m_toolBar = new QToolBar (widget);
+  m_tabWidget = new QTabWidget (widget);
+  m_tabWidget->setTabsClosable (true);
+
+  // Theme icons with QStyle icons as fallback
+  QAction *newAction = new QAction (
+        QIcon::fromTheme("document-new",style->standardIcon (QStyle::SP_FileIcon)),
+        tr("&New File"), m_toolBar);
+
+  QAction *openAction = new QAction (
+        QIcon::fromTheme("document-open",style->standardIcon (QStyle::SP_DirOpenIcon)),
+        tr("&Open File"), m_toolBar);
+
+  QAction *saveAction = new QAction (
+        QIcon::fromTheme("document-save",style->standardIcon (QStyle::SP_DriveHDIcon)),
+        tr("&Save File"), m_toolBar);
+
+  QAction *saveAsAction = new QAction (
+        QIcon::fromTheme("document-save-as",style->standardIcon (QStyle::SP_DriveFDIcon)),
+        tr("Save File &As"), m_toolBar);
+
+  QAction *undoAction = new QAction (
+        QIcon::fromTheme("edit-undo",style->standardIcon (QStyle::SP_ArrowLeft)),
+        tr("&Undo"), m_toolBar);
+
+  QAction *redoAction = new QAction (
+        QIcon::fromTheme("edit-redo",style->standardIcon (QStyle::SP_ArrowRight)),
+        tr("&Redo"), m_toolBar);
+
+  m_copyAction = new QAction (QIcon::fromTheme ("edit-copy"), tr ("&Copy"), m_toolBar);
+  m_cutAction = new QAction (QIcon::fromTheme ("edit-cut"), tr ("Cu&t"), m_toolBar);
+
+  QAction *pasteAction              = new QAction (QIcon::fromTheme ("edit-paste"), tr ("&Paste"),m_toolBar);
+  QAction *nextBookmarkAction       = new QAction (tr ("&Next Bookmark"),m_toolBar);
+  QAction *prevBookmarkAction       = new QAction (tr ("Pre&vious Bookmark"),m_toolBar);
+  QAction *toggleBookmarkAction     = new QAction (tr ("Toggle &Bookmark"),m_toolBar);
+  QAction *removeBookmarkAction     = new QAction (tr ("&Remove All Bookmarks"),m_toolBar);
+  QAction *commentSelectedAction    = new QAction (tr ("&Comment Selected Text"),m_toolBar);
+  QAction *uncommentSelectedAction  = new QAction (tr ("&Uncomment Selected Text"),m_toolBar);
+
+  QAction *runAction = new QAction (
+        QIcon::fromTheme ("media-play", style->standardIcon (QStyle::SP_MediaPlay)),
+        tr("&Run File"), m_toolBar);
+
+  // some actions are disabled from the beginning
+  m_copyAction->setEnabled(false);
+  m_cutAction->setEnabled(false);
+
+  // short cuts
+  newAction->setShortcut              (QKeySequence::New);
+  openAction->setShortcut             (QKeySequence::Open);
+  saveAction->setShortcut             (QKeySequence::Save);
+  saveAsAction->setShortcut           (QKeySequence::SaveAs);
+  undoAction->setShortcut             (QKeySequence::Undo);
+  redoAction->setShortcut             (QKeySequence::Redo);
+  m_copyAction->setShortcut           (QKeySequence::Copy);
+  m_cutAction->setShortcut            (QKeySequence::Cut);
+  pasteAction->setShortcut            (QKeySequence::Paste);
+  runAction->setShortcut              (Qt::Key_F5);
+  nextBookmarkAction->setShortcut     (Qt::Key_F2);
+  prevBookmarkAction->setShortcut     (Qt::SHIFT + Qt::Key_F2);
+  toggleBookmarkAction->setShortcut   (Qt::Key_F7);
+  commentSelectedAction->setShortcut  (Qt::CTRL + Qt::Key_R);
+  uncommentSelectedAction->setShortcut(Qt::CTRL + Qt::Key_T);
+
+  // toolbar
+  m_toolBar->addAction (newAction);
+  m_toolBar->addAction (openAction);
+  m_toolBar->addAction (saveAction);
+  m_toolBar->addAction (saveAsAction);
+  m_toolBar->addSeparator ();
+  m_toolBar->addAction (undoAction);
+  m_toolBar->addAction (redoAction);
+  m_toolBar->addAction (m_copyAction);
+  m_toolBar->addAction (m_cutAction);
+  m_toolBar->addAction (pasteAction);
+  m_toolBar->addSeparator ();
+  m_toolBar->addAction (runAction);
+
+  // menu bar
+  QMenu *fileMenu = new QMenu (tr ("&File"), m_menuBar);
+  fileMenu->addAction (newAction);
+  fileMenu->addAction (openAction);
+  fileMenu->addAction (saveAction);
+  fileMenu->addAction (saveAsAction);
+  fileMenu->addSeparator ();
+  m_menuBar->addMenu (fileMenu);
+
+  QMenu *editMenu = new QMenu (tr ("&Edit"), m_menuBar);
+  editMenu->addAction (undoAction);
+  editMenu->addAction (redoAction);
+  editMenu->addSeparator ();
+  editMenu->addAction (m_copyAction);
+  editMenu->addAction (m_cutAction);
+  editMenu->addAction (pasteAction);
+  editMenu->addSeparator ();
+  editMenu->addAction (commentSelectedAction);
+  editMenu->addAction (uncommentSelectedAction);
+  editMenu->addSeparator ();
+  editMenu->addAction (toggleBookmarkAction);
+  editMenu->addAction (nextBookmarkAction);
+  editMenu->addAction (prevBookmarkAction);
+  editMenu->addAction (removeBookmarkAction);
+  m_menuBar->addMenu (editMenu);
+
+  QMenu *runMenu = new QMenu (tr ("&Run"), m_menuBar);
+  runMenu->addAction (runAction);
+  m_menuBar->addMenu (runMenu);
+
+  QVBoxLayout *layout = new QVBoxLayout ();
+  layout->addWidget (m_menuBar);
+  layout->addWidget (m_toolBar);
+  layout->addWidget (m_tabWidget);
+  layout->setMargin (0);
+  widget->setLayout (layout);
+  setWidget (widget);
+
+  connect (newAction,               SIGNAL (triggered ()), this, SLOT (requestNewFile ()));
+  connect (openAction,              SIGNAL (triggered ()), this, SLOT (requestOpenFile ()));
+  connect (undoAction,              SIGNAL (triggered ()), this, SLOT (requestUndo ()));
+  connect (redoAction,              SIGNAL (triggered ()), this, SLOT (requestRedo ()));
+  connect (m_copyAction,            SIGNAL (triggered ()), this, SLOT (requestCopy ()));
+  connect (m_cutAction,             SIGNAL (triggered ()), this, SLOT (requestCut ()));
+  connect (pasteAction,             SIGNAL (triggered ()), this, SLOT (requestPaste ()));
+  connect (saveAction,              SIGNAL (triggered ()), this, SLOT (requestSaveFile ()));
+  connect (saveAsAction,            SIGNAL (triggered ()), this, SLOT (requestSaveFileAs ()));
+  connect (runAction,               SIGNAL (triggered ()), this, SLOT (requestRunFile ()));
+  connect (toggleBookmarkAction,    SIGNAL (triggered ()), this, SLOT (requestToggleBookmark ()));
+  connect (nextBookmarkAction,      SIGNAL (triggered ()), this, SLOT (requestNextBookmark ()));
+  connect (prevBookmarkAction,      SIGNAL (triggered ()), this, SLOT (requestPreviousBookmark ()));
+  connect (removeBookmarkAction,    SIGNAL (triggered ()), this, SLOT (requestRemoveBookmark ()));
+  connect (commentSelectedAction,   SIGNAL (triggered ()), this, SLOT (requestCommentSelectedText ()));
+  connect (uncommentSelectedAction, SIGNAL (triggered ()), this, SLOT (requestUncommentSelectedText ()));
+  connect (m_tabWidget, SIGNAL (tabCloseRequested (int)), this, SLOT (handleTabCloseRequest (int)));
+  connect (m_tabWidget, SIGNAL (currentChanged(int)), this, SLOT (activeTabChanged (int)));
+
+  // this has to be done only once, not for each editor
+  m_lexer = new LexerOctaveGui ();
+
+  // Editor font (default or from settings)
+  m_lexer->setDefaultFont (QFont (
+                             settings->value ("editor/fontName","Courier").toString (),
+                             settings->value ("editor/fontSize",10).toInt ()));
+
+  // TODO: Autoindent not working as it should
+  m_lexer->setAutoIndentStyle (QsciScintilla::AiMaintain ||
+                               QsciScintilla::AiOpening  ||
+                               QsciScintilla::AiClosing);
+
+  // The API info that is used for auto completion
+  // TODO: Where to store a file with API info (raw or prepared?)?
+  // TODO: Also provide infos on octave-forge functions?
+  // TODO: Also provide infos on function parameters?
+  // By now, use the keywords-list from syntax highlighting
+  m_lexerAPI = new QsciAPIs (m_lexer);
+
+  QString keyword;
+  QStringList keywordList;
+  keyword = m_lexer->keywords (1);  // get whole string with all keywords
+  keywordList = keyword.split (QRegExp ("\\s+"));  // split into single strings
+  int i;
+  for (i = 0; i < keywordList.size (); i++)
+    {
+      m_lexerAPI->add (keywordList.at (i));  // add single strings to the API
+    }
+  m_lexerAPI->prepare ();           // prepare API info ... this make take some time
+  resize (500, 400);
+  setWindowIcon (QIcon::fromTheme ("accessories-text-editor", style->standardIcon (QStyle::SP_FileIcon)));
+  setWindowTitle ("Octave Editor");
+}
+
+void
+FileEditor::addFileEditorTab (FileEditorTab *fileEditorTab)
+{
+  m_tabWidget->addTab (fileEditorTab, "");
+  connect (fileEditorTab, SIGNAL (fileNameChanged(QString)),
+           this, SLOT(handleFileNameChanged(QString)));
+  connect (fileEditorTab, SIGNAL (editorStateChanged ()),
+           this, SLOT (handleEditorStateChanged ()));
+  connect (fileEditorTab, SIGNAL (closeRequest ()),
+           this, SLOT (handleTabCloseRequest ()));
+  m_tabWidget->setCurrentWidget (fileEditorTab);
+}
+
+FileEditorTab *
+FileEditor::activeEditorTab ()
+{
+  return dynamic_cast<FileEditorTab*> (m_tabWidget->currentWidget ());
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/editor/fileeditor.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,98 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef FILEEDITORMDISUBWINDOW_H
+#define FILEEDITORMDISUBWINDOW_H
+
+#include "mainwindow.h"
+#include "fileeditorinterface.h"
+#include "fileeditortab.h"
+
+#include <QToolBar>
+#include <QAction>
+#include <QMenuBar>
+#include <QStatusBar>
+#include <QCloseEvent>
+#include <QTabWidget>
+#include <Qsci/qsciapis.h>
+// Not available in the Debian repos yet!
+// #include <Qsci/qscilexeroctave.h>
+#include "lexeroctavegui.h"
+
+const char UNNAMED_FILE[]     = "<unnamed>";
+const char SAVE_FILE_FILTER[] = "Octave Files (*.m);;All Files (*.*)";
+enum MARKER
+  {
+    MARKER_BOOKMARK,
+    MARKER_BREAKPOINT
+  };
+
+class FileEditor : public FileEditorInterface
+{
+Q_OBJECT
+
+public:
+  FileEditor (QTerminal *terminal, MainWindow *mainWindow);
+  ~FileEditor ();
+  void loadFile (QString fileName);
+  LexerOctaveGui *lexer ();
+  QTerminal *terminal ();
+  MainWindow *mainWindow ();
+
+public slots:
+  void requestNewFile ();
+  void requestOpenFile ();
+  void requestOpenFile (QString fileName);
+
+  void requestUndo ();
+  void requestRedo ();
+  void requestCopy ();
+  void requestCut ();
+  void requestPaste ();
+  void requestSaveFile ();
+  void requestSaveFileAs ();
+  void requestRunFile ();
+  void requestToggleBookmark ();
+  void requestNextBookmark ();
+  void requestPreviousBookmark ();
+  void requestRemoveBookmark ();
+  void requestCommentSelectedText ();
+  void requestUncommentSelectedText ();
+
+  void handleFileNameChanged (QString fileName);
+  void handleTabCloseRequest (int index);
+  void handleTabCloseRequest ();
+  void activeTabChanged (int index);
+  void handleEditorStateChanged ();
+
+private:
+  void construct ();
+  void addFileEditorTab(FileEditorTab *fileEditorTab);
+  FileEditorTab *activeEditorTab();
+
+  QMenuBar *m_menuBar;
+  QToolBar *m_toolBar;
+  QAction* m_copyAction;
+  QAction* m_cutAction;
+  QTabWidget *m_tabWidget;
+  int m_markerBookmark;
+
+  LexerOctaveGui *m_lexer;
+  QsciAPIs *m_lexerAPI;
+};
+
+#endif // FILEEDITORMDISUBWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/editor/fileeditorinterface.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,68 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef FILEEDITORINTERFACE_H
+#define FILEEDITORINTERFACE_H
+
+#include <QDockWidget>
+
+class QTerminal;
+class MainWindow;
+
+class FileEditorInterface : public QDockWidget
+{
+  Q_OBJECT
+
+  public:
+    FileEditorInterface (QTerminal *terminal, MainWindow *mainWindow)
+      : QDockWidget ((QWidget*)mainWindow) // QDockWidget constructor is explicit, hence the cast.
+    {
+      setObjectName ("FileEditor");
+      m_terminal = terminal;
+      m_mainWindow = mainWindow;
+
+      connect (this, SIGNAL (visibilityChanged (bool)), this, SLOT (handleVisibilityChanged (bool)));
+    }
+
+    virtual ~FileEditorInterface () { }
+  public slots:
+    virtual void requestNewFile () = 0;
+    virtual void requestOpenFile () = 0;
+    virtual void requestOpenFile (QString fileName) = 0;
+
+  signals:
+      void activeChanged (bool active);
+
+  protected:
+    QTerminal* m_terminal;
+    MainWindow* m_mainWindow;
+
+    void closeEvent (QCloseEvent *event)
+    {
+      emit activeChanged (false);
+      QDockWidget::closeEvent (event);
+    }
+
+  protected slots:
+    void handleVisibilityChanged (bool visible)
+    {
+      if (visible)
+        emit activeChanged (true);
+    }
+};
+
+#endif // FILEEDITORINTERFACE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/editor/fileeditortab.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,514 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "fileeditortab.h"
+#include "fileeditor.h"
+#include <QMessageBox>
+#include <QVBoxLayout>
+
+FileEditorTab::FileEditorTab(FileEditor *fileEditor)
+  : QWidget ((QWidget*)fileEditor)
+{
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  m_fileEditor = fileEditor;
+  m_fileName = "";
+  m_editArea = new QsciScintilla (this);
+  m_editArea->setLexer (fileEditor->lexer ());
+
+  // markers
+  m_editArea->setMarginType (1, QsciScintilla::SymbolMargin);
+  m_editArea->setMarginSensitivity (1, true);
+  m_editArea->markerDefine (QsciScintilla::RightTriangle, MARKER_BOOKMARK);
+  connect (m_editArea, SIGNAL (marginClicked (int, int, Qt::KeyboardModifiers)),
+           this, SLOT (handleMarginClicked (int, int, Qt::KeyboardModifiers)));
+
+  // line numbers
+  m_editArea->setMarginsForegroundColor(QColor(96,96,96));
+  m_editArea->setMarginsBackgroundColor(QColor(232,232,220));
+  if (settings->value ("editor/showLineNumbers",true).toBool ())
+    {
+      QFont marginFont( settings->value ("editor/fontName","Courier").toString () ,
+                        settings->value ("editor/fontSize",10).toInt () );
+      m_editArea->setMarginsFont( marginFont );
+      QFontMetrics metrics(marginFont);
+      m_editArea->setMarginType (2, QsciScintilla::TextMargin);
+      m_editArea->setMarginWidth(2, metrics.width("99999"));
+      m_editArea->setMarginLineNumbers(2, true);
+    }
+
+  // code folding
+  m_editArea->setMarginType (3, QsciScintilla::SymbolMargin);
+  m_editArea->setFolding (QsciScintilla::BoxedTreeFoldStyle , 3);
+
+  // other features
+  if (settings->value ("editor/highlightCurrentLine",true).toBool ())
+    {
+      m_editArea->setCaretLineVisible(true);
+      m_editArea->setCaretLineBackgroundColor(QColor(245,245,245));
+    }
+  m_editArea->setBraceMatching (QsciScintilla::StrictBraceMatch);
+  m_editArea->setAutoIndent (true);
+  m_editArea->setIndentationWidth (2);
+  m_editArea->setIndentationsUseTabs (false);
+  if (settings->value ("editor/codeCompletion",true).toBool ())
+    {
+      m_editArea->autoCompleteFromAll ();
+      m_editArea->setAutoCompletionSource(QsciScintilla::AcsAll);
+      m_editArea->setAutoCompletionThreshold (1);
+    }
+  m_editArea->setUtf8 (true);
+
+  QVBoxLayout *layout = new QVBoxLayout ();
+  layout->addWidget (m_editArea);
+  layout->setMargin (0);
+  setLayout (layout);
+
+  // connect modified signal
+  connect (m_editArea, SIGNAL (modificationChanged (bool)),
+           this, SLOT (newTitle (bool)));
+  connect (m_editArea, SIGNAL (copyAvailable (bool)),
+           this, SLOT (handleCopyAvailable (bool)));
+  connect (&m_fileSystemWatcher, SIGNAL (fileChanged (QString)),
+           this, SLOT (fileHasChanged (QString)));
+
+  m_fileName = "";
+  newTitle (false);
+}
+
+bool
+FileEditorTab::copyAvailable ()
+{
+  return m_copyAvailable;
+}
+
+void
+FileEditorTab::closeEvent (QCloseEvent *event)
+{
+  if (m_fileEditor->mainWindow ()->closing ())
+    {
+      // close whole application: save file or not if modified
+      checkFileModified ("Closing Octave", 0); // no cancel possible
+      event->accept ();
+    }
+  else
+    {
+      // ignore close event if file is not saved and user cancels closing this window
+      if (checkFileModified ("Close File", QMessageBox::Cancel) == QMessageBox::Cancel)
+        {
+          event->ignore ();
+        }
+      else
+        {
+          event->accept();
+        }
+    }
+}
+
+void
+FileEditorTab::setFileName (QString fileName)
+{
+  m_fileName = fileName;
+  updateTrackedFile ();
+}
+
+void
+FileEditorTab::handleMarginClicked(int margin, int line, Qt::KeyboardModifiers state)
+{
+  Q_UNUSED (state);
+  if (margin == 1)  // marker margin
+    {
+      unsigned int mask = m_editArea->markersAtLine (line);
+      if (mask && (1 << MARKER_BOOKMARK))
+        m_editArea->markerDelete(line,MARKER_BOOKMARK);
+      else
+        m_editArea->markerAdd(line,MARKER_BOOKMARK);
+    }
+}
+
+void
+FileEditorTab::commentSelectedText ()
+{
+  doCommentSelectedText (true);
+}
+
+void
+FileEditorTab::uncommentSelectedText ()
+{
+  doCommentSelectedText (false);
+}
+
+void
+FileEditorTab::doCommentSelectedText (bool comment)
+{
+  if ( m_editArea->hasSelectedText() )
+    {
+      int lineFrom, lineTo, colFrom, colTo, i;
+      m_editArea->getSelection (&lineFrom,&colFrom,&lineTo,&colTo);
+      if ( colTo == 0 )  // the beginning of last line is not selected
+        lineTo--;        // stop at line above
+      m_editArea->beginUndoAction ();
+      for ( i=lineFrom; i<=lineTo; i++ )
+        {
+          if ( comment )
+            m_editArea->insertAt("%",i,0);
+          else
+            {
+              QString line(m_editArea->text(i));
+              if ( line.startsWith("%") )
+                {
+                  m_editArea->setSelection(i,0,i,1);
+                  m_editArea->removeSelectedText();
+                }
+            }
+        }
+      m_editArea->endUndoAction ();
+    }
+}
+
+void
+FileEditorTab::newTitle(bool modified)
+{
+  QString title(m_fileName);
+  if ( !m_longTitle )
+    {
+      QFileInfo file(m_fileName);
+      title = file.fileName();
+    }
+
+  if ( modified )
+    {
+      emit fileNameChanged (title.prepend("* "));
+    }
+  else
+    emit fileNameChanged (title);
+}
+
+void
+FileEditorTab::handleCopyAvailable(bool enableCopy)
+{
+  m_copyAvailable = enableCopy;
+  emit editorStateChanged ();
+}
+
+void
+FileEditorTab::updateTrackedFile ()
+{
+  QStringList trackedFiles = m_fileSystemWatcher.files ();
+  if (!trackedFiles.isEmpty ())
+    m_fileSystemWatcher.removePaths (trackedFiles);
+
+  if (m_fileName != UNNAMED_FILE)
+    m_fileSystemWatcher.addPath (m_fileName);
+}
+
+int
+FileEditorTab::checkFileModified (QString msg, int cancelButton)
+{
+  int decision = QMessageBox::Yes;
+  if (m_editArea->isModified ())
+    {
+      // file is modified but not saved, aks user what to do
+      decision = QMessageBox::warning (this,
+                                       msg,
+                                       tr ("The file %1\n"
+                                           "has been modified. Do you want to save the changes?").
+                                       arg (m_fileName),
+                                       QMessageBox::Save, QMessageBox::Discard, cancelButton );
+      if (decision == QMessageBox::Save)
+        {
+          saveFile ();
+          if (m_editArea->isModified ())
+            {
+              // If the user attempted to save the file, but it's still
+              // modified, then probably something went wrong, so return cancel
+              // for cancel this operation or try to save files as if cancel not
+              // possible
+              if ( cancelButton )
+                return (QMessageBox::Cancel);
+              else
+                saveFileAs ();
+            }
+        }
+    }
+  return (decision);
+}
+
+void
+FileEditorTab::removeBookmark ()
+{
+  m_editArea->markerDeleteAll(MARKER_BOOKMARK);
+}
+
+void
+FileEditorTab::toggleBookmark ()
+{
+  int line,cur;
+  m_editArea->getCursorPosition(&line,&cur);
+  if ( m_editArea->markersAtLine (line) && (1 << MARKER_BOOKMARK) )
+    m_editArea->markerDelete(line,MARKER_BOOKMARK);
+  else
+    m_editArea->markerAdd(line,MARKER_BOOKMARK);
+}
+
+void
+FileEditorTab::nextBookmark ()
+{
+  int line,cur,nextline;
+  m_editArea->getCursorPosition(&line,&cur);
+  if ( m_editArea->markersAtLine(line) && (1 << MARKER_BOOKMARK) )
+    line++; // we have a bookmark here, so start search from next line
+  nextline = m_editArea->markerFindNext(line,(1 << MARKER_BOOKMARK));
+  m_editArea->setCursorPosition(nextline,0);
+}
+
+void
+FileEditorTab::previousBookmark ()
+{
+  int line,cur,prevline;
+  m_editArea->getCursorPosition(&line,&cur);
+  if ( m_editArea->markersAtLine(line) && (1 << MARKER_BOOKMARK) )
+    line--; // we have a bookmark here, so start search from prev line
+  prevline = m_editArea->markerFindPrevious(line,(1 << MARKER_BOOKMARK));
+  m_editArea->setCursorPosition(prevline,0);
+}
+
+void
+FileEditorTab::cut ()
+{
+  m_editArea->cut ();
+}
+
+void
+FileEditorTab::copy ()
+{
+  m_editArea->copy ();
+}
+
+void
+FileEditorTab::paste ()
+{
+  m_editArea->paste ();
+}
+
+void
+FileEditorTab::undo ()
+{
+  m_editArea->undo ();
+}
+
+void
+FileEditorTab::redo ()
+{
+  m_editArea->redo ();
+}
+
+void
+FileEditorTab::setModified (bool modified)
+{
+  m_editArea->setModified (modified);
+}
+
+bool
+FileEditorTab::openFile ()
+{
+  QString openFileName;
+  QFileDialog fileDialog(this);
+  fileDialog.setNameFilter(SAVE_FILE_FILTER);
+  fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
+  fileDialog.setViewMode(QFileDialog::Detail);
+  if (fileDialog.exec () == QDialog::Accepted)
+    {
+      openFileName = fileDialog.selectedFiles().at(0);
+      if (openFileName.isEmpty ())
+        return false;
+
+      loadFile(openFileName);
+      return true;
+    }
+  else
+    {
+      return false;
+    }
+}
+
+void
+FileEditorTab::loadFile (QString fileName)
+{
+  if (!m_fileEditor->isVisible ())
+    {
+      m_fileEditor->show ();
+    }
+
+  QFile file (fileName);
+  if (!file.open (QFile::ReadOnly))
+    {
+      QMessageBox::warning (this, tr ("Octave Editor"),
+                            tr ("Could not open file %1 for read:\n%2.").arg (fileName).
+                            arg (file.errorString ()));
+      return;
+    }
+
+  QTextStream in (&file);
+  QApplication::setOverrideCursor (Qt::WaitCursor);
+  m_editArea->setText (in.readAll ());
+  QApplication::restoreOverrideCursor ();
+
+  setFileName (fileName);
+  updateTrackedFile ();
+
+
+  newTitle (false); // window title (no modification)
+  m_editArea->setModified (false); // loaded file is not modified yet
+}
+
+void
+FileEditorTab::newFile ()
+{
+  if (!m_fileEditor->isVisible ())
+    {
+      m_fileEditor->show ();
+    }
+
+  setFileName (UNNAMED_FILE);
+  newTitle (false); // window title (no modification)
+  m_editArea->setText ("");
+  m_editArea->setModified (false); // new file is not modified yet
+}
+
+bool FileEditorTab::saveFile()
+{
+  return saveFile (m_fileName);
+}
+
+bool
+FileEditorTab::saveFile (QString saveFileName)
+{
+  // it is a new file with the name "<unnamed>" -> call saveFielAs
+  if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ())
+    {
+      return saveFileAs();
+    }
+
+  // open the file for writing
+  QFile file (saveFileName);
+  if (!file.open (QFile::WriteOnly))
+    {
+      QMessageBox::warning (this, tr ("Octave Editor"),
+                            tr ("Could not open file %1 for write:\n%2.").
+                            arg (saveFileName).arg (file.errorString ()));
+      return false;
+    }
+
+  // save the contents into the file
+  QTextStream out (&file);
+  QApplication::setOverrideCursor (Qt::WaitCursor);
+  out << m_editArea->text ();
+  QApplication::restoreOverrideCursor ();
+  setFileName (saveFileName);  // save file name for later use
+  newTitle (false);      // set the window title to actual file name (not modified)
+  m_editArea->setModified (false); // files is save -> not modified
+  return true;
+}
+
+bool
+FileEditorTab::saveFileAs ()
+{
+  QString saveFileName(m_fileName);
+  QFileDialog fileDialog(this);
+  if (saveFileName == UNNAMED_FILE || saveFileName.isEmpty ())
+    {
+      saveFileName = QDir::homePath ();
+      fileDialog.setDirectory (saveFileName);
+    }
+  else
+    {
+      fileDialog.selectFile (saveFileName);
+    }
+  fileDialog.setNameFilter (SAVE_FILE_FILTER);
+  fileDialog.setDefaultSuffix ("m");
+  fileDialog.setAcceptMode (QFileDialog::AcceptSave);
+  fileDialog.setViewMode (QFileDialog::Detail);
+
+  if (fileDialog.exec ())
+    {
+      saveFileName = fileDialog.selectedFiles ().at (0);
+      if (saveFileName.isEmpty ())
+        return false;
+
+      return saveFile (saveFileName);
+    }
+
+  return false;
+}
+
+void
+FileEditorTab::runFile ()
+{
+  if (m_editArea->isModified ())
+    saveFile(m_fileName);
+
+  m_fileEditor->terminal ()->sendText (QString ("run \'%1\'\n").arg (m_fileName));
+  m_fileEditor->terminal ()->setFocus ();
+}
+
+void
+FileEditorTab::fileHasChanged (QString fileName)
+{
+  Q_UNUSED (fileName);
+  if (QFile::exists (m_fileName))
+    {
+      // Prevent popping up multiple message boxes when the file has been changed multiple times.
+      static bool alreadyAsking = false;
+      if (!alreadyAsking)
+        {
+          alreadyAsking = true;
+
+          int decision =
+          QMessageBox::warning (this, tr ("Octave Editor"),
+                                tr ("It seems that \'%1\' has been modified by another application. Do you want to reload it?").
+                                arg (m_fileName), QMessageBox::Yes, QMessageBox::No);
+
+          if (decision == QMessageBox::Yes)
+            {
+              loadFile (m_fileName);
+            }
+
+          alreadyAsking = false;
+        }
+    }
+  else
+    {
+      int decision =
+      QMessageBox::warning (this, tr ("Octave Editor"),
+                            tr ("It seems that \'%1\' has been deleted or renamed. Do you want to save it now?").
+                            arg (m_fileName), QMessageBox::Save, QMessageBox::Close);
+      if (decision == QMessageBox::Save)
+        {
+          if (!saveFileAs ())
+            {
+              setFileName (UNNAMED_FILE);
+              newTitle (true); // window title (no modification)
+              setModified (true);
+              updateTrackedFile ();
+            }
+        }
+      else
+        {
+          emit closeRequest ();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/editor/fileeditortab.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,88 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef FILEEDITORTAB_H
+#define FILEEDITORTAB_H
+
+#include <Qsci/qsciscintilla.h>
+#include <QWidget>
+#include <QCloseEvent>
+#include <QFileSystemWatcher>
+
+class FileEditor;
+class FileEditorTab : public QWidget
+{
+  Q_OBJECT
+public:
+  FileEditorTab (FileEditor *fileEditor);
+  bool copyAvailable ();
+
+public slots:
+  void newTitle(bool modified);
+  void handleCopyAvailable(bool enableCopy);
+  void handleMarginClicked (int line, int margin, Qt::KeyboardModifiers state);
+  void commentSelectedText ();
+  void uncommentSelectedText ();
+  void removeBookmark ();
+  void toggleBookmark ();
+  void nextBookmark ();
+  void previousBookmark ();
+  void cut ();
+  void copy ();
+  void paste ();
+  void undo ();
+  void redo ();
+
+  void setModified (bool modified = true);
+
+  bool openFile();
+  void loadFile (QString fileName);
+  void newFile ();
+  bool saveFile ();
+  bool saveFile(QString saveFileName);
+  bool saveFileAs();
+  void runFile ();
+
+  void fileHasChanged (QString fileName);
+
+signals:
+  void fileNameChanged (QString fileName);
+  void editorStateChanged ();
+  void closeRequest ();
+
+protected:
+  void closeEvent (QCloseEvent *event);
+  void setFileName (QString fileName);
+
+private:
+  void updateTrackedFile ();
+  int checkFileModified (QString msg, int cancelButton);
+  void doCommentSelectedText (bool comment);
+
+  FileEditor *m_fileEditor;
+  QsciScintilla *m_editArea;
+
+  QString m_fileName;
+  QString m_fileNameShort;
+
+  bool m_longTitle;
+  bool m_copyAvailable;
+
+  QFileSystemWatcher m_fileSystemWatcher;
+};
+
+#endif // FILEEDITORTAB_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/editor/lexeroctavegui.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,141 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "lexeroctavegui.h"
+#include <qcolor.h>
+#include <qfont.h>
+
+// -----------------------------------------------------
+// Some basic functions
+// -----------------------------------------------------
+LexerOctaveGui::LexerOctaveGui(QObject *parent)
+    : QsciLexer(parent)  // inherit from base lexer
+{
+}
+
+LexerOctaveGui::~LexerOctaveGui()
+{
+}
+
+const char *LexerOctaveGui::language() const
+{
+  return "Octave";  // return the name of the language
+}
+
+const char *LexerOctaveGui::lexer() const
+{
+  return "octave";  // return the name of the lexer
+}
+
+// -----------------------------------------------------
+// The colors for syntax highlighting
+// -----------------------------------------------------
+QColor LexerOctaveGui::defaultColor(int style) const
+{
+    switch (style)
+      {
+        case Default:  // black
+          return QColor(0x00,0x00,0x00);
+        case Operator: // red
+          return QColor(0xef,0x00,0x00);
+        case Comment:  // gray
+          return QColor(0x7f,0x7f,0x7f);
+        case Command:  // blue-green
+          return QColor(0x00,0x7f,0x7f);
+        case Number:   // orange
+          return QColor(0x7f,0x7f,0x00);
+        case Keyword:  // blue
+          return QColor(0x00,0x00,0xbf);
+        case SingleQuotedString: // green
+          return QColor(0x00,0x7f,0x00);
+        case DoubleQuotedString: // green-yellow
+          return QColor(0x4f,0x7f,0x00);
+      }
+    return QsciLexer::defaultColor(style);
+}
+
+
+// -----------------------------------------------------
+// The font decorations for highlighting
+// -----------------------------------------------------
+QFont LexerOctaveGui::defaultFont(int style) const
+{
+    QFont f;
+
+    switch (style)
+      {
+        case Comment: // default but italic
+          f = QsciLexer::defaultFont(style);
+          f.setItalic(true);
+          break;
+        case Keyword: // default
+          f = QsciLexer::defaultFont(style);
+          break;
+        case Operator:  // default
+          f = QsciLexer::defaultFont(style);
+          break;
+        default:        // default
+          f = QsciLexer::defaultFont(style);
+          break;
+      }
+    return f;   // return the selected font
+}
+
+
+// -----------------------------------------------------
+// Style names
+// -----------------------------------------------------
+QString LexerOctaveGui::description(int style) const
+{
+    switch (style)
+      {
+        case Default:
+          return tr("Default");
+        case Comment:
+          return tr("Comment");
+        case Command:
+          return tr("Command");
+        case Number:
+          return tr("Number");
+        case Keyword:
+          return tr("Keyword");
+        case SingleQuotedString:
+          return tr("Single-quoted string");
+        case Operator:
+          return tr("Operator");
+        case Identifier:
+          return tr("Identifier");
+        case DoubleQuotedString:
+          return tr("Double-quoted string");
+      }
+    return QString();
+}
+
+
+// -----------------------------------------------------
+// The set of keywords for highlighting
+// TODO: How to define a second set?
+// -----------------------------------------------------
+const char *LexerOctaveGui::keywords(int set) const
+{
+    if (set == 1)
+      {
+        return ResourceManager::instance ()->octaveKeywords ();
+      }
+    return 0;
+}
+
--- a/gui/src/editor/lexeroctavegui.cpp	Tue May 29 23:11:26 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,141 +0,0 @@
-/* OctaveGUI - A graphical user interface for Octave
- * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "lexeroctavegui.h"
-#include <qcolor.h>
-#include <qfont.h>
-
-// -----------------------------------------------------
-// Some basic functions
-// -----------------------------------------------------
-LexerOctaveGui::LexerOctaveGui(QObject *parent)
-    : QsciLexer(parent)  // inherit from base lexer
-{
-}
-
-LexerOctaveGui::~LexerOctaveGui()
-{
-}
-
-const char *LexerOctaveGui::language() const
-{
-  return "Octave";  // return the name of the language
-}
-
-const char *LexerOctaveGui::lexer() const
-{
-  return "octave";  // return the name of the lexer
-}
-
-// -----------------------------------------------------
-// The colors for syntax highlighting
-// -----------------------------------------------------
-QColor LexerOctaveGui::defaultColor(int style) const
-{
-    switch (style)
-      {
-        case Default:  // black
-          return QColor(0x00,0x00,0x00);
-        case Operator: // red
-          return QColor(0xef,0x00,0x00);
-        case Comment:  // gray
-          return QColor(0x7f,0x7f,0x7f);
-        case Command:  // blue-green
-          return QColor(0x00,0x7f,0x7f);
-        case Number:   // orange
-          return QColor(0x7f,0x7f,0x00);
-        case Keyword:  // blue
-          return QColor(0x00,0x00,0xbf);
-        case SingleQuotedString: // green
-          return QColor(0x00,0x7f,0x00);
-        case DoubleQuotedString: // green-yellow
-          return QColor(0x4f,0x7f,0x00);
-      }
-    return QsciLexer::defaultColor(style);
-}
-
-
-// -----------------------------------------------------
-// The font decorations for highlighting
-// -----------------------------------------------------
-QFont LexerOctaveGui::defaultFont(int style) const
-{
-    QFont f;
-
-    switch (style)
-      {
-        case Comment: // default but italic
-          f = QsciLexer::defaultFont(style);
-          f.setItalic(true);
-          break;
-        case Keyword: // default
-          f = QsciLexer::defaultFont(style);
-          break;
-        case Operator:  // default
-          f = QsciLexer::defaultFont(style);
-          break;
-        default:        // default
-          f = QsciLexer::defaultFont(style);
-          break;
-      }
-    return f;   // return the selected font
-}
-
-
-// -----------------------------------------------------
-// Style names
-// -----------------------------------------------------
-QString LexerOctaveGui::description(int style) const
-{
-    switch (style)
-      {
-        case Default:
-          return tr("Default");
-        case Comment:
-          return tr("Comment");
-        case Command:
-          return tr("Command");
-        case Number:
-          return tr("Number");
-        case Keyword:
-          return tr("Keyword");
-        case SingleQuotedString:
-          return tr("Single-quoted string");
-        case Operator:
-          return tr("Operator");
-        case Identifier:
-          return tr("Identifier");
-        case DoubleQuotedString:
-          return tr("Double-quoted string");
-      }
-    return QString();
-}
-
-
-// -----------------------------------------------------
-// The set of keywords for highlighting
-// TODO: How to define a second set?
-// -----------------------------------------------------
-const char *LexerOctaveGui::keywords(int set) const
-{
-    if (set == 1)
-      {
-        return ResourceManager::instance ()->octaveKeywords ();
-      }
-    return 0;
-}
-
--- a/gui/src/editor/lexeroctavegui.h	Tue May 29 23:11:26 2012 +0200
+++ b/gui/src/editor/lexeroctavegui.h	Thu May 31 20:53:56 2012 +0200
@@ -18,7 +18,7 @@
 #ifndef LEXEROCTAVE_H
 #define LEXEROCTAVE_H
 
-#include "ResourceManager.h"
+#include "resourcemanager.h"
 #include <QObject>
 #include <Qsci/qsciglobal.h>
 #include <Qsci/qscilexer.h>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/filesdockwidget.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,199 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "resourcemanager.h"
+#include "filesdockwidget.h"
+
+#include <QApplication>
+#include <QFileInfo>
+#include <QCompleter>
+#include <QSettings>
+#include <QProcess>
+#include <QDebug>
+
+FilesDockWidget::FilesDockWidget (QWidget *parent)
+  : QDockWidget (parent)
+{
+  setObjectName ("FilesDockWidget");
+  setWindowTitle (tr ("Current Directory"));
+  setWidget (new QWidget (this));
+
+  // Create a toolbar
+  m_navigationToolBar = new QToolBar ("", widget ());
+  m_navigationToolBar->setAllowedAreas (Qt::TopToolBarArea);
+  m_navigationToolBar->setMovable (false);
+  m_navigationToolBar->setIconSize (QSize (20, 20));
+
+  // Add a button to the toolbar with the QT standard icon for up-directory
+  // TODO: Maybe change this to be an up-directory icon that is OS specific???
+  QStyle *style = QApplication::style ();
+  m_directoryIcon = style->standardIcon (QStyle::SP_FileDialogToParent);
+  m_directoryUpAction = new QAction (m_directoryIcon, "", m_navigationToolBar);
+  m_directoryUpAction->setStatusTip (tr ("Move up one directory."));
+
+  m_currentDirectory = new QLineEdit (m_navigationToolBar);
+  m_currentDirectory->setStatusTip (tr ("Enter the path or filename."));
+
+  m_navigationToolBar->addAction (m_directoryUpAction);
+  m_navigationToolBar->addWidget (m_currentDirectory);
+  connect (m_directoryUpAction, SIGNAL (triggered ()), this,
+           SLOT (onUpDirectory ()));
+
+  // TODO: Add other buttons for creating directories
+
+  // Create the QFileSystemModel starting in the home directory
+  QString
+    homePath = QDir::homePath ();
+  // TODO: This should occur after Octave has been initialized and the startup directory of Octave is established
+
+  m_fileSystemModel = new QFileSystemModel (this);
+  m_fileSystemModel->setFilter (QDir::NoDotAndDotDot | QDir::AllEntries);
+  QModelIndex
+    rootPathIndex = m_fileSystemModel->setRootPath (homePath);
+
+  // Attach the model to the QTreeView and set the root index
+  m_fileTreeView = new QTreeView (widget ());
+  m_fileTreeView->setModel (m_fileSystemModel);
+  m_fileTreeView->setRootIndex (rootPathIndex);
+  m_fileTreeView->setSortingEnabled (true);
+  m_fileTreeView->setAlternatingRowColors (true);
+  m_fileTreeView->setAnimated (true);
+  m_fileTreeView->setColumnHidden (1, true);
+  m_fileTreeView->setColumnHidden (2, true);
+  m_fileTreeView->setColumnHidden (3, true);
+  m_fileTreeView->setStatusTip (tr ("Doubleclick a file to open it."));
+
+  setCurrentDirectory (m_fileSystemModel->fileInfo (rootPathIndex).
+                       absoluteFilePath ());
+
+  connect (m_fileTreeView, SIGNAL (doubleClicked (const QModelIndex &)), this,
+           SLOT (itemDoubleClicked (const QModelIndex &)));
+
+  // Layout the widgets vertically with the toolbar on top
+  QVBoxLayout *
+    layout = new QVBoxLayout ();
+  layout->setSpacing (0);
+  layout->addWidget (m_navigationToolBar);
+  layout->addWidget (m_fileTreeView);
+  layout->setMargin (1);
+  widget ()->setLayout (layout);
+  // TODO: Add right-click contextual menus for copying, pasting, deleting files (and others)
+
+  connect (m_currentDirectory, SIGNAL (returnPressed ()), this,
+           SLOT (currentDirectoryEntered ()));
+  QCompleter *
+    completer = new QCompleter (m_fileSystemModel, this);
+  m_currentDirectory->setCompleter (completer);
+
+  connect (this, SIGNAL (visibilityChanged(bool)), this, SLOT(handleVisibilityChanged(bool)));
+}
+
+void
+FilesDockWidget::itemDoubleClicked (const QModelIndex & index)
+{
+  // Retrieve the file info associated with the model index.
+  QFileInfo fileInfo = m_fileSystemModel->fileInfo (index);
+
+  // If it is a directory, cd into it.
+  if (fileInfo.isDir ())
+    {
+      m_fileSystemModel->setRootPath (fileInfo.absolutePath ());
+      m_fileTreeView->setRootIndex (index);
+      setCurrentDirectory (m_fileSystemModel->fileInfo (index).
+                           absoluteFilePath ());
+    }
+  // Otherwise attempt to open it.
+  else
+    {
+      // Check if the user wants to use a custom file editor.
+      QSettings *settings = ResourceManager::instance ()->settings ();
+      if (settings->value ("useCustomFileEditor").toBool ())
+        {
+          QString editor = settings->value ("customFileEditor").toString ();
+          QStringList arguments;
+          arguments << fileInfo.filePath ();
+          QProcess::startDetached (editor, arguments);
+        }
+      else
+        {
+          emit openFile (fileInfo.filePath ());
+        }
+    }
+}
+
+void
+FilesDockWidget::setCurrentDirectory (QString currentDirectory)
+{
+  m_currentDirectory->setText (currentDirectory);
+}
+
+void
+FilesDockWidget::onUpDirectory (void)
+{
+  QDir dir =
+    QDir (m_fileSystemModel->filePath (m_fileTreeView->rootIndex ()));
+  dir.cdUp ();
+  m_fileSystemModel->setRootPath (dir.absolutePath ());
+  m_fileTreeView->setRootIndex (m_fileSystemModel->
+                                index (dir.absolutePath ()));
+  setCurrentDirectory (dir.absolutePath ());
+}
+
+void
+FilesDockWidget::currentDirectoryEntered ()
+{
+  QFileInfo fileInfo (m_currentDirectory->text ());
+  if (fileInfo.isDir ())
+    {
+      m_fileTreeView->setRootIndex (m_fileSystemModel->
+                                    index (fileInfo.absolutePath ()));
+      m_fileSystemModel->setRootPath (fileInfo.absolutePath ());
+      setCurrentDirectory (fileInfo.absoluteFilePath ());
+    }
+  else
+    {
+      if (QFile::exists (fileInfo.absoluteFilePath ()))
+        emit openFile (fileInfo.absoluteFilePath ());
+    }
+}
+
+void
+FilesDockWidget::noticeSettings ()
+{
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  m_fileTreeView->setColumnHidden (0, !settings->value ("showFilenames").toBool ());
+  m_fileTreeView->setColumnHidden (1, !settings->value ("showFileSize").toBool ());
+  m_fileTreeView->setColumnHidden (2, !settings->value ("showFileType").toBool ());
+  m_fileTreeView->setColumnHidden (3, !settings->value ("showLastModified").toBool ());
+  m_fileTreeView->setAlternatingRowColors (settings->value ("useAlternatingRowColors").toBool ());
+  //if (settings.value ("showHiddenFiles").toBool ())
+  // TODO: React on option for hidden files.
+}
+
+void
+FilesDockWidget::handleVisibilityChanged (bool visible)
+{
+  if (visible)
+    emit activeChanged (true);
+}
+
+void
+FilesDockWidget::closeEvent (QCloseEvent *event)
+{
+  emit activeChanged (false);
+  QDockWidget::closeEvent (event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/filesdockwidget.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,85 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef FILESDOCKWIDGET_H
+#define FILESDOCKWIDGET_H
+
+#include <QListView>
+#include <QDate>
+#include <QObject>
+#include <QWidget>
+#include <QListWidget>
+#include <QFileSystemModel>
+#include <QToolBar>
+#include <QToolButton>
+#include <QVBoxLayout>
+#include <QAction>
+#include <QTreeView>
+
+#include <QDockWidget>
+#include <QLineEdit>
+
+class FilesDockWidget : public QDockWidget
+{
+  Q_OBJECT
+public:
+  FilesDockWidget (QWidget *parent = 0);
+
+public slots:
+  /** Slot for handling a change in directory via double click. */
+  void itemDoubleClicked (const QModelIndex & index);
+
+  /** Slot for handling the up-directory button in the toolbar. */
+  void onUpDirectory ();
+
+  void setCurrentDirectory (QString currentDirectory);
+
+  void currentDirectoryEntered ();
+
+  /** Tells the widget to notice settings that are probably new. */
+  void noticeSettings ();
+  void handleVisibilityChanged (bool visible);
+
+signals:
+  void openFile (QString fileName);
+
+  /** Custom signal that tells if a user has clicke away that dock widget. */
+  void activeChanged (bool active);
+
+protected:
+  void closeEvent (QCloseEvent *event);
+
+private:
+  // TODO: Add toolbar with buttons for navigating the path, creating dirs, etc
+
+    /** Toolbar for file and directory manipulation. */
+    QToolBar * m_navigationToolBar;
+
+    /** Variables for the up-directory action. */
+  QIcon m_directoryIcon;
+  QAction *m_directoryUpAction;
+  QToolButton *upDirectoryButton;
+
+    /** The file system model. */
+  QFileSystemModel *m_fileSystemModel;
+
+    /** The file system view. */
+  QTreeView *m_fileTreeView;
+  QLineEdit *m_currentDirectory;
+};
+
+#endif // FILESDOCKWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/historydockwidget.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,72 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "historydockwidget.h"
+#include <QVBoxLayout>
+
+HistoryDockWidget::HistoryDockWidget (QWidget * parent):QDockWidget (parent)
+{
+  setObjectName ("HistoryDockWidget");
+  construct ();
+}
+
+void
+HistoryDockWidget::construct ()
+{
+  m_sortFilterProxyModel.setSourceModel(OctaveLink::instance ()->historyModel());
+  m_historyListView = new QListView (this);
+  m_historyListView->setModel (&m_sortFilterProxyModel);
+  m_historyListView->setAlternatingRowColors (true);
+  m_historyListView->setEditTriggers (QAbstractItemView::NoEditTriggers);
+  m_historyListView->setStatusTip (tr ("Doubleclick a command to transfer it to the terminal."));
+  m_filterLineEdit = new QLineEdit (this);
+  m_filterLineEdit->setStatusTip (tr ("Enter text to filter the command history."));
+  QVBoxLayout *layout = new QVBoxLayout ();
+
+  setWindowTitle (tr ("Command History"));
+  setWidget (new QWidget ());
+
+  layout->addWidget (m_historyListView);
+  layout->addWidget (m_filterLineEdit);
+  layout->setMargin (2);
+
+  widget ()->setLayout (layout);
+
+  connect (m_filterLineEdit, SIGNAL (textEdited (QString)), &m_sortFilterProxyModel, SLOT (setFilterWildcard(QString)));
+  connect (m_historyListView, SIGNAL (doubleClicked (QModelIndex)), this, SLOT (handleDoubleClick (QModelIndex)));
+  connect (this, SIGNAL (visibilityChanged(bool)), this, SLOT(handleVisibilityChanged(bool)));
+}
+
+void
+HistoryDockWidget::handleDoubleClick (QModelIndex modelIndex)
+{
+  emit commandDoubleClicked (modelIndex.data().toString());
+}
+
+void
+HistoryDockWidget::handleVisibilityChanged (bool visible)
+{
+  if (visible)
+    emit activeChanged (true);
+}
+
+void
+HistoryDockWidget::closeEvent (QCloseEvent *event)
+{
+  emit activeChanged (false);
+  QDockWidget::closeEvent (event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/historydockwidget.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,54 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef HISTORYDOCKWIDGET_H
+#define HISTORYDOCKWIDGET_H
+
+#include <QDockWidget>
+#include <QLineEdit>
+#include <QListView>
+#include <QSortFilterProxyModel>
+#include "octavelink.h"
+
+class HistoryDockWidget:public QDockWidget
+{
+Q_OBJECT
+public:
+  HistoryDockWidget (QWidget *parent = 0);
+  void updateHistory (QStringList history);
+
+public slots:
+  void handleVisibilityChanged (bool visible);
+
+signals:
+  void information (QString message);
+  void commandDoubleClicked (QString command);
+  /** Custom signal that tells if a user has clicked away that dock widget. */
+  void activeChanged (bool active);
+protected:
+  void closeEvent (QCloseEvent *event);
+private slots:
+  void handleDoubleClick (QModelIndex modelIndex);
+
+private:
+  void construct ();
+  QListView *m_historyListView;
+  QLineEdit *m_filterLineEdit;
+  QSortFilterProxyModel m_sortFilterProxyModel;
+};
+
+#endif // HISTORYDOCKWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/mainwindow.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,432 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <QMenuBar>
+#include <QMenu>
+#include <QAction>
+#include <QSettings>
+#include <QStyle>
+#include <QToolBar>
+#include <QDesktopServices>
+#include <QFileDialog>
+#include <QMessageBox>
+#include <QIcon>
+
+#include "mainwindow.h"
+#include "fileeditor.h"
+#include "settingsdialog.h"
+
+MainWindow::MainWindow (QWidget * parent):QMainWindow (parent)
+{
+  // We have to set up all our windows, before we finally launch octave.
+  construct ();
+  OctaveLink::instance ()->launchOctave();
+}
+
+MainWindow::~MainWindow ()
+{
+}
+
+void
+MainWindow::newFile ()
+{
+  m_fileEditor->requestNewFile ();
+}
+
+void
+MainWindow::openFile ()
+{
+  m_fileEditor->requestOpenFile ();
+}
+
+void
+MainWindow::reportStatusMessage (QString statusMessage)
+{
+  m_statusBar->showMessage (statusMessage, 1000);
+}
+
+void
+MainWindow::handleSaveWorkspaceRequest ()
+{
+  QString selectedFile =
+      QFileDialog::getSaveFileName (this, tr ("Save Workspace"),
+                                    ResourceManager::instance ()->homePath ());
+  m_terminal->sendText (QString ("save \'%1\'\n").arg (selectedFile));
+  m_terminal->setFocus ();
+}
+
+void
+MainWindow::handleLoadWorkspaceRequest ()
+{
+  QString selectedFile =
+      QFileDialog::getOpenFileName (this, tr ("Load Workspace"),
+                                    ResourceManager::instance ()->homePath ());
+  if (!selectedFile.isEmpty ())
+    {
+      m_terminal->sendText (QString ("load \'%1\'\n").arg (selectedFile));
+      m_terminal->setFocus ();
+    }
+}
+
+void
+MainWindow::handleClearWorkspaceRequest ()
+{
+  m_terminal->sendText ("clear\n");
+  m_terminal->setFocus ();
+}
+
+void
+MainWindow::handleCommandDoubleClicked (QString command)
+{
+  m_terminal->sendText(command);
+  m_terminal->setFocus ();
+}
+
+void
+MainWindow::openBugTrackerPage ()
+{
+  QDesktopServices::openUrl (QUrl ("http://savannah.gnu.org/bugs/?group=octave"));
+}
+
+void
+MainWindow::openAgoraPage ()
+{
+  QDesktopServices::openUrl (QUrl ("http://agora.panocha.org.mx/"));
+}
+
+void
+MainWindow::openOctaveForgePage ()
+{
+  QDesktopServices::openUrl (QUrl ("http://octave.sourceforge.net/"));
+}
+
+void
+MainWindow::processSettingsDialogRequest ()
+{
+  SettingsDialog *settingsDialog = new SettingsDialog (this);
+  settingsDialog->exec ();
+  delete settingsDialog;
+  emit settingsChanged ();
+  ResourceManager::instance ()->updateNetworkSettings ();
+  noticeSettings();
+}
+
+void
+MainWindow::noticeSettings ()
+{
+  // Set terminal font:
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  QFont font = QFont();
+  font.setFamily(settings->value("terminal/fontName").toString());
+  font.setPointSize(settings->value("terminal/fontSize").toInt ());
+  m_terminal->setTerminalFont(font);
+}
+
+void
+MainWindow::prepareForQuit ()
+{
+  writeSettings ();
+}
+
+void
+MainWindow::resetWindows ()
+{
+  // TODO: Implement.
+}
+
+void
+MainWindow::updateCurrentWorkingDirectory (QString directory)
+{
+  if (m_currentDirectoryComboBox->count () > 31)
+    {
+      m_currentDirectoryComboBox->removeItem (0);
+    }
+  m_currentDirectoryComboBox->addItem (directory);
+  int index = m_currentDirectoryComboBox->findText (directory);
+  m_currentDirectoryComboBox->setCurrentIndex (index);
+}
+
+void
+MainWindow::changeCurrentWorkingDirectory ()
+{
+  QString selectedDirectory =
+      QFileDialog::getExistingDirectory(this, tr ("Set working direcotry"));
+
+  if (!selectedDirectory.isEmpty ())
+    {
+      m_terminal->sendText (QString ("cd \'%1\'\n").arg (selectedDirectory));
+      m_terminal->setFocus ();
+    }
+}
+
+void
+MainWindow::changeCurrentWorkingDirectory (QString directory)
+{
+  m_terminal->sendText (QString ("cd \'%1\'\n").arg (directory));
+  m_terminal->setFocus ();
+}
+
+void
+MainWindow::currentWorkingDirectoryUp ()
+{
+  m_terminal->sendText ("cd ..\n");
+  m_terminal->setFocus ();
+}
+
+void
+MainWindow::showAboutOctave ()
+{
+  QString message =
+      "GNU Octave\n"
+      "Copyright (C) 2009 John W. Eaton and others.\n"
+      "This is free software; see the source code for copying conditions."
+      "There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or"
+      "FITNESS FOR A PARTICULAR PURPOSE.  For details, type `warranty'.\n"
+      "\n"
+      "Octave was configured for \"x86_64-pc-linux-gnu\".\n"
+      "\n"
+      "Additional information about Octave is available at http://www.octave.org.\n"
+      "\n"
+      "Please contribute if you find this software useful."
+      "For more information, visit http://www.octave.org/help-wanted.html\n"
+      "\n"
+      "Report bugs to <bug@octave.org> (but first, please read"
+      "http://www.octave.org/bugs.html to learn how to write a helpful report).\n"
+      "\n"
+      "For information about changes from previous versions, type `news'.\n";
+
+  QMessageBox::about (this, tr ("About Octave"), message);
+}
+
+void
+MainWindow::closeEvent (QCloseEvent * closeEvent)
+{
+  reportStatusMessage (tr ("Saving data and shutting down."));
+  m_closing = true;  // inform editor window that whole application is closed
+  OctaveLink::instance ()->terminateOctave ();
+
+  QMainWindow::closeEvent (closeEvent);
+}
+
+void
+MainWindow::readSettings ()
+{
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  restoreGeometry (settings->value ("MainWindow/geometry").toByteArray ());
+  restoreState (settings->value ("MainWindow/windowState").toByteArray ());
+  emit settingsChanged ();
+}
+
+void
+MainWindow::writeSettings ()
+{
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  settings->setValue ("MainWindow/geometry", saveGeometry ());
+  settings->setValue ("MainWindow/windowState", saveState ());
+  settings->sync ();
+}
+
+void
+MainWindow::construct ()
+{
+  QStyle *style = QApplication::style ();
+  // TODO: Check this.
+  m_closing = false;   // flag for editor files when closed
+  setWindowIcon (ResourceManager::instance ()->icon (ResourceManager::Octave));
+
+  // Setup dockable widgets and the status bar.
+  m_workspaceView = new WorkspaceView (this);
+  m_workspaceView->setStatusTip (tr ("View the variables in the active workspace."));
+  m_historyDockWidget = new HistoryDockWidget (this);
+  m_historyDockWidget->setStatusTip (tr ("Browse and search the command history."));
+  m_filesDockWidget = new FilesDockWidget (this);
+  m_filesDockWidget->setStatusTip (tr ("Browse your files."));
+  m_statusBar = new QStatusBar (this);
+
+  m_currentDirectoryComboBox = new QComboBox (this);
+  m_currentDirectoryComboBox->setFixedWidth (300);
+  m_currentDirectoryComboBox->setEditable (true);
+  m_currentDirectoryComboBox->setInsertPolicy (QComboBox::InsertAtTop);
+  m_currentDirectoryComboBox->setMaxVisibleItems (14);
+
+  m_currentDirectoryToolButton = new QToolButton (this);
+  m_currentDirectoryToolButton->setIcon (style->standardIcon (QStyle::SP_DirOpenIcon));
+
+  m_currentDirectoryUpToolButton = new QToolButton (this);
+  m_currentDirectoryUpToolButton->setIcon (style->standardIcon (QStyle::SP_FileDialogToParent));
+
+  // Octave Terminal subwindow.
+  m_terminal = new QTerminal (this);
+  m_terminal->setObjectName ("OctaveTerminal");
+  m_terminalDockWidget = new TerminalDockWidget (m_terminal, this);
+
+  QWidget *dummyWidget = new QWidget ();
+  dummyWidget->setObjectName ("CentralDummyWidget");
+  dummyWidget->resize (10, 10);
+  dummyWidget->setSizePolicy (QSizePolicy::Minimum, QSizePolicy::Minimum);
+  dummyWidget->hide ();
+  setCentralWidget (dummyWidget);
+
+  m_fileEditor = new FileEditor (m_terminal, this);
+
+  QMenu *fileMenu = menuBar ()->addMenu (tr ("&File"));
+  QAction *newFileAction
+    = fileMenu->addAction (QIcon::fromTheme ("document-new",
+      style->standardIcon (QStyle::SP_FileIcon)), tr ("New File"));
+
+  QAction *openFileAction
+      = fileMenu->addAction (QIcon::fromTheme ("document-open",
+        style->standardIcon (QStyle::SP_FileIcon)), tr ("Open File"));
+
+  QAction *settingsAction = fileMenu->addAction (tr ("Settings"));
+  fileMenu->addSeparator ();
+  QAction *exitAction = fileMenu->addAction (tr ("Exit"));
+
+  QMenu *editMenu = menuBar ()->addMenu (tr ("&Edit"));
+  QAction *cutAction
+      = editMenu->addAction (QIcon::fromTheme ("edit-cut",
+        style->standardIcon (QStyle::SP_FileIcon)), tr ("Cut"));
+  cutAction->setShortcut (QKeySequence::Cut);
+
+  QAction *copyAction
+      = editMenu->addAction (QIcon::fromTheme ("edit-copy",
+        style->standardIcon (QStyle::SP_FileIcon)), tr ("Copy"));
+  copyAction->setShortcut (QKeySequence::Copy);
+
+  QAction *pasteAction
+      = editMenu->addAction (QIcon::fromTheme ("edit-paste",
+        style->standardIcon (QStyle::SP_FileIcon)), tr ("Paste"));
+  pasteAction->setShortcut (QKeySequence::Paste);
+
+  QAction *undoAction
+      = editMenu->addAction (QIcon::fromTheme ("edit-undo",
+        style->standardIcon (QStyle::SP_FileIcon)), tr ("Undo"));
+  undoAction->setShortcut (QKeySequence::Undo);
+
+  QAction *redoAction
+      = editMenu->addAction (QIcon::fromTheme ("edit-redo",
+        style->standardIcon (QStyle::SP_FileIcon)), tr ("Redo"));
+  redoAction->setShortcut (QKeySequence::Redo);
+
+  //QMenu *debugMenu = menuBar ()->addMenu (tr ("De&bug"));
+  //QMenu *parallelMenu = menuBar ()->addMenu (tr ("&Parallel"));
+
+  QMenu *desktopMenu = menuBar ()->addMenu (tr ("&Desktop"));
+  QAction *loadWorkspaceAction = desktopMenu->addAction (tr ("Load workspace"));
+  QAction *saveWorkspaceAction = desktopMenu->addAction (tr ("Save workspace"));
+  QAction *clearWorkspaceAction = desktopMenu->addAction (tr ("Clear workspace"));
+
+  // Window menu
+  QMenu *windowMenu = menuBar ()->addMenu (tr ("&Window"));
+  QAction *showCommandWindowAction = windowMenu->addAction (tr ("Command Window"));
+  showCommandWindowAction->setCheckable (true);
+  QAction *showWorkspaceAction = windowMenu->addAction (tr ("Workspace"));
+  showWorkspaceAction->setCheckable (true);
+  QAction *showHistoryAction = windowMenu->addAction (tr ("Command History"));
+  showHistoryAction->setCheckable (true);
+  QAction *showFileBrowserAction = windowMenu->addAction (tr ("Current Directory"));
+  showFileBrowserAction->setCheckable (true);
+  QAction *showEditorAction = windowMenu->addAction (tr ("Editor"));
+  showEditorAction->setCheckable (true);
+
+  windowMenu->addSeparator ();
+  QAction *resetWindowsAction = windowMenu->addAction (tr ("Reset Windows"));
+
+  // Help menu
+  QMenu *helpMenu = menuBar ()->addMenu (tr ("&Help"));
+  QAction *reportBugAction = helpMenu->addAction (tr ("Report Bug"));
+  QAction *agoraAction = helpMenu->addAction (tr ("Visit Agora"));
+  QAction *octaveForgeAction = helpMenu->addAction (tr ("Visit Octave Forge"));
+  helpMenu->addSeparator ();
+  QAction *aboutOctaveAction = helpMenu->addAction (tr ("About Octave"));
+
+  // Toolbars
+  QToolBar *mainToolBar = addToolBar ("Main");
+  mainToolBar->addAction (newFileAction);
+  mainToolBar->addAction (openFileAction);
+  mainToolBar->addSeparator ();
+  mainToolBar->addAction (cutAction);
+  mainToolBar->addAction (copyAction);
+  mainToolBar->addAction (pasteAction);
+  mainToolBar->addAction (undoAction);
+  mainToolBar->addAction (redoAction);
+  mainToolBar->addSeparator ();
+  mainToolBar->addWidget (new QLabel (tr ("Current Directory:")));
+  mainToolBar->addWidget (m_currentDirectoryComboBox);
+  mainToolBar->addWidget (m_currentDirectoryToolButton);
+  mainToolBar->addWidget (m_currentDirectoryUpToolButton);
+
+  connect (qApp, SIGNAL(aboutToQuit ()), this, SLOT (prepareForQuit ()));
+
+  connect (settingsAction, SIGNAL (triggered ()), this, SLOT (processSettingsDialogRequest ()));
+  connect (exitAction, SIGNAL (triggered ()), this, SLOT (close ()));
+  connect (newFileAction, SIGNAL (triggered ()), this, SLOT (newFile ()));
+  connect (openFileAction, SIGNAL (triggered ()), this, SLOT (openFile ()));
+  connect (reportBugAction, SIGNAL (triggered ()), this, SLOT (openBugTrackerPage ()));
+  connect (agoraAction, SIGNAL (triggered ()), this, SLOT (openAgoraPage ()));
+  connect (octaveForgeAction, SIGNAL (triggered ()), this, SLOT (openOctaveForgePage ()));
+  connect (aboutOctaveAction, SIGNAL (triggered ()), this, SLOT (showAboutOctave ()));
+
+  connect (showCommandWindowAction, SIGNAL (toggled (bool)), m_terminalDockWidget, SLOT (setShown (bool)));
+  connect (m_terminalDockWidget, SIGNAL (activeChanged (bool)), showCommandWindowAction, SLOT (setChecked (bool)));
+  connect (showWorkspaceAction, SIGNAL (toggled (bool)), m_workspaceView, SLOT (setShown (bool)));
+  connect (m_workspaceView, SIGNAL (activeChanged (bool)), showWorkspaceAction, SLOT (setChecked (bool)));
+  connect (showHistoryAction, SIGNAL (toggled (bool)), m_historyDockWidget, SLOT (setShown (bool)));
+  connect (m_historyDockWidget, SIGNAL (activeChanged (bool)), showHistoryAction, SLOT (setChecked (bool)));
+  connect (showFileBrowserAction, SIGNAL (toggled (bool)), m_filesDockWidget, SLOT (setShown (bool)));
+  connect (m_filesDockWidget, SIGNAL (activeChanged (bool)), showFileBrowserAction, SLOT (setChecked (bool)));
+  connect (showEditorAction, SIGNAL (toggled (bool)), m_fileEditor, SLOT (setShown (bool)));
+  connect (m_fileEditor, SIGNAL (activeChanged (bool)), showEditorAction, SLOT (setChecked (bool)));
+  connect (resetWindowsAction, SIGNAL (triggered ()), this, SLOT (resetWindows ()));
+  //connect (this, SIGNAL (settingsChanged ()), m_workspaceView, SLOT (noticeSettings ()));
+  //connect (this, SIGNAL (settingsChanged ()), m_historyDockWidget, SLOT (noticeSettings ()));
+  connect (this, SIGNAL (settingsChanged ()), m_filesDockWidget, SLOT (noticeSettings ()));
+  connect (this, SIGNAL (settingsChanged ()), this, SLOT (noticeSettings ()));
+
+  connect (m_filesDockWidget, SIGNAL (openFile (QString)), m_fileEditor, SLOT (requestOpenFile (QString)));
+  connect (m_historyDockWidget, SIGNAL (information (QString)), this, SLOT (reportStatusMessage (QString)));
+  connect (m_historyDockWidget, SIGNAL (commandDoubleClicked (QString)), this, SLOT (handleCommandDoubleClicked (QString)));
+  connect (saveWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleSaveWorkspaceRequest ()));
+  connect (loadWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleLoadWorkspaceRequest ()));
+  connect (clearWorkspaceAction, SIGNAL (triggered ()), this, SLOT (handleClearWorkspaceRequest ()));
+
+  connect (m_currentDirectoryToolButton, SIGNAL (clicked ()),
+           this, SLOT (changeCurrentWorkingDirectory ()));
+  connect (m_currentDirectoryUpToolButton, SIGNAL (clicked ()),
+           this, SLOT(currentWorkingDirectoryUp()));
+  connect (copyAction, SIGNAL (triggered()), m_terminal, SLOT(copyClipboard ()));
+  connect (pasteAction, SIGNAL (triggered()), m_terminal, SLOT(pasteClipboard ()));
+
+  connect (OctaveLink::instance (), SIGNAL (workingDirectoryChanged (QString)),
+           this, SLOT (updateCurrentWorkingDirectory (QString)));
+  connect (m_currentDirectoryComboBox, SIGNAL (activated (QString)),
+           this, SLOT (changeCurrentWorkingDirectory (QString)));
+
+  setWindowTitle ("Octave");
+
+  setDockOptions(QMainWindow::AnimatedDocks | QMainWindow::AllowNestedDocks | QMainWindow::AllowTabbedDocks);
+
+  addDockWidget (Qt::LeftDockWidgetArea, m_workspaceView);
+  addDockWidget (Qt::LeftDockWidgetArea, m_historyDockWidget);
+  addDockWidget (Qt::RightDockWidgetArea, m_filesDockWidget);
+  addDockWidget (Qt::RightDockWidgetArea, m_fileEditor);
+  addDockWidget (Qt::BottomDockWidgetArea, m_terminalDockWidget);
+  setStatusBar (m_statusBar);
+
+  readSettings ();
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/mainwindow.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,130 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef MAINWINDOW_H
+#define MAINWINDOW_H
+
+// Qt includes
+#include <QtGui/QMainWindow>
+#include <QThread>
+#include <QTabWidget>
+#include <QMdiArea>
+#include <QStatusBar>
+#include <QToolBar>
+#include <QQueue>
+#include <QMdiSubWindow>
+#include <QCloseEvent>
+#include <QToolButton>
+#include <QComboBox>
+
+// Editor includes
+#include "fileeditorinterface.h"
+
+// QTerminal includes
+#include "QTerminal.h"
+
+// Own includes
+#include "resourcemanager.h"
+#include "octavelink.h"
+#include "workspaceview.h"
+#include "historydockwidget.h"
+#include "filesdockwidget.h"
+#include "terminaldockwidget.h"
+
+/**
+  * \class MainWindow
+  *
+  * Represents the main window.
+  */
+class MainWindow:public QMainWindow
+{
+Q_OBJECT public:
+  MainWindow (QWidget * parent = 0);
+  ~MainWindow ();
+
+  QTerminal *terminalView ()
+  {
+    return m_terminal;
+  }
+
+  HistoryDockWidget *historyDockWidget ()
+  {
+    return m_historyDockWidget;
+  }
+  FilesDockWidget *filesDockWidget ()
+  {
+    return m_filesDockWidget;
+  }
+  bool closing ()
+  {
+    return m_closing;
+  }
+
+signals:
+  void settingsChanged ();
+
+public slots:
+  void reportStatusMessage (QString statusMessage);
+  void handleSaveWorkspaceRequest ();
+  void handleLoadWorkspaceRequest ();
+  void handleClearWorkspaceRequest ();
+  void handleCommandDoubleClicked (QString command);
+  void newFile ();
+  void openFile ();
+  void openBugTrackerPage ();
+  void openAgoraPage ();
+  void openOctaveForgePage ();
+  void processSettingsDialogRequest ();
+  void showAboutOctave ();
+  void noticeSettings ();
+  void prepareForQuit ();
+  void resetWindows ();
+  void updateCurrentWorkingDirectory (QString directory);
+  void changeCurrentWorkingDirectory ();
+  void changeCurrentWorkingDirectory (QString directory);
+  void currentWorkingDirectoryUp ();
+
+protected:
+  void closeEvent (QCloseEvent * closeEvent);
+  void readSettings ();
+  void writeSettings ();
+
+private:
+  void construct ();
+  void establishOctaveLink ();
+
+  QTerminal *m_terminal;
+  FileEditorInterface *m_fileEditor;
+
+  // Dock widgets.
+  WorkspaceView *m_workspaceView;
+  HistoryDockWidget *m_historyDockWidget;
+  FilesDockWidget *m_filesDockWidget;
+  TerminalDockWidget *m_terminalDockWidget;
+
+  // Toolbars.
+  QStatusBar *m_statusBar;
+
+  QComboBox *m_currentDirectoryComboBox;
+  QToolButton *m_currentDirectoryToolButton;
+  QToolButton *m_currentDirectoryUpToolButton;
+
+  // Flag for closing whole application
+  bool m_closing;
+};
+
+#endif // MAINWINDOW_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/octavegui.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,90 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <QtGui/QApplication>
+#include <QTranslator>
+#include <QSettings>
+#include "welcomewizard.h"
+#include "resourcemanager.h"
+#include "mainwindow.h"
+
+int
+main (int argc, char *argv[])
+{
+  QApplication application (argc, argv);
+  while (true)
+    {
+      if (ResourceManager::instance ()->isFirstRun ())
+        {
+          WelcomeWizard welcomeWizard;
+          int returnCode = welcomeWizard.exec ();
+
+          QSettings *settings = ResourceManager::instance ()->settings ();
+          settings->setValue ("connectOnStartup", true);
+          settings->setValue ("showMessageOfTheDay", true);
+          settings->setValue ("showTopic", true);
+          settings->setValue ("autoIdentification", false);
+          settings->setValue ("nickServPassword", "");
+          settings->setValue ("useCustomFileEditor", false);
+          settings->setValue ("customFileEditor", "emacs");
+          settings->setValue ("editor/showLineNumbers", true);
+          settings->setValue ("editor/highlightCurrentLine", true);
+          settings->setValue ("editor/codeCompletion", true);
+          settings->setValue ("editor/fontName", "Monospace");
+          settings->setValue ("editor/fontSize", 10);
+          settings->setValue ("editor/shortWindowTitle", true);
+          settings->setValue ("showFilenames", true);
+          settings->setValue ("showFileSize", false);
+          settings->setValue ("showFileType", false);
+          settings->setValue ("showLastModified", false);
+          settings->setValue ("showHiddenFiles", false);
+          settings->setValue ("useAlternatingRowColors", true);
+          settings->setValue ("useProxyServer", false);
+          settings->setValue ("proxyType", "Sock5Proxy");
+          settings->setValue ("proxyHostName", "none");
+          settings->setValue ("proxyPort", 8080);
+          settings->setValue ("proxyUserName", "");
+          settings->setValue ("proxyPassword", "");
+          settings->sync ();
+          ResourceManager::instance ()->reloadSettings ();
+
+          application.quit ();
+          // We are in an infinite loop, so everything else than a return
+          // will cause the application to restart from the very beginning.
+          if (returnCode == QDialog::Rejected)
+            return 0;
+        }
+      else
+        {
+          QSettings *settings = ResourceManager::instance ()->settings ();
+          QString language = settings->value ("language").toString ();
+
+          QString translatorFile = ResourceManager::instance ()->findTranslatorFile (language);
+          QTranslator translator;
+          translator.load (translatorFile);
+          application.installTranslator (&translator);
+
+          ResourceManager::instance ()->updateNetworkSettings ();
+          ResourceManager::instance ()->loadIcons ();
+
+          MainWindow w;
+          w.show ();
+          //w.activateWindow();
+          return application.exec ();
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/resourcemanager.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,1687 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "resourcemanager.h"
+#include <QFile>
+#include <QNetworkProxy>
+
+ResourceManager ResourceManager::m_singleton;
+
+ResourceManager::ResourceManager ()
+{
+  m_settings = 0;
+  reloadSettings ();
+}
+
+ResourceManager::~ResourceManager ()
+{
+  delete m_settings;
+}
+
+QSettings *
+ResourceManager::settings ()
+{
+  return m_settings;
+}
+
+QString
+ResourceManager::homePath ()
+{
+  return m_homePath;
+}
+
+void
+ResourceManager::reloadSettings ()
+{
+  QDesktopServices desktopServices;
+  m_homePath = desktopServices.storageLocation (QDesktopServices::HomeLocation);
+  setSettings(m_homePath + "/.config/octave-gui/settings");
+}
+
+void
+ResourceManager::setSettings (QString file)
+{
+  delete m_settings;
+
+  m_firstRun = false;
+  if (!QFile::exists (file))
+    m_firstRun = true;
+
+  // If the settings file does not exist, QSettings automatically creates it.
+  // Therefore we have to check if it exists before instantiating the settings object.
+  // That way we can detect if the user ran this application before.
+  m_settings = new QSettings (file, QSettings::IniFormat);
+}
+
+QString
+ResourceManager::findTranslatorFile (QString language)
+{
+  // TODO: Quick hack to be able to test language files.
+  return QString("../languages/%1.qm").arg(language);
+}
+
+QIcon
+ResourceManager::icon (Icon icon)
+{
+  if (m_icons.contains (icon))
+    {
+      return m_icons [icon];
+    }
+  return QIcon ();
+}
+
+bool
+ResourceManager::isFirstRun ()
+{
+  return m_firstRun;
+}
+
+void
+ResourceManager::updateNetworkSettings ()
+{
+  QNetworkProxy::ProxyType proxyType = QNetworkProxy::NoProxy;
+  if (m_settings->value ("useProxyServer").toBool ())
+    {
+      QString proxyTypeString = m_settings->value ("proxyType").toString ();
+      if (proxyTypeString == "Socks5Proxy")
+        {
+          proxyType = QNetworkProxy::Socks5Proxy;
+        }
+      else if (proxyTypeString == "HttpProxy")
+        {
+          proxyType = QNetworkProxy::HttpProxy;
+        }
+    }
+
+  QNetworkProxy proxy;
+  proxy.setType (proxyType);
+  proxy.setHostName (m_settings->value ("proxyHostName").toString ());
+  proxy.setPort (m_settings->value ("proxyPort").toInt ());
+  proxy.setUser (m_settings->value ("proxyUserName").toString ());
+  proxy.setPassword (m_settings->value ("proxyPassword").toString ());
+  QNetworkProxy::setApplicationProxy (proxy);
+}
+
+void
+ResourceManager::loadIcons ()
+{
+  m_icons [ResourceManager::Octave] = QIcon ("../media/logo.png");
+  m_icons [ResourceManager::Terminal] = QIcon ("../media/terminal.png");
+  m_icons [ResourceManager::Documentation] = QIcon ("../media/help_index.png");
+  m_icons [ResourceManager::Chat] = QIcon ("../media/chat.png");
+  m_icons [ResourceManager::ChatNewMessage] = QIcon ("../media/jabber_protocol.png");
+}
+
+const char*
+ResourceManager::octaveKeywords ()
+{
+  return
+      ".nargin. "
+      "EDITOR "
+      "EXEC_PATH "
+      "F_DUPFD "
+      "F_GETFD "
+      "F_GETFL "
+      "F_SETFD "
+      "F_SETFL "
+      "I "
+      "IMAGE_PATH "
+      "Inf "
+      "J "
+      "NA "
+      "NaN "
+      "OCTAVE_HOME "
+      "OCTAVE_VERSION "
+      "O_APPEND "
+      "O_ASYNC "
+      "O_CREAT "
+      "O_EXCL "
+      "O_NONBLOCK "
+      "O_RDONLY "
+      "O_RDWR "
+      "O_SYNC "
+      "O_TRUNC "
+      "O_WRONLY "
+      "PAGER "
+      "PAGER_FLAGS "
+      "PS1 "
+      "PS2 "
+      "PS4 "
+      "P_tmpdir "
+      "SEEK_CUR "
+      "SEEK_END "
+      "SEEK_SET "
+      "SIG "
+      "S_ISBLK "
+      "S_ISCHR "
+      "S_ISDIR "
+      "S_ISFIFO "
+      "S_ISLNK "
+      "S_ISREG "
+      "S_ISSOCK "
+      "WCONTINUE "
+      "WCOREDUMP "
+      "WEXITSTATUS "
+      "WIFCONTINUED "
+      "WIFEXITED "
+      "WIFSIGNALED "
+      "WIFSTOPPED "
+      "WNOHANG "
+      "WSTOPSIG "
+      "WTERMSIG "
+      "WUNTRACED "
+      "__accumarray_max__ "
+      "__accumarray_min__ "
+      "__accumarray_sum__ "
+      "__accumdim_sum__ "
+      "__all_opts__ "
+      "__builtins__ "
+      "__calc_dimensions__ "
+      "__contourc__ "
+      "__current_scope__ "
+      "__delaunayn__ "
+      "__dispatch__ "
+      "__display_tokens__ "
+      "__dsearchn__ "
+      "__dump_symtab_info__ "
+      "__end__ "
+      "__error_text__ "
+      "__finish__ "
+      "__fltk_ginput__ "
+      "__fltk_print__ "
+      "__fltk_uigetfile__ "
+      "__ftp__ "
+      "__ftp_ascii__ "
+      "__ftp_binary__ "
+      "__ftp_close__ "
+      "__ftp_cwd__ "
+      "__ftp_delete__ "
+      "__ftp_dir__ "
+      "__ftp_mget__ "
+      "__ftp_mkdir__ "
+      "__ftp_mode__ "
+      "__ftp_mput__ "
+      "__ftp_pwd__ "
+      "__ftp_rename__ "
+      "__ftp_rmdir__ "
+      "__get__ "
+      "__glpk__ "
+      "__gnuplot_drawnow__ "
+      "__gnuplot_get_var__ "
+      "__gnuplot_ginput__ "
+      "__gnuplot_has_feature__ "
+      "__gnuplot_open_stream__ "
+      "__gnuplot_print__ "
+      "__gnuplot_version__ "
+      "__go_axes__ "
+      "__go_axes_init__ "
+      "__go_close_all__ "
+      "__go_delete__ "
+      "__go_draw_axes__ "
+      "__go_draw_figure__ "
+      "__go_execute_callback__ "
+      "__go_figure__ "
+      "__go_figure_handles__ "
+      "__go_handles__ "
+      "__go_hggroup__ "
+      "__go_image__ "
+      "__go_line__ "
+      "__go_patch__ "
+      "__go_surface__ "
+      "__go_text__ "
+      "__go_uimenu__ "
+      "__gud_mode__ "
+      "__image_pixel_size__ "
+      "__init_fltk__ "
+      "__isa_parent__ "
+      "__keywords__ "
+      "__lexer_debug_flag__ "
+      "__lin_interpn__ "
+      "__list_functions__ "
+      "__magick_finfo__ "
+      "__magick_format_list__ "
+      "__magick_read__ "
+      "__magick_write__ "
+      "__makeinfo__ "
+      "__marching_cube__ "
+      "__next_line_color__ "
+      "__next_line_style__ "
+      "__operators__ "
+      "__parent_classes__ "
+      "__parser_debug_flag__ "
+      "__pathorig__ "
+      "__pchip_deriv__ "
+      "__plt_get_axis_arg__ "
+      "__print_parse_opts__ "
+      "__qp__ "
+      "__request_drawnow__ "
+      "__sort_rows_idx__ "
+      "__strip_html_tags__ "
+      "__token_count__ "
+      "__varval__ "
+      "__version_info__ "
+      "__voronoi__ "
+      "__which__ "
+      "abs "
+      "accumarray "
+      "accumdim "
+      "acos "
+      "acosd "
+      "acosh "
+      "acot "
+      "acotd "
+      "acoth "
+      "acsc "
+      "acscd "
+      "acsch "
+      "add_input_event_hook "
+      "addlistener "
+      "addpath "
+      "addproperty "
+      "addtodate "
+      "airy "
+      "all "
+      "allchild "
+      "allow_noninteger_range_as_index "
+      "amd "
+      "ancestor "
+      "and "
+      "angle "
+      "anova "
+      "ans "
+      "any "
+      "arch_fit "
+      "arch_rnd "
+      "arch_test "
+      "area "
+      "arg "
+      "argnames "
+      "argv "
+      "arma_rnd "
+      "arrayfun "
+      "asctime "
+      "asec "
+      "asecd "
+      "asech "
+      "asin "
+      "asind "
+      "asinh "
+      "assert "
+      "assignin "
+      "atan "
+      "atan2 "
+      "atand "
+      "atanh "
+      "atexit "
+      "autocor "
+      "autocov "
+      "autoload "
+      "autoreg_matrix "
+      "autumn "
+      "available_graphics_toolkits "
+      "axes "
+      "axis "
+      "balance "
+      "bar "
+      "barh "
+      "bartlett "
+      "bartlett_test "
+      "base2dec "
+      "beep "
+      "beep_on_error "
+      "bessel "
+      "besselh "
+      "besseli "
+      "besselj "
+      "besselk "
+      "bessely "
+      "beta "
+      "betacdf "
+      "betai "
+      "betainc "
+      "betainv "
+      "betaln "
+      "betapdf "
+      "betarnd "
+      "bicgstab "
+      "bicubic "
+      "bin2dec "
+      "bincoeff "
+      "binocdf "
+      "binoinv "
+      "binopdf "
+      "binornd "
+      "bitand "
+      "bitcmp "
+      "bitget "
+      "bitmax "
+      "bitor "
+      "bitpack "
+      "bitset "
+      "bitshift "
+      "bitunpack "
+      "bitxor "
+      "blackman "
+      "blanks "
+      "blkdiag "
+      "blkmm "
+      "bone "
+      "box "
+      "break "
+      "brighten "
+      "bsxfun "
+      "bug_report "
+      "builtin "
+      "bunzip2 "
+      "bzip2 "
+      "calendar "
+      "canonicalize_file_name "
+      "cart2pol "
+      "cart2sph "
+      "case "
+      "cast "
+      "cat "
+      "catch "
+      "cauchy_cdf "
+      "cauchy_inv "
+      "cauchy_pdf "
+      "cauchy_rnd "
+      "caxis "
+      "cbrt "
+      "ccolamd "
+      "cd "
+      "ceil "
+      "cell "
+      "cell2mat "
+      "cell2struct "
+      "celldisp "
+      "cellfun "
+      "cellidx "
+      "cellindexmat "
+      "cellslices "
+      "cellstr "
+      "center "
+      "cgs "
+      "char "
+      "chdir "
+      "chi2cdf "
+      "chi2inv "
+      "chi2pdf "
+      "chi2rnd "
+      "chisquare_test_homogeneity "
+      "chisquare_test_independence "
+      "chol "
+      "chol2inv "
+      "choldelete "
+      "cholinsert "
+      "cholinv "
+      "cholshift "
+      "cholupdate "
+      "chop "
+      "circshift "
+      "cla "
+      "clabel "
+      "class "
+      "clc "
+      "clear "
+      "clf "
+      "clg "
+      "clock "
+      "cloglog "
+      "close "
+      "closereq "
+      "colamd "
+      "colloc "
+      "colon "
+      "colorbar "
+      "colormap "
+      "colperm "
+      "colstyle "
+      "columns "
+      "comet "
+      "comet3 "
+      "comma "
+      "command_line_path "
+      "common_size "
+      "commutation_matrix "
+      "compan "
+      "compare_versions "
+      "compass "
+      "complement "
+      "completion_append_char "
+      "completion_matches "
+      "complex "
+      "computer "
+      "cond "
+      "condest "
+      "confirm_recursive_rmdir "
+      "conj "
+      "continue "
+      "contour "
+      "contour3 "
+      "contourc "
+      "contourf "
+      "contrast "
+      "conv "
+      "conv2 "
+      "convhull "
+      "convhulln "
+      "convn "
+      "cool "
+      "copper "
+      "copyfile "
+      "cor "
+      "cor_test "
+      "corrcoef "
+      "cos "
+      "cosd "
+      "cosh "
+      "cot "
+      "cotd "
+      "coth "
+      "cov "
+      "cplxpair "
+      "cputime "
+      "cquad "
+      "crash_dumps_octave_core "
+      "create_set "
+      "cross "
+      "csc "
+      "cscd "
+      "csch "
+      "cstrcat "
+      "csvread "
+      "csvwrite "
+      "csymamd "
+      "ctime "
+      "ctranspose "
+      "cummax "
+      "cummin "
+      "cumprod "
+      "cumsum "
+      "cumtrapz "
+      "curl "
+      "cut "
+      "cylinder "
+      "daspect "
+      "daspk "
+      "daspk_options "
+      "dasrt "
+      "dasrt_options "
+      "dassl "
+      "dassl_options "
+      "date "
+      "datenum "
+      "datestr "
+      "datetick "
+      "datevec "
+      "dbclear "
+      "dbcont "
+      "dbdown "
+      "dblquad "
+      "dbnext "
+      "dbquit "
+      "dbstack "
+      "dbstatus "
+      "dbstep "
+      "dbstop "
+      "dbtype "
+      "dbup "
+      "dbwhere "
+      "deal "
+      "deblank "
+      "debug "
+      "debug_on_error "
+      "debug_on_interrupt "
+      "debug_on_warning "
+      "dec2base "
+      "dec2bin "
+      "dec2hex "
+      "deconv "
+      "default_save_options "
+      "del2 "
+      "delaunay "
+      "delaunay3 "
+      "delaunayn "
+      "delete "
+      "dellistener "
+      "demo "
+      "det "
+      "detrend "
+      "diag "
+      "diary "
+      "diff "
+      "diffpara "
+      "diffuse "
+      "dir "
+      "discrete_cdf "
+      "discrete_inv "
+      "discrete_pdf "
+      "discrete_rnd "
+      "disp "
+      "dispatch "
+      "display "
+      "divergence "
+      "dlmread "
+      "dlmwrite "
+      "dmperm "
+      "dmult "
+      "do "
+      "do_braindead_shortcircuit_evaluation "
+      "do_string_escapes "
+      "doc "
+      "doc_cache_file "
+      "dos "
+      "dot "
+      "double "
+      "drawnow "
+      "dsearch "
+      "dsearchn "
+      "dump_prefs "
+      "dup2 "
+      "duplication_matrix "
+      "durbinlevinson "
+      "e "
+      "echo "
+      "echo_executing_commands "
+      "edit "
+      "edit_history "
+      "eig "
+      "eigs "
+      "ellipsoid "
+      "else "
+      "elseif "
+      "empirical_cdf "
+      "empirical_inv "
+      "empirical_pdf "
+      "empirical_rnd "
+      "end "
+      "end_try_catch "
+      "end_unwind_protect "
+      "endfor "
+      "endfunction "
+      "endgrent "
+      "endif "
+      "endpwent "
+      "endswitch "
+      "endwhile "
+      "eomday "
+      "eps "
+      "eq "
+      "erf "
+      "erfc "
+      "erfcx "
+      "erfinv "
+      "errno "
+      "errno_list "
+      "error "
+      "error_text "
+      "errorbar "
+      "etime "
+      "etree "
+      "etreeplot "
+      "eval "
+      "evalin "
+      "example "
+      "exec "
+      "exist "
+      "exit "
+      "exp "
+      "expcdf "
+      "expinv "
+      "expm "
+      "expm1 "
+      "exppdf "
+      "exprnd "
+      "eye "
+      "ezcontour "
+      "ezcontourf "
+      "ezmesh "
+      "ezmeshc "
+      "ezplot "
+      "ezplot3 "
+      "ezpolar "
+      "ezsurf "
+      "ezsurfc "
+      "f_test_regression "
+      "factor "
+      "factorial "
+      "fail "
+      "false "
+      "fcdf "
+      "fclear "
+      "fclose "
+      "fcntl "
+      "fdisp "
+      "feather "
+      "feof "
+      "ferror "
+      "feval "
+      "fflush "
+      "fft "
+      "fft2 "
+      "fftconv "
+      "fftfilt "
+      "fftn "
+      "fftshift "
+      "fftw "
+      "fgetl "
+      "fgets "
+      "fieldnames "
+      "figure "
+      "file_in_loadpath "
+      "file_in_path "
+      "fileattrib "
+      "filemarker "
+      "fileparts "
+      "fileread "
+      "filesep "
+      "fill "
+      "filter "
+      "filter2 "
+      "find "
+      "find_dir_in_path "
+      "findall "
+      "findobj "
+      "findstr "
+      "finite "
+      "finv "
+      "fix "
+      "fixed_point_format "
+      "flag "
+      "flipdim "
+      "fliplr "
+      "flipud "
+      "floor "
+      "fminbnd "
+      "fminunc "
+      "fmod "
+      "fnmatch "
+      "fopen "
+      "for "
+      "fork "
+      "format "
+      "formula "
+      "fpdf "
+      "fplot "
+      "fprintf "
+      "fputs "
+      "fractdiff "
+      "fread "
+      "freport "
+      "freqz "
+      "freqz_plot "
+      "frewind "
+      "frnd "
+      "fscanf "
+      "fseek "
+      "fskipl "
+      "fsolve "
+      "fstat "
+      "ftell "
+      "full "
+      "fullfile "
+      "func2str "
+      "function "
+      "functions "
+      "fwrite "
+      "fzero "
+      "gamcdf "
+      "gaminv "
+      "gamma "
+      "gammai "
+      "gammainc "
+      "gammaln "
+      "gampdf "
+      "gamrnd "
+      "gca "
+      "gcbf "
+      "gcbo "
+      "gcd "
+      "gcf "
+      "ge "
+      "gen_doc_cache "
+      "genpath "
+      "genvarname "
+      "geocdf "
+      "geoinv "
+      "geopdf "
+      "geornd "
+      "get "
+      "get_first_help_sentence "
+      "get_help_text "
+      "get_help_text_from_file "
+      "getappdata "
+      "getegid "
+      "getenv "
+      "geteuid "
+      "getfield "
+      "getgid "
+      "getgrent "
+      "getgrgid "
+      "getgrnam "
+      "gethostname "
+      "getpgrp "
+      "getpid "
+      "getppid "
+      "getpwent "
+      "getpwnam "
+      "getpwuid "
+      "getrusage "
+      "getuid "
+      "ginput "
+      "givens "
+      "glob "
+      "global "
+      "glpk "
+      "glpkmex "
+      "gls "
+      "gmap40 "
+      "gmres "
+      "gmtime "
+      "gnuplot_binary "
+      "gplot "
+      "gradient "
+      "graphics_toolkit "
+      "gray "
+      "gray2ind "
+      "grid "
+      "griddata "
+      "griddata3 "
+      "griddatan "
+      "gt "
+      "gtext "
+      "gunzip "
+      "gzip "
+      "hadamard "
+      "hamming "
+      "hankel "
+      "hanning "
+      "help "
+      "hess "
+      "hex2dec "
+      "hex2num "
+      "hggroup "
+      "hidden "
+      "hilb "
+      "hist "
+      "histc "
+      "history "
+      "history_control "
+      "history_file "
+      "history_size "
+      "history_timestamp_format_string "
+      "hold "
+      "home "
+      "horzcat "
+      "hot "
+      "hotelling_test "
+      "hotelling_test_2 "
+      "housh "
+      "hsv "
+      "hsv2rgb "
+      "hurst "
+      "hygecdf "
+      "hygeinv "
+      "hygepdf "
+      "hygernd "
+      "hypot "
+      "i "
+      "idivide "
+      "if "
+      "ifelse "
+      "ifft "
+      "ifft2 "
+      "ifftn "
+      "ifftshift "
+      "ignore_function_time_stamp "
+      "imag "
+      "image "
+      "imagesc "
+      "imfinfo "
+      "imread "
+      "imshow "
+      "imwrite "
+      "ind2gray "
+      "ind2rgb "
+      "ind2sub "
+      "index "
+      "inf "
+      "inferiorto "
+      "info "
+      "info_file "
+      "info_program "
+      "inline "
+      "inpolygon "
+      "input "
+      "inputname "
+      "int16 "
+      "int2str "
+      "int32 "
+      "int64 "
+      "int8 "
+      "interp1 "
+      "interp1q "
+      "interp2 "
+      "interp3 "
+      "interpft "
+      "interpn "
+      "intersect "
+      "intmax "
+      "intmin "
+      "intwarning "
+      "inv "
+      "inverse "
+      "invhilb "
+      "ipermute "
+      "iqr "
+      "is_absolute_filename "
+      "is_duplicate_entry "
+      "is_global "
+      "is_leap_year "
+      "is_rooted_relative_filename "
+      "is_valid_file_id "
+      "isa "
+      "isalnum "
+      "isalpha "
+      "isappdata "
+      "isargout "
+      "isascii "
+      "isbool "
+      "iscell "
+      "iscellstr "
+      "ischar "
+      "iscntrl "
+      "iscolumn "
+      "iscommand "
+      "iscomplex "
+      "isdebugmode "
+      "isdefinite "
+      "isdeployed "
+      "isdigit "
+      "isdir "
+      "isempty "
+      "isequal "
+      "isequalwithequalnans "
+      "isfield "
+      "isfigure "
+      "isfinite "
+      "isfloat "
+      "isglobal "
+      "isgraph "
+      "ishandle "
+      "ishermitian "
+      "ishghandle "
+      "ishold "
+      "isieee "
+      "isindex "
+      "isinf "
+      "isinteger "
+      "iskeyword "
+      "isletter "
+      "islogical "
+      "islower "
+      "ismac "
+      "ismatrix "
+      "ismember "
+      "ismethod "
+      "isna "
+      "isnan "
+      "isnull "
+      "isnumeric "
+      "isobject "
+      "isocolors "
+      "isonormals "
+      "isosurface "
+      "ispc "
+      "isprime "
+      "isprint "
+      "isprop "
+      "ispunct "
+      "israwcommand "
+      "isreal "
+      "isrow "
+      "isscalar "
+      "issorted "
+      "isspace "
+      "issparse "
+      "issquare "
+      "isstr "
+      "isstrprop "
+      "isstruct "
+      "issymmetric "
+      "isunix "
+      "isupper "
+      "isvarname "
+      "isvector "
+      "isxdigit "
+      "j "
+      "jet "
+      "kbhit "
+      "kendall "
+      "keyboard "
+      "kill "
+      "kolmogorov_smirnov_cdf "
+      "kolmogorov_smirnov_test "
+      "kolmogorov_smirnov_test_2 "
+      "kron "
+      "kruskal_wallis_test "
+      "krylov "
+      "krylovb "
+      "kurtosis "
+      "laplace_cdf "
+      "laplace_inv "
+      "laplace_pdf "
+      "laplace_rnd "
+      "lasterr "
+      "lasterror "
+      "lastwarn "
+      "lchol "
+      "lcm "
+      "ldivide "
+      "le "
+      "legend "
+      "legendre "
+      "length "
+      "lgamma "
+      "license "
+      "lin2mu "
+      "line "
+      "link "
+      "linkprop "
+      "linspace "
+      "list "
+      "list_in_columns "
+      "list_primes "
+      "load "
+      "loadaudio "
+      "loadimage "
+      "loadobj "
+      "localtime "
+      "log "
+      "log10 "
+      "log1p "
+      "log2 "
+      "logical "
+      "logistic_cdf "
+      "logistic_inv "
+      "logistic_pdf "
+      "logistic_regression "
+      "logistic_rnd "
+      "logit "
+      "loglog "
+      "loglogerr "
+      "logm "
+      "logncdf "
+      "logninv "
+      "lognpdf "
+      "lognrnd "
+      "logspace "
+      "lookfor "
+      "lookup "
+      "lower "
+      "ls "
+      "ls_command "
+      "lsode "
+      "lsode_options "
+      "lsqnonneg "
+      "lstat "
+      "lt "
+      "lu "
+      "luinc "
+      "luupdate "
+      "magic "
+      "mahalanobis "
+      "make_absolute_filename "
+      "makeinfo_program "
+      "manova "
+      "mark_as_command "
+      "mark_as_rawcommand "
+      "mat2cell "
+      "mat2str "
+      "matlabroot "
+      "matrix_type "
+      "max "
+      "max_recursion_depth "
+      "mcnemar_test "
+      "md5sum "
+      "mean "
+      "meansq "
+      "median "
+      "menu "
+      "merge "
+      "mesh "
+      "meshc "
+      "meshgrid "
+      "meshz "
+      "methods "
+      "mex "
+      "mexext "
+      "mfilename "
+      "mgorth "
+      "min "
+      "minus "
+      "mislocked "
+      "missing_function_hook "
+      "mist "
+      "mkdir "
+      "mkfifo "
+      "mkoctfile "
+      "mkpp "
+      "mkstemp "
+      "mktime "
+      "mldivide "
+      "mlock "
+      "mod "
+      "mode "
+      "moment "
+      "more "
+      "most "
+      "movefile "
+      "mpoles "
+      "mpower "
+      "mrdivide "
+      "mtimes "
+      "mu2lin "
+      "munlock "
+      "namelengthmax "
+      "nan "
+      "nargchk "
+      "nargin "
+      "nargout "
+      "nargoutchk "
+      "native_float_format "
+      "nbincdf "
+      "nbininv "
+      "nbinpdf "
+      "nbinrnd "
+      "nchoosek "
+      "ndgrid "
+      "ndims "
+      "ne "
+      "newplot "
+      "news "
+      "nextpow2 "
+      "nfields "
+      "nnz "
+      "nonzeros "
+      "norm "
+      "normcdf "
+      "normest "
+      "norminv "
+      "normpdf "
+      "normrnd "
+      "not "
+      "now "
+      "nproc "
+      "nth_element "
+      "nthroot "
+      "ntsc2rgb "
+      "null "
+      "num2cell "
+      "num2hex "
+      "num2str "
+      "numel "
+      "nzmax "
+      "ocean "
+      "octave_config_info "
+      "octave_core_file_limit "
+      "octave_core_file_name "
+      "octave_core_file_options "
+      "octave_tmp_file_name "
+      "ols "
+      "onCleanup "
+      "onenormest "
+      "ones "
+      "optimget "
+      "optimize_subsasgn_calls "
+      "optimset "
+      "or "
+      "orderfields "
+      "orient "
+      "orth "
+      "otherwise "
+      "output_max_field_width "
+      "output_precision "
+      "pack "
+      "page_output_immediately "
+      "page_screen_output "
+      "paren "
+      "pareto "
+      "parseparams "
+      "pascal "
+      "patch "
+      "path "
+      "pathdef "
+      "pathsep "
+      "pause "
+      "pbaspect "
+      "pcg "
+      "pchip "
+      "pclose "
+      "pcolor "
+      "pcr "
+      "peaks "
+      "periodogram "
+      "perl "
+      "perms "
+      "permute "
+      "perror "
+      "persistent "
+      "pi "
+      "pie "
+      "pie3 "
+      "pink "
+      "pinv "
+      "pipe "
+      "pkg "
+      "planerot "
+      "playaudio "
+      "plot "
+      "plot3 "
+      "plotmatrix "
+      "plotyy "
+      "plus "
+      "poisscdf "
+      "poissinv "
+      "poisspdf "
+      "poissrnd "
+      "pol2cart "
+      "polar "
+      "poly "
+      "polyaffine "
+      "polyarea "
+      "polyder "
+      "polyderiv "
+      "polyfit "
+      "polygcd "
+      "polyint "
+      "polyout "
+      "polyreduce "
+      "polyval "
+      "polyvalm "
+      "popen "
+      "popen2 "
+      "postpad "
+      "pow2 "
+      "power "
+      "powerset "
+      "ppder "
+      "ppint "
+      "ppjumps "
+      "ppplot "
+      "ppval "
+      "pqpnonneg "
+      "prctile "
+      "prepad "
+      "primes "
+      "print "
+      "print_empty_dimensions "
+      "print_struct_array_contents "
+      "print_usage "
+      "printf "
+      "prism "
+      "probit "
+      "prod "
+      "program_invocation_name "
+      "program_name "
+      "prop_test_2 "
+      "putenv "
+      "puts "
+      "pwd "
+      "qp "
+      "qqplot "
+      "qr "
+      "qrdelete "
+      "qrinsert "
+      "qrshift "
+      "qrupdate "
+      "quad "
+      "quad_options "
+      "quadcc "
+      "quadgk "
+      "quadl "
+      "quadv "
+      "quantile "
+      "quit "
+      "quiver "
+      "quiver3 "
+      "qz "
+      "qzhess "
+      "rainbow "
+      "rand "
+      "rande "
+      "randg "
+      "randi "
+      "randn "
+      "randp "
+      "randperm "
+      "range "
+      "rank "
+      "ranks "
+      "rat "
+      "rats "
+      "rcond "
+      "rdivide "
+      "re_read_readline_init_file "
+      "read_readline_init_file "
+      "readdir "
+      "readlink "
+      "real "
+      "reallog "
+      "realmax "
+      "realmin "
+      "realpow "
+      "realsqrt "
+      "record "
+      "rectangle "
+      "rectint "
+      "refresh "
+      "refreshdata "
+      "regexp "
+      "regexpi "
+      "regexprep "
+      "regexptranslate "
+      "rehash "
+      "rem "
+      "remove_input_event_hook "
+      "rename "
+      "repelems "
+      "replot "
+      "repmat "
+      "reset "
+      "reshape "
+      "residue "
+      "resize "
+      "restoredefaultpath "
+      "rethrow "
+      "return "
+      "rgb2hsv "
+      "rgb2ind "
+      "rgb2ntsc "
+      "ribbon "
+      "rindex "
+      "rmappdata "
+      "rmdir "
+      "rmfield "
+      "rmpath "
+      "roots "
+      "rose "
+      "rosser "
+      "rot90 "
+      "rotdim "
+      "round "
+      "roundb "
+      "rows "
+      "rref "
+      "rsf2csf "
+      "run "
+      "run_count "
+      "run_history "
+      "run_test "
+      "rundemos "
+      "runlength "
+      "runtests "
+      "save "
+      "save_header_format_string "
+      "save_precision "
+      "saveas "
+      "saveaudio "
+      "saveimage "
+      "saveobj "
+      "savepath "
+      "saving_history "
+      "scanf "
+      "scatter "
+      "scatter3 "
+      "schur "
+      "sec "
+      "secd "
+      "sech "
+      "semicolon "
+      "semilogx "
+      "semilogxerr "
+      "semilogy "
+      "semilogyerr "
+      "set "
+      "setappdata "
+      "setaudio "
+      "setdiff "
+      "setenv "
+      "setfield "
+      "setgrent "
+      "setpwent "
+      "setstr "
+      "setxor "
+      "shading "
+      "shell_cmd "
+      "shg "
+      "shift "
+      "shiftdim "
+      "sighup_dumps_octave_core "
+      "sign "
+      "sign_test "
+      "sigterm_dumps_octave_core "
+      "silent_functions "
+      "sin "
+      "sinc "
+      "sind "
+      "sinetone "
+      "sinewave "
+      "single "
+      "sinh "
+      "size "
+      "size_equal "
+      "sizemax "
+      "sizeof "
+      "skewness "
+      "sleep "
+      "slice "
+      "sombrero "
+      "sort "
+      "sortrows "
+      "source "
+      "spalloc "
+      "sparse "
+      "sparse_auto_mutate "
+      "spatan2 "
+      "spaugment "
+      "spchol "
+      "spchol2inv "
+      "spcholinv "
+      "spconvert "
+      "spcumprod "
+      "spcumsum "
+      "spdet "
+      "spdiag "
+      "spdiags "
+      "spearman "
+      "spectral_adf "
+      "spectral_xdf "
+      "specular "
+      "speed "
+      "spencer "
+      "speye "
+      "spfind "
+      "spfun "
+      "sph2cart "
+      "sphcat "
+      "sphere "
+      "spinmap "
+      "spinv "
+      "spkron "
+      "splchol "
+      "spline "
+      "split "
+      "split_long_rows "
+      "splu "
+      "spmax "
+      "spmin "
+      "spones "
+      "spparms "
+      "spprod "
+      "spqr "
+      "sprand "
+      "sprandn "
+      "sprandsym "
+      "sprank "
+      "spring "
+      "sprintf "
+      "spstats "
+      "spsum "
+      "spsumsq "
+      "spvcat "
+      "spy "
+      "sqp "
+      "sqrt "
+      "sqrtm "
+      "squeeze "
+      "sscanf "
+      "stairs "
+      "stat "
+      "static "
+      "statistics "
+      "std "
+      "stderr "
+      "stdin "
+      "stdnormal_cdf "
+      "stdnormal_inv "
+      "stdnormal_pdf "
+      "stdnormal_rnd "
+      "stdout "
+      "stem "
+      "stem3 "
+      "stft "
+      "str2double "
+      "str2func "
+      "str2mat "
+      "str2num "
+      "strcat "
+      "strchr "
+      "strcmp "
+      "strcmpi "
+      "strerror "
+      "strfind "
+      "strftime "
+      "string_fill_char "
+      "strjust "
+      "strmatch "
+      "strncmp "
+      "strncmpi "
+      "strptime "
+      "strread "
+      "strrep "
+      "strsplit "
+      "strtok "
+      "strtrim "
+      "strtrunc "
+      "struct "
+      "struct2cell "
+      "struct_levels_to_print "
+      "structfun "
+      "strvcat "
+      "studentize "
+      "sub2ind "
+      "subplot "
+      "subsasgn "
+      "subsindex "
+      "subspace "
+      "subsref "
+      "substr "
+      "substruct "
+      "sum "
+      "summer "
+      "sumsq "
+      "superiorto "
+      "suppress_verbose_help_message "
+      "surf "
+      "surface "
+      "surfc "
+      "surfl "
+      "surfnorm "
+      "svd "
+      "svd_driver "
+      "svds "
+      "swapbytes "
+      "switch "
+      "syl "
+      "sylvester_matrix "
+      "symamd "
+      "symbfact "
+      "symlink "
+      "symrcm "
+      "symvar "
+      "synthesis "
+      "system "
+      "t_test "
+      "t_test_2 "
+      "t_test_regression "
+      "table "
+      "tan "
+      "tand "
+      "tanh "
+      "tar "
+      "tcdf "
+      "tempdir "
+      "tempname "
+      "terminal_size "
+      "test "
+      "test2 "
+      "test3 "
+      "text "
+      "textread "
+      "textscan "
+      "tic "
+      "tilde_expand "
+      "time "
+      "times "
+      "tinv "
+      "title "
+      "tmpfile "
+      "tmpnam "
+      "toascii "
+      "toc "
+      "toeplitz "
+      "tolower "
+      "toupper "
+      "tpdf "
+      "trace "
+      "transpose "
+      "trapz "
+      "treelayout "
+      "treeplot "
+      "tril "
+      "trimesh "
+      "triplequad "
+      "triplot "
+      "trisurf "
+      "triu "
+      "trnd "
+      "true "
+      "try "
+      "tsearch "
+      "tsearchn "
+      "type "
+      "typecast "
+      "typeinfo "
+      "u_test "
+      "uigetdir "
+      "uigetfile "
+      "uimenu "
+      "uint16 "
+      "uint32 "
+      "uint64 "
+      "uint8 "
+      "uiputfile "
+      "umask "
+      "uminus "
+      "uname "
+      "undo_string_escapes "
+      "unidcdf "
+      "unidinv "
+      "unidpdf "
+      "unidrnd "
+      "unifcdf "
+      "unifinv "
+      "unifpdf "
+      "unifrnd "
+      "unimplemented "
+      "union "
+      "unique "
+      "unix "
+      "unlink "
+      "unmark_command "
+      "unmark_rawcommand "
+      "unmkpp "
+      "unpack "
+      "untabify "
+      "untar "
+      "until "
+      "unwind_protect "
+      "unwind_protect_cleanup "
+      "unwrap "
+      "unzip "
+      "uplus "
+      "upper "
+      "urlread "
+      "urlwrite "
+      "usage "
+      "usleep "
+      "validatestring "
+      "values "
+      "vander "
+      "var "
+      "var_test "
+      "varargin "
+      "varargout "
+      "vec "
+      "vech "
+      "vectorize "
+      "ver "
+      "version "
+      "vertcat "
+      "view "
+      "voronoi "
+      "voronoin "
+      "waitforbuttonpress "
+      "waitpid "
+      "warning "
+      "warning_ids "
+      "warranty "
+      "wavread "
+      "wavwrite "
+      "wblcdf "
+      "wblinv "
+      "wblpdf "
+      "wblrnd "
+      "weekday "
+      "weibcdf "
+      "weibinv "
+      "weibpdf "
+      "weibrnd "
+      "welch_test "
+      "what "
+      "which "
+      "while "
+      "white "
+      "whitebg "
+      "who "
+      "whos "
+      "whos_line_format "
+      "wienrnd "
+      "wilcoxon_test "
+      "wilkinson "
+      "winter "
+      "xlabel "
+      "xlim "
+      "xor "
+      "yes_or_no "
+      "ylabel "
+      "ylim "
+      "yulewalker "
+      "z_test "
+      "z_test_2 "
+      "zeros "
+      "zip "
+      "zlabel "
+      "zlim ";
+  /*            "break case catch continue do else elseif end end_unwind_protect "
+              "endfor endfunction endif endswitch endwhile for function "
+              "global if otherwise persistent return switch try until "
+              "unwind_protect unwind_protect_cleanup while";
+  */
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/resourcemanager.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,67 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef RESOURCEMANAGER_H
+#define RESOURCEMANAGER_H
+
+#include <QSettings>
+#include <QDesktopServices>
+#include <QMap>
+#include <QIcon>
+
+class ResourceManager
+{
+public:
+  enum Icon
+  {
+    Octave,
+    Terminal,
+    Documentation,
+    Chat,
+    ChatNewMessage
+  };
+
+  ~ResourceManager ();
+
+  static ResourceManager *
+  instance ()
+  {
+    return &m_singleton;
+  }
+
+  QSettings *settings ();
+  QString homePath ();
+  void reloadSettings ();
+  void setSettings (QString file);
+  QString findTranslatorFile (QString language);
+  void updateNetworkSettings ();
+  void loadIcons ();
+  QIcon icon (Icon icon);
+  bool isFirstRun ();
+
+  const char *octaveKeywords ();
+private:
+  ResourceManager ();
+
+  QSettings *m_settings;
+  QString m_homePath;
+  QMap <Icon, QIcon> m_icons;
+  static ResourceManager m_singleton;
+  bool m_firstRun;
+};
+
+#endif // RESOURCEMANAGER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/settingsdialog.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,87 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "resourcemanager.h"
+#include "settingsdialog.h"
+#include "ui_settingsdialog.h"
+#include <QSettings>
+
+SettingsDialog::SettingsDialog (QWidget * parent):
+QDialog (parent), ui (new Ui::SettingsDialog)
+{
+  ui->setupUi (this);
+
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  ui->useCustomFileEditor->setChecked (settings->value ("useCustomFileEditor").toBool ());
+  ui->customFileEditor->setText (settings->value ("customFileEditor").toString ());
+  ui->editor_showLineNumbers->setChecked (settings->value ("editor/showLineNumbers",true).toBool () );
+  ui->editor_highlightCurrentLine->setChecked (settings->value ("editor/highlightCurrentLine",true).toBool () );
+  ui->editor_codeCompletion->setChecked (settings->value ("editor/codeCompletion",true).toBool () );
+  ui->editor_fontName->setCurrentFont (QFont (settings->value ("editor/fontName","Courier").toString()) );
+  ui->editor_fontSize->setValue (settings->value ("editor/fontSize",10).toInt ());
+  ui->editor_longWindowTitle->setChecked (settings->value ("editor/longWindowTitle",true).toBool ());
+  ui->terminal_fontName->setCurrentFont (QFont (settings->value ("terminal/fontName","Courier").toString()) );
+  ui->terminal_fontSize->setValue (settings->value ("terminal/fontSize",10).toInt ());
+  ui->showFilenames->setChecked (settings->value ("showFilenames").toBool());
+  ui->showFileSize->setChecked (settings->value ("showFileSize").toBool());
+  ui->showFileType->setChecked (settings->value ("showFileType").toBool());
+  ui->showLastModified->setChecked (settings->value ("showLastModified").toBool());
+  ui->showHiddenFiles->setChecked (settings->value ("showHiddenFiles").toBool());
+  ui->useAlternatingRowColors->setChecked (settings->value ("useAlternatingRowColors").toBool());
+  ui->useProxyServer->setChecked (settings->value ("useProxyServer").toBool ());
+  ui->proxyHostName->setText (settings->value ("proxyHostName").toString ());
+
+  int currentIndex = 0;
+  QString proxyTypeString = settings->value ("proxyType").toString ();
+  while ( (currentIndex < ui->proxyType->count ()) && (ui->proxyType->currentText () != proxyTypeString))
+    {
+      currentIndex++;
+      ui->proxyType->setCurrentIndex (currentIndex);
+    }
+
+  ui->proxyPort->setText (settings->value ("proxyPort").toString ());
+  ui->proxyUserName->setText (settings->value ("proxyUserName").toString ());
+  ui->proxyPassword->setText (settings->value ("proxyPassword").toString ());
+}
+
+SettingsDialog::~SettingsDialog ()
+{
+  QSettings *settings = ResourceManager::instance ()->settings ();
+  settings->setValue ("useCustomFileEditor", ui->useCustomFileEditor->isChecked ());
+  settings->setValue ("customFileEditor", ui->customFileEditor->text ());
+  settings->setValue ("editor/showLineNumbers", ui->editor_showLineNumbers->isChecked ());
+  settings->setValue ("editor/highlightCurrentLine", ui->editor_highlightCurrentLine->isChecked ());
+  settings->setValue ("editor/codeCompletion", ui->editor_codeCompletion->isChecked ());
+  settings->setValue ("editor/fontName", ui->editor_fontName->currentFont().family());
+  settings->setValue ("editor/fontSize", ui->editor_fontSize->value());
+  settings->setValue ("editor/longWindowTitle", ui->editor_longWindowTitle->isChecked());
+  settings->setValue ("terminal/fontSize", ui->terminal_fontSize->value());
+  settings->setValue ("terminal/fontName", ui->terminal_fontName->currentFont().family());
+  settings->setValue ("showFilenames", ui->showFilenames->isChecked ());
+  settings->setValue ("showFileSize", ui->showFileSize->isChecked ());
+  settings->setValue ("showFileType", ui->showFileType->isChecked ());
+  settings->setValue ("showLastModified", ui->showLastModified->isChecked ());
+  settings->setValue ("showHiddenFiles", ui->showHiddenFiles->isChecked ());
+  settings->setValue ("useAlternatingRowColors", ui->useAlternatingRowColors->isChecked ());
+  settings->setValue ("useProxyServer", ui->useProxyServer->isChecked ());
+  settings->setValue ("proxyType", ui->proxyType->currentText ());
+  settings->setValue ("proxyHostName", ui->proxyHostName->text ());
+  settings->setValue ("proxyPort", ui->proxyPort->text ());
+  settings->setValue ("proxyUserName", ui->proxyUserName->text ());
+  settings->setValue ("proxyPassword", ui->proxyPassword->text ());
+  delete ui;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/settingsdialog.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,39 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *md5
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef SETTINGSDIALOG_H
+#define SETTINGSDIALOG_H
+
+#include <QDialog>
+
+namespace Ui
+{
+  class SettingsDialog;
+}
+
+class SettingsDialog:public QDialog
+{
+Q_OBJECT public:
+  explicit SettingsDialog (QWidget * parent);
+  ~SettingsDialog ();
+
+private:
+  Ui::SettingsDialog * ui;
+};
+
+#endif // SETTINGSDIALOG_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/settingsdialog.ui	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,668 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>SettingsDialog</class>
+ <widget class="QDialog" name="SettingsDialog">
+  <property name="windowModality">
+   <enum>Qt::ApplicationModal</enum>
+  </property>
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>600</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>600</width>
+    <height>400</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>600</width>
+    <height>400</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Settings</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QTabWidget" name="tabWidget">
+     <property name="currentIndex">
+      <number>0</number>
+     </property>
+     <widget class="QWidget" name="tab">
+      <attribute name="title">
+       <string>Editor</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_6">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_5">
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_4">
+           <item>
+            <widget class="QLabel" name="label_8">
+             <property name="text">
+              <string>Font</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QFontComboBox" name="editor_fontName">
+             <property name="editable">
+              <bool>false</bool>
+             </property>
+             <property name="fontFilters">
+              <set>QFontComboBox::MonospacedFonts</set>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QLabel" name="label_9">
+             <property name="text">
+              <string>Font Size</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <widget class="QSpinBox" name="editor_fontSize">
+             <property name="minimum">
+              <number>2</number>
+             </property>
+             <property name="maximum">
+              <number>96</number>
+             </property>
+             <property name="value">
+              <number>10</number>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_4">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+          </layout>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="editor_showLineNumbers">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string>Show line numbers</string>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="editor_highlightCurrentLine">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string>Highlight current line</string>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="editor_codeCompletion">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string>Code completion</string>
+           </property>
+           <property name="checked">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QCheckBox" name="editor_longWindowTitle">
+           <property name="text">
+            <string>Show complete path in window title</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>40</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout">
+         <item>
+          <widget class="QCheckBox" name="useCustomFileEditor">
+           <property name="enabled">
+            <bool>true</bool>
+           </property>
+           <property name="text">
+            <string>Use custom file editor:</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLineEdit" name="customFileEditor">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>emacs</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_5">
+      <attribute name="title">
+       <string>Terminal</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_5">
+         <item>
+          <widget class="QLabel" name="label_11">
+           <property name="text">
+            <string>Font</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QFontComboBox" name="terminal_fontName">
+           <property name="editable">
+            <bool>false</bool>
+           </property>
+           <property name="fontFilters">
+            <set>QFontComboBox::MonospacedFonts</set>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_12">
+           <property name="text">
+            <string>Font Size</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QSpinBox" name="terminal_fontSize">
+           <property name="minimum">
+            <number>2</number>
+           </property>
+           <property name="maximum">
+            <number>96</number>
+           </property>
+           <property name="value">
+            <number>10</number>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="horizontalSpacer_5">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+        </layout>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_3">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>321</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_2">
+      <attribute name="title">
+       <string>File Browser</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_3">
+       <item>
+        <widget class="QCheckBox" name="showFilenames">
+         <property name="text">
+          <string>Show filenames</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="showFileSize">
+         <property name="text">
+          <string>Show file size</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="showFileType">
+         <property name="text">
+          <string>Show file type</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="showLastModified">
+         <property name="text">
+          <string>Show date of last modification</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="showHiddenFiles">
+         <property name="text">
+          <string>Show hidden files</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <widget class="QCheckBox" name="useAlternatingRowColors">
+         <property name="text">
+          <string>Alternating row colors</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer_2">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>360</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="tab_3">
+      <attribute name="title">
+       <string>Network</string>
+      </attribute>
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <widget class="QCheckBox" name="useProxyServer">
+         <property name="text">
+          <string>Use proxy server</string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <layout class="QFormLayout" name="formLayout">
+         <item row="0" column="0">
+          <widget class="QLabel" name="label_3">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Proxy Type:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="0" column="1">
+          <widget class="QComboBox" name="proxyType">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <item>
+            <property name="text">
+             <string>HttpProxy</string>
+            </property>
+           </item>
+           <item>
+            <property name="text">
+             <string>Socks5Proxy</string>
+            </property>
+           </item>
+          </widget>
+         </item>
+         <item row="1" column="0">
+          <widget class="QLabel" name="label_4">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Hostname:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="1" column="1">
+          <widget class="QLineEdit" name="proxyHostName">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="0">
+          <widget class="QLabel" name="label_5">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Port:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="2" column="1">
+          <widget class="QLineEdit" name="proxyPort">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="0">
+          <widget class="QLabel" name="label_6">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Username:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="3" column="1">
+          <widget class="QLineEdit" name="proxyUserName">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="0">
+          <widget class="QLabel" name="label_7">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="text">
+            <string>Password:</string>
+           </property>
+          </widget>
+         </item>
+         <item row="4" column="1">
+          <widget class="QLineEdit" name="proxyPassword">
+           <property name="enabled">
+            <bool>false</bool>
+           </property>
+           <property name="echoMode">
+            <enum>QLineEdit::Password</enum>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>label_4</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>69</x>
+     <y>122</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>label_3</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>59</x>
+     <y>91</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>label_5</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>44</x>
+     <y>152</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>proxyType</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>291</x>
+     <y>91</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>proxyHostName</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>291</x>
+     <y>124</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>proxyPort</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>364</x>
+     <y>154</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useCustomFileEditor</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>customFileEditor</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>111</x>
+     <y>62</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>343</x>
+     <y>63</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>label_7</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>67</x>
+     <y>212</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>editor_showLineNumbers</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>editor_showLineNumbers</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>87</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>249</x>
+     <y>87</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>editor_highlightCurrentLine</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>editor_highlightCurrentLine</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>112</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>249</x>
+     <y>112</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>proxyUserName</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>364</x>
+     <y>184</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>proxyPassword</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>364</x>
+     <y>214</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>useProxyServer</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>label_6</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>59</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>68</x>
+     <y>182</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>editor_codeCompletion</sender>
+   <signal>toggled(bool)</signal>
+   <receiver>editor_codeCompletion</receiver>
+   <slot>setEnabled(bool)</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>249</x>
+     <y>137</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>249</x>
+     <y>137</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
--- a/gui/src/src.pro	Tue May 29 23:11:26 2012 +0200
+++ b/gui/src/src.pro	Thu May 31 20:53:56 2012 +0200
@@ -74,40 +74,40 @@
 
 # Files associated with the project:
 SOURCES +=\
-    editor/lexeroctavegui.cpp \
-    MainWindow.cpp \
-    WorkspaceView.cpp \
-    HistoryDockWidget.cpp \
-    FilesDockWidget.cpp \
-    SettingsDialog.cpp \
-    OctaveGUI.cpp \
-    ResourceManager.cpp \
-    backend/OctaveLink.cpp \
-    backend/OctaveMainThread.cpp \
-    WelcomeWizard.cpp \
-    editor/FileEditor.cpp \
-    WorkspaceModel.cpp \
-    editor/FileEditorTab.cpp \
-    TerminalDockWidget.cpp
+    backend/octavelink.cc \
+    backend/octavemainthread.cc \
+    editor/lexeroctavegui.cc \
+    editor/fileeditor.cc \
+    editor/fileeditortab.cc \
+    mainwindow.cc \
+    workspaceview.cc \
+    historydockwidget.cc \
+    filesdockwidget.cc \
+    settingsdialog.cc \
+    octavegui.cc \
+    resourcemanager.cc \
+    welcomewizard.cc \
+    workspacemodel.cc \
+    terminaldockwidget.cc
 
 HEADERS += \
+    backend/octavelink.h \
+    backend/octavemainthread.h \
+    backend/symbolinformation.h \
     editor/lexeroctavegui.h \
-    MainWindow.h \
-    WorkspaceView.h \
-    HistoryDockWidget.h \
-    FilesDockWidget.h \
-    SettingsDialog.h \
-    ResourceManager.h \
-    backend/OctaveLink.h \
-    backend/OctaveMainThread.h \
-    WelcomeWizard.h \
-    editor/FileEditor.h \
-    WorkspaceModel.h \
-    editor/FileEditorInterface.h \
-    editor/FileEditorTab.h \
-    TerminalDockWidget.h \
-    backend/SymbolInformation.h
+    editor/fileeditor.h \
+    editor/fileeditorinterface.h \
+    editor/fileeditortab.h \
+    mainwindow.h \
+    workspaceview.h \
+    historydockwidget.h \
+    filesdockwidget.h \
+    settingsdialog.h \
+    resourcemanager.h \
+    welcomewizard.h \
+    workspacemodel.h \
+    terminaldockwidget.h
 
 FORMS += \
-    SettingsDialog.ui \
-    WelcomeWizard.ui
+    settingsdialog.ui \
+    welcomewizard.ui
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/terminaldockwidget.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,28 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "terminaldockwidget.h"
+
+TerminalDockWidget::TerminalDockWidget (QTerminal *terminal, QWidget *parent)
+  : QDockWidget (parent)
+{
+  setObjectName ("TerminalDockWidget");
+  setWindowTitle (tr ("Command Window"));
+  setWidget (terminal);
+
+  connect (this, SIGNAL (visibilityChanged (bool)), this, SLOT (handleVisibilityChanged (bool)));
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/terminaldockwidget.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,41 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef TERMINALDOCKWIDGET_H
+#define TERMINALDOCKWIDGET_H
+
+#include <QDockWidget>
+#include "QTerminal.h"
+
+class TerminalDockWidget : public QDockWidget
+{
+  Q_OBJECT
+public:
+  TerminalDockWidget (QTerminal *terminal, QWidget *parent = 0);
+
+signals:
+    void activeChanged (bool active);
+
+public slots:
+    void handleVisibilityChanged (bool visible)
+    {
+      if (visible)
+        emit activeChanged (true);
+    }
+};
+
+#endif // TERMINALDOCKWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/welcomewizard.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,53 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "welcomewizard.h"
+#include "ui_welcomewizard.h"
+
+WelcomeWizard::WelcomeWizard (QWidget *parent) :
+  QDialog (parent),
+  ui (new Ui::WelcomeWizard)
+{
+  ui->setupUi (this);
+  connect (ui->nextButton1, SIGNAL (clicked ()), this, SLOT (next ()));
+  connect (ui->nextButton2, SIGNAL (clicked ()), this, SLOT (next ()));
+  connect (ui->nextButton3, SIGNAL (clicked ()), this, SLOT (next ()));
+  connect (ui->nextButton4, SIGNAL (clicked ()), this, SLOT (next ()));
+
+  connect (ui->previousButton2, SIGNAL (clicked ()), this, SLOT (previous ()));
+  connect (ui->previousButton3, SIGNAL (clicked ()), this, SLOT (previous ()));
+  connect (ui->previousButton4, SIGNAL (clicked ()), this, SLOT (previous ()));
+  connect (ui->previousButton5, SIGNAL (clicked ()), this, SLOT (previous ()));
+}
+
+WelcomeWizard::~WelcomeWizard()
+{
+  delete ui;
+}
+
+void
+WelcomeWizard::next ()
+{
+  ui->stackedWidget->setCurrentIndex (ui->stackedWidget->currentIndex () + 1);
+}
+
+void
+WelcomeWizard::previous ()
+{
+  ui->stackedWidget->setCurrentIndex (ui->stackedWidget->currentIndex () - 1);
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/welcomewizard.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,43 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef WELCOMEWIZARD_H
+#define WELCOMEWIZARD_H
+
+#include <QDialog>
+
+namespace Ui {
+class WelcomeWizard;
+}
+
+class WelcomeWizard : public QDialog
+{
+  Q_OBJECT
+
+public:
+  explicit WelcomeWizard(QWidget *parent = 0);
+  ~WelcomeWizard();
+
+public slots:
+  void next ();
+  void previous ();
+
+private:
+  Ui::WelcomeWizard *ui;
+};
+
+#endif // WELCOMEWIZARD_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/welcomewizard.ui	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,354 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>WelcomeWizard</class>
+ <widget class="QDialog" name="WelcomeWizard">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>647</width>
+    <height>400</height>
+   </rect>
+  </property>
+  <property name="minimumSize">
+   <size>
+    <width>647</width>
+    <height>400</height>
+   </size>
+  </property>
+  <property name="maximumSize">
+   <size>
+    <width>647</width>
+    <height>400</height>
+   </size>
+  </property>
+  <property name="windowTitle">
+   <string>Welcome to GNU Octave</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout_2">
+   <item>
+    <widget class="QStackedWidget" name="stackedWidget">
+     <property name="currentIndex">
+      <number>4</number>
+     </property>
+     <widget class="QWidget" name="page">
+      <layout class="QVBoxLayout" name="verticalLayout">
+       <item>
+        <widget class="QLabel" name="label">
+         <property name="text">
+          <string>It appears that you have launched Octave GUI for the first time on this computer, since no configuration file could be found at '~/.octave-gui'. This wizard will guide you through the essential settings you should make before you can start using Octave GUI. If you want to transfer your settings you have previously made just close this dialog and copy over the settings file to your home folder. The presence of that file will automatically be detected and will skip this wizard. IMPORTANT: This wizard is not fully functional yet. Just click your way to the end and it will create a standard settings file.</string>
+         </property>
+         <property name="alignment">
+          <set>Qt::AlignJustify|Qt::AlignVCenter</set>
+         </property>
+         <property name="wordWrap">
+          <bool>true</bool>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer name="verticalSpacer">
+         <property name="orientation">
+          <enum>Qt::Vertical</enum>
+         </property>
+         <property name="sizeHint" stdset="0">
+          <size>
+           <width>20</width>
+           <height>218</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <layout class="QHBoxLayout" name="horizontalLayout_2">
+         <item>
+          <spacer name="horizontalSpacer">
+           <property name="orientation">
+            <enum>Qt::Horizontal</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>40</width>
+             <height>20</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <widget class="QPushButton" name="nextButton1">
+           <property name="text">
+            <string>Next</string>
+           </property>
+          </widget>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="page_2">
+      <layout class="QVBoxLayout" name="verticalLayout_4">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_3">
+         <item>
+          <spacer name="verticalSpacer_2">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>40</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout">
+           <item>
+            <widget class="QPushButton" name="previousButton2">
+             <property name="text">
+              <string>Previous</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_2">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="nextButton2">
+             <property name="text">
+              <string>Next</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="page_3">
+      <layout class="QHBoxLayout" name="horizontalLayout_4">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_5">
+         <item>
+          <spacer name="verticalSpacer_3">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>40</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_3">
+           <item>
+            <widget class="QPushButton" name="previousButton3">
+             <property name="text">
+              <string>Previous</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_3">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="nextButton3">
+             <property name="text">
+              <string>Next</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="page_4">
+      <layout class="QHBoxLayout" name="horizontalLayout_6">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_6">
+         <item>
+          <spacer name="verticalSpacer_4">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>40</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_5">
+           <item>
+            <widget class="QPushButton" name="previousButton4">
+             <property name="text">
+              <string>Previous</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_4">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="nextButton4">
+             <property name="text">
+              <string>Next</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+     <widget class="QWidget" name="page_5">
+      <layout class="QHBoxLayout" name="horizontalLayout_8">
+       <item>
+        <layout class="QVBoxLayout" name="verticalLayout_7">
+         <item>
+          <widget class="QLabel" name="label_2">
+           <property name="font">
+            <font>
+             <pointsize>20</pointsize>
+            </font>
+           </property>
+           <property name="text">
+            <string>Welcome to Octave!</string>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_3">
+           <property name="text">
+            <string>This is the development version of Octave with the first official GUI.</string>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <widget class="QLabel" name="label_4">
+           <property name="text">
+            <string>You seem to run Octave GUI for the first time on this computer. This assistant will help you to configure this software installation. Click 'Finish' to write a configuration file and launch Octave GUI.</string>
+           </property>
+           <property name="wordWrap">
+            <bool>true</bool>
+           </property>
+          </widget>
+         </item>
+         <item>
+          <spacer name="verticalSpacer_5">
+           <property name="orientation">
+            <enum>Qt::Vertical</enum>
+           </property>
+           <property name="sizeHint" stdset="0">
+            <size>
+             <width>20</width>
+             <height>40</height>
+            </size>
+           </property>
+          </spacer>
+         </item>
+         <item>
+          <layout class="QHBoxLayout" name="horizontalLayout_7">
+           <item>
+            <widget class="QPushButton" name="previousButton5">
+             <property name="enabled">
+              <bool>false</bool>
+             </property>
+             <property name="text">
+              <string>Previous</string>
+             </property>
+            </widget>
+           </item>
+           <item>
+            <spacer name="horizontalSpacer_5">
+             <property name="orientation">
+              <enum>Qt::Horizontal</enum>
+             </property>
+             <property name="sizeHint" stdset="0">
+              <size>
+               <width>40</width>
+               <height>20</height>
+              </size>
+             </property>
+            </spacer>
+           </item>
+           <item>
+            <widget class="QPushButton" name="finishButton">
+             <property name="text">
+              <string>Finish</string>
+             </property>
+            </widget>
+           </item>
+          </layout>
+         </item>
+        </layout>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>finishButton</sender>
+   <signal>clicked()</signal>
+   <receiver>WelcomeWizard</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>577</x>
+     <y>372</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>323</x>
+     <y>199</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/workspacemodel.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,172 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "workspacemodel.h"
+#include <QTreeWidget>
+#include <QTime>
+#include "octavelink.h"
+
+WorkspaceModel::WorkspaceModel(QObject *parent)
+  : QAbstractItemModel(parent)
+{
+  QList<QVariant> rootData;
+  rootData << tr ("Name") << tr ("Type") << tr ("Value");
+  _rootItem = new TreeItem(rootData);
+}
+
+WorkspaceModel::~WorkspaceModel()
+{
+  delete _rootItem;
+}
+
+QModelIndex
+WorkspaceModel::index(int row, int column, const QModelIndex &parent) const
+{
+  if (!hasIndex(row, column, parent))
+    return QModelIndex();
+
+  TreeItem *parentItem;
+
+  if (!parent.isValid())
+    parentItem = _rootItem;
+  else
+    parentItem = static_cast<TreeItem*>(parent.internalPointer());
+
+  TreeItem *childItem = parentItem->child(row);
+  if (childItem)
+    return createIndex(row, column, childItem);
+  else
+    return QModelIndex();
+}
+
+QModelIndex
+WorkspaceModel::parent(const QModelIndex &index) const
+{
+  if (!index.isValid())
+    return QModelIndex();
+
+  TreeItem *childItem = static_cast<TreeItem*>(index.internalPointer());
+  TreeItem *parentItem = childItem->parent();
+
+  if (parentItem == _rootItem)
+    return QModelIndex();
+
+  return createIndex(parentItem->row(), 0, parentItem);
+}
+
+int
+WorkspaceModel::rowCount(const QModelIndex &parent) const
+{
+  TreeItem *parentItem;
+  if (parent.column() > 0)
+    return 0;
+
+  if (!parent.isValid())
+    parentItem = _rootItem;
+  else
+    parentItem = static_cast<TreeItem*>(parent.internalPointer());
+
+  return parentItem->childCount();
+}
+
+int
+WorkspaceModel::columnCount(const QModelIndex &parent) const
+{
+  if (parent.isValid())
+    return static_cast<TreeItem*>(parent.internalPointer())->columnCount();
+  else
+    return _rootItem->columnCount();
+}
+
+void
+WorkspaceModel::insertTopLevelItem(int at, TreeItem *treeItem)
+{
+  _rootItem->insertChildItem(at, treeItem);
+}
+
+TreeItem *
+WorkspaceModel::topLevelItem (int at)
+{
+  return _rootItem->child(at);
+}
+
+Qt::ItemFlags
+WorkspaceModel::flags(const QModelIndex &index) const
+{
+  if (!index.isValid())
+    return 0;
+
+  return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
+}
+
+QVariant
+WorkspaceModel::headerData(int section, Qt::Orientation orientation, int role) const
+{
+  if (orientation == Qt::Horizontal && role == Qt::DisplayRole)
+    return _rootItem->data(section);
+
+  return QVariant();
+}
+
+QVariant
+WorkspaceModel::data(const QModelIndex &index, int role) const
+{
+  if (!index.isValid())
+    return QVariant();
+
+  if (role != Qt::DisplayRole)
+    return QVariant();
+
+  TreeItem *item = static_cast<TreeItem*>(index.internalPointer());
+
+  return item->data(index.column());
+}
+
+
+void
+WorkspaceModel::updateFromSymbolTable ()
+{
+  topLevelItem (0)->deleteChildItems ();
+  topLevelItem (1)->deleteChildItems ();
+  topLevelItem (2)->deleteChildItems ();
+  topLevelItem (3)->deleteChildItems ();
+
+  OctaveLink::instance ()-> acquireSymbolInformation();
+  const QList <SymbolInformation>& symbolInformation = OctaveLink::instance() ->symbolInformation ();
+
+  foreach (const SymbolInformation& s, symbolInformation)
+    {
+      TreeItem *child = new TreeItem ();
+
+      child->setData (0, s._symbol);
+      child->setData (1, s._type);
+      child->setData (2, s._value);
+
+      switch (s._scope)
+        {
+          case SymbolInformation::Local:       topLevelItem (0)->addChild (child); break;
+          case SymbolInformation::Global:      topLevelItem (1)->addChild (child); break;
+          case SymbolInformation::Persistent:  topLevelItem (2)->addChild (child); break;
+          case SymbolInformation::Hidden:      topLevelItem (3)->addChild (child); break;
+        }
+    }
+
+  OctaveLink::instance ()-> releaseSymbolInformation();
+
+  reset();
+  emit expandRequest();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/workspacemodel.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,137 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef WORKSPACEMODEL_H
+#define WORKSPACEMODEL_H
+
+// Qt includes
+#include <QAbstractItemModel>
+#include <QVector>
+#include <QSemaphore>
+
+class TreeItem
+{
+public:
+  TreeItem(const QList<QVariant> &data, TreeItem *parent = 0) {
+    _parentItem = parent;
+    _itemData = data;
+  }
+
+  TreeItem(QVariant data = QVariant(), TreeItem *parent = 0) {
+    QList<QVariant> variantList;
+    variantList << data << QVariant() << QVariant();
+    _parentItem = parent;
+    _itemData = variantList;
+  }
+
+  ~TreeItem() {
+     qDeleteAll(_childItems);
+  }
+
+  void insertChildItem(int at, TreeItem *item) {
+    item->_parentItem = this;
+    _childItems.insert(at, item);
+  }
+
+  void addChild(TreeItem *item) {
+    item->_parentItem = this;
+    _childItems.append(item);
+  }
+
+  void deleteChildItems() {
+      qDeleteAll(_childItems);
+      _childItems.clear();
+  }
+
+  void removeChild(TreeItem *item) {
+    _childItems.removeAll(item);
+  }
+
+  QVariant data(int column) const
+  {
+    return _itemData[column];
+  }
+
+  void setData(int column, QVariant data)
+  {
+    _itemData[column] = data;
+  }
+
+  TreeItem *child(int row) {
+    return _childItems[row];
+  }
+
+  int childCount() const {
+    return _childItems.count();
+  }
+
+  int columnCount() const
+  {
+    return _itemData.count();
+  }
+
+  int row() const {
+    if (_parentItem)
+      return _parentItem->_childItems.indexOf(const_cast<TreeItem*>(this));
+
+    return 0;
+  }
+
+  TreeItem *parent()
+  {
+    return _parentItem;
+  }
+
+private:
+  QList<TreeItem*> _childItems;
+  QList<QVariant> _itemData;
+  TreeItem *_parentItem;
+};
+
+class WorkspaceModel : public QAbstractItemModel
+{
+  Q_OBJECT
+
+public:
+  WorkspaceModel(QObject *parent = 0);
+  ~WorkspaceModel();
+
+  QVariant data(const QModelIndex &index, int role) const;
+  Qt::ItemFlags flags(const QModelIndex &index) const;
+  QVariant headerData(int section, Qt::Orientation orientation,
+                      int role = Qt::DisplayRole) const;
+  QModelIndex index(int row, int column,
+                    const QModelIndex &parent = QModelIndex()) const;
+  QModelIndex parent(const QModelIndex &index) const;
+  int rowCount(const QModelIndex &parent = QModelIndex()) const;
+  int columnCount(const QModelIndex &parent = QModelIndex()) const;
+
+  void insertTopLevelItem (int at, TreeItem *treeItem);
+  TreeItem *topLevelItem (int at);
+
+public slots:
+  void updateFromSymbolTable ();
+
+signals:
+  void expandRequest();
+
+private:
+
+  TreeItem *_rootItem;
+};
+
+#endif // WORKSPACEMODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/workspaceview.cc	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,60 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "workspaceview.h"
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QPushButton>
+
+WorkspaceView::WorkspaceView (QWidget * parent) : QDockWidget
+  (parent)
+{
+  setObjectName ("WorkspaceView");
+  setWindowTitle (tr ("Workspace"));
+
+  m_workspaceTreeView = new QTreeView (this);
+  m_workspaceTreeView->setHeaderHidden (false);
+  m_workspaceTreeView->setAlternatingRowColors (true);
+  m_workspaceTreeView->setAnimated (true);
+  m_workspaceTreeView->setModel(OctaveLink::instance()->workspaceModel());
+
+  setWidget (new QWidget (this));
+  QVBoxLayout *layout = new QVBoxLayout ();
+  layout->addWidget (m_workspaceTreeView);
+  layout->setMargin (2);
+  widget ()->setLayout (layout);
+
+  connect (this, SIGNAL (visibilityChanged (bool)),
+           this, SLOT(handleVisibilityChanged (bool)));
+
+  connect (OctaveLink::instance()->workspaceModel(), SIGNAL(expandRequest()),
+           m_workspaceTreeView, SLOT(expandAll()));
+}
+
+void
+WorkspaceView::handleVisibilityChanged (bool visible)
+{
+  if (visible)
+  emit activeChanged (true);
+}
+
+void
+WorkspaceView::closeEvent (QCloseEvent *event)
+{
+  emit activeChanged (false);
+  QDockWidget::closeEvent (event);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gui/src/workspaceview.h	Thu May 31 20:53:56 2012 +0200
@@ -0,0 +1,46 @@
+/* OctaveGUI - A graphical user interface for Octave
+ * Copyright (C) 2011 Jacob Dawid (jacob.dawid@googlemail.com)
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef WORKSPACEVIEW_H
+#define WORKSPACEVIEW_H
+
+#include <QDockWidget>
+#include <QTreeView>
+#include <QSemaphore>
+#include "octavelink.h"
+
+class WorkspaceView:public QDockWidget
+{
+  Q_OBJECT
+public:
+  WorkspaceView (QWidget * parent = 0);
+
+public slots:
+  void handleVisibilityChanged (bool visible);
+
+signals:
+  /** Custom signal that tells if a user has clicke away that dock widget. */
+  void activeChanged (bool active);
+
+protected:
+  void closeEvent (QCloseEvent *event);
+
+private:
+  QTreeView *m_workspaceTreeView;
+};
+
+#endif // WORKSPACEVIEW_H