15 #include <QtCore/QString>
16 #include <QtCore/QFileInfo>
25 #include <QtCore/QtDebug>
32 if (index >= group->
size())
33 return QString::fromLatin1(
"INVALID");
35 if (type) *type = group->
getType(index);
79 return QString::fromUtf8(
"INVALID");
86 return QString::fromLatin1(
"INVALID");
90 const std::string & name,
96 const QString & value)
98 if (index >= group->
size())
116 DOUBLE = value.toDouble(&ok);
118 if (!ok)
return false;
120 return group->
setValue(index, DOUBLE);
124 INT = value.toInt(&ok);
126 if (!ok)
return false;
132 UINT = value.toUInt(&ok);
134 if (!ok)
return false;
136 return group->
setValue(index, UINT);
140 UINT = value.toUShort(&ok);
142 if (!ok)
return false;
144 if (UINT == 1) BOOL =
true;
145 else if (UINT == 0) BOOL =
false;
148 return group->
setValue(index, BOOL);
154 return group->
setValue(index, STRING);
158 CN = std::string(
TO_UTF8(value));
175 const std::string & name,
176 const QString & value)
183 qDebug() <<
"Filename on checkSelection = " << file;
186 if (QFileInfo(file).exists())
190 "Overwrite existing file " + file +
"?",
191 QMessageBox::Ok | QMessageBox::Cancel,
192 QMessageBox::Cancel);
196 "The file is read-only. Please select another file!",
197 QMessageBox::Ok, QMessageBox::Ok);
198 return QMessageBox::Cancel;
202 return QMessageBox::Ok;
208 size_t i, imax = vs.size();
210 for (i = 0; i < imax; ++i) qsl +=
FROM_UTF8(vs[i]);
virtual const std::string & getName(const size_t &index) const
size_t getIndex(const std::string &name) const
CCopasiParameter::Type getType(const std::string &name) const
bool setParameterValue(CCopasiParameterGroup *group, const size_t &index, const QString &value)
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
CRegisteredObjectName * pCN
void vectorOfStrings2QStringList(std::vector< std::string > vs, QStringList &qsl)
C_INT32 checkSelection(const QString &file)
bool setValue(const std::string &name, const CType &value)
static bool isWritable(const std::string &path)
QString getParameterValue(const CCopasiParameterGroup *group, const size_t &index, CCopasiParameter::Type *type)
const CCopasiParameter::Value & getValue(const std::string &name) const
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)