Isis 3 Programmer Reference
SetActiveImageListWorkOrder.cpp
Go to the documentation of this file.
1
22
23#include <QMessageBox>
24#include <QtDebug>
25
26#include "Directory.h"
27#include "IException.h"
28#include "ImageList.h"
29#include "Project.h"
30
31namespace Isis {
32
38 WorkOrder(project) {
39 // This work order is not undoable
40 m_isUndoable = false;
41
42 QAction::setText(tr("Set Active Image List") );
43 QUndoCommand::setText(tr("Set Active Image List"));
44 }
45
46
54
55
61
62
70
71
79 if (imageList->name() == "") {
80 return false;
81 }
82 if (project()->activeImageList()) {
83 if (project()->activeImageList()->name() == imageList->name()) {
84 return false;
85 }
86 }
87 return true;
88 }
89
90
103
104
111 try {
113 }
114 catch (IException &e) {
115 m_status = WorkOrderFinished;
116 QMessageBox::critical(NULL, tr("Error"), tr(e.what()));
117 }
118 }
119}
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Isis exception class.
Definition IException.h:91
Internalizes a list of images and allows for operations on the entire list.
Definition ImageList.h:55
QString name() const
Get the human-readable name of this image list.
The main project for ipce.
Definition Project.h:289
void setActiveImageList(QString displayName)
Set the Active ImageList from the displayName which is saved in project.xml.
Definition Project.cpp:1954
This is a child of class WorkOrder which is used for anything that performs an action in a Project.
virtual bool setupExecution()
Simply calls the parent WorkOrder::setupExecution().
virtual void execute()
Executes this work order.
virtual SetActiveImageListWorkOrder * clone() const
Returns a copy of this SetActiveImageListWorkOrder instance.
SetActiveImageListWorkOrder(Project *project)
Creates a not undable WorkOrder that will set the active ImageList in the project.
virtual bool isExecutable(ImageList *imageList)
Determines if we can set this imageList as active.
Provide Undo/redo abilities, serialization, and history for an operation.
Definition WorkOrder.h:311
@ WorkOrderFinished
This is used for work orders that will not undo or redo (See createsCleanState())
Definition WorkOrder.h:331
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
Definition WorkOrder.h:523
virtual bool setupExecution()
This sets up the state for the work order.
Project * project() const
Returns the Project this WorkOrder is attached to.
ImageList * imageList()
Returns a pointer to the ImageList for this WorkOrder.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16