fixed a bug which was leading to wrong file format settings when loading default msr files.
This commit is contained in:
parent
4cb6aa2ec9
commit
df7f36de2f
@ -239,13 +239,17 @@ PAdmin::PAdmin()
|
|||||||
if (path.isEmpty())
|
if (path.isEmpty())
|
||||||
path = "/home/nemu/analysis/bin";
|
path = "/home/nemu/analysis/bin";
|
||||||
QString fln = path + "/musrgui_startup.xml";
|
QString fln = path + "/musrgui_startup.xml";
|
||||||
if (QFile::exists(fln)) { // administrations file present
|
if (QFile::exists(fln)) { // administration file present
|
||||||
PAdminXMLParser handler(this);
|
PAdminXMLParser handler(this);
|
||||||
QFile xmlFile(fln);
|
QFile xmlFile(fln);
|
||||||
QXmlInputSource source( &xmlFile );
|
QXmlInputSource source( &xmlFile );
|
||||||
QXmlSimpleReader reader;
|
QXmlSimpleReader reader;
|
||||||
reader.setContentHandler( &handler );
|
reader.setContentHandler( &handler );
|
||||||
reader.parse( source );
|
reader.parse( source );
|
||||||
|
} else {
|
||||||
|
QMessageBox::critical(0, "ERROR",
|
||||||
|
"Couldn't find the musrgui_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,45 +57,8 @@ PGetDefaultDialog::PGetDefaultDialog(QWidget *parent, const char *name,
|
|||||||
bool modal, WFlags f) :
|
bool modal, WFlags f) :
|
||||||
PGetDefaultDialogBase(parent, name, modal, f)
|
PGetDefaultDialogBase(parent, name, modal, f)
|
||||||
{
|
{
|
||||||
fInstitute = fInstitute_comboBox->currentText();
|
|
||||||
fFileFormat = fFileFormat_comboBox->currentText();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::runFileNameChanged(const QString &text)
|
|
||||||
{
|
|
||||||
fRunFileName = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::beamlineChanged(const QString &text)
|
|
||||||
{
|
|
||||||
fBeamline = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::instituteChanged(const QString &text)
|
|
||||||
{
|
|
||||||
fInstitute = text;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
void PGetDefaultDialog::fileFormatChanged(const QString &text)
|
|
||||||
{
|
|
||||||
fFileFormat = text;
|
|
||||||
}
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// END
|
// END
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -34,6 +34,8 @@
|
|||||||
|
|
||||||
#include <qstring.h>
|
#include <qstring.h>
|
||||||
#include <qwidget.h>
|
#include <qwidget.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qcombobox.h>
|
||||||
|
|
||||||
#include "forms/PGetDefaultDialogBase.h"
|
#include "forms/PGetDefaultDialogBase.h"
|
||||||
|
|
||||||
@ -46,22 +48,10 @@ class PGetDefaultDialog : public PGetDefaultDialogBase
|
|||||||
bool modal = TRUE, WFlags f = 0);
|
bool modal = TRUE, WFlags f = 0);
|
||||||
virtual ~PGetDefaultDialog() {}
|
virtual ~PGetDefaultDialog() {}
|
||||||
|
|
||||||
virtual const QString getRunFileName() const { return fRunFileName; }
|
virtual const QString getRunFileName() const { return fRunFileName_lineEdit->text(); }
|
||||||
virtual const QString getBeamline() const { return fBeamline; }
|
virtual const QString getBeamline() const { return fBeamline_lineEdit->text(); }
|
||||||
virtual const QString getInstitute() const { return fInstitute; }
|
virtual const QString getInstitute() const { return fInstitute_comboBox->currentText(); }
|
||||||
virtual const QString getFileFormat() const { return fFileFormat; }
|
virtual const QString getFileFormat() const { return fFileFormat_comboBox->currentText(); }
|
||||||
|
|
||||||
private:
|
|
||||||
QString fRunFileName;
|
|
||||||
QString fBeamline;
|
|
||||||
QString fInstitute;
|
|
||||||
QString fFileFormat;
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void runFileNameChanged(const QString&);
|
|
||||||
void beamlineChanged(const QString&);
|
|
||||||
void instituteChanged(const QString&);
|
|
||||||
void fileFormatChanged(const QString&);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _PGETDEFAULTDIALOG_H_
|
#endif // _PGETDEFAULTDIALOG_H_
|
||||||
|
@ -174,6 +174,71 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</hbox>
|
</hbox>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QLineEdit">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>fRunFileName_lineEdit</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>130</x>
|
||||||
|
<y>20</y>
|
||||||
|
<width>360</width>
|
||||||
|
<height>24</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip" stdset="0">
|
||||||
|
<string>e.g. 2007/lem07_his_0147</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLineEdit">
|
||||||
|
<property name="name">
|
||||||
|
<cstring>fBeamline_lineEdit</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>130</x>
|
||||||
|
<y>60</y>
|
||||||
|
<width>360</width>
|
||||||
|
<height>24</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip" stdset="0">
|
||||||
|
<string>e.g. mue4</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QComboBox">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>PSI</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>RAL</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>TRIUMF</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>JPARC</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<property name="name">
|
||||||
|
<cstring>fInstitute_comboBox</cstring>
|
||||||
|
</property>
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>130</x>
|
||||||
|
<y>100</y>
|
||||||
|
<width>99</width>
|
||||||
|
<height>24</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
<widget class="QComboBox">
|
<widget class="QComboBox">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@ -227,71 +292,6 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QComboBox">
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>PSI</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>RAL</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>TRIUMF</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<property name="text">
|
|
||||||
<string>JPARC</string>
|
|
||||||
</property>
|
|
||||||
</item>
|
|
||||||
<property name="name">
|
|
||||||
<cstring>fInstitute_comboBox</cstring>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>130</x>
|
|
||||||
<y>100</y>
|
|
||||||
<width>99</width>
|
|
||||||
<height>24</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLineEdit">
|
|
||||||
<property name="name">
|
|
||||||
<cstring>fRunFileName_lineEdit</cstring>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>130</x>
|
|
||||||
<y>20</y>
|
|
||||||
<width>360</width>
|
|
||||||
<height>24</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip" stdset="0">
|
|
||||||
<string>e.g. 2007/lem07_his_0147</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
<widget class="QLineEdit">
|
|
||||||
<property name="name">
|
|
||||||
<cstring>fBeamline_lineEdit</cstring>
|
|
||||||
</property>
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>130</x>
|
|
||||||
<y>60</y>
|
|
||||||
<width>360</width>
|
|
||||||
<height>24</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="toolTip" stdset="0">
|
|
||||||
<string>e.g. mue4</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
</widget>
|
||||||
<images>
|
<images>
|
||||||
<image name="image0">
|
<image name="image0">
|
||||||
@ -311,30 +311,6 @@
|
|||||||
<receiver>PGetDefaultDialogBase</receiver>
|
<receiver>PGetDefaultDialogBase</receiver>
|
||||||
<slot>reject()</slot>
|
<slot>reject()</slot>
|
||||||
</connection>
|
</connection>
|
||||||
<connection>
|
|
||||||
<sender>fRunFileName_lineEdit</sender>
|
|
||||||
<signal>textChanged(const QString&)</signal>
|
|
||||||
<receiver>PGetDefaultDialogBase</receiver>
|
|
||||||
<slot>runFileNameChanged(const QString&)</slot>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>fBeamline_lineEdit</sender>
|
|
||||||
<signal>textChanged(const QString&)</signal>
|
|
||||||
<receiver>PGetDefaultDialogBase</receiver>
|
|
||||||
<slot>beamlineChanged(const QString&)</slot>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>fInstitute_comboBox</sender>
|
|
||||||
<signal>activated(const QString&)</signal>
|
|
||||||
<receiver>PGetDefaultDialogBase</receiver>
|
|
||||||
<slot>instituteChanged(const QString&)</slot>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>fFileFormat_comboBox</sender>
|
|
||||||
<signal>activated(const QString&)</signal>
|
|
||||||
<receiver>PGetDefaultDialogBase</receiver>
|
|
||||||
<slot>fileFormatChanged(const QString&)</slot>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
</connections>
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>fRunFileName_lineEdit</tabstop>
|
<tabstop>fRunFileName_lineEdit</tabstop>
|
||||||
@ -345,11 +321,5 @@
|
|||||||
<tabstop>buttonCancel</tabstop>
|
<tabstop>buttonCancel</tabstop>
|
||||||
<tabstop>buttonHelp</tabstop>
|
<tabstop>buttonHelp</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<slots>
|
|
||||||
<slot>runFileNameChanged(const QString&)</slot>
|
|
||||||
<slot>beamlineChanged(const QString&)</slot>
|
|
||||||
<slot>instituteChanged(const QString&)</slot>
|
|
||||||
<slot>fileFormatChanged(const QString&)</slot>
|
|
||||||
</slots>
|
|
||||||
<layoutdefaults spacing="6" margin="11"/>
|
<layoutdefaults spacing="6" margin="11"/>
|
||||||
</UI>
|
</UI>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user