26 #include <QMessageBox> 29 #include "ImageList.h" 37 RemoveImagesWorkOrder::RemoveImagesWorkOrder(
Project *project) :
WorkOrder(project) {
41 QAction::setText(
"&Delete images from project...");
54 RemoveImagesWorkOrder::~RemoveImagesWorkOrder() {
86 long itemCount = selectedItems.count();
88 if (selectedItems.at(0)->isImage()) {
89 QUndoCommand::setText(
"&Delete image " + selectedItems.at(0)->image()->fileName() +
" from project...");
91 else if (selectedItems.at(0)->isImageList()) {
92 QUndoCommand::setText(
"&Delete " + QString::number(selectedItems.at(0)->imageList()->count(), 10) +
" images from project...");
105 totalCount += item->
imageList()->count();
106 imageListAdded.append(item->
imageList());
112 foreach (
Image *image, images) {
118 QUndoCommand::setText(
"&Delete " + QString::number(totalCount, 10) +
" images from project...");
145 foreach (
ProjectItem *selectedItem, selectedItems) {
150 foreach (
ImageList* projectImageList, projectImageLists) {
151 projectImageList->
removeAll(selectedImage);
155 imageListToProcess.append(selectedItem->
imageList());
156 needToRemoveItems.append(selectedItem);
160 "Item cannot be removed from the project.",
166 foreach (
ImageList* projectImageList, projectImageLists) {
167 projectImageList->
removeAll(selectedImage);
bool isImageList() const
Returns true if an ImageList is stored in the data of the item.
Internalizes a list of images and allows for operations on the entire list.
The main project for ipce.
bool isImage() const
Returns true if an Image is stored in the data of the item.
int removeAll(Image *const &value)
Removes all occurances of an image.
virtual bool setupExecution()
This sets up the state for the work order.
ImageList * imageList() const
Returns the ImageList stored in the data of the item.
static QStringList images(QStringList)
Verify that the input fileNames are image files.
void execute()
Remove any selected items from the project directory.
Directory * directory() const
Returns the directory associated with this Project.
virtual void removeItems(QList< ProjectItem *> items)
Removes a list of items and their children from the model.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Provide Undo/redo abilities, serialization, and history for an operation.
#define _FILEINFO_
Macro for the filename and line number.
A type of error that could only have occurred due to a mistake on the user's part (e...
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
This represents a cube in a project-based GUI interface.
Image * image() const
Returns the Image stored in the data of the item.
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
void append(Image *const &value)
Appends an image to the image list.
bool setupExecution()
Set up the execution.
void setModifiesDiskState(bool changesProjectOnDisk)
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
virtual bool isExecutable(ImageList *images)
Determines if we can remove this ImageList.
QList< ProjectItem * > selectedItems()
Returns a list of the selected items of the internal selection model.
Represents an item of a ProjectItemModel in Qt's model-view framework.
Removes selected images from current project.
Namespace for ISIS/Bullet specific routines.
Project * project() const
Returns the Project this WorkOrder is attached to.
ImageList * imageList()
Returns a pointer to the ImageList for this WorkOrder.
void setClean(bool value)
Function to change the clean state of the project.