#3646 Add icons for MainGrid LGR/Temp LGR's, Export Completions, sub items on/off/toggle

This commit is contained in:
Jacob Støren 2018-11-13 15:43:36 +01:00
parent 47edac084f
commit bfee1dfa64
20 changed files with 58 additions and 23 deletions

View File

@ -75,6 +75,7 @@ void RicExportCompletionsForTemporaryLgrsFeature::onActionTriggered(bool isCheck
void RicExportCompletionsForTemporaryLgrsFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Export Completion Data");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
}
//--------------------------------------------------------------------------------------------------

View File

@ -64,6 +64,8 @@ void RicExportCompletionsForVisibleSimWellsFeature::onActionTriggered(bool isChe
void RicExportCompletionsForVisibleSimWellsFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Export Completion Data for Visible Simulation Wells");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
}
//--------------------------------------------------------------------------------------------------

View File

@ -89,6 +89,8 @@ void RicExportCompletionsForVisibleWellPathsFeature::onActionTriggered(bool isCh
void RicExportCompletionsForVisibleWellPathsFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Export Completion Data for Visible Well Paths");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
}
//--------------------------------------------------------------------------------------------------

View File

@ -174,6 +174,8 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
void RicWellPathExportCompletionDataFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("Export Completion Data for Selected Well Paths");
actionToSetup->setIcon(QIcon(":/ExportCompletionsSymbol16x16.png"));
}
//--------------------------------------------------------------------------------------------------

View File

@ -52,4 +52,6 @@ void RicToggleItemsFeature::setupActionLook(QAction* actionToSetup)
actionToSetup->setText("Toggle Sub Items");
else
actionToSetup->setText("Toggle");
actionToSetup->setIcon(QIcon(":/ToggleOnOff16x16.png"));
}

View File

@ -52,4 +52,7 @@ void RicToggleItemsOffFeature::setupActionLook(QAction* actionToSetup)
actionToSetup->setText("Sub Items Off");
else
actionToSetup->setText("Off");
actionToSetup->setIcon(QIcon(":/ToggleOff16x16.png"));
}

View File

@ -52,4 +52,7 @@ void RicToggleItemsOnFeature::setupActionLook(QAction* actionToSetup)
actionToSetup->setText("Sub Items On");
else
actionToSetup->setText("On");
actionToSetup->setIcon(QIcon(":/ToggleOn16x16.png"));
}

View File

@ -83,6 +83,9 @@ void RicToggleItemsOnOthersOffFeature::onActionTriggered(bool isChecked)
void RicToggleItemsOnOthersOffFeature::setupActionLook(QAction* actionToSetup)
{
actionToSetup->setText("On - Others Off");
actionToSetup->setIcon(QIcon(":/ToggleOnOthersOff16x16.png"));
}
//--------------------------------------------------------------------------------------------------

View File

@ -311,7 +311,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
menuBuilder << "RicEditPerforationCollectionFeature";
menuBuilder.subMenuEnd();
menuBuilder.subMenuStart("Export Completions", QIcon(":/Save.png"));
menuBuilder.subMenuStart("Export Completions", QIcon(":/ExportCompletionsSymbol16x16.png"));
menuBuilder << "RicExportCompletionsForVisibleWellPathsFeature";
menuBuilder << "RicWellPathExportCompletionDataFeature";
menuBuilder.subMenuEnd();
@ -749,7 +749,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
if (!candidates.isEmpty())
{
menuBuilder.subMenuStart("Export Completions", QIcon(":/Save.png"));
menuBuilder.subMenuStart("Export Completions", QIcon(":/ExportCompletionsSymbol16x16.png"));
for (const auto& text : candidates)
{

View File

@ -53,8 +53,8 @@ RimGridInfo::RimGridInfo()
CAF_PDM_InitField(&m_gridName, "GridName", QString(), "Grid Name", "", "", "");
m_gridName.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitField(&m_gridIndex, "GridIndex", 0, "Grid Index", "", "", "");
m_gridIndex.uiCapability()->setUiReadOnly(true);
CAF_PDM_InitField(&m_eclipseGridIndex, "GridIndex", 0, "Grid Index", "", "", "");
m_eclipseGridIndex.uiCapability()->setUiReadOnly(true);
}
//--------------------------------------------------------------------------------------------------
@ -77,9 +77,9 @@ void RimGridInfo::setName(const QString& name)
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridInfo::setIndex(int index)
void RimGridInfo::setEclipseGridIndex(int index)
{
m_gridIndex = index;
m_eclipseGridIndex = index;
}
//--------------------------------------------------------------------------------------------------
@ -109,9 +109,9 @@ QString RimGridInfo::name() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimGridInfo::index() const
int RimGridInfo::eclipseGridIndex() const
{
return m_gridIndex();
return m_eclipseGridIndex();
}
//--------------------------------------------------------------------------------------------------
@ -139,7 +139,7 @@ void RimGridInfo::fieldChangedByUi(const caf::PdmFieldHandle* changedField, cons
void RimGridInfo::defineUiOrdering(QString uiConfigName, caf::PdmUiOrdering& uiOrdering)
{
uiOrdering.add(&m_gridName);
uiOrdering.add(&m_gridIndex);
uiOrdering.add(&m_eclipseGridIndex);
uiOrdering.skipRemainingFields();
}
@ -172,11 +172,9 @@ bool RimGridInfoCollection::isActive() const
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimGridInfoCollection::addGridInfo(const QString& name, size_t gridIndex)
void RimGridInfoCollection::addGridInfo(RimGridInfo* gridInfo)
{
auto gridInfo = new RimGridInfo();
gridInfo->setName(name);
gridInfo->setIndex((int)gridIndex);
m_gridInfos.push_back(gridInfo);
}
@ -262,15 +260,18 @@ RimGridCollection::RimGridCollection()
m_mainGrid = new RimGridInfo();
m_mainGrid->setUiName("Main Grid");
m_mainGrid->uiCapability()->setUiTreeHidden(true);
m_mainGrid->setUiIcon(QIcon(":/MainGrid16x16.png"));
CAF_PDM_InitFieldNoDefault(&m_persistentLgrs, "PersistentLgrs", "Persistent LGRs", "", "", "");
m_persistentLgrs = new RimGridInfoCollection();
m_persistentLgrs->setUiName(persistentGridUiName());
m_persistentLgrs->setUiIcon(QIcon(":/LGR16x16.png"));
CAF_PDM_InitFieldNoDefault(&m_temporaryLgrs, "TemporaryLgrs", "Temporary LGRs", "", "", "");
m_temporaryLgrs.xmlCapability()->disableIO();
m_temporaryLgrs = new RimGridInfoCollection();
m_temporaryLgrs->setUiName(temporaryGridUiName());
m_temporaryLgrs->setUiIcon(QIcon(":/TempLGR16x16.png"));
}
//--------------------------------------------------------------------------------------------------
@ -305,7 +306,7 @@ std::vector<size_t> RimGridCollection::indicesToVisibleGrids() const
if (m_mainGrid()->isActive())
{
gridIndices.push_back(m_mainGrid->index());
gridIndices.push_back(m_mainGrid->eclipseGridIndex());
}
if (m_persistentLgrs()->isActive())
@ -314,7 +315,7 @@ std::vector<size_t> RimGridCollection::indicesToVisibleGrids() const
{
if (gridInfo->isActive())
{
gridIndices.push_back(gridInfo->index());
gridIndices.push_back(gridInfo->eclipseGridIndex());
}
}
}
@ -325,7 +326,7 @@ std::vector<size_t> RimGridCollection::indicesToVisibleGrids() const
{
if (gridInfo->isActive())
{
gridIndices.push_back(gridInfo->index());
gridIndices.push_back(gridInfo->eclipseGridIndex());
}
}
}
@ -366,7 +367,7 @@ void RimGridCollection::syncFromMainGrid()
if (mainGrid)
{
m_mainGrid->setName("Main Grid");
m_mainGrid->setIndex(0);
m_mainGrid->setEclipseGridIndex(0);
auto allTemporaryGrids = m_temporaryLgrs->gridInfos();
auto allPersistentGrids = m_persistentLgrs->gridInfos();
@ -386,7 +387,11 @@ void RimGridCollection::syncFromMainGrid()
}
else
{
m_temporaryLgrs->addGridInfo(gridName, gridIndex);
auto gridInfo = new RimGridInfo();
gridInfo->setName(gridName);
gridInfo->setEclipseGridIndex((int)gridIndex);
gridInfo->setUiIcon(QIcon(":/TempLGR16x16.png"));
m_temporaryLgrs->addGridInfo(gridInfo);
}
}
else
@ -397,7 +402,11 @@ void RimGridCollection::syncFromMainGrid()
}
else
{
m_persistentLgrs->addGridInfo(gridName, gridIndex);
auto gridInfo = new RimGridInfo();
gridInfo->setName(gridName);
gridInfo->setEclipseGridIndex((int)gridIndex);
gridInfo->setUiIcon(QIcon(":/LGR16x16.png"));
m_persistentLgrs->addGridInfo(gridInfo);
}
}
}

View File

@ -40,11 +40,11 @@ public:
~RimGridInfo() {}
void setName(const QString& name);
void setIndex(int index);
void setEclipseGridIndex(int index);
void setActive(bool active);
bool isActive() const;
QString name() const;
int index() const;
int eclipseGridIndex() const;
caf::PdmFieldHandle* objectToggleField() override;
@ -56,7 +56,7 @@ protected:
private:
caf::PdmField<bool> m_isActive;
caf::PdmField<QString> m_gridName;
caf::PdmField<int> m_gridIndex;
caf::PdmField<int> m_eclipseGridIndex;
};
//==================================================================================================
@ -71,7 +71,7 @@ public:
~RimGridInfoCollection() {}
bool isActive() const;
void addGridInfo(const QString& name, size_t gridIndex);
void addGridInfo(RimGridInfo * gridInfo);
void clear();
bool containsGrid(const QString& gridName) const;
void deleteGridInfo(const QString& gridName);

Binary file not shown.

After

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 837 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

View File

@ -132,6 +132,14 @@
<file>ICDValve16x16.png</file>
<file>ICVValve16x16.png</file>
<file>CasingDesign16x16.png</file>
<file>LGR16x16.png</file>
<file>MainGrid16x16.png</file>
<file>TempLGR16x16.png</file>
<file>ToggleOff16x16.png</file>
<file>ToggleOn16x16.png</file>
<file>ToggleOnOff16x16.png</file>
<file>ToggleOnOthersOff16x16.png</file>
<file>ExportCompletionsSymbol16x16.png</file>
</qresource>
<qresource prefix="/Shader/">
<file>fs_CellFace.glsl</file>

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 337 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 B