added possibility to change timeout on the fly

This commit is contained in:
2012-04-15 09:59:41 +00:00
parent 7368884482
commit 0e7424507f
5 changed files with 51 additions and 4 deletions

View File

@ -130,11 +130,11 @@ class PAdmin
PTheory* getTheoryItem(const unsigned int idx);
PMsr2DataParam getMsr2DataParam() { return fMsr2DataParam; }
void setTimeout(const int ival) { fTimeout = ival; }
void setFontName(const QString str) { fFontName = str; }
void setFontSize(const int ival) { fFontSize = ival; }
protected:
void setTimeout(const int ival) { fTimeout = ival; }
void setExecPath(const QString str) { fExecPath = str; }
void setDefaultSavePath(const QString str) { fDefaultSavePath = str; }
void setTitleFromDataFileFlag(const bool flag) { fTitleFromDataFile = flag; }

View File

@ -44,7 +44,7 @@
* \param enable_musrt0 if true, musrt0 is enabled from within musredit.
*/
PPrefsDialog::PPrefsDialog(const bool keep_mn2_output, const int dump_tag, const bool title_from_data_file,
const bool enable_musrt0)
const bool enable_musrt0, const int timeout)
{
setupUi(this);
@ -68,6 +68,11 @@ PPrefsDialog::PPrefsDialog(const bool keep_mn2_output, const int dump_tag, const
fTitleFromData_checkBox->setChecked(title_from_data_file);
fEnableMusrT0_checkBox->setChecked(enable_musrt0);
QString numStr;
numStr.setNum(timeout);
fTimeout_lineEdit->setText(numStr);
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));
}
//----------------------------------------------------------------------------------------------------

View File

@ -45,12 +45,13 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
public:
PPrefsDialog(const bool keep_mn2_output, const int dump_tag, const bool title_from_data_file,
const bool enable_musrt0);
const bool enable_musrt0, const int timeout);
bool getKeepMinuit2OutputFlag() { return fKeepMn2Output_checkBox->isChecked(); }
bool getTitleFromDataFileFlag() { return fTitleFromData_checkBox->isChecked(); }
bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); }
int getDump();
int getTimeout() { return fTimeout_lineEdit->text().toInt(); }
public slots:
void dumpAscii();

View File

@ -2112,7 +2112,7 @@ void PTextEdit::musrT0()
*/
void PTextEdit::musrPrefs()
{
PPrefsDialog *dlg = new PPrefsDialog(fKeepMinuit2Output, fDump, fTitleFromDataFile, fEnableMusrT0);
PPrefsDialog *dlg = new PPrefsDialog(fKeepMinuit2Output, fDump, fTitleFromDataFile, fEnableMusrT0, fAdmin->getTimeout());
if (dlg == 0) {
QMessageBox::critical(this, "**ERROR** musrPrefs", "Couldn't invoke Preferences Dialog.");
return;
@ -2124,6 +2124,7 @@ void PTextEdit::musrPrefs()
fEnableMusrT0 = dlg->getEnableMusrT0Flag();
fMusrT0Action->setEnabled(fEnableMusrT0);
fDump = dlg->getDump();
fAdmin->setTimeout(dlg->getTimeout());
}
delete dlg;

View File

@ -35,6 +35,46 @@
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>general</string>
</attribute>
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>421</width>
<height>25</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="fTimeout_lineEdit"/>
</item>
<item>
<widget class="QLabel" name="fTimeout_label">
<property name="text">
<string>timeout</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>208</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>musrfit</string>