Isis 3.0 Programmer Reference
Back | Home
TargetGetInfoWorkOrder.cpp
Go to the documentation of this file.
1 
23 #include "TargetGetInfoWorkOrder.h"
24 
25 #include <QFileDialog>
26 #include <QInputDialog>
27 #include <QtDebug>
28 
29 #include "Directory.h"
30 #include "IException.h"
31 #include "Project.h"
32 #include "TargetBody.h"
33 #include "TargetInfoWidget.h"
34 
35 namespace Isis {
36 
42  WorkOrder(project) {
43  QAction::setText(tr("Get Info...") );
44  }
45 
46 
52  WorkOrder(other) {
53  }
54 
55 
60  }
61 
62 
68  return new TargetGetInfoWorkOrder(*this);
69  }
70 
71 
79  if (!targetBody)
80  return false;
81 
82  // if we already have a view for this target, don't redisplay
84  for (int i = 0; i < existingViews.size(); i++) {
85  if (existingViews.at(i)->objectName() == targetBody->displayProperties()->displayName() )
86  return false;
87  }
88 
89  return true;
90  }
91 
92 
98  bool success = WorkOrder::execute();
99 
100  if (success) {
101  QString targetDisplayName = targetBody()->displayProperties()->displayName();
102  QUndoCommand::setText(tr("Get %1 target info").arg(targetDisplayName));
103 
105  internalData.append(targetDisplayName);
106  setInternalData(internalData);
107  }
108 
109  return success;
110  }
111 
112 
119  // depend on types of ourselves.
120  return dynamic_cast<TargetGetInfoWorkOrder *>(other);
121  }
122 
123 
128  TargetInfoWidget *targetInfoWidget =
130 
131 
132  if (!targetInfoWidget) {
133  QString msg = "error displaying target info";
135  }
136  }
137 
138 
143  //delete project()->directory()->cnetEditorViews().last();
144  }
145 }
146 
void syncRedo()
Redisplays the Target info.
TargetGetInfoWorkOrder(Project *project)
Creates a WorkOrder that will retrieve Target info.
The main project for cnetsuite.
Definition: Project.h:105
bool dependsOn(WorkOrder *other) const
Determines whether another WorkOrder depends upon TargetGetInfoWorkOrder.
bool execute()
Attempt to retrieve the Target info and view it.
TargetInfoWidget * addTargetInfoView(TargetBodyQsp target)
Add target body data view widget to the window.
Definition: Directory.cpp:752
Project * project() const
Returns the Project this WorkOrder is attached to.
Definition: WorkOrder.cpp:1116
This is a child of class WorkOrder which is used for anything that performs an action in a Project...
virtual bool isExecutable(TargetBodyQsp targetBody)
Determines if we already have a view for the target.
QStringList internalData() const
Gets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1186
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:154
QList< TargetInfoWidget * > targetInfoViews()
Accessor for the list of TargetInfoWidgets currently available.
Definition: Directory.cpp:992
TargetBodyQsp targetBody()
WorkOrder::targetBody.
Definition: WorkOrder.cpp:666
Parent class for anything that performs an action in Project.
Definition: WorkOrder.h:104
QSharedPointer< TargetBody > TargetBodyQsp
Defines A smart pointer to a TargetBody obj.
Definition: TargetBody.h:224
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
Widget for displaying information about a target.
void syncUndo()
Deletes the last view.
Directory * directory() const
Returns the directory associated with this Project.
Definition: Project.cpp:824
virtual TargetGetInfoWorkOrder * clone() const
Returns a copy of this TargetGetInfoWorkOrder instance.
Isis exception class.
Definition: IException.h:99
virtual bool execute()
The (child) implementation of this method should prompt the user/gather state by any means necessary...
Definition: WorkOrder.cpp:1078
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
Definition: WorkOrder.cpp:1130

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:30:38