COPASI API  4.16.103
Public Slots | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
DefaultPlotDialog Class Reference

#include <DefaultplotDialog.h>

Inheritance diagram for DefaultPlotDialog:
Inheritance graph
[legend]
Collaboration diagram for DefaultPlotDialog:
Collaboration graph
[legend]

Public Slots

virtual void setTask (CCopasiTask *t)
 

Public Member Functions

 DefaultPlotDialog (QWidget *parent=0, const char *name=0, bool modal=false, Qt::WindowFlags fl=0)
 
 ~DefaultPlotDialog ()
 

Protected Slots

virtual void slotCreate ()
 connected to create button More...
 
virtual void slotSelect ()
 called when selection in listbox is changed More...
 
virtual void slotToggleAll (bool flag)
 connected to check box More...
 

Protected Member Functions

void fillList ()
 

Protected Attributes

int mIndex
 
std::vector< C_INT32mList
 
CCopasiTaskmpTask
 

Detailed Description

Definition at line 28 of file DefaultplotDialog.h.

Constructor & Destructor Documentation

DefaultPlotDialog::DefaultPlotDialog ( QWidget *  parent = 0,
const char *  name = 0,
bool  modal = false,
Qt::WindowFlags  fl = 0 
)

Definition at line 29 of file DefaultplotDialog.cpp.

30  : QDialog(parent, fl)
31 {
32  setObjectName(QString::fromUtf8(name));
33  setModal(modal);
34  setupUi(this);
35 }
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
DefaultPlotDialog::~DefaultPlotDialog ( )

Definition at line 40 of file DefaultplotDialog.cpp.

41 {
42  // no need to delete child widgets, Qt does it all for us
43 }

Member Function Documentation

void DefaultPlotDialog::fillList ( )
protected

Definition at line 66 of file DefaultplotDialog.cpp.

References FROM_UTF8, COutputAssistant::getItemName(), COutputAssistant::getListOfDefaultOutputDescriptions(), mList, and mpTask.

Referenced by setTask(), and slotToggleAll().

67 {
68  if (mpCheckAll->isChecked())
69  mList = COutputAssistant::getListOfDefaultOutputDescriptions(NULL); //this gets the complete list
70  else
71  mList = COutputAssistant::getListOfDefaultOutputDescriptions(mpTask); //only the items fitting the task
72 
73  listBox->clear();
74 
75  std::vector<C_INT32>::const_iterator it, itEnd = mList.end();
76 
77  QStringList Items;
78 
79  for (it = mList.begin(); it != itEnd; ++it)
80  {
81  QString Name = FROM_UTF8(COutputAssistant::getItemName(*it));
82 
83  if (!Name.startsWith("--")) Name = " " + Name;
84 
85  Items.append(Name);
86  }
87 
88  listBox->insertItems(0, Items);
89 
90  listBox->item(0)->setSelected(true);
91 }
CCopasiTask * mpTask
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
static const std::string & getItemName(C_INT32 id)
static std::vector< C_INT32 > getListOfDefaultOutputDescriptions(const CCopasiTask *task=NULL)
std::vector< C_INT32 > mList
void DefaultPlotDialog::setTask ( CCopasiTask t)
virtualslot

Definition at line 59 of file DefaultplotDialog.cpp.

References fillList(), and mpTask.

Referenced by TaskWidget::assistantBtnClicked().

60 {
61  mpTask = t;
62 
63  fillList();
64 }
CCopasiTask * mpTask
void DefaultPlotDialog::slotCreate ( )
protectedvirtualslot

connected to create button

Definition at line 45 of file DefaultplotDialog.cpp.

References COutputAssistant::createDefaultOutput(), CCopasiRootContainer::getDatamodelList(), mIndex, and mpTask.

46 {
47  if (!mpTask) return;
48 
49  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
51  assert(pDataModel != NULL);
52 
54  this->accept();
55  else
56  this->reject();
57 }
CCopasiTask * mpTask
static CCopasiObject * createDefaultOutput(C_INT32 id, CCopasiTask *task, CCopasiDataModel *pDataModel, bool activate=true)
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
void DefaultPlotDialog::slotSelect ( )
protectedvirtualslot

called when selection in listbox is changed

Definition at line 93 of file DefaultplotDialog.cpp.

References FROM_UTF8, COutputAssistant::getItem(), COutputAssistant::getItemName(), mIndex, mList, and mpTask.

94 {
95  if (!mpTask) return;
96 
97  int i = listBox->currentRow();
98 
99  if (i >= 0)
100  {
101  mIndex = mList[i];
102  lineEditTitle->setText(FROM_UTF8(COutputAssistant::getItemName(mIndex)));
103  textEdit->setText(FROM_UTF8(COutputAssistant::getItem(mIndex).description));
104 
105  createButton->setEnabled(!lineEditTitle->text().startsWith("-- "));
106  }
107  else //Listbox is emtpy, so there is no current row (-1)
108  {
109  mIndex = 0;
110  lineEditTitle->setText("");
111  textEdit->setText("");
112 
113  createButton->setEnabled(false);
114  }
115 }
CCopasiTask * mpTask
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
static const std::string & getItemName(C_INT32 id)
std::vector< C_INT32 > mList
static const CDefaultOutputDescription & getItem(C_INT32 id)
void DefaultPlotDialog::slotToggleAll ( bool  flag)
protectedvirtualslot

connected to check box

Definition at line 118 of file DefaultplotDialog.cpp.

References fillList().

119 {
120  fillList();
121 }

Member Data Documentation

int DefaultPlotDialog::mIndex
protected

Definition at line 45 of file DefaultplotDialog.h.

Referenced by slotCreate(), and slotSelect().

std::vector< C_INT32 > DefaultPlotDialog::mList
protected

Definition at line 44 of file DefaultplotDialog.h.

Referenced by fillList(), and slotSelect().

CCopasiTask* DefaultPlotDialog::mpTask
protected

Definition at line 43 of file DefaultplotDialog.h.

Referenced by fillList(), setTask(), slotCreate(), and slotSelect().


The documentation for this class was generated from the following files: