Isis 3.0 Programmer Reference
Back | Home
RemoveImagesWorkOrder.cpp
Go to the documentation of this file.
1 
23 #include "RemoveImagesWorkOrder.h"
24 
25 #include <QDebug>
26 #include <QMessageBox>
27 
28 #include "IException.h"
29 #include "ImageList.h"
30 #include "Progress.h"
31 #include "Project.h"
32 #include "ProjectItem.h"
33 #include "ProjectItemModel.h"
34 
35 namespace Isis {
36 
37  RemoveImagesWorkOrder::RemoveImagesWorkOrder(Project *project) : WorkOrder(project) {
38 
39  QAction::setText(tr("&Delete images from project..."));
40  QUndoCommand::setText(tr("Delete images from project"));
41 
43  }
44 
45 
46  RemoveImagesWorkOrder::RemoveImagesWorkOrder(const RemoveImagesWorkOrder &other) :
47  WorkOrder(other) {
48  }
49 
50 
51  RemoveImagesWorkOrder::~RemoveImagesWorkOrder() {
52  }
53 
54 
55  RemoveImagesWorkOrder *RemoveImagesWorkOrder::clone() const {
56  return new RemoveImagesWorkOrder(*this);
57  }
58 
59 
67 
68  return (images->count() > 0);
69  }
70 
71 
72 
74 
75  bool success = WorkOrder::execute();
76  return success;
77  //TODO: 2016-07-29 TLS Should I ask if files should be deleted from disk also?
78  }
79 
80 
82  qDebug()<<"RemoveImagesWorkOrder::syncRedo project()->directory()->model() = "<<project()->directory()->model();
83  ProjectItem *currentItem = project()->directory()->model()->currentItem();
84  project()->directory()->model()->removeItem(currentItem);
85 // project()->removeImages(imageList());
86  }
87 }
$Date$ $Revision$
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
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1116
ProjectItem * currentItem()
Returns the current item of the internal selection model.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
Definition: Directory.cpp:828
Parent class for anything that performs an action in Project.
Definition: WorkOrder.h:104
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
Directory * directory() const
Returns the directory associated with this Project.
Definition: Project.cpp:824
bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
void setModifiesDiskState(bool changesProjectOnDisk)
.
Definition: WorkOrder.cpp:1531
$Date$ $Revision$
virtual bool isExecutable(ImageList *images)
Determines if we can remove this ImageList.
Represents an item of a ProjectItemModel in Qt&#39;s model-view framework.
Definition: ProjectItem.h:113
Removes selected images from current project.
virtual bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
Definition: WorkOrder.cpp:1078
void syncRedo()
This method is designed to be implemented by children work orders.

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:28:15