9#include "CloseProjectWorkOrder.h"
11#include <QCoreApplication>
15#include <QtConcurrentMap>
30 QAction::setText(tr(
"&Close Project"));
31 QUndoCommand::setText(tr(
"Close Project"));
77 if (success && !
project()->isClean()) {
78 QMessageBox *box =
new QMessageBox(QMessageBox::NoIcon,
79 QString(
"Current Project Has Unsaved Changes"),
80 QString(
"Would you like to save your current project?"),
81 QMessageBox::NoButton, qobject_cast<QWidget *>(parent()), Qt::Dialog);
82 QPushButton *
save = box->addButton(
"Save", QMessageBox::AcceptRole);
83 QPushButton *dontsave = box->addButton(
"Don't Save", QMessageBox::RejectRole);
84 QPushButton *cancel = box->addButton(
"Cancel", QMessageBox::NoRole);
87 if (box->clickedButton() == (QAbstractButton*)cancel) {
91 else if (box->clickedButton() == (QAbstractButton*)dontsave) {
95 else if (box->clickedButton() == (QAbstractButton*)
save) {
This opens a project that's saved on disk.
void execute()
@description Clear the current Project
virtual bool isExecutable()
This method will always return true.
~CloseProjectWorkOrder()
Destructor.
virtual CloseProjectWorkOrder * clone() const
This method clones the CloseProjectWorkOrder.
CloseProjectWorkOrder(Project *project)
This method sets the text of the work order to Close Project and sets setCreatesCleanState to true.
bool setupExecution()
If WorkOrder::execute() returns true, then this method returns true.
The main project for ipce.
void clear()
Function to clear out all values in a project essentially making it a new project object.
void addToProject(WorkOrder *)
This executes the WorkOrder and stores it in the project.
void setClean(bool value)
Function to change the clean state of the project.
Saves a project to disk (File->Save Project...)
Provide Undo/redo abilities, serialization, and history for an operation.
bool m_isSavedToHistory
Set the work order to be shown in the HistoryTreeWidget.
void save(QXmlStreamWriter &stream) const
: Saves a WorkOrder to a data stream.
bool m_isUndoable
Set the workorder to be undoable/redoable This is defaulted to true - his will allow the workorder to...
virtual bool setupExecution()
This sets up the state for the work order.
void setCreatesCleanState(bool createsCleanState)
Declare that this work order is saving the project.
Project * project() const
Returns the Project this WorkOrder is attached to.
This is free and unencumbered software released into the public domain.