}
onNew();
+
+ emit applicationStarted();
}
//******************************************************
std::set<ObjectPtr>::const_iterator aIt;
for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
ObjectPtr aObj = (*aIt);
+
bool aHide = !aObj->data() || !aObj->data()->isValid();
if (!aHide) { // check that this is not hidden result
ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
} else {
if (myOperationMgr->hasOperation()) {
ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
- // Display only current operation results if operation has preview
- if (aOperation->hasObject(aObj)/* && aOperation->hasPreview()*/) {
+ if (myModule->canDisplayObject(aObj)) {
displayObject(aObj);
// Deactivate object of current operation from selection
if (myDisplayer->isActive(aObj))
bool aHasPart = false;
bool isDisplayed = false;
for (aIt = aObjects.begin(); aIt != aObjects.end(); ++aIt) {
+
ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aIt);
if (aPart) {
aHasPart = true;
// If a feature is created from the aplication's python console
// it doesn't stored in the operation mgr and doesn't displayed
- } else if (myOperationMgr->hasOperation()) {
- ModuleBase_Operation* aOperation = myOperationMgr->currentOperation();
- if (aOperation->hasObject(*aIt)) { // Display only current operation results
- displayObject(*aIt);
- isDisplayed = true;
- }
+ } else if (myModule->canDisplayObject(*aIt)) {
+ displayObject(*aIt);
+ isDisplayed = true;
}
}
if (myObjectBrowser)
aWidget->enableFocusProcessing();
QObject::connect(aWidget, SIGNAL(valuesChanged()), this, SLOT(onWidgetValuesChanged()));
// Init default values
- if (!theOperation->isEditOperation() && !aWidget->isComputedDefault()) {
+ if (!theOperation->isEditOperation() && aWidget->isValueDefault() && !aWidget->isComputedDefault()) {
aWidget->storeValue();
}
}
connect(myPropertyPanel, SIGNAL(noMoreWidgets()), myModule, SLOT(onNoMoreWidgets()));
aDesktop->addDockWidget(Qt::LeftDockWidgetArea, myPropertyPanel);
- hidePropertyPanel(); //<! Invisible by default
+ hidePropertyPanel(); ///<! Invisible by default
hideObjectBrowser();
aDesktop->tabifyDockWidget(aObjDock, myPropertyPanel);
myPropertyPanel->installEventFilter(myOperationMgr);
connect(aCancelBtn, SIGNAL(clicked()), myOperationMgr, SLOT(onAbortOperation()));
connect(myPropertyPanel, SIGNAL(keyReleased(QKeyEvent*)), myOperationMgr,
SLOT(onKeyReleased(QKeyEvent*)));
- connect(myOperationMgr, SIGNAL(operationValidated(bool)), myPropertyPanel,
+ connect(myOperationMgr, SIGNAL(applyEnableChanged(bool)), myPropertyPanel,
SLOT(setAcceptEnabled(bool)));
}
void XGUI_Workshop::showPropertyPanel()
{
QAction* aViewAct = myPropertyPanel->toggleViewAction();
- //<! Restore ability to close panel from the window's menu
+ ///<! Restore ability to close panel from the window's menu
aViewAct->setEnabled(true);
myPropertyPanel->show();
myPropertyPanel->raise();
void XGUI_Workshop::hidePropertyPanel()
{
QAction* aViewAct = myPropertyPanel->toggleViewAction();
- //<! Do not allow to show empty property panel
+ ///<! Do not allow to show empty property panel
aViewAct->setEnabled(false);
myPropertyPanel->hide();
}
}
//**************************************************************
-void XGUI_Workshop::activateLastPart()
-{
- SessionPtr aMgr = ModelAPI_Session::get();
- DocumentPtr aDoc = aMgr->moduleDocument();
- std::string aGrpName = ModelAPI_ResultPart::group();
- ObjectPtr aLastPart = aDoc->object(aGrpName, aDoc->size(aGrpName) - 1);
- ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aLastPart);
- if (aPart) {
- activatePart(aPart);
- }
-}
+//void XGUI_Workshop::activateLastPart()
+//{
+// SessionPtr aMgr = ModelAPI_Session::get();
+// DocumentPtr aDoc = aMgr->moduleDocument();
+// std::string aGrpName = ModelAPI_ResultPart::group();
+// ObjectPtr aLastPart = aDoc->object(aGrpName, aDoc->size(aGrpName) - 1);
+// ResultPartPtr aPart = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aLastPart);
+// if (aPart) {
+// activatePart(aPart);
+// }
+//}
//**************************************************************
void XGUI_Workshop::deleteObjects(const QObjectPtrList& theList)
//**************************************************************
void XGUI_Workshop::closeDocument()
{
+ ModuleBase_Operation* anOperation = operationMgr()->currentOperation();
+ while (anOperation) {
+ anOperation->abort();
+ anOperation = operationMgr()->currentOperation();
+ }
myDisplayer->closeLocalContexts();
myDisplayer->eraseAll();
objectBrowser()->clearContent();