+
+void XGUI_Workshop::addHistoryMenu(QObject* theObject, const char* theSignal, const char* theSlot)
+{
+ XGUI_HistoryMenu* aMenu = NULL;
+ if (isSalomeMode()) {
+ QAction* anAction = qobject_cast<QAction*>(theObject);
+ if (!anAction)
+ return;
+ aMenu = new XGUI_HistoryMenu(anAction);
+ } else {
+ QToolButton* aButton = qobject_cast<QToolButton*>(theObject);
+ aMenu = new XGUI_HistoryMenu(aButton);
+ }
+ connect(this, theSignal, aMenu, SLOT(setHistory(const QList<ActionInfo>&)));
+ connect(aMenu, SIGNAL(actionSelected(int)), this, theSlot);
+
+}