Skip to content

Commit

Permalink
Re #5939. Remove existing ipython console launch mechanism.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Oct 4, 2013
1 parent 5ffea0b commit f129459
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 181 deletions.
16 changes: 1 addition & 15 deletions Code/Mantid/MantidPlot/CMakeLists.txt
Expand Up @@ -825,25 +825,14 @@ copy_python_files_to_dir ( "${MTDPLOTPY_FILES}"
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/mantidplotpy
MTDPLOT_INSTALL_FILES )

# IPython scripts
set( IPY_FILES
__init__.py
internal_ipkernel.py
ipython_plugin.py
)
copy_python_files_to_dir ( "${IPY_FILES}"
${CMAKE_CURRENT_SOURCE_DIR}/ipython_plugin
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/ipython_plugin
IPYTHON_INSTALL_FILES )

###########################################################################
# MantidPlot executable
###########################################################################

add_executable ( MantidPlot ${WIN_CONSOLE} MACOSX_BUNDLE ${ALL_SRC} src/main.cpp
${INC_FILES} ${QTIPLOT_C_SRC} ${UI_HDRS}
${RES_FILES} ${MANTID_RC_FILE}
${PYTHON_INSTALL_FILES} ${IPYTHON_INSTALL_FILES} ${MTDPLOT_INSTALL_FILES}
${PYTHON_INSTALL_FILES} ${MTDPLOT_INSTALL_FILES}
)

# Library dependencies
Expand Down Expand Up @@ -976,9 +965,6 @@ install ( FILES ${PY_FILES} DESTINATION ${BIN_DIR} )
foreach(PY_FILE ${MTDPLOTPY_FILES} )
install ( FILES mantidplotpy/${PY_FILE} DESTINATION ${BIN_DIR}/mantidplotpy )
endforeach()
foreach(PY_FILE ${IPY_FILES} )
install ( FILES ipython_plugin/${PY_FILE} DESTINATION ${BIN_DIR}/ipython_plugin )
endforeach()

if ( APPLE )
configure_file ( ${CMAKE_CURRENT_SOURCE_DIR}/FixBundle.cmake.in
Expand Down
1 change: 0 additions & 1 deletion Code/Mantid/MantidPlot/ipython_plugin/__init__.py

This file was deleted.

85 changes: 0 additions & 85 deletions Code/Mantid/MantidPlot/ipython_plugin/internal_ipkernel.py

This file was deleted.

47 changes: 0 additions & 47 deletions Code/Mantid/MantidPlot/ipython_plugin/ipython_plugin.py

This file was deleted.

30 changes: 0 additions & 30 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.cpp
Expand Up @@ -513,8 +513,6 @@ void ApplicationWindow::init(bool factorySettings, const QStringList& args)
g_log.warning("The scripting language is set to muParser. This is probably not what you want! Change the default in View->Preferences.");
}

actionIPythonConsole->setVisible(testForIPython());

// Need to show first time setup dialog?
using Mantid::Kernel::ConfigServiceImpl;
ConfigServiceImpl& config = ConfigService::Instance();
Expand Down Expand Up @@ -1108,7 +1106,6 @@ void ApplicationWindow::initMainMenu()
view->insertSeparator();
view->addAction(actionShowScriptWindow);//Mantid
view->addAction(actionShowScriptInterpreter);
view->addAction(actionIPythonConsole);
view->insertSeparator();

mantidUI->addMenuItems(view);
Expand Down Expand Up @@ -13221,14 +13218,6 @@ void ApplicationWindow::createActions()
#endif
actionShowScriptInterpreter->setToggleAction(true);
connect(actionShowScriptInterpreter, SIGNAL(activated()), this, SLOT(showScriptInterpreter()));

actionIPythonConsole = new QAction(getQPixmap("python_xpm"), tr("Launch IPython Console"), this);
#ifdef __APPLE__
actionIPythonConsole->setShortcut(tr("Ctrl+5")); // F4 is used by the window manager on Mac
#else
actionIPythonConsole->setShortcut(tr("F5"));
#endif
connect(actionIPythonConsole, SIGNAL(activated()), this, SLOT(launchIPythonConsole()));
#endif

actionShowCurvePlotDialog = new QAction(tr("&Plot details..."), this);
Expand Down Expand Up @@ -16151,25 +16140,6 @@ void ApplicationWindow::showScriptInterpreter()

}

bool ApplicationWindow::testForIPython()
{
#ifdef _WIN32
// We have an issue with clashing MSVCR90 libraries on 32-bit windows. When this method
// is run at startup it raises a dialog box warning about an invalid load of the C runtime library.
// It seems to have picked up MSCRV90 from the CMake bin directory. Clicking OK allows
// Mantid to load and then running IPython seesm fine, also without CMake in the PATH it is okay.
// We will have to assume that this is always here on Windows.
return true;
#else
return runPythonScript("from ipython_plugin import MantidPlot_IPython",false, true,false);
#endif
}

void ApplicationWindow::launchIPythonConsole()
{
runPythonScript("from ipython_plugin import MantidPlot_IPython\nMantidPlot_IPython().launch_console()",false, true,false);
}

/**
Turns perspective mode on or off
*/
Expand Down
4 changes: 1 addition & 3 deletions Code/Mantid/MantidPlot/src/ApplicationWindow.h
Expand Up @@ -748,8 +748,6 @@ public slots:
void showScriptWindow(bool forceVisible = false, bool quitting = false);
void saveScriptWindowGeometry();
void showScriptInterpreter();
bool testForIPython();
void launchIPythonConsole();
void showMoreWindows();
void showMarkerPopupMenu();
void showHelp();
Expand Down Expand Up @@ -1449,7 +1447,7 @@ public slots:
QAction *actionNextWindow, *actionPrevWindow;
QAction *actionScriptingLang,*actionClearTable, *actionGoToRow, *actionGoToColumn;
QAction *actionSaveNote;
QAction *actionShowScriptWindow, *actionShowScriptInterpreter, *actionIPythonConsole;
QAction *actionShowScriptWindow, *actionShowScriptInterpreter;
QAction *actionAnimate, *actionPerspective, *actionFitFrame, *actionResetRotation;
QAction *actionDeleteRows, *actionDrawPoints;
QAction *btnCursor, /* *btnSelect,*/ *btnPicker, *btnRemovePoints, *btnMovePoints, /* *btnPeakPick,*/ *btnMultiPeakPick;
Expand Down

0 comments on commit f129459

Please sign in to comment.