47 QStringList TaskNames;
54 mpTaskBox->addItems(TaskNames);
85 if (mpTabCheck->isChecked())
86 mpSeparator->setEnabled(
false);
88 mpSeparator->setEnabled(
true);
96 "Converting an advanced report to a table may result in loss of customization.\n"
97 "Do you want to proceed?",
98 QMessageBox::Ok | QMessageBox::Cancel,
99 QMessageBox::Cancel) == QMessageBox::Ok)
102 mpTableList->clear();
106 for (i = 0, imax = mpBodyList->count(); i < imax; i++)
107 if (static_cast<CQReportListItem *>(mpBodyList->item(i))->getCN().getObjectType()
109 new CQReportListItem(static_cast<CQReportListItem *>(mpBodyList->item(i))->getCN());
111 mpHeaderList->clear();
113 mpFooterList->clear();
154 std::vector< const CCopasiObject * > SelectedVector =
160 if (SelectedVector.size() != 0)
162 QListWidget * pList =
static_cast< QListWidget *
>(mpReportSectionTab->currentWidget());
163 std::vector< const CCopasiObject * >::const_iterator it = SelectedVector.begin();
164 std::vector< const CCopasiObject * >::const_iterator end = SelectedVector.end();
166 for (; it != end; ++it)
169 pList->addItem(pItem);
182 if (mpTabCheck->isChecked())
185 Separator =
TO_UTF8(mpSeparator->text());
187 static_cast<QListWidget *
>(mpReportSectionTab->currentWidget())->addItem(
new CQReportListItem(Separator.
getCN()));
198 if (pDialog->exec() == QDialog::Accepted &&
203 static_cast<QListWidget *
>(mpReportSectionTab->currentWidget())->addItem(
new CQReportListItem(Text.
getCN()));
215 QListWidget * pList =
static_cast< QListWidget *
>(mpReportSectionTab->currentWidget());
217 QListWidgetItem * pNewSelection = NULL;
219 int i, multipleSelection;
221 for (i = pList->count() - 1, multipleSelection = 0; 0 <= i; i--)
222 if (pList->item(i)->isSelected())
224 delete pList->takeItem(i);
226 if (!pNewSelection && i < pList->count())
228 pNewSelection = pList->item(i);
234 if (multipleSelection == 0)
return;
237 pList->clearSelection();
239 if (multipleSelection > 1)
return;
242 if (!pNewSelection && pList->count())
243 pNewSelection = pList->item(pList->count() - 1);
248 pNewSelection->setSelected(
true);
256 QListWidget * pList =
static_cast< QListWidget *
>(mpReportSectionTab->currentWidget());
257 int i, to, multipleSelection;
259 QListWidgetItem * pMove;
261 for (i = pList->count() - 1, to = -1, multipleSelection = 0; i >= 0; i--)
262 if (pList->item(i)->isSelected())
264 if (multipleSelection == 0)
271 else if (multipleSelection > 0)
273 pMove = pList->takeItem(i);
277 pList->insertItem(to, pMove);
279 multipleSelection = 0;
285 for (i = 0; i < multipleSelection; i++)
286 pList->item(i)->setSelected(
false);
293 QListWidget * pList =
static_cast< QListWidget *
>(mpReportSectionTab->currentWidget());
294 int i, imax, to, multipleSelection;
296 QListWidgetItem * pMove;
299 for (i = 0, imax = pList->count(), to = -1, multipleSelection = 0; i < imax; i++)
300 if (pList->item(i)->isSelected())
302 if (multipleSelection == 0) to = i;
306 else if (multipleSelection > 0)
308 pMove = pList->takeItem(i);
312 pList->insertItem(to, pMove);
314 multipleSelection = 0;
320 for (i = pList->count() - multipleSelection, imax = pList->count(); i < imax; i++)
321 pList->item(i)->setSelected(
false);
334 std::set< const CCopasiObject * > Tasks;
335 std::set< const CCopasiObject * > DeletedObjects;
338 QMessageBox::StandardButton choice =
345 case QMessageBox::Ok:
349 if (pReportList == NULL)
354 std::set< const CCopasiObject * >::iterator it = Tasks.begin();
355 std::set< const CCopasiObject * >::iterator end = Tasks.end();
357 for (; it != end; ++it)
367 pReportList->
remove(Index);
369 size_t Size = pReportList->
size();
389 std::string Name =
"report";
399 Name +=
TO_UTF8(QString::number(i));
402 std::string key = pRep->
getKey();
413 if (pDataModel == NULL)
return;
418 std::string name = baseName;
425 name = baseName +
TO_UTF8(QString::number(i));
431 std::string key = pRep->
getKey();
472 const std::string & key)
495 mpBtnCommit->setFocus();
516 mpNotes->enter(
mKey);
526 mpHeaderList->clear();
528 mpFooterList->clear();
529 mpTableList->clear();
537 mpSeparator->setEnabled(
false);
538 mpTabCheck->setChecked(
true);
542 mpSeparator->setEnabled(
true);
543 mpTabCheck->setChecked(
false);
549 std::vector< CRegisteredObjectName > * pList = NULL;
550 std::vector< CRegisteredObjectName >::const_iterator it;
551 std::vector< CRegisteredObjectName >::const_iterator end;
562 for (it = pList->begin(), end = pList->end(); it != end; ++it)
571 for (it = pList->begin(), end = pList->end(); it != end; ++it)
576 for (it = pList->begin(), end = pList->end(); it != end; ++it)
581 for (it = pList->begin(), end = pList->end(); it != end; ++it)
601 +
"to '" + mpName->text() +
"' since a report with that name already exists.";
604 "Unable to rename Report",
606 QMessageBox::Ok, QMessageBox::Ok);
618 if (mpTabCheck->isChecked())
621 Separator =
TO_UTF8(mpSeparator->text());
632 std::vector< CRegisteredObjectName > * pList = NULL;
641 for (i = 0, imax = mpHeaderList->count(); i < imax; i++)
642 if (static_cast<CQReportListItem *>(mpHeaderList->item(i))->getCN().getObjectType()
644 pList->push_back(Separator.
getCN());
646 pList->push_back(static_cast<CQReportListItem *>(mpHeaderList->item(i))->getCN());
650 for (i = 0, imax = mpBodyList->count(); i < imax; i++)
651 if (static_cast<CQReportListItem *>(mpBodyList->item(i))->getCN().getObjectType()
653 pList->push_back(Separator.
getCN());
655 pList->push_back(static_cast<CQReportListItem *>(mpBodyList->item(i))->getCN());
659 for (i = 0, imax = mpFooterList->count(); i < imax; i++)
660 if (static_cast<CQReportListItem *>(mpFooterList->item(i))->getCN().getObjectType()
662 pList->push_back(Separator.
getCN());
664 pList->push_back(static_cast<CQReportListItem *>(mpFooterList->item(i))->getCN());
674 for (i = 0, imax = mpTableList->count(); i < imax; i++)
675 pList->push_back(static_cast<CQReportListItem *>(mpTableList->item(i))->getCN());
691 mpBtnAdvanced->setText(
"Advanced <<");
692 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpTableList),
false);
693 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpHeaderList),
true);
694 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpBodyList),
true);
695 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpFooterList),
true);
696 mpReportSectionTab->setCurrentIndex(2);
697 mpBtnSeparator->show();
699 mpTitleCheck->hide();
705 mpBtnAdvanced->setText(
"Advanced >>");
706 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpTableList),
true);
707 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpHeaderList),
false);
708 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpBodyList),
false);
709 mpReportSectionTab->setTabEnabled(mpReportSectionTab->indexOf(mpFooterList),
false);
710 mpReportSectionTab->setCurrentIndex(0);
711 mpBtnSeparator->hide();
713 mpTitleCheck->show();
CCopasiDataModel * getObjectDataModel()
static const std::string TypeName[]
void btnDeleteReportClicked()
void switchToOtherWidget(const size_t &id, const std::string &key)
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
virtual CCopasiObjectName getCN() const
bool setTaskType(const CCopasiTask::Type &taskType)
const std::string & getObjectName() const
bool appendDependentTasks(std::set< const CCopasiObject * > candidates, std::set< const CCopasiObject * > &dependentTasks) const
virtual size_t size() const
void setTitle(bool title)
const CCopasiTask::Type & getTaskType() const
static std::vector< const CCopasiObject * > getObjectVector(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const std::vector< const CCopasiObject * > *pCurrentSelection=NULL)
const CCopasiReportSeparator & getSeparator() const
void nameChanged(const QString &string)
void btnNewReportClicked()
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
virtual bool enterProtected()
virtual size_t getIndex(const std::string &name) const
void setSeparator(const CCopasiReportSeparator &Separator)
CQReportDefinition(QWidget *parent=0, const char *name=0)
const unsigned C_INT32 & getPrecision() const
void btnAdvancedClicked()
void setIsTable(bool table)
const CReportDefinitionVector * getReportDefinitionList() const
virtual const std::string & getKey() const
const std::string & getStaticString() const
void taskChanged(const QString &string)
virtual bool add(const CType &src)
void separatorChanged(const QString &string)
std::vector< CRegisteredObjectName > * getTableAddr()
std::vector< CRegisteredObjectName > * getFooterAddr()
static StandardButton confirmDelete(QWidget *parent, const QString &objectType, const QString &objects, const std::set< const CCopasiObject * > &deletedObjects)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
virtual const std::string & getKey() const
virtual void remove(const size_t &index)
virtual size_t getIndex(const CCopasiObject *pObject) const
static CKeyFactory * getKeyFactory()
void setPrecision(const unsigned C_INT32 &precision)
void btnSeparatorClicked()
CReportDefinition * mpReportDefinition
std::vector< CRegisteredObjectName > * getBodyAddr()
void precisionChanged(const QString &string)
bool setAdvancedMode(const bool &advanced)
bool setObjectName(const std::string &name)
void btnCopyReportClicked()
std::vector< CRegisteredObjectName > * getHeaderAddr()
bool preCompileTable(const std::vector< CCopasiContainer * > &listOfContainer=CCopasiContainer::EmptyList)
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)