#include <XGUI_HistoryMenu.h>
#include <XGUI_QtEvents.h>
#include <XGUI_DataModel.h>
+#include <XGUI_InspectionPanel.h>
#ifndef HAVE_SALOME
#include <AppElements_Button.h>
myModule(NULL),
mySalomeConnector(theConnector),
myPropertyPanel(0),
+ myInspectionPanel(0),
myFacesPanel(0),
myObjectBrowser(0),
myDisplayer(0)
ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
(anOperationMgr->currentOperation());
if (aFOperation) {
- myOperationMgr->commitOperation();
- module()->launchOperation(aFOperation->id(), false);
+ if (myOperationMgr->commitOperation())
+ module()->launchOperation(aFOperation->id(), false);
}
}
}
void XGUI_Workshop::onUndo(int theTimes)
{
processUndoRedo(ActionUndo, theTimes);
+ myObjectBrowser->updateAllIndexes(1);
}
//******************************************************
void XGUI_Workshop::onRedo(int theTimes)
{
processUndoRedo(ActionRedo, theTimes);
+ myObjectBrowser->updateAllIndexes(1);
}
//******************************************************
// unblock the viewer update functionality and make update on purpose
myDisplayer->enableUpdateViewer(isUpdateEnabled);
myDisplayer->updateViewer();
+ // Clear messages in status bar from previous operations if exists
+ setStatusBarMessage("");
}
//******************************************************
Qt::BottomDockWidgetArea);
connect(myFacesPanel, SIGNAL(closed()), myFacesPanel, SLOT(onClosed()));
+ myInspectionPanel = new XGUI_InspectionPanel(aDesktop, mySelector);
+ myInspectionPanel->setAllowedAreas(Qt::LeftDockWidgetArea |
+ Qt::RightDockWidgetArea);
+ aDesktop->addDockWidget(Qt::RightDockWidgetArea, myInspectionPanel);
+
aDesktop->addDockWidget(
#ifdef HAVE_SALOME
Qt::RightDockWidgetArea,
int anAnswer = QMessageBox::question(
desktop(), tr("Show object"),
tr("'%1'\n are hidden by %2:\nRemove objects from the panel to be displayed?")
- .arg(aHiddenObjectNames.join(' ,')).arg(facesPanel()->windowTitle()),
+ .arg(aHiddenObjectNames.join(", ")).arg(facesPanel()->windowTitle()),
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
bool aToBeDisplayed = anAnswer == QMessageBox::Yes;
//**************************************************************
bool XGUI_Workshop::deleteFeatures(const QObjectPtrList& theObjects)
{
- std::map<FeaturePtr, std::set<FeaturePtr> > aReferences;
std::set<FeaturePtr> aFeatures;
ModuleBase_Tools::convertToFeatures(theObjects, aFeatures);
QObjectPtrList::const_iterator anIt = aObjects.begin(), aLast = aObjects.end();
for (; anIt != aLast && aCanMove; anIt++) {
ObjectPtr aObject = *anIt;
+ if (!aObject.get() || !aObject->data().get() || !aObject->data()->isValid()) {
+ aCanMove = false;
+ break;
+ }
+ FeaturePtr aFeat = std::dynamic_pointer_cast<ModelAPI_Feature>(aObject);
+ // only groups can be moved to the end for now (#2451)
+ if (aFeat.get() && aFeat->getKind() != "Group") {
+ aCanMove = false;
+ break;
+ }
+
// 1. Get features placed between selected and current in the document
std::list<FeaturePtr> aFeaturesBetween = toCurrentFeatures(aObject);
// if aFeaturesBetween is empty it means wrong order or aObject is the current feature
{
FeaturePtr aFeature;
QObjectPtrList aSelList = theObjects;
+ QObjectPtrList aNewSel;
bool aHasHidden = false;
foreach(ObjectPtr aObj, theObjects) {
aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aObj);
for(aIt = aResults.cbegin(); aIt != aResults.cend(); aIt++) {
aHasHidden |= (*aIt)->isConcealed();
aSelList.append(*aIt);
+ aNewSel.append(*aIt);
}
}
}
bool aBlocked = objectBrowser()->blockSignals(true);
objectBrowser()->setObjectsSelected(aSelList);
objectBrowser()->blockSignals(aBlocked);
+ objectBrowser()->ensureVisible(aNewSel.first());
}
if (aHasHidden)
QMessageBox::information(desktop(), tr("Find results"),
{
ResultPtr aResult;
QObjectPtrList aSelList = theObjects;
+ QObjectPtrList aNewSel;
FeaturePtr aFeature;
foreach(ObjectPtr aObj, theObjects) {
aResult = std::dynamic_pointer_cast<ModelAPI_Result>(aObj);
aFeature = ModelAPI_Feature::feature(aResult);
if (aFeature.get()) {
aSelList.append(aFeature);
+ aNewSel.append(aFeature);
}
}
}
bool aBlocked = objectBrowser()->blockSignals(true);
objectBrowser()->setObjectsSelected(aSelList);
objectBrowser()->blockSignals(aBlocked);
+ objectBrowser()->ensureVisible(aNewSel.first());
}
}
QString aDescription = contextMenuMgr()->action(
isBefore ? "ADD_TO_FOLDER_BEFORE_CMD" : "ADD_TO_FOLDER_AFTER_CMD")->text();
+ QMap<ObjectPtr, bool> aStates = myObjectBrowser->getFoldersState(aDoc);
+
aMgr->startOperation(aDescription.toStdString());
aDoc->moveToFolder(aFeatures, aFolder);
aMgr->finishOperation();
+ myObjectBrowser->setFoldersState(aStates);
+
updateCommandStatus();
}
SessionPtr aMgr = ModelAPI_Session::get();
DocumentPtr aDoc = aMgr->activeDocument();
-
QString aDescription = contextMenuMgr()->action(
isBefore ? "ADD_OUT_FOLDER_BEFORE_CMD" : "ADD_OUT_FOLDER_AFTER_CMD")->text();
+ QMap<ObjectPtr, bool> aStates = myObjectBrowser->getFoldersState(aDoc);
+
aMgr->startOperation(aDescription.toStdString());
aDoc->removeFromFolder(aFeatures, isBefore);
aMgr->finishOperation();
+ myObjectBrowser->setFoldersState(aStates);
+
updateCommandStatus();
}