myErrorLabel(0),
myWorkshop(theWorkshop)
{
+ ModuleBase_ModelWidget* anActiveWidget = activeWidget();
+ XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
+ QAction* anAcceptAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll, NULL);
+ myAcceptAllToolTip = anAcceptAllAction->toolTip();
+ QAction* anOkAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::Accept);
+ myAcceptToolTip = anOkAction->toolTip();
}
XGUI_ErrorMgr::~XGUI_ErrorMgr()
QString aWidgetError = "";
if (!isApplyEnabledByActiveWidget) {
anError = myWorkshop->module()->getFeatureError(theFeature);
- aWidgetError = myWorkshop->module()->getWidgetError(anActiveWidget);
+ if (anActiveWidget)
+ aWidgetError = anActiveWidget->getError();
if (anError.isEmpty())
anError = aWidgetError;
}
void XGUI_ErrorMgr::updateAcceptAllAction(const FeaturePtr& theFeature)
{
QString anError = myWorkshop->module()->getFeatureError(theFeature);
- if (anError.isEmpty())
- anError = myWorkshop->module()->getWidgetError(activeWidget());
-
+ if (anError.isEmpty()) {
+ ModuleBase_ModelWidget* anActiveWidget = activeWidget();
+ if (anActiveWidget)
+ anError = anActiveWidget->getError();
+ }
XGUI_ActionsMgr* anActionsMgr = workshop()->actionsMgr();
if (workshop()->isFeatureOfNested(theFeature)) {
QAction* anAcceptAllAction = anActionsMgr->operationStateAction(XGUI_ActionsMgr::AcceptAll, NULL);
bool anEnabled = anError.isEmpty();
anAcceptAllAction->setEnabled(anEnabled);
- anAcceptAllAction->setToolTip(anError);
+ anAcceptAllAction->setToolTip(!anEnabled ? anError : myAcceptAllToolTip);
}
}
bool anEnabled = theError.isEmpty();
theAction->setEnabled(anEnabled);
+ theAction->setToolTip(anEnabled ? myAcceptToolTip : theError);
// some operations have no property panel, so it is important to check that it is not null
if (myPropertyPanel) {
// update controls error information
if (!aModelWidget || !aModelWidget->feature().get())
return;
- QString aWidgetError = myWorkshop->module()->getWidgetError(aModelWidget);
+ QString aWidgetError = aModelWidget->getError();
updateToolTip(aModelWidget, aWidgetError);
}