23 #include "ExportControlNetWorkOrder.h" 26 #include <QFileDialog> 27 #include <QInputDialog> 30 #include "ControlList.h" 50 QAction::setText(tr(
"&Export Control Network..."));
51 QUndoCommand::setText(tr(
"Export Control Network..."));
103 return (controls->count() == 1);
134 if (controls.count() > 0) {
143 foreach (
Control *control, *list) {
144 cnetChoices[control] = tr(
"%1/%2").arg(list->
name())
152 QString choice = QInputDialog::getItem(NULL, tr(
"Select Control"),
153 tr(
"Please choose a control to export."), cnetNames, 0,
false, &success);
155 control = cnetChoices.key(choice);
161 QString destination =
162 QFileDialog::getSaveFileName(NULL, QString(
"Export Control Network"),
165 if (destination.isEmpty()) {
200 QString currentLocation = control->
fileName();
201 if (!QFile::copy(currentLocation, destination) ) {
This represents an ISIS control net in a project-based GUI interface.
bool isExecutable(ControlList *controls)
Determines if we can export a control net.
The main project for ipce.
File name manipulation and expansion.
Write a project control network to a user-specified location.
Control * control(QString id)
Accessor for if the project is clearing or not.
Maintains a list of Controls so that control nets can easily be copied from one Project to another...
virtual bool setupExecution()
This sets up the state for the work order.
QString displayName() const
Returns the display name.
virtual bool setupExecution()
Prepares for exporting a control net by soliciting information from the user.
virtual void postExecution()
Display any warnings that occurred during the asynchronous computations.
Provide Undo/redo abilities, serialization, and history for an operation.
bool m_isSynchronous
This is defaulted to true.
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
virtual void setData(Context)
Sets the context data for this WorkOrder.
QList< ControlList * > controls()
Return controls in project.
virtual ExportControlNetWorkOrder * clone() const
Clones this work order.
ControlDisplayProperties * displayProperties()
Access a pointer to the display properties for the control network.
ExportControlNetWorkOrder(Project *project)
Creates a work order for exporting a control network from the project.
QString name() const
Get the human-readable name of this control list.
virtual void execute()
Executes the work order.
~ExportControlNetWorkOrder()
Destructor.
Namespace for ISIS/Bullet specific routines.
QString m_warning
Stores any errors that may have occurred during export.
Project * project() const
Returns the Project this WorkOrder is attached to.
QString id() const
Access the unique ID associated with this Control.
QPointer< ControlList > controlList()
Returns the Control List for this WorkOrder (a list of control networks).
QString fileName() const
Access the name of the control network file associated with this Control.
QStringList internalData() const
Gets the internal data for this WorkOrder.
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.