USGS

Isis 3.0 Object Programmers' Reference

Home

CnetEditorViewWorkOrder.cpp
Go to the documentation of this file.
1 
24 
25 #include <QtDebug>
26 
27 #include <QFileDialog>
28 #include <QInputDialog>
29 #include <QMessageBox>
30 
31 #include "CnetEditorWidget.h"
32 #include "Control.h"
34 #include "Directory.h"
35 #include "MosaicSceneItem.h"
36 #include "MosaicSceneWidget.h"
37 #include "Project.h"
38 
39 namespace Isis {
40 
41  CnetEditorViewWorkOrder::CnetEditorViewWorkOrder(Project *project) :
42  WorkOrder(project) {
43  QAction::setText(tr("View &Network..."));
44  }
45 
46 
47  CnetEditorViewWorkOrder::CnetEditorViewWorkOrder(const CnetEditorViewWorkOrder &other) :
48  WorkOrder(other) {
49  }
50 
51 
52  CnetEditorViewWorkOrder::~CnetEditorViewWorkOrder() {
53  }
54 
55 
56  CnetEditorViewWorkOrder *CnetEditorViewWorkOrder::clone() const {
57  return new CnetEditorViewWorkOrder(*this);
58  }
59 
60 
62  return (controls.count() == 1);
63  }
64 
65 
67  bool success = WorkOrder::execute();
68 
69  if (success) {
70  QUndoCommand::setText(tr("View control network [%1] in new cnet editor view")
71  .arg(controlList().first()->displayProperties()->displayName()));
72  }
73 
74  return success;
75  }
76 
77 
78  bool CnetEditorViewWorkOrder::dependsOn(WorkOrder *other) const {
79  // depend on types of ourselves.
80  return dynamic_cast<CnetEditorViewWorkOrder *>(other);
81  }
82 
83 
85  project()->directory()->addCnetEditorView(controlList().first());
86  }
87 
88 
90  delete project()->directory()->cnetEditorViews().last();
91  }
92 }
93