return res;
}
+/*!
+ \return true if action has rule of given type
+ \param a - action
+ \param t - rule type
+*/
+bool QtxPopupMgr::hasRule( QAction* a, const RuleType t ) const
+{
+ return a ? expression( a, t, false ) : false;
+}
+
+/*!
+ \return true if action with given id has rule of given type
+ \param id - action id
+ \param t - rule type
+*/
+bool QtxPopupMgr::hasRule( const int id, const RuleType t ) const
+{
+ return hasRule( action( id ), t );
+}
+
/*!
\brief Get rule of type \a type for the action \a a.
\param a action
*/
bool QtxPopupMgr::isVisible( const int id, const int place ) const
{
- return QtxActionMenuMgr::isVisible( id, place ) && isSatisfied( action( id ) );
+ return QtxActionMenuMgr::isVisible( id, place ) && ( !hasRule( id ) || isSatisfied( action( id ) ) );
}
/*!
void setRule( QAction*, const QString&, const RuleType = VisibleRule );
void setRule( const int, const QString&, const RuleType = VisibleRule );
+ bool hasRule( QAction*, const RuleType = VisibleRule ) const;
+ bool hasRule( const int, const RuleType = VisibleRule ) const;
+
QtxPopupSelection* selection() const;
void setSelection( QtxPopupSelection* );