From: vsv Date: Mon, 25 Dec 2017 14:42:02 +0000 (+0300) Subject: Merge branch 'Dev_GroupsRevision' X-Git-Tag: V_2.10.1~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dc7d4d86b58b81684abc9b5a2be8ec30f210c2da;p=modules%2Fshaper.git Merge branch 'Dev_GroupsRevision' # Conflicts: # src/ModuleBase/CMakeLists.txt # src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp # src/ModuleBase/ModuleBase_WidgetMultiSelector.h # src/XGUI/XGUI_pictures.qrc --- dc7d4d86b58b81684abc9b5a2be8ec30f210c2da diff --cc src/ModuleBase/CMakeLists.txt index a9ad6af4d,a849fa00f..3e8fc7d4b --- a/src/ModuleBase/CMakeLists.txt +++ b/src/ModuleBase/CMakeLists.txt @@@ -97,8 -94,8 +97,10 @@@ SET(PROJECT_HEADER ModuleBase_IconFactory.h ModuleBase_Dialog.h ModuleBase_ModelDialogWidget.h + ModuleBase_ActionParameter.h + ModuleBase_ActionIntParameter.h + ModuleBase_ChoiceCtrl.h + ModuleBase_WidgetNameEdit.h ) SET(PROJECT_MOC_HEADERS diff --cc src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index 407a59339,e59721ff6..48df5b61b --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@@ -19,20 -19,18 +19,22 @@@ // #include -#include + +#include +#include +#include +#include +#include #include -#include +#include + #include #include +#include +#include #include -#include -#include #include -#include -#include +#include + #include #include #include @@@ -133,8 -192,22 +151,8 @@@ ModuleBase_WidgetMultiSelector::ModuleB //aMainLay->addWidget(new QLabel(this)); //FIXME(sbh)??? //aMainLay->setRowMinimumHeight(3, 20); //this->setLayout(aMainLay); - connect(myTypeCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(onSelectionTypeChanged())); + connect(myTypeCtrl, SIGNAL(valueChanged(int)), this, SLOT(onSelectionTypeChanged())); - myCopyAction = ModuleBase_Tools::createAction(QIcon(":pictures/copy.png"), tr("Copy"), - myWorkshop->desktop(), this, SLOT(onCopyItem())); - myCopyAction->setShortcut(QKeySequence::Copy); - myCopyAction->setEnabled(false); - myListControl->addAction(myCopyAction); - - myDeleteAction = ModuleBase_Tools::createAction(QIcon(":pictures/delete.png"), tr("Delete"), - myWorkshop->desktop(), this, SLOT(onDeleteItem())); - myDeleteAction->setEnabled(false); - myListControl->addAction(myDeleteAction); - - myListControl->setContextMenuPolicy(Qt::ActionsContextMenu); - connect(myListControl, SIGNAL(itemSelectionChanged()), SLOT(onListSelection())); - myIsNeutralPointClear = theData->getBooleanAttribute("clear_in_neutral_point", true); } @@@ -427,8 -499,7 +445,7 @@@ bool ModuleBase_WidgetMultiSelector::pr QList ModuleBase_WidgetMultiSelector::getControls() const { QList result; - //result << myTypeCombo; - result << myListControl; + result << myListView->getControl(); return result; } @@@ -598,17 -666,19 +619,18 @@@ void ModuleBase_WidgetMultiSelector::se { QString aShapeTypeName; - for (int idx = 0; idx < myTypeCombo->count(); ++idx) { - aShapeTypeName = myTypeCombo->itemText(idx); + int idx = 0; + foreach (QString aShapeTypeName, myShapeTypes) { int aRefType = ModuleBase_Tools::shapeType(aShapeTypeName); - if(aRefType == theShapeType && idx != myTypeCombo->currentIndex()) { + if(aRefType == theShapeType && idx != myTypeCtrl->value()) { - bool aWasActivated = activateSelectionAndFilters(false); + updateSelectionModesAndFilters(false); - bool isBlocked = myTypeCombo->blockSignals(true); - myTypeCombo->setCurrentIndex(idx); - myTypeCombo->blockSignals(isBlocked); + bool isBlocked = myTypeCtrl->blockSignals(true); + myTypeCtrl->setValue(idx); + myTypeCtrl->blockSignals(isBlocked); - if (aWasActivated) - activateSelectionAndFilters(true); + updateSelectionModesAndFilters(true); break; } + idx++; } } diff --cc src/ModuleBase/ModuleBase_WidgetMultiSelector.h index f4a155981,c8dcdf66f..be8bfee91 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.h +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.h @@@ -37,10 -37,13 +37,11 @@@ #include class QWidget; - class QComboBox; -class QListWidget; + //class QComboBox; +class ModuleBase_ListView; class ModuleBase_IWorkshop; -class QAction; + class ModuleBase_ChoiceCtrl; - /** * \ingroup GUI * Implementation of widget for shapes selection. This widget provides selection of several shapes. @@@ -218,10 -216,26 +219,15 @@@ protected ModuleBase_IWorkshop* theWorkshop); protected: - /// List control - QListWidget* myListControl; + ModuleBase_ListView* myListView; ///< List control - QComboBox* myTypeCombo; ///< Combobox of types - bool myIsUseChoice; /// A flag to store use_choice parameter state ++ ++ bool myIsUseChoice; ///< A flag to store use_choice parameter state + - QStringList myShapeTypes; ++ QStringList myShapeTypes; ///< List of Shape types defined in XML + + /// Control for types + ModuleBase_ChoiceCtrl* myTypeCtrl; - /// Provides correspondance between Result object and its shape - typedef QPair GeomSelection; - - /// A copy action for pop-up menu in a list control - QAction* myCopyAction; - - /// A delete action for pop-up menu in a list control - QAction* myDeleteAction; - - /// A flag to store use_choice parameter state - bool myIsUseChoice; - /// A flag to clear selection by click in empty place in the viewer bool myIsNeutralPointClear; diff --cc src/XGUI/XGUI_ActionsMgr.h index 89693cbc1,deeb75433..3773ae9ba --- a/src/XGUI/XGUI_ActionsMgr.h +++ b/src/XGUI/XGUI_ActionsMgr.h @@@ -56,22 -61,23 +56,23 @@@ class XGUI_EXPORT XGUI_ActionsMgr : pub enum OperationStateActionId { Abort = 0, Accept = 1, - Help = 2, - AbortAll = 3, - AcceptAll = 4, - Preview = 5 + AcceptPlus = 2, + Help = 3, + AbortAll = 4, + AcceptAll = 5, + Preview = 6 }; - //! Add a command in the manager. - //! Please note that nested commands in the Salome mode (No AppElements_Command, pure QActions) - //! won't be extracted and should be added manually using the addNestedCommands method. + /// Add a command in the manager. + /// Please note that nested commands in the Salome mode (No AppElements_Command, pure QActions) + /// won't be extracted and should be added manually using the addNestedCommands method. void addCommand(QAction* theCmd); - //! Sets relation between the command (with given Id) and it's nested actions. + /// Sets relation between the command (with given Id) and it's nested actions. void addNestedCommands(const QString& theId, const QStringList& theCommands); - //! Returns list of nested commands by parent command Id - //! \param theId a parent command Id + /// Returns list of nested commands by parent command Id + /// \param theId a parent command Id QStringList nestedCommands(const QString& theId) const; /// Returns True if the given Id is an Id of nested command diff --cc src/XGUI/XGUI_pictures.qrc index 14e55f367,879fa4416..913ca9b00 --- a/src/XGUI/XGUI_pictures.qrc +++ b/src/XGUI/XGUI_pictures.qrc @@@ -62,12 -63,9 +63,16 @@@ pictures/eyeopen.png pictures/transparency.png + pictures/solid32.png + pictures/face32.png + pictures/edge32.png + pictures/vertex32.png + pictures/features_folder.png + pictures/create_folder.png + pictures/insert_folder_after.png + pictures/insert_folder_before.png + pictures/move_out_after.png + pictures/move_out_before.png + pictures/selection.png