Isis 3 Programmer Reference
Isis::ImageFileListWidget Class Reference

A colored, grouped cube list. More...

#include <ImageFileListWidget.h>

Inheritance diagram for Isis::ImageFileListWidget:
Inheritance graph
Collaboration diagram for Isis::ImageFileListWidget:
Collaboration graph

Classes

class  XmlHandler
 

Public Slots

void addImages (ImageList *images)
 This method adds the new images to the tree.
 
void removeImages (ImageList *images)
 Removes an imagelist from the FileListWidget.
 
void clear ()
 
void filterFileList ()
 

Public Member Functions

 ImageFileListWidget (Directory *directory=0, QWidget *parent=0)
 Constructor.
 
virtual ~ImageFileListWidget ()
 Destructor.
 
QProgressBargetProgress ()
 This method returns the progress bar.
 
void fromPvl (PvlObject &pvl)
 This method loads the state of this class from the pvl.
 
PvlObject toPvl () const
 This method writes the state of this class to a pvl.
 
void load (XmlStackedHandlerReader *xmlReader)
 This method pushes a new XmlHandler into the parser stack.
 
void save (QXmlStreamWriter &stream, Project *project, FileName newProjectRoot) const
 This method saves the FootprintColumns in the project and the settings associated with every column.
 
QList< QAction * > actions ()
 This method calls ImageTreeWidget::actions() which sets up a QAction that sets a default for the file list columns and returns a QList of QPointers that point to the QAction.
 
QList< QAction * > getViewActions ()
 This method calls ImageTreeWidget::getViewActions() which returns a list of FootprintColumns.
 
QList< QAction * > getExportActions ()
 This method creates a new QAction which is connected and when triggered will save the cube list.
 

Static Public Member Functions

static QWidgetgetLongHelp (QWidget *fileListContainer=NULL)
 This method creates a QWidget that displays a long help message explaining the tool.
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event)
 This method takes an event and gets all of the FootprintColumns, adds them to the menu, then it pops up the menu at the location of event.
 

Private Slots

void saveList ()
 This method saves the list to the choosen output file.
 

Private Member Functions

void save (QXmlStreamWriter &stream, QTreeWidgetItem *itemToWrite) const
 This method saves the QTreeWidgetItem and the settings associated with the QTreeWidgetItem to the stream.
 
ImageTreeWidget::ImagePosition find (const Image *image) const
 This method takes an image and finds it's position.
 
void restoreExpandedStates (QVariant expandedStates, QTreeWidgetItem *item)
 This method returns the QTreeWidgetItem to it's expanded state.
 
QVariant saveExpandedStates (QTreeWidgetItem *item)
 This method saves the the expanded state of item.
 

Private Attributes

QPointer< ProgressBarm_progress
 The ProgressBar of the ImageFileListWidget Serialized (file) version of this object.
 
QScopedPointer< PvlObjectm_serialized
 
QToolBarm_searchToolbar
 Tool bar for the FileList widget to search.
 
QLineEdit * m_searchLineEdit
 
QLabel * m_fileCount
 
ImageTreeWidgetm_tree
 Tree item associated with this mosaic item.
 
Directorym_directory
 The directory of the project.
 

Detailed Description

A colored, grouped cube list.

Author
2011-07-29 Steven Lambright
History

2011-07-29 Steven Lambright - Expansion state is now stored in the project file. This change will cause older versions of qmos to fail to read newer project files. References #275.

2011-08-12 Steven Lambright - Added export options, references #342

2011-08-29 Steven Lambright - Reworded save file list export action, references #342

2011-09-27 Steven Lambright - Improved user documentation

2012-06-22 Tracie Sucharski - Adapted from MosaicFileListWidget.

2012-09-12 Steven Lambright - Added save/load from XML capabilities.

2012-10-02 Steven Lambright - Added context menu to show/hide the various columns

2013-03-19 Steven Lambright - Added setDefaultFileListCols().

2013-06-17 Jeannie Backer, Tracie Sucharski, and Stuart Sides - replaced setDefaultFileListCols() with actions() to call setDefaultFileListCols() from ImageTreeWidget.

2014-09-05 Kim Oyama - Modified XmlHandler::startElement and save().

2016-04-28 Tracie Sucharski - Modified to use Qt5 and v006 libraries.

2016-06-07 Makayla Shepherd - Updated documentation. Fixes #3962.

2016-09-14 Ian Humphrey - Modified getLongHelp() - replaced deprecated static QPixmap::grabWidget with QWidget::grab (Qt5). Fixes #4304.

2017-07-18 Cole Neubauer - Added removeImages slot to be able to remove from the ImageFileList in IPCE Fixes #4996

2017-08-22 Cole Neuabuer - Added ability to search ImageFileListWidget. Fixes #1556

2018-05-15 Tracie Sucharski - Fixed xml serialization for Ipce project saves. Fixes #5422.

2018-07-09 Tracie Sucharski - Serialize the objectName for this view so that the view can be re-created with the same objectName for restoring the project state. Qt's save/restoreState use the objectName.

2018-10-04 Tracie Sucharski - When serializing images for ipce project saving, check for shapes in project if image for given id cannot be found. References #5495.

Definition at line 64 of file ImageFileListWidget.h.

Constructor & Destructor Documentation

◆ ImageFileListWidget()

Isis::ImageFileListWidget::ImageFileListWidget ( Directory * directory = 0,
QWidget * parent = 0 )

Constructor.

This method sets up the QWidget to show the ImageTreeWidget that is created using directory.

Parameters
directoryThe directory where you want the ImageTreeWidget to be made
parentThe QWidget parent

Definition at line 46 of file ImageFileListWidget.cpp.

References m_directory, m_progress, m_searchToolbar, and m_tree.

Referenced by getLongHelp().

◆ ~ImageFileListWidget()

Isis::ImageFileListWidget::~ImageFileListWidget ( )
virtual

Destructor.

Definition at line 98 of file ImageFileListWidget.cpp.

References m_directory, and m_progress.

Member Function Documentation

◆ actions()

QList< QAction * > Isis::ImageFileListWidget::actions ( )

This method calls ImageTreeWidget::actions() which sets up a QAction that sets a default for the file list columns and returns a QList of QPointers that point to the QAction.

Returns
QList<QAction *> The QList of QPointers that point to the QAction set up by ImageTreeWidget::actions().

Definition at line 230 of file ImageFileListWidget.cpp.

References m_tree.

Referenced by contextMenuEvent().

◆ addImages

void Isis::ImageFileListWidget::addImages ( ImageList * images)
slot

This method adds the new images to the tree.

Parameters
imagesImageList containing all of the images that need to be added to the tree.

Definition at line 342 of file ImageFileListWidget.cpp.

References find(), m_progress, m_tree, Isis::ImageList::name(), restoreExpandedStates(), and saveExpandedStates().

Referenced by Isis::ImageFileListViewWorkOrder::execute(), and Isis::Footprint2DView::onItemsAdded().

◆ clear

void Isis::ImageFileListWidget::clear ( )
slot

Definition at line 906 of file ImageFileListWidget.cpp.

◆ contextMenuEvent()

void Isis::ImageFileListWidget::contextMenuEvent ( QContextMenuEvent * event)
protected

This method takes an event and gets all of the FootprintColumns, adds them to the menu, then it pops up the menu at the location of event.

Parameters
eventA QContextMenuEvent that is used to find the position of the mouse.

Definition at line 474 of file ImageFileListWidget.cpp.

References actions(), and m_tree.

◆ filterFileList

void Isis::ImageFileListWidget::filterFileList ( )
slot

Definition at line 878 of file ImageFileListWidget.cpp.

◆ find()

ImageTreeWidget::ImagePosition Isis::ImageFileListWidget::find ( const Image * image) const
private

This method takes an image and finds it's position.

Parameters
imageThe image we are trying to find.
Returns
ImageTreeWidget::ImagePosition The position of the image.

Definition at line 525 of file ImageFileListWidget.cpp.

References Isis::Image::id(), and Isis::PvlKeyword::isNamed().

Referenced by addImages().

◆ fromPvl()

void Isis::ImageFileListWidget::fromPvl ( PvlObject & pvl)

This method loads the state of this class from the pvl.

Parameters
pvlThe pvl that we are reading the state from.
Exceptions
IException::Io"Unable to read image file's list widget settings from Pvl"

Definition at line 119 of file ImageFileListWidget.cpp.

References Isis::IString::Convert(), Isis::IException::Io, m_tree, Isis::PvlObject::object(), Isis::toBool(), and Isis::IString::ToQt().

◆ getExportActions()

QList< QAction * > Isis::ImageFileListWidget::getExportActions ( )

This method creates a new QAction which is connected and when triggered will save the cube list.

Returns
QList<QAction *> The QList of the new QAction.

Definition at line 250 of file ImageFileListWidget.cpp.

References saveList().

◆ getLongHelp()

QWidget * Isis::ImageFileListWidget::getLongHelp ( QWidget * fileListContainer = NULL)
static

This method creates a QWidget that displays a long help message explaining the tool.

Returns
QWidget Returns the message QWidget that was made.

Definition at line 268 of file ImageFileListWidget.cpp.

References ImageFileListWidget().

◆ getProgress()

QProgressBar * Isis::ImageFileListWidget::getProgress ( )

This method returns the progress bar.

Returns
QProgressBar * Returns the ProgressBar

Definition at line 108 of file ImageFileListWidget.cpp.

References m_progress.

◆ getViewActions()

QList< QAction * > Isis::ImageFileListWidget::getViewActions ( )

This method calls ImageTreeWidget::getViewActions() which returns a list of FootprintColumns.

Returns
QList<QAction *> The QList of FootprintColumns.

Definition at line 240 of file ImageFileListWidget.cpp.

References m_tree.

◆ load()

void Isis::ImageFileListWidget::load ( XmlStackedHandlerReader * xmlReader)

This method pushes a new XmlHandler into the parser stack.

Parameters
xmlReaderThis is the parser stack.

Definition at line 613 of file ImageFileListWidget.cpp.

◆ removeImages

void Isis::ImageFileListWidget::removeImages ( ImageList * images)
slot

Removes an imagelist from the FileListWidget.

This would normally be handled elsewhere but for IPCE it needs a method to hide images and update the tree.

Parameters
ImageListcontaining the images to remove from the tree

Definition at line 446 of file ImageFileListWidget.cpp.

References m_tree.

Referenced by Isis::Footprint2DView::onItemRemoved(), and Isis::Footprint2DView::onMosItemRemoved().

◆ restoreExpandedStates()

void Isis::ImageFileListWidget::restoreExpandedStates ( QVariant expandedStates,
QTreeWidgetItem * item )
private

This method returns the QTreeWidgetItem to it's expanded state.

Parameters
expandedStatesThe expanded state that needs to be restored.
itemThe QTreeWidgetItem that will be restored to it's expanded state.

Definition at line 558 of file ImageFileListWidget.cpp.

References restoreExpandedStates(), and Isis::toBool().

Referenced by addImages(), and restoreExpandedStates().

◆ save() [1/2]

void Isis::ImageFileListWidget::save ( QXmlStreamWriter & stream,
Project * project,
FileName newProjectRoot ) const

This method saves the FootprintColumns in the project and the settings associated with every column.

Parameters
streamThe QXmlStreamWriter that saves the FootprintColumns.
projectThe current project being saved.
newProjectRootThis is not used.

Definition at line 626 of file ImageFileListWidget.cpp.

References m_tree, and save().

Referenced by Isis::Directory::save(), Isis::Footprint2DView::save(), save(), and save().

◆ save() [2/2]

void Isis::ImageFileListWidget::save ( QXmlStreamWriter & stream,
QTreeWidgetItem * itemToWrite ) const
private

This method saves the QTreeWidgetItem and the settings associated with the QTreeWidgetItem to the stream.

Parameters
streamThe stream that is saving the QTreeWidgetItem and the settings.
itemToWriteThe QTreeWidgetItem that is being saved.

Definition at line 689 of file ImageFileListWidget.cpp.

References m_tree, and save().

◆ saveExpandedStates()

QVariant Isis::ImageFileListWidget::saveExpandedStates ( QTreeWidgetItem * item)
private

This method saves the the expanded state of item.

Parameters
itemThe QTreeWidgetItem that we will save the expanded state of.
Returns
QVariant The expanded state of item.

Definition at line 589 of file ImageFileListWidget.cpp.

References saveExpandedStates().

Referenced by addImages(), and saveExpandedStates().

◆ saveList

void Isis::ImageFileListWidget::saveList ( )
privateslot

This method saves the list to the choosen output file.

Definition at line 494 of file ImageFileListWidget.cpp.

References m_tree.

Referenced by getExportActions().

◆ toPvl()

PvlObject Isis::ImageFileListWidget::toPvl ( ) const

This method writes the state of this class to a pvl.

Returns
PvlObject The pvl that we are writing too.

Definition at line 183 of file ImageFileListWidget.cpp.

References Isis::IString::Convert(), m_tree, Isis::IString::ToQt(), and Isis::toString().

Member Data Documentation

◆ m_directory

Directory* Isis::ImageFileListWidget::m_directory
private

The directory of the project.

Definition at line 137 of file ImageFileListWidget.h.

Referenced by ImageFileListWidget(), and ~ImageFileListWidget().

◆ m_fileCount

QLabel* Isis::ImageFileListWidget::m_fileCount
private

Definition at line 133 of file ImageFileListWidget.h.

◆ m_progress

QPointer<ProgressBar> Isis::ImageFileListWidget::m_progress
private

The ProgressBar of the ImageFileListWidget Serialized (file) version of this object.

Definition at line 127 of file ImageFileListWidget.h.

Referenced by addImages(), getProgress(), ImageFileListWidget(), and ~ImageFileListWidget().

◆ m_searchLineEdit

QLineEdit* Isis::ImageFileListWidget::m_searchLineEdit
private

Definition at line 132 of file ImageFileListWidget.h.

◆ m_searchToolbar

QToolBar* Isis::ImageFileListWidget::m_searchToolbar
private

Tool bar for the FileList widget to search.

Definition at line 131 of file ImageFileListWidget.h.

Referenced by ImageFileListWidget().

◆ m_serialized

QScopedPointer<PvlObject> Isis::ImageFileListWidget::m_serialized
private

Definition at line 129 of file ImageFileListWidget.h.

◆ m_tree

ImageTreeWidget* Isis::ImageFileListWidget::m_tree
private

Tree item associated with this mosaic item.

Definition at line 136 of file ImageFileListWidget.h.

Referenced by actions(), addImages(), contextMenuEvent(), fromPvl(), getViewActions(), ImageFileListWidget(), removeImages(), save(), save(), saveList(), and toPvl().


The documentation for this class was generated from the following files: