16 #include <QStringList> 17 #include <QTextStream> 26 mCustomFile = customFile;
52 std::cout <<
"TODO IMPLEMENT: void Presets::remove()" << std::endl;
82 retval = retval.
tryDescend(
"Preset",
"name", presetName);
87 retval = retval.
descend(
"Preset",
"name", presetName);
98 QString presetName = element.attribute(
"name");
99 if(presetName.isEmpty())
103 file = file.
descend(
"Presets");
112 QTextStream stream(stdout);
114 element.save(stream, 4);
IMAGE_MODALITY getId() const
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(IMAGE_MODALITY tag=imUNKNOWN)
returns a list of the preset names for the given tag
void addCustomPreset(QDomElement &element)
adds a custom preset
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.
virtual QStringList generatePresetList(IMAGE_MODALITY tag)
internally generate the preset list
XmlOptionFile descend(QString element) const
step one level down in the xml tree
Namespace for all CustusX production code.