aCommand->connectTo(this, SLOT(onSave()));
//aCommand->disable();
+ aCommand = aGroup->addFeature("SAVEAS_CMD", tr("Save as..."), tr("Save the document into a file"),
+ QIcon(":pictures/save.png"), QKeySequence());
+ aCommand->connectTo(this, SLOT(onSaveAs()));
+
QString aUndoId = "UNDO_CMD";
aCommand = aGroup->addFeature(aUndoId, tr("Undo"), tr("Undo last command"),
QIcon(":pictures/undo.png"), QKeySequence::Undo);
SIGNAL(updateRedoHistory(const QList<ActionInfo>&)),
SLOT(onRedo(int)));
- aCommand = aGroup->addFeature("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
- QIcon(":pictures/rebuild.png"), QKeySequence());
- aCommand->connectTo(this, SLOT(onRebuild()));
+ //aCommand = aGroup->addFeature("REBUILD_CMD", tr("Rebuild"), tr("Rebuild data objects"),
+ // QIcon(":pictures/rebuild.png"), QKeySequence());
+ //aCommand->connectTo(this, SLOT(onRebuild()));
- aCommand = aGroup->addFeature("SAVEAS_CMD", tr("Save as..."), tr("Save the document into a file"),
- QIcon(":pictures/save.png"), QKeySequence());
- aCommand->connectTo(this, SLOT(onSaveAs()));
//aCommand->disable();
aCommand = aGroup->addFeature("OPEN_CMD", tr("Open..."), tr("Open a new document"),
if (theOperation->getDescription()->hasXmlRepresentation()) { //!< No need for property panel
setPropertyPanel(theOperation);
+ connectToPropertyPanel(true);
}
updateCommandStatus();
foreach (ModuleBase_ModelWidget* aWidget, aWidgets) {
myModule->connectToPropertyPanel(aWidget, isToConnect);
if (isToConnect) {
- connect(aWidget, SIGNAL(valueStateChanged()), this, SLOT(onValueStateChanged()));
+ connect(aWidget, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetStateChanged(int)));
}
else {
- disconnect(aWidget, SIGNAL(valueStateChanged()), this, SLOT(onValueStateChanged()));
+ disconnect(aWidget, SIGNAL(valueStateChanged(int)), this, SLOT(onWidgetStateChanged(int)));
}
}
}
}
//******************************************************
-}
-
-//******************************************************
-void XGUI_Workshop::onValueStateChanged()
+void XGUI_Workshop::onWidgetStateChanged(int thePreviousState)
{
ModuleBase_ModelWidget* anActiveWidget = 0;
ModuleBase_Operation* anOperation = myOperationMgr->currentOperation();
if (aPanel)
anActiveWidget = aPanel->activeWidget();
}
- if (anActiveWidget && anActiveWidget->getValueState() != ModuleBase_ModelWidget::Stored)
+ if (anActiveWidget)
operationMgr()->onValidateOperation();
+
+ myModule->widgetStateChanged(thePreviousState);
+}
+
ModuleBase_IModule* XGUI_Workshop::loadModule(const QString& theModule)
{
QString libName = QString::fromStdString(library(theModule.toStdString()));
QAction* aCancelAct = myActionsMgr->operationStateAction(XGUI_ActionsMgr::Abort);
connect(aCancelAct, SIGNAL(triggered()), myOperationMgr, SLOT(onAbortOperation()));
- connect(myPropertyPanel, SIGNAL(noMoreWidgets()), myModule, SLOT(onNoMoreWidgets()));
connect(myPropertyPanel, SIGNAL(keyReleased(QKeyEvent*)),
myOperationMgr, SLOT(onKeyReleased(QKeyEvent*)));
//connect(myOperationMgr, SIGNAL(validationStateChanged(bool)),