+//******************************************************
+QAction* NewGeom_Module::addFeature(const QString& theWBName, const QString& theId,
+ const QString& theTitle, const QString& theTip,
+ const QIcon& theIcon, const QKeySequence& theKeys,
+ bool isCheckable)
+{
+ int aMenu = createMenu(theWBName, -1, -1, 50);
+ int aTool = createTool(theWBName);
+
+ int aId = myActionsList.size();
+ myActionsList.append(theId);
+ SUIT_Desktop* aDesk = application()->desktop();
+ int aKeys = 0;
+ for (unsigned int i = 0; i < theKeys.count(); i++)
+ aKeys += theKeys[i];
+ QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
+ isCheckable);
+ aAction->setData(theId);
+ int aItemId = createMenu(aId, aMenu, -1, 10);
+ int aToolId = createTool(aId, aTool);
+ return aAction;
+}
+
+//******************************************************
+QAction* NewGeom_Module::addEditCommand(const QString& theId, const QString& theTitle,
+ const QString& theTip, const QIcon& theIcon,
+ const QKeySequence& theKeys, bool isCheckable)
+{
+ int aMenu = createMenu(tr("MEN_DESK_EDIT"), -1, -1);
+
+ int aId = myActionsList.size();
+ myActionsList.append(theId);
+ SUIT_Desktop* aDesk = application()->desktop();
+ int aKeys = 0;
+ for (unsigned int i = 0; i < theKeys.count(); i++)
+ aKeys += theKeys[i];
+ QAction* aAction = createAction(aId, theTip, theIcon, theTitle, theTip, aKeys, aDesk,
+ isCheckable);
+ aAction->setData(theId);
+ createMenu(aId, aMenu, 10);
+ return aAction;
+}
+
+//******************************************************
+void NewGeom_Module::addEditMenuSeparator()
+{
+ int aMenu = createMenu(tr("MEN_DESK_EDIT"), -1, -1);
+ createMenu(separator(), aMenu, -1, 10);
+}
+
+//******************************************************
+QList<QAction*> NewGeom_Module::commandList() const
+{
+ QList<QAction*> aActions;
+ for (int i = 0; i < myActionsList.size(); i++)
+ aActions.append(action(i));
+ return aActions;
+}
+
+//******************************************************
+QStringList NewGeom_Module::commandIdList() const
+{
+ return myActionsList;
+}
+
+//******************************************************
+QMainWindow* NewGeom_Module::desktop() const
+{
+ return application()->desktop();
+}
+
+//******************************************************
+QString NewGeom_Module::commandId(const QAction* theCmd) const
+{
+ int aId = actionId(theCmd);
+ if (aId < myActionsList.size())
+ return myActionsList[aId];
+ return QString();
+}
+
+//******************************************************
+QAction* NewGeom_Module::command(const QString& theId) const
+{
+ int aId = myActionsList.indexOf(theId);
+ if ((aId != -1) && (aId < myActionsList.size())) {
+ return action(aId);
+ }
+ return 0;
+}
+
+//******************************************************
+void NewGeom_Module::setNestedActions(const QString& theId, const QStringList& theActions)
+{
+ myNestedActions[theId] = theActions;
+}
+
+//******************************************************
+QStringList NewGeom_Module::nestedActions(const QString& theId) const
+{
+ if (myNestedActions.contains(theId))
+ return myNestedActions[theId];
+ return QStringList();
+}
+
+//******************************************************
+void NewGeom_Module::selectionChanged()
+{
+ LightApp_Module::selectionChanged();
+ myWorkshop->salomeViewerSelectionChanged();
+}
+
+//******************************************************
+void NewGeom_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle)
+{
+ myWorkshop->contextMenuMgr()->addViewerItems(theMenu);
+ LightApp_Module::contextMenuPopup(theClient, theMenu, theTitle);
+}
+
+
+//******************************************************
+void NewGeom_Module::createPreferences()
+{
+ LightApp_Preferences* pref = preferences();
+ if (!pref)
+ return;
+ XGUI_Preferences::updateCustomProps();
+ QString aModName = moduleName();
+
+ QtxPreferenceItem* item = pref->findItem(aModName, true );
+ if ( item && (!item->isEmpty() )) {
+ item->parentItem()->removeItem(item);
+ delete item;
+ }
+
+ int catId = pref->addPreference(aModName, -1 );
+ if ( catId == -1 )
+ return;
+ NewGeom_PrefMgr aMgr(pref, aModName);
+ XGUI_Preferences::createEditContent(&aMgr, catId);
+ pref->retrieve();
+}
+
+//******************************************************
+void NewGeom_Module::preferencesChanged(const QString& theSection, const QString& theParam)
+{
+ SUIT_ResourceMgr* aResMgr = application()->resourceMgr();
+ QString aVal = aResMgr->stringValue(theSection, theParam);
+ if (!aVal.isNull()) {
+ Config_Prop* aProp = Config_PropManager::findProp(theSection.toStdString(), theParam.toStdString());
+ aProp->setValue(aVal.toStdString());
+ }
+}