<plugin>
<workbench id="Features" document="Part">
<group id="Extrusion">
- <feature id="Extrusion" title="Extrusion" tooltip="Create a solid by extrusion of a face" icon=":icons/extrusion.png" auto_preview="false">
+ <feature id="Extrusion" title="Extrusion" tooltip="Create a solid by extrusion of a face" icon=":icons/extrusion.png">
<source path="extrusion_widget.xml"/>
</feature>
<!--<feature id="ExtrusionSketch" title="ExtrusionSketch" tooltip="Create a solids by extrusion of a sketch" icon=":icons/extrusionsketch.png">
</feature>
</group>
<group id="Boolean">
- <feature id="Boolean" title="Boolean" tooltip="Perform boolean operations with solids" icon=":icons/cut.png">
+ <feature id="Boolean" title="Boolean" tooltip="Perform boolean operations with solids" icon=":icons/cut.png"
+ auto_preview="false">
<source path="boolean_widget.xml"/>
</feature>
- <feature id="Partition" title="Partition" tooltip="Perform partition operations with solids" icon=":icons/partition.png">
+ <feature id="Partition" title="Partition" tooltip="Perform partition operations with solids" icon=":icons/partition.png"
+ auto_preview="false">
<source path="partition_widget.xml"/>
</feature>
<feature id="Intersection" title="Intersection" tooltip="Intersect objects with tools" icon=":icons/intersection.png">
/// \return True in success
bool restoreValue();
+ /// Saves the internal parameters to the given feature. Emits signals before and after store
+ /// \return True in success
+ bool storeValue();
+
/// Set focus to the first control of the current widget. The focus policy of the control is checked.
/// If the widget has the NonFocus focus policy, it is skipped.
/// \return the state whether the widget can accept the focus
/// or store the control value to the feature
virtual void initializeValueByActivate();
- /// Saves the internal parameters to the given feature. Emits signals before and after store
- /// \return True in success
- bool storeValue();
-
/// Saves the internal parameters to the given feature
/// \return True in success
virtual bool storeValueCustom() const = 0;
bool myUseReset;
/// blocked flag of modification of the value state
bool myIsValueStateBlocked;
-
- friend class ModuleBase_OperationFeature; // to call storeValue() by commit if value state is ModifiedInPP
};
#endif
std::shared_ptr<Config_FeatureMessage> SHAPERGUI::featureInfo(const QString& theFeatureId)
{
- return myFeaturesInfo.contains(theFeatureId) ? myFeaturesInfo[theFeatureId] : NULL;
+ std::shared_ptr<Config_FeatureMessage> aMessage;
+ if (myFeaturesInfo.contains(theFeatureId))
+ aMessage = myFeaturesInfo[theFeatureId];
+ return aMessage;
}
//******************************************************
#include <ModuleBase_OperationAction.h>
#include <ModuleBase_PagedContainer.h>
#include <ModuleBase_WidgetValidated.h>
+#include <ModuleBase_ModelWidget.h>
#include <Config_Common.h>
#include <Config_FeatureMessage.h>
}
//******************************************************
-void XGUI_Workshop::onPreivewActionClicked()
+void XGUI_Workshop::onPreviewActionClicked()
{
+ ModuleBase_IPropertyPanel* aPanel = propertyPanel();
+ if (aPanel) {
+ ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
+ if (anActiveWidget && anActiveWidget->getValueState() == ModuleBase_ModelWidget::ModifiedInPP) {
+ anActiveWidget->storeValue();
+ }
+ }
std::shared_ptr<Events_Message> aMsg = std::shared_ptr<Events_Message>(
new Events_Message(Events_Loop::eventByName(EVENT_PREVIEW_REQUESTED)));
Events_Loop::loop()->send(aMsg);
connect(aCancelAct, SIGNAL(triggered()), myOperationMgr, SLOT(onAbortOperation()));
QAction* aPreviewAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::Preview);
- connect(aPreviewAct, SIGNAL(triggered()), this, SLOT(onPreivewActionClicked()));
+ connect(aPreviewAct, SIGNAL(triggered()), this, SLOT(onPreviewActionClicked()));
connect(myPropertyPanel, SIGNAL(keyReleased(QObject*, QKeyEvent*)),
myOperationMgr, SLOT(onKeyReleased(QObject*, QKeyEvent*)));
/// Called by Preview button clicked in the property panel. Sends signal to model to
/// compute preview.
- void onPreivewActionClicked();
+ void onPreviewActionClicked();
private:
/// Init menu