16 #include <QStringList> 17 #include <QTextStream> 25 mCustomFile = customFile;
51 std::cout <<
"TODO IMPLEMENT: void Presets::remove()" << std::endl;
81 retval = retval.
tryDescend(
"Preset",
"name", presetName);
86 retval = retval.
descend(
"Preset",
"name", presetName);
97 QString presetName = element.attribute(
"name");
98 if(presetName.isEmpty())
102 file = file.
descend(
"Presets");
111 QTextStream stream(stdout);
113 element.save(stream, 4);
virtual void save()
saves the presets to file
Presets(XmlOptionFile presetFile, XmlOptionFile customFile)
QDomElement getElement()
return the current element
XmlOptionFile mPresetFile
< the name of the last custom preset removed
virtual void deleteCustomPreset(QString name)
deletes the custom preset with the given name if it exists
XmlOptionFile getCustomFile()
QString mLastCustomPresetRemoved
< the name of the last custom preset added
QStringList getPresetList(QString tag="")
returns a list of the preset names for the given tag
void addCustomPreset(QDomElement &element)
adds a custom preset
virtual QStringList generatePresetList(QString tag)
internally generate the preset list
bool isDefaultPreset(QString presetName)
Check is the preset is one of the "system presets".
QDomDocument getDocument()
returns the document
QString mLastCustomPresetAdded
void deleteNode()
Delete the current node.
void save()
save entire document.
void addDefaultPreset(QDomElement &element)
bool isNull() const
checks if this is null
void addPreset(XmlOptionFile &file, QDomElement &element)
XmlOptionFile getPresetNode(const QString &presetName)
Look for a preset with the given name. Create one if not found.
XmlOptionFile root() const
set the current element to root
virtual void remove()
removes the presets from file
void print(QDomElement element)
debugging function for printing xml elements
XmlOptionFile tryDescend(QString element, QString attributeName, QString attributeValue) const
Helper class for xml files used to store ssc/cx data.
XmlOptionFile descend(QString element) const
step one level down in the xml tree
Namespace for all CustusX production code.