Skip to content

Commit

Permalink
Re #5939. Remove usage of existing script interpreter.
Browse files Browse the repository at this point in the history
Have left the QTextEdit (that was previously only used temporarily)
as a placeholder.
  • Loading branch information
RussellTaylor committed Oct 4, 2013
1 parent f129459 commit 5ee3ec3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
24 changes: 3 additions & 21 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Expand Up @@ -83,7 +83,6 @@
#include "plot2D/ScaleEngine.h"
#include "ScriptingLangDialog.h"
#include "ScriptingWindow.h"
#include "CommandLineInterpreter.h"
#include "ScriptFileInterpreter.h"
#include "TableStatistics.h"
#include "Fit.h"
Expand Down Expand Up @@ -500,9 +499,7 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args)
//Scripting
m_script_envs = QHash<QString, ScriptingEnv*>();
setScriptingLanguage(defaultScriptingLang);
m_scriptInterpreter = new CommandLineInterpreter(*scriptingEnv(), m_interpreterDock);
delete m_interpreterDock->widget();
m_interpreterDock->setWidget(m_scriptInterpreter);
//delete m_interpreterDock->widget();
m_iface_script = NULL;
loadCustomActions();

Expand Down Expand Up @@ -5628,8 +5625,6 @@ void ApplicationWindow::saveSettings()
settings.setValue("/KeepAspect", d_keep_plot_aspect);
settings.endGroup(); // ExportImage


if(m_scriptInterpreter ) m_scriptInterpreter->saveSettings();
settings.beginGroup("/ScriptWindow");
// Geometry is applied by the app window
settings.setValue("/size", d_script_win_size);
Expand Down Expand Up @@ -8275,11 +8270,6 @@ void ApplicationWindow::copySelection()
info->copy();
return;
}
else if (m_interpreterDock->hasFocus())
{
m_scriptInterpreter->copy();
return;
}
MdiSubWindow* m = activeWindow();
if (!m)
return;
Expand Down Expand Up @@ -8379,12 +8369,6 @@ void ApplicationWindow::copyMarker()

void ApplicationWindow::pasteSelection()
{
if (m_interpreterDock->hasFocus())
{
m_scriptInterpreter->paste();
return;
}

MdiSubWindow* m = activeWindow();
if (!m)
return;
Expand Down Expand Up @@ -9507,7 +9491,6 @@ void ApplicationWindow::closeEvent( QCloseEvent* ce )

//Save the settings and exit
saveSettings();
m_scriptInterpreter->shutdown();
scriptingEnv()->finalize();

// Help window
Expand Down Expand Up @@ -16132,10 +16115,9 @@ void ApplicationWindow::showScriptInterpreter()
{
m_interpreterDock->show();
m_interpreterDock->setFocusPolicy(Qt::StrongFocus);
m_interpreterDock->setFocusProxy(m_scriptInterpreter);
m_scriptInterpreter->setFocus();
m_interpreterDock->setFocusProxy(m_interpreterDock->widget());
m_interpreterDock->setFocus();
m_interpreterDock->activateWindow();

}

}
Expand Down
2 changes: 0 additions & 2 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.h
Expand Up @@ -121,7 +121,6 @@ namespace MantidQt
//Mantid
class MantidUI;
class ScriptingWindow;
class CommandLineInterpreter;

/**
* \brief QtiPlot's main window.
Expand Down Expand Up @@ -1380,7 +1379,6 @@ public slots:
QDockWidget *explorerWindow, *undoStackWindow;
MantidQt::MantidWidgets::MessageDisplay *resultsLog;
QDockWidget *m_interpreterDock;
CommandLineInterpreter *m_scriptInterpreter;
QMdiArea *d_workspace;

QToolBar *standardTools, *plotTools, *displayBar;
Expand Down

0 comments on commit 5ee3ec3

Please sign in to comment.