diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 5f3b61d77ddc6193f2dbd95a556164d22fbd027b..e6acb18a6b089d15335cf9f8098eaa663f06cf8c 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -155,8 +155,7 @@ if ( CMAKE_COMPILER_IS_GNUCXX ) PROPERTIES COMPILE_FLAGS -Wno-cast-qual ) endif () -set ( MANTID_SRCS src/Mantid/AbstractMantidLog.cpp - src/Mantid/AlgorithmMonitor.cpp +set ( MANTID_SRCS src/Mantid/AlgorithmMonitor.cpp src/Mantid/AlgorithmHistoryWindow.cpp src/Mantid/ErrorBarSettings.cpp src/Mantid/FirstTimeSetup.cpp @@ -171,7 +170,6 @@ set ( MANTID_SRCS src/Mantid/AbstractMantidLog.cpp src/Mantid/MantidApplication.cpp src/Mantid/MantidCurve.cpp src/Mantid/MantidDock.cpp - src/Mantid/MantidLog.cpp src/Mantid/MantidMatrix.cpp src/Mantid/MantidMatrixCurve.cpp src/Mantid/MantidMDCurve.cpp @@ -383,8 +381,7 @@ set ( QTIPLOT_HDRS src/ApplicationWindow.h src/lib/3rdparty/qtcolorpicker/src/qtcolorpicker.h ) -set ( MANTID_HDRS src/Mantid/AbstractMantidLog.h - src/Mantid/AlgorithmMonitor.h +set ( MANTID_HDRS src/Mantid/AlgorithmMonitor.h src/Mantid/AlgorithmHistoryWindow.h src/Mantid/ErrorBarSettings.h src/Mantid/FirstTimeSetup.h @@ -399,7 +396,6 @@ set ( MANTID_HDRS src/Mantid/AbstractMantidLog.h src/Mantid/MantidApplication.h src/Mantid/MantidCurve.h src/Mantid/MantidDock.h - src/Mantid/MantidLog.h src/Mantid/MantidMatrixCurve.h src/Mantid/MantidMDCurve.h src/Mantid/MantidMDCurveDialog.h @@ -663,7 +659,6 @@ set ( MANTID_MOC_FILES src/Mantid/AlgorithmMonitor.h src/Mantid/MantidApplication.h src/Mantid/MantidCurve.h src/Mantid/MantidDock.h - src/Mantid/MantidLog.h src/Mantid/MantidMatrixCurve.h src/Mantid/MantidMDCurve.h src/Mantid/MantidMDCurveDialog.h diff --git a/Code/Mantid/MantidPlot/src/Mantid/AbstractMantidLog.cpp b/Code/Mantid/MantidPlot/src/Mantid/AbstractMantidLog.cpp deleted file mode 100644 index b7c4c44480b90be104ea121c4b0e982bba485d6f..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/src/Mantid/AbstractMantidLog.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "AbstractMantidLog.h" - -#include "MantidKernel/SignalChannel.h" - -#include <Poco/LoggingRegistry.h> -#include <boost/bind.hpp> - -#include <QMessageBox> - -void AbstractMantidLog::connect() -{ - try - { - Poco::SignalChannel *pChannel = dynamic_cast<Poco::SignalChannel*>(Poco::LoggingRegistry::defaultRegistry().channelForName("signalChannel")); - if (!pChannel) - { - QMessageBox::warning(0,"MantidLog","Channel is of wrong type"); - return; - } - pChannel->sig().connect(boost::bind(&AbstractMantidLog::log,this,_1)); - } - catch(...) - { - QMessageBox::warning(0,"MantidLog","Channel signalChannel not found"); - return; - } -} - -void AbstractMantidLog::log(const Poco::Message& msg) -{ - (void) msg; -} - diff --git a/Code/Mantid/MantidPlot/src/Mantid/AbstractMantidLog.h b/Code/Mantid/MantidPlot/src/Mantid/AbstractMantidLog.h deleted file mode 100644 index 61abb06db462c4461a6076c5fb12a250692c059b..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/src/Mantid/AbstractMantidLog.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ABSTRACT_MANTIDLOG_H -#define ABSTRACT_MANTIDLOG_H - -#ifndef QT_NO_KEYWORDS -#define QT_NO_KEYWORDS -#define DEFINE_SLOTS_AGAIN -#endif - -#include <QObject> -#include <Poco/Message.h> - -/** - - class AbstractMantidLog connects to Mantid's SignalChannel - Method log() receives the message from SignalChannel - -*/ -class AbstractMantidLog : public QObject -{ -public: - - /// Makes connection to SignalChannel. - /// Channel's name must be signalChannel - void connect(); - -protected: - - /// Receives message from SignalChannel. - /// Does nothing, must be overriden in a child class - virtual void log(const Poco::Message& msg); -}; - -#ifdef DEFINE_SLOTS_AGAIN -#undef QT_NO_KEYWORDS -#undef DEFINE_SLOTS_AGAIN -#endif - -#endif /* ABSTRACT_MANTIDLOG_H */ diff --git a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp index ff8cfb4f89140a7cf33dd7d862af4d86953d3451..48587ed8273f94a13d6be06c592e27da25d59116 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/InstrumentWidget/InstrumentWindow.cpp @@ -42,6 +42,8 @@ #include <QDropEvent> #include <QStackedLayout> #include <QKeyEvent> +#include <QUrl> +#include <QTemporaryFile> #include "MantidQtAPI/FileDialogHandler.h" diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidLog.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidLog.cpp deleted file mode 100644 index 354412cbff517114f724a136cfac27f7ad523bcf..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidLog.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "MantidLog.h" -#include "MantidUI.h" -#include <iostream> -using namespace std; - -void MantidLog::connect(MantidUI* mui) -{ - if (!s_Instance) - { - qRegisterMetaType<Poco::Message>(); - s_Instance.reset(new MantidLog); - QObject::connect(s_Instance.get(),SIGNAL(messageReceived(const Poco::Message&)),mui,SLOT(logMessage(const Poco::Message&)), Qt::QueuedConnection); - s_Instance->AbstractMantidLog::connect(); - } -} - -/// Posts message text to QtiPlot Result Log -void MantidLog::log(const Poco::Message& msg) -{ - emit messageReceived(msg); -} - -boost::shared_ptr<MantidLog> MantidLog::s_Instance; \ No newline at end of file diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidLog.h b/Code/Mantid/MantidPlot/src/Mantid/MantidLog.h deleted file mode 100644 index d037c5167f99c08da18956a0ca60c0ce022437c1..0000000000000000000000000000000000000000 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidLog.h +++ /dev/null @@ -1,35 +0,0 @@ -#ifndef MANTIDLOG_H -#define MANTIDLOG_H - -#include <QtCore> -#include "AbstractMantidLog.h" -#include <boost/shared_ptr.hpp> - - -class MantidUI; - -class MantidLog: public AbstractMantidLog -{ - Q_OBJECT - -public: - static void connect(MantidUI* mui); - static long count() - { - return s_Instance.use_count(); - } -signals: - void messageReceived(const Poco::Message& msg); -protected:// slots: - - void log(const Poco::Message& msg); - -private: - - static boost::shared_ptr<MantidLog> s_Instance; - -}; - -Q_DECLARE_METATYPE(Poco::Message) - -#endif /* MANTIDLOG_H */ diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidMatrix.h b/Code/Mantid/MantidPlot/src/Mantid/MantidMatrix.h index cef2146d422baf8e3b37063903520a42628e7457..2dec3fb5784aba8ce9107a6eb21b21cb1d7296ab 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidMatrix.h +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidMatrix.h @@ -27,7 +27,6 @@ #include <iostream> #include "MantidAPI/FrameworkManager.h" -#include "MantidLog.h" #include "../ContourLinesEditor.h" class QLabel; diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp b/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp index 49ad42a9b4627d65e7a8678151f04bdcbdf4d693..9526cb13808dc24271080a7f85b71010302f5430 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidSampleLogDialog.cpp @@ -18,7 +18,7 @@ #include <QAction> #include <QGroupBox> #include <QRadioButton> - +#include <QFileInfo> #include <QMessageBox> #include <iostream> #include <sstream> diff --git a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h index a95e639cbce6e9520d09f1addff1437da51f70c9..add3556f5be5487cec04fa7018a976c8a9704856 100644 --- a/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h +++ b/Code/Mantid/MantidPlot/src/Mantid/MantidUI.h @@ -6,7 +6,6 @@ //---------------------------------- #include "../ApplicationWindow.h" #include "../Graph.h" -#include "MantidLog.h" #include "MantidAlgorithmMetatype.h" #include "MantidAPI/FrameworkManager.h"