Isis 3.0
Home
ImageFileListWidget.h
Go to the documentation of this file.
1 #ifndef ImageFileListWidget_H
2 #define ImageFileListWidget_H
3 
4 #include <QWidget>
5 
6 #include <QPointer>
7 #include <QScopedPointer>
8 
9 #include "ImageList.h"
10 #include "ImageTreeWidget.h"
11 #include "PvlObject.h"
12 
13 class QProgressBar;
14 class QSettings;
15 class QTreeWidgetItem;
16 
17 namespace Isis {
18  class Directory;
19  class ImageTreeWidgetItem;
20  class ProgressBar;
21 
50  class ImageFileListWidget : public QWidget {
51  Q_OBJECT
52  public:
53  ImageFileListWidget(Directory *directory = 0, QWidget *parent = 0);
54  virtual ~ImageFileListWidget();
55 
57  void fromPvl(PvlObject &pvl);
58  PvlObject toPvl() const;
59  void load(XmlStackedHandlerReader *xmlReader);
60  void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const;
61 
65 
66  static QWidget *getLongHelp(QWidget *fileListContainer = NULL);
67 
68  public slots:
69  void addImages(ImageList *images);
70 
71  protected:
72  void contextMenuEvent(QContextMenuEvent *event);
73 
74  private slots:
75  void saveList();
76 
77  private:
78  void save(QXmlStreamWriter &stream, QTreeWidgetItem *itemToWrite) const;
79 
80  ImageTreeWidget::ImagePosition find(const Image *image) const;
81  void restoreExpandedStates(QVariant expandedStates, QTreeWidgetItem *item);
82  QVariant saveExpandedStates(QTreeWidgetItem *item);
83 
84  private:
90  class XmlHandler : public XmlStackedHandler {
91  public:
92  XmlHandler(ImageFileListWidget *fileList);
93  ~XmlHandler();
94 
95  virtual bool startElement(const QString &namespaceURI, const QString &localName,
96  const QString &qName, const QXmlAttributes &atts);
97  virtual bool endElement(const QString &namespaceURI, const QString &localName,
98  const QString &qName);
99 
100  private:
101  Q_DISABLE_COPY(XmlHandler);
102 
103  ImageFileListWidget *m_fileList;
104  ImageList *m_currentImageList;
105  QTreeWidgetItem *m_currentImageListItem;
106  QTreeWidgetItem *m_currentGroup;
107  };
108 
109  private:
110  QPointer<ProgressBar> m_progress;
111  QScopedPointer<PvlObject> m_serialized;
113  ImageTreeWidget *m_tree;
114  Directory *m_directory;
115  };
116 }
117 
118 #endif
119 
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:44
The main project for cnetsuite.
Definition: Project.h:105
File name manipulation and expansion.
Definition: FileName.h:111
void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
This method saves the FootprintColumns in the project and the settings associated with every column...
Definition: ImageFileListWidget.cpp:565
PvlObject toPvl() const
This method writes the state of this class to a pvl.
Definition: ImageFileListWidget.cpp:152
ImageFileListWidget(Directory *directory=0, QWidget *parent=0)
Constructor.
Definition: ImageFileListWidget.cpp:41
void load(XmlStackedHandlerReader *xmlReader)
This method pushes a new XmlHandler into the parser stack.
Definition: ImageFileListWidget.cpp:196
virtual ~ImageFileListWidget()
Destructor.
Definition: ImageFileListWidget.cpp:67
QList< QAction * > getExportActions()
This method creates a new QAction which is connected and when triggered will save the cube list...
Definition: ImageFileListWidget.cpp:228
QProgressBar * getProgress()
This method returns the progress bar.
Definition: ImageFileListWidget.cpp:77
void contextMenuEvent(QContextMenuEvent *event)
This method takes an event and gets all of the FootprintColumns, adds them to the menu...
Definition: ImageFileListWidget.cpp:424
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:47
void addImages(ImageList *images)
This method adds the new images to the tree.
Definition: ImageFileListWidget.cpp:320
This represents a cube in a project-based GUI interface.
Definition: Image.h:91
QList< QAction * > getViewActions()
This method calls ImageTreeWidget::getViewActions() which returns a list of FootprintColumns.
Definition: ImageFileListWidget.cpp:218
Definition: ImageTreeWidget.h:42
static QWidget * getLongHelp(QWidget *fileListContainer=NULL)
This method creates a QWidget that displays a long help message explaining the tool.
Definition: ImageFileListWidget.cpp:246
A colored, grouped cube list.
Definition: ImageFileListWidget.h:50
void fromPvl(PvlObject &pvl)
This method loads the state of this class from the pvl.
Definition: ImageFileListWidget.cpp:88
QList< QAction * > actions()
This method calls ImageTreeWidget::actions() which sets up a QAction that sets a default for the file...
Definition: ImageFileListWidget.cpp:208
Definition: ImageTreeWidget.h:82
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
Definition: Directory.h:106
his enables stack-based XML parsing of XML files.
Definition: XmlStackedHandlerReader.h:26