Isis Developer Reference
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 QLabel;
14 class QLineEdit;
15 class QProgressBar;
16 class QSettings;
17 class QToolBar;
18 class QTreeWidgetItem;
19 
20 namespace Isis {
21  class Directory;
22  class ImageTreeWidgetItem;
23  class ProgressBar;
24 
64  class ImageFileListWidget : public QWidget {
65  Q_OBJECT
66  public:
67  ImageFileListWidget(Directory *directory = 0, QWidget *parent = 0);
68  virtual ~ImageFileListWidget();
69 
71  void fromPvl(PvlObject &pvl);
72  PvlObject toPvl() const;
73  void load(XmlStackedHandlerReader *xmlReader);
74  void save(QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const;
75 
79 
80  static QWidget *getLongHelp(QWidget *fileListContainer = NULL);
81 
82  public slots:
83  void addImages(ImageList *images);
84  void removeImages(ImageList *images);
85  void clear();
86  void filterFileList();
87 
88  protected:
89  void contextMenuEvent(QContextMenuEvent *event);
90 
91  private slots:
92  void saveList();
93 
94  private:
95  void save(QXmlStreamWriter &stream, QTreeWidgetItem *itemToWrite) const;
96 
97  ImageTreeWidget::ImagePosition find(const Image *image) const;
98  void restoreExpandedStates(QVariant expandedStates, QTreeWidgetItem *item);
99  QVariant saveExpandedStates(QTreeWidgetItem *item);
100 
101  private:
107  class XmlHandler : public XmlStackedHandler {
108  public:
109  XmlHandler(ImageFileListWidget *fileList);
110  ~XmlHandler();
111 
112  virtual bool startElement(const QString &namespaceURI, const QString &localName,
113  const QString &qName, const QXmlAttributes &atts);
114  virtual bool endElement(const QString &namespaceURI, const QString &localName,
115  const QString &qName);
116 
117  private:
118  Q_DISABLE_COPY(XmlHandler);
119 
120  ImageFileListWidget *m_fileList;
121  ImageList *m_currentImageList;
122  QTreeWidgetItem *m_currentImageListItem;
123  QTreeWidgetItem *m_currentGroup;
124  };
125 
126  private:
127  QPointer<ProgressBar> m_progress;
128  QScopedPointer<PvlObject> m_serialized;
130 
131  QToolBar *m_searchToolbar;
132  QLineEdit *m_searchLineEdit;
133  QLabel *m_fileCount;
134 
135 
136  ImageTreeWidget *m_tree;
137  Directory *m_directory;
138  };
139 }
140 
141 #endif
FileName.h
QWidget
QProgressBar
Isis::IException::Io
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::ImageTreeWidgetItem
Definition: ImageTreeWidgetItem.h:20
Isis::Directory
Definition: Directory.h:271
Isis::ImageTreeWidget::ImageListNameType
@ ImageListNameType
Definition: ImageTreeWidget.h:49
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::ProgressBar
Definition: ProgressBar.h:15
Project.h
Isis::ImageFileListWidget::save
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:626
ImageFileListWidget.h
Isis::ImageFileListWidget::getProgress
QProgressBar * getProgress()
This method returns the progress bar.
Definition: ImageFileListWidget.cpp:108
Isis::ImageFileListWidget::getLongHelp
static QWidget * getLongHelp(QWidget *fileListContainer=NULL)
This method creates a QWidget that displays a long help message explaining the tool.
Definition: ImageFileListWidget.cpp:268
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::ImageTreeWidget::ImagePosition::index
int index() const
Definition: ImageTreeWidget.cpp:379
Isis::ImageFileListWidget::getViewActions
QList< QAction * > getViewActions()
This method calls ImageTreeWidget::getViewActions() which returns a list of FootprintColumns.
Definition: ImageFileListWidget.cpp:240
Isis::ImageFileListWidget::removeImages
void removeImages(ImageList *images)
Removes an imagelist from the FileListWidget.
Definition: ImageFileListWidget.cpp:446
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
QMenu
Directory.h
Isis::ImageFileListWidget
A colored, grouped cube list.
Definition: ImageFileListWidget.h:64
ImageTreeWidgetItem.h
Isis::ImageTreeWidgetItem::BlankColumn
@ BlankColumn
Definition: ImageTreeWidgetItem.h:51
Isis::ImageFileListWidget::addImages
void addImages(ImageList *images)
This method adds the new images to the tree.
Definition: ImageFileListWidget.cpp:342
Isis::ImageTreeWidget::updateViewActs
void updateViewActs()
Definition: ImageTreeWidget.cpp:247
Isis::ImageTreeWidget::createImageListNameItem
QTreeWidgetItem * createImageListNameItem(QString name)
Definition: ImageTreeWidget.cpp:173
Isis::TextFile
Provides access to sequential ASCII stream I/O.
Definition: TextFile.h:38
Isis::XmlStackedHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Definition: XmlStackedHandler.cpp:44
QTreeWidgetItem
Isis::PvlObject::objects
int objects() const
Returns the number of objects.
Definition: PvlObject.h:219
Isis::Image::fileName
QString fileName() const
Get the file name of the cube that this image represents.
Definition: Image.cpp:340
Image.h
Isis::ImageTreeWidgetItem::treeColumnToString
static QString treeColumnToString(TreeColumn)
Definition: ImageTreeWidgetItem.cpp:143
Isis::ImageFileListWidget::filterFileList
void filterFileList()
Definition: ImageFileListWidget.cpp:878
Isis::PvlObject::object
PvlObject & object(const int index)
Return the object at the specified index.
Definition: PvlObject.cpp:489
QToolBar
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::IString::Convert
IString Convert(const std::string &listofchars, const char &to)
Returns the string with all occurrences of any character in the "from" argument converted to the "to"...
Definition: IString.cpp:1196
Isis::ImageFileListWidget::actions
QList< QAction * > actions()
This method calls ImageTreeWidget::actions() which sets up a QAction that sets a default for the file...
Definition: ImageFileListWidget.cpp:230
Isis::ImageFileListWidget::~ImageFileListWidget
virtual ~ImageFileListWidget()
Destructor.
Definition: ImageFileListWidget.cpp:98
IString.h
Shape.h
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::ImageFileListWidget::getExportActions
QList< QAction * > getExportActions()
This method creates a new QAction which is connected and when triggered will save the cube list.
Definition: ImageFileListWidget.cpp:250
Isis::ImageList
Internalizes a list of images and allows for operations on the entire list.
Definition: ImageList.h:55
Isis::ImageTreeWidget::ImagePosition
Definition: ImageTreeWidget.h:82
Isis::ImageTreeWidget::ImageGroupType
@ ImageGroupType
Definition: ImageTreeWidget.h:48
Isis::ImageTreeWidget::getViewActions
QList< QAction * > getViewActions()
Definition: ImageTreeWidget.cpp:223
Isis::ImageTreeWidget::refit
void refit()
Definition: ImageTreeWidget.cpp:183
Isis::ImageTreeWidget::ImagePosition::group
int group() const
Definition: ImageTreeWidget.cpp:374
Isis::ImageTreeWidgetItem::TreeColumn
TreeColumn
Definition: ImageTreeWidgetItem.h:35
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
ImageTreeWidget.h
TextFile.h
Isis::ImageTreeWidget::groupInList
bool groupInList(QList< QTreeWidgetItem * >)
Definition: ImageTreeWidget.cpp:870
Isis::ImageTreeWidget::createGroup
QTreeWidgetItem * createGroup(QTreeWidgetItem *imageListItem, QString groupName="", int index=-1)
Definition: ImageTreeWidget.cpp:141
Isis::PvlObject::hasKeyword
bool hasKeyword(const QString &kname, FindOptions opts) const
See if a keyword is in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within ...
Definition: PvlObject.cpp:236
Isis::ImageTreeWidget::imagesInView
ImageList imagesInView()
Definition: ImageTreeWidget.cpp:321
Isis::ImageList::name
QString name() const
Get the human-readable name of this image list.
Definition: ImageList.cpp:724
ImageList.h
Isis::PvlContainer::name
QString name() const
Returns the container name.
Definition: PvlContainer.h:63
Isis::XmlStackedHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: XmlStackedHandler.cpp:55
Isis::Image
This represents a cube in a project-based GUI interface.
Definition: Image.h:107
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::ImageFileListWidget::load
void load(XmlStackedHandlerReader *xmlReader)
This method pushes a new XmlHandler into the parser stack.
Definition: ImageFileListWidget.cpp:613
Isis::ImageTreeWidgetItem::image
Image * image()
Definition: ImageTreeWidgetItem.cpp:59
Isis::ImageTreeWidget::actions
QList< QAction * > actions()
Definition: ImageTreeWidget.cpp:113
ProgressBar.h
IException.h
Isis::ImageTreeWidget::ImagePosition::isValid
bool isValid() const
Definition: ImageTreeWidget.cpp:384
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
Isis::Image::id
QString id() const
Get a unique, identifying string associated with this image.
Definition: Image.cpp:445
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::ImageFileListWidget::fromPvl
void fromPvl(PvlObject &pvl)
This method loads the state of this class from the pvl.
Definition: ImageFileListWidget.cpp:119
PvlObject.h
QMap< QString, QVariant >
Isis::ImageTreeWidget
Definition: ImageTreeWidget.h:42
Isis::ImageFileListWidget::clear
void clear()
Definition: ImageFileListWidget.cpp:906
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::ImageFileListWidget::ImageFileListWidget
ImageFileListWidget(Directory *directory=0, QWidget *parent=0)
Constructor.
Definition: ImageFileListWidget.cpp:46
Isis::ImageTreeWidgetItem::NameColumn
@ NameColumn
Definition: ImageTreeWidgetItem.h:36
Isis::ImageFileListWidget::contextMenuEvent
void contextMenuEvent(QContextMenuEvent *event)
This method takes an event and gets all of the FootprintColumns, adds them to the menu,...
Definition: ImageFileListWidget.cpp:474
QAction
XmlStackedHandlerReader.h
Isis::ImageTreeWidget::prepCube
ImageTreeWidgetItem * prepCube(ImageList *imageList, Image *image)
Definition: ImageTreeWidget.cpp:300
Isis::ImageFileListWidget::toPvl
PvlObject toPvl() const
This method writes the state of this class to a pvl.
Definition: ImageFileListWidget.cpp:183
Isis::ImageTreeWidgetItem::FootprintColumn
@ FootprintColumn
Definition: ImageTreeWidgetItem.h:37
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IString::ToQt
QString ToQt() const
Retuns the object string as a QString.
Definition: IString.cpp:869
Isis::ImageTreeWidget::addGroup
QTreeWidgetItem * addGroup(QString imageListName, QString groupName="", int index=-1)
Definition: ImageTreeWidget.cpp:129