Skip to content

Commit

Permalink
Replace log handling in SANS window with MessageDisplays. Refs #6202
Browse files Browse the repository at this point in the history
  • Loading branch information
martyngigg committed Apr 15, 2013
1 parent f0681a6 commit 39dafe5
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 166 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ class SANSRunWindow : public MantidQt::API::UserSubWindow
int addBatchLine(QString csv_line, QString separator = "");
///Save the batch file
QString saveBatchGrid(const QString & filename = "");
///Reset the log flags
void checkLogFlags();
//@}

public slots:
Expand Down Expand Up @@ -232,29 +230,28 @@ private slots:
void handleInstrumentChange();
///Record if that user has changed the default filename
void setUserFname();
/// Update the centre finding progress
void updateCentreFindingStatus(const QString & msg);
/// Enables or disables the floodFile run widget
void prepareFlood(int state);
/// Enable the default save button only if there an output workspace and a filename to save it to
void enableOrDisableDefaultSave();
/// connected to the Multi-period check box it shows or hides the multi-period boxes on the file widgets
void disOrEnablePeriods(const int);
/// Append log message to log window
void updateLogWindow(const QString & msg);
/// Switch mode
void switchMode();
///Paste to batch table
void pasteToBatchTable();
///Clear the batch table
void clearBatchTable();
///Clear logger
void clearLogger();
void clearLogger();
///Default trans changed state
void updateTransInfo(int state);
/// So user can decide to use fixed q range or not
void updateFrontDetQrange(int state);
void checkList();
/// Adds a warning message to the tab title
void setLoggerTabTitleToWarn();


private:
/// used to specify the range of validation to do
Expand Down Expand Up @@ -312,8 +309,6 @@ private slots:
/// Holds pointers to the check box for each supported save format with the name of its save algorithm
QHash<const QCheckBox * const, QString> m_savFormats;
typedef QHash<const QCheckBox * const, QString>::const_iterator SavFormatsConstIt;
/// A flag indicating there were warning messsages in the log
bool m_log_warnings;
/// Get notified when the system input directories have changed
Poco::NObserver<SANSRunWindow, Mantid::Kernel::ConfigValChangeNotification> m_newInDir;
/// An observer for a delete notification from Mantid
Expand Down Expand Up @@ -341,7 +336,6 @@ private slots:
void makeValidator(QLabel * const newValid, QWidget * control, QWidget * tab, const QString & errorMsg);
void upDateDataDir();
void handleInputDirChange(Mantid::Kernel::ConfigValChangeNotification_ptr pDirInfo);
void issueWarning(const QString & title, const QString & info);
QString getInstrumentClass() const;
bool entriesAreValid(const ValCheck check=ALL);
bool entriesAreValid(ValMap & vals);
Expand All @@ -350,6 +344,8 @@ private slots:

//A reference to a logger
static Mantid::Kernel::Logger & g_log;
static Mantid::Kernel::Logger & g_centreFinderLog;

};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<string notr="true"/>
</property>
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
Expand Down Expand Up @@ -258,7 +258,7 @@
</item>
<item row="1" column="4">
<widget class="MantidQt::MantidWidgets::InstrumentSelector" name="inst_opt">
<property name="techniques" stdset="0">
<property name="techniques">
<stringlist>
<string>Small Angle Scattering</string>
</stringlist>
Expand Down Expand Up @@ -306,7 +306,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_10">
<item row="0" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="scatterSample" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="scatterSample">
<property name="toolTip">
<string>The run with the sample under investigation</string>
</property>
Expand All @@ -322,7 +322,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="scatCan" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="scatCan">
<property name="toolTip">
<string>The run with the sample under investigation</string>
</property>
Expand Down Expand Up @@ -363,7 +363,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_11">
<item row="0" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="transmis" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="transmis">
<property name="toolTip">
<string>The run with the sample under investigation</string>
</property>
Expand All @@ -382,7 +382,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="transCan" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="transCan">
<property name="toolTip">
<string>The run with the sample under investigation</string>
</property>
Expand Down Expand Up @@ -423,7 +423,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_12">
<item row="0" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="direct" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="direct">
<property name="toolTip">
<string>The run with the sample under investigation</string>
</property>
Expand All @@ -442,7 +442,7 @@
</widget>
</item>
<item row="1" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="dirCan" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="dirCan">
<property name="toolTip">
<string>The run with the sample under investigation</string>
</property>
Expand Down Expand Up @@ -1771,7 +1771,7 @@ intermediate ranges are there for comparison</string>
</widget>
</item>
<item>
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="floodRearFile" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="floodRearFile">
<property name="findRunFiles" stdset="0">
<bool>false</bool>
</property>
Expand Down Expand Up @@ -1801,7 +1801,7 @@ intermediate ranges are there for comparison</string>
</widget>
</item>
<item>
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="floodFrontFile" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="floodFrontFile">
<property name="findRunFiles" stdset="0">
<bool>false</bool>
</property>
Expand Down Expand Up @@ -3059,9 +3059,9 @@ p, li { white-space: pre-wrap; }
</layout>
</item>
<item>
<widget class="QTextBrowser" name="centre_logging">
<property name="openLinks">
<bool>false</bool>
<widget class="MantidQt::MantidWidgets::MessageDisplay" name="centre_logging">
<property name="source">
<string>CentreFinder</string>
</property>
</widget>
</item>
Expand All @@ -3088,7 +3088,7 @@ p, li { white-space: pre-wrap; }
</widget>
</item>
<item>
<widget class="QPushButton" name="clear_log">
<widget class="QPushButton" name="clear_centre_log">
<property name="text">
<string>Clear log</string>
</property>
Expand Down Expand Up @@ -3352,25 +3352,6 @@ p, li { white-space: pre-wrap; }
<string>Logging</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_15">
<item row="1" column="0">
<widget class="QTextEdit" name="logging_field">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="lineWidth">
<number>10</number>
</property>
<property name="midLineWidth">
<number>0</number>
</property>
<property name="textInteractionFlags">
<set>Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
</property>
</widget>
</item>
<item row="1" column="1">
<layout class="QVBoxLayout" name="verticalLayout_10">
<item>
Expand Down Expand Up @@ -3419,6 +3400,13 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="MantidQt::MantidWidgets::MessageDisplay" name="logging_field">
<property name="source">
<string>SANS</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="AddRuns">
Expand Down Expand Up @@ -3672,7 +3660,7 @@ p, li { white-space: pre-wrap; }
<number>6</number>
</property>
<item row="0" column="0">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="file_run_edit" native="true">
<widget class="MantidQt::MantidWidgets::MWRunFiles" name="file_run_edit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Minimum">
<horstretch>0</horstretch>
Expand Down Expand Up @@ -3938,6 +3926,11 @@ p, li { white-space: pre-wrap; }
<extends>QComboBox</extends>
<header>MantidQtMantidWidgets/InstrumentSelector.h</header>
</customwidget>
<customwidget>
<class>MantidQt::MantidWidgets::MessageDisplay</class>
<extends>QWidget</extends>
<header>MantidQtMantidWidgets/MessageDisplay.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>rad_min</tabstop>
Expand Down Expand Up @@ -3999,7 +3992,6 @@ p, li { white-space: pre-wrap; }
<tabstop>showMaskBtn</tabstop>
<tabstop>user_spec_mask</tabstop>
<tabstop>user_time_mask</tabstop>
<tabstop>logging_field</tabstop>
<tabstop>logger_clear</tabstop>
<tabstop>new2Add_edit</tabstop>
<tabstop>add_Btn</tabstop>
Expand Down

0 comments on commit 39dafe5

Please sign in to comment.