23 #include "TargetBodyList.h" 30 #include <QInputDialog> 32 #include <QProgressDialog> 33 #include <QtConcurrentMap> 34 #include <QXmlStreamWriter> 41 #include "XmlStackedHandlerReader.h" 135 emit countChanged(count());
148 emit countChanged(count());
158 bool countChanging = count();
161 emit countChanged(count());
175 emit countChanged(count());
194 emit countChanged(count());
210 emit countChanged(count());
227 emit countChanged(count());
241 emit countChanged(count());
254 emit countChanged(count());
267 emit countChanged(count());
284 emit countChanged(count());
300 emit countChanged(count());
311 emit countChanged(count());
322 emit countChanged(count());
339 emit countChanged(count());
356 if (count() != other.count()) {
357 emit countChanged(count());
373 emit countChanged(count());
387 emit countChanged(count());
401 emit countChanged(count());
419 emit countChanged(count());
437 emit countChanged(count());
455 emit countChanged(count());
473 emit countChanged(count());
488 bool countChanging = (rhs.count() != count());
492 emit countChanged(count());
507 bool countChanging = (rhs.count() != count());
514 emit countChanged(count());
894 const QString &localName,
895 const QString &qName,
896 const QXmlAttributes &atts) {
897 if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
898 if (localName ==
"TargetBodyList") {
899 QString
name = atts.value(
"name");
900 QString
path = atts.value(
"path");
902 if (!
name.isEmpty()) {
903 m_TargetBodyList->setName(
name);
906 if (!
path.isEmpty()) {
907 m_TargetBodyList->setPath(
path);
910 else if (localName ==
"target") {
935 const QString &localName,
936 const QString &qName) {
937 if (localName ==
"TargetBodyList") {
938 XmlHandler handler(m_TargetBodyList, m_project);
942 reader.setErrorHandler(&handler);
944 QString TargetBodyListXmlPath = m_project->targetBodyRoot() +
"/" +
945 m_TargetBodyList->path() +
"/targets.xml";
946 QFile file(TargetBodyListXmlPath);
948 if (!file.open(QFile::ReadOnly)) {
950 QString(
"Unable to open [%1] with read access")
951 .arg(TargetBodyListXmlPath),
955 QXmlInputSource xmlInputSource(&file);
956 if (!reader.parse(xmlInputSource))
958 tr(
"Failed to open target body list XML [%1]").arg(TargetBodyListXmlPath),
962 return XmlStackedHandler::endElement(namespaceURI, localName, qName);
TargetBodyList * m_TargetBodyList
The TargetBodyList to read into/save from.
QString m_name
This functor is used for copying the TargetBody objects between two projects quickly.
The main project for ipce.
Project * m_project
The project that contains the TargetBodies.
bool removeOne(TargetBodyQsp const &value)
Removes the first occurrence of a TargetBody from the list.
File name manipulation and expansion.
TargetBodyQsp takeAt(int i)
Removes and returns the TargetBody at a specific index.
TargetBodyList & operator<<(const QList< TargetBodyQsp > &other)
Appends another TargetBodyList to the list.
TargetBodyQsp takeFirst()
Removes and returns the first TargetBody in the list.
List for holding TargetBodies.
void removeLast()
Removes the last TargetBody from the list.
A type of error that occurred when performing an actual I/O operation.
QString path() const
Get the path to these target body objects in the list (relative to project root). ...
QDebug operator<<(QDebug dbg, const Isis::Angle &angleToPrint)
Display an Angle for a debugging statement.
void removeFirst()
Removes the first TargetBody from the list.
~TargetBodyList()
Create an target body list from a list of target body file names.
XmlReader for working with TargetBody XML files.
QString m_path
This stores the directory name that contains the TargetBody objects in this list. ...
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
int removeAll(TargetBodyQsp const &value)
Removes all occurrences of a TargetBody and returns the number removed.
void removeAt(int i)
Removes the TargetBody at a specific index.
void push_front(TargetBodyQsp const &value)
Insertes a TargetBody at the front of the list.
#define _FILEINFO_
Macro for the filename and line number.
XmlHandler(TargetBodyList *TargetBodyList, Project *project)
Change the visibility of the display name.
void append(TargetBodyQsp const &value)
Appends a TargetBody to the list.
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
void insert(int i, TargetBodyQsp const &value)
Inserts a TargetBody at a specific index.
void setPath(QString newPath)
Set the relative path (from the project root) to this target body list's folder.
iterator erase(iterator pos)
Erases the TargetBody associated with an iterator.
void swap(QList< TargetBodyQsp > &other)
Swaps the list with another TargetBodyList.
TargetBodyList & operator+=(const QList< TargetBodyQsp > &other)
Appends another TargetBodyList to the list.
void push_back(TargetBodyQsp const &value)
Appends a TargetBody to the end of the list.
QString name() const
Get the human-readable name of this target body list.
TargetBodyQsp takeLast()
Removes and returns the last TargetBody in the list.
TargetBodyList & operator=(const QList< TargetBodyQsp > &rhs)
Assignment operator for a QList of TargetBodyQsp.
void clear()
clears the list.
Namespace for ISIS/Bullet specific routines.
TargetBodyList(QString name, QString path, QObject *parent=NULL)
Create an target body list from an target body list name and path (does not read TargetBody objects)...
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle an XML end element.
void setName(QString newName)
Gets a list of pre-connected actions that have to do with display, such as color, alpha...
Manage a stack of content handlers for reading XML files.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Delete all of the contained TargetBody objects from disk (see TargetBody::deleteFromDisk()) ...
void prepend(TargetBodyQsp const &value)
Inserts a TargetBody at the front of the list.