File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
 |
Isis 3 Programmer Reference
|
Go to the documentation of this file.
26 #include <QFileDialog>
27 #include <QMessageBox>
28 #include <QRegularExpression>
32 #include "ProjectItemModel.h"
34 #include "TemplateList.h"
48 QAction::setText(tr(
"Import Registration Templates..."));
49 QUndoCommand::setText(tr(
"Import Registration Templates..."));
94 QString itemType = item->text();
97 return (itemType ==
"Registrations");
116 templateFileNames = QFileDialog::getOpenFileNames(
117 qobject_cast<QWidget *>(parent()),
118 "Import Registration Templates",
120 "Registrations (*.def);; All Files (*)");
122 if (!templateFileNames.isEmpty()) {
123 QUndoCommand::setText(tr(
"Import %1 Template(s)").arg(templateFileNames.count()));
147 "registrations/" + templateFolder.dirName() );
149 foreach (
FileName filename, templateFileNames) {
150 QFile::copy(filename.
expanded(), templateFolder.path() +
"/" + filename.
name());
151 m_list->append(
new Template(templateFolder.path() +
"/" + filename.
name(),
153 templateFolder.dirName()));
156 if (!m_list->isEmpty()) {
171 if (m_list &&
project()->templates().size() > 0) {
177 foreach (
Template *currentTemplate, *m_list) {
178 delete currentTemplate;
virtual bool setupExecution()
This sets up the state for the work order.
Provide Undo/redo abilities, serialization, and history for an operation.
ProjectItemModel * model()
Gets the ProjectItemModel for this directory.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
File name manipulation and expansion.
void setInternalData(QStringList data)
Sets the internal data for this WorkOrder.
void execute()
Imports the templates.
Add registration templates to a project.
void addTemplates(TemplateList *templateFiles)
Add new templates to m_mapTemplates or m_regTemplates and update project item model.
The main project for ipce.
Directory * directory() const
Returns the directory associated with this Project.
void undoExecution()
Deletes the previously imported templates.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
void deleteFromDisk(Project *project)
Delete all of the contained Templates from disk.
bool setupExecution()
Sets up the work order for execution.
virtual bool isExecutable(ProjectItem *item)
This method returns true if the user clicked on a project tree node with the text "Registrations".
Project * project() const
Returns the Project this WorkOrder is attached to.
ProjectItem * findItemData(const QVariant &data, int role=Qt::UserRole+1)
Returns the first item found that contains the given data in the given role or a null pointer if no i...
virtual ImportRegistrationTemplateWorkOrder * clone() const
This method clones the current ImportRegistrationTemplateWorkOrder and returns it.
ImportRegistrationTemplateWorkOrder(Project *project)
Creates a work order to import registration templates.
QStringList internalData() const
Gets the internal data for this WorkOrder.
void setModifiesDiskState(bool changesProjectOnDisk)
QDir addTemplateFolder(QString prefix)
Create and navigate to the appropriate template type folder in the project directory.
~ImportRegistrationTemplateWorkOrder()
Destructor.
void setClean(bool value)
Function to change the clean state of the project.
virtual void removeItem(ProjectItem *item)
Removes an item and its children from the model.
This is free and unencumbered software released into the public domain.
Represents an item of a ProjectItemModel in Qt's model-view framework.