15 #include <QtCore/QtDebug>
16 #include <QtGui/QFrame>
17 #include <QtGui/QVBoxLayout>
18 #include <QtGui/QHeaderView>
19 #include <QtGui/QComboBox>
20 #include <QtGui/QApplication>
66 setObjectName(
"TaskWidget");
68 setWindowTitle(trUtf8(
"TaskWidget"));
91 void TaskWidget::addHeaderToGrid(
unsigned int row)
95 static_cast<QVBoxLayout *
>(
mpBtnWidget->layout())->insertStretch(0, 0);
105 bool TaskWidget::addHLineToGrid(QGridLayout* grid,
unsigned int row,
unsigned int maxcol)
107 QFrame * line =
new QFrame(
this,
"line");
108 line->setFrameShape(QFrame::HLine);
109 line->setFrameShadow(QFrame::Sunken);
110 grid->addMultiCellWidget(line, row, row, 0, maxcol);
115 void TaskWidget::addMethodParameterTable(
unsigned int row)
117 if (mpTblParameter)
return;
121 static_cast<QVBoxLayout *
>(
mpBtnWidget->layout())->insertStretch(0, 0);
129 mpLblParameter =
new QLabel(
this,
"mpLblParameter");
130 mpLblParameter->setText(tr(
"Parameter"));
131 mpLblParameter->setAlignment(
int(Qt::AlignTop | Qt::AlignRight));
133 mpTblParameter =
new QTableWidget(
this);
134 mpTblParameter->setSelectionMode(QAbstractItemView::SingleSelection);
135 mpTblParameter->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
137 mpTblParameter->setColumnCount(1);
139 mpTblParameter->setHorizontalHeaderItem(0,
new QTableWidgetItem());
140 mpTblParameter->horizontalHeaderItem(0)->setText(
"Value");
141 mpTblParameter->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Maximum);
143 mpTblParameter->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
144 mpTblParameter->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
145 mpTblParameter->horizontalHeader()->hide();
151 qDebug() <<
"row = " << row;
154 connect(mpTblParameter, SIGNAL(cellChanged(
int,
int)),
this, SLOT(
adjustTable()));
159 void TaskWidget::addMethodSelectionBox(
const unsigned C_INT32 * validMethods,
unsigned int row)
163 static_cast<QVBoxLayout *
>(
mpBtnWidget->layout())->insertStretch(0, 0);
170 mpLblMethod =
new QLabel(0,
"mpLblMethod");
171 mpLblMethod->setText(tr(
"Method"));
172 mpLblMethod->setAlignment(
int(Qt::AlignTop | Qt::AlignRight));
174 mpBoxMethod =
new QComboBox(
this);
181 mpSpacer2 =
new QSpacerItem(0, 0, QSizePolicy::MinimumExpanding, QSizePolicy::Minimum);
187 connect(mpBoxMethod, SIGNAL(activated(
int)),
this, SLOT(changeMethod(
int)));
237 if (pDlg->exec() == QDialog::Accepted)
242 if (pDlg)
delete pDlg;
249 if (!
mpTask)
return false;
260 if (!
mpTask)
return false;
286 if (!
mpTask)
return false;
296 qDebug() <<
"--> TaskWidget::adjustTable <--";
310 if (!
mpTask)
return false;
324 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
328 if (!
mpTask)
return false;
343 if (QMessageBox::question(
this,
344 QString(
"Confirm Overwrite"),
345 QString(
"The report file already exists. Would you like to overwrite it? \n\n(You can disable this dialog by clicking the 'Report' button.)"),
346 QMessageBox::Yes, QMessageBox::No) == QMessageBox::No)
351 setCursor(Qt::WaitCursor);
367 if (!
mpTask)
return false;
414 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
427 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
438 QMessageBox::Ignore | QMessageBox::Abort, QMessageBox::Ignore);
440 if (Result == QMessageBox::Abort)
462 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
468 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
487 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
498 QMessageBox::Ok | QMessageBox::Default, QMessageBox::NoButton);
552 if (!
mpTask)
return false;
void setReport(CReport *newReport)
static const CCopasiMessage & peekLastMessage()
virtual bool setCallBack(CProcessReport *pCallBack)
void setScheduled(const bool &scheduled)
virtual void setTask(CCopasiTask *t)
const bool & confirmOverwrite() const
void suspendAutoSave(const bool &suspend)
virtual bool initialize(const OutputFlag &of, COutputHandler *pOutputHandler, std::ostream *pOstream)
const bool & isUpdateModel() const
static CProgressBar * create(QWidget *parent=0, const char *name=0, Qt::WindowModality windowModality=Qt::WindowModal)
void updateNonSimulatedValues(void)
static std::string getAllMessageText(const bool &chronological=true)
void updateSimulatedValues(const bool &updateMoieties)
const size_t & getNumber() const
const bool & isScheduled() const
const std::string & getTarget() const
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
static CopasiUI3Window * getMainWindow()
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
void loadReportDefinitionVector()
CCopasiMethod * getMethod()
static const std::string SubTypeName[]
static StandardButton critical(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
const bool & success() const
void setUpdateModel(const bool &updateModel)
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
static CCopasiMessage::Type getHighestSeverity()