QApplication::restoreOverrideCursor();
}
+bool XGUI_Workshop::isActiveOperationAborted()
+{
+ if(!myOperationMgr->hasOperation())
+ return true;
+ return myOperationMgr->abortOperation();
+}
+
//******************************************************
void XGUI_Workshop::onExit()
{
//******************************************************
void XGUI_Workshop::onOpen()
{
- if(!myOperationMgr->abortOperation())
+ if(!isActiveOperationAborted())
return;
//save current file before close if modified
SessionPtr aSession = ModelAPI_Session::get();
myObjectBrowser->rebuildDataTree();
displayAllResults();
updateCommandStatus();
- myMainWindow->setCurrentDir(myCurrentDir);
QApplication::restoreOverrideCursor();
}
//******************************************************
bool XGUI_Workshop::onSave()
{
- if(!myOperationMgr->abortOperation())
+ if(!isActiveOperationAborted())
return false;
if (myCurrentDir.isEmpty()) {
return onSaveAs();
//******************************************************
bool XGUI_Workshop::onSaveAs()
{
- if(!myOperationMgr->abortOperation())
+ if(!isActiveOperationAborted())
return false;
QFileDialog dialog(mainWindow());
dialog.setWindowTitle(tr("Select directory to save files..."));
*/
void saveDocument(const QString& theName, std::list<std::string>& theFileNames);
+ /*
+ * If there is an active (uncommited) operation shows a prompt to abort it
+ * and performs abortion if user agreed. Returns true if
+ * - operation aborted successfully
+ * - there is no active operation
+ */
+ bool isActiveOperationAborted();
+
signals:
void salomeViewerSelection();
void errorOccurred(const QString&);
void activateLastPart();
- /// Display all results of the current document
- void displayAllResults();
-
protected:
//Event-loop processing methods:
void addFeature(const Config_FeatureMessage*);
QList<QAction*> getModuleCommands() const;
+ void displayAllResults();
void displayDocumentResults(DocumentPtr theDoc);
void displayGroupResults(DocumentPtr theDoc, std::string theGroup);