mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2412 Disable irrelevant toolbar commands
This commit is contained in:
@@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT(RicTogglePerspectiveViewFeature, "RicTogglePerspectiveViewFe
|
|||||||
bool RicTogglePerspectiveViewFeature::isCommandEnabled()
|
bool RicTogglePerspectiveViewFeature::isCommandEnabled()
|
||||||
{
|
{
|
||||||
this->action(); // Retrieve the action to update the looks
|
this->action(); // Retrieve the action to update the looks
|
||||||
return RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer();
|
return RiaApplication::instance()->activeGridView() && RiaApplication::instance()->activeReservoirView()->viewer();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
@@ -42,7 +42,7 @@ bool RicTogglePerspectiveViewFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicTogglePerspectiveViewFeature::onActionTriggered(bool isChecked)
|
void RicTogglePerspectiveViewFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
if(RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
if(RiaApplication::instance()->activeGridView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
||||||
{
|
{
|
||||||
bool isPerspective = RiaApplication::instance()->activeReservoirView()->isPerspectiveView();
|
bool isPerspective = RiaApplication::instance()->activeReservoirView()->isPerspectiveView();
|
||||||
RiaApplication::instance()->activeReservoirView()->isPerspectiveView = !isPerspective;
|
RiaApplication::instance()->activeReservoirView()->isPerspectiveView = !isPerspective;
|
||||||
|
|||||||
@@ -723,7 +723,7 @@ void RiuMainWindow::slotRefreshEditActions()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMainWindow::slotRefreshViewActions()
|
void RiuMainWindow::slotRefreshViewActions()
|
||||||
{
|
{
|
||||||
bool enabled = true;
|
bool enabled = RiaApplication::instance()->activeGridView() != nullptr;
|
||||||
m_viewFromNorth->setEnabled(enabled);
|
m_viewFromNorth->setEnabled(enabled);
|
||||||
m_viewFromSouth->setEnabled(enabled);
|
m_viewFromSouth->setEnabled(enabled);
|
||||||
m_viewFromEast->setEnabled(enabled);
|
m_viewFromEast->setEnabled(enabled);
|
||||||
@@ -1445,6 +1445,7 @@ void RiuMainWindow::refreshDrawStyleActions()
|
|||||||
{
|
{
|
||||||
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
|
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
|
||||||
bool enable = view != NULL;
|
bool enable = view != NULL;
|
||||||
|
bool isGridView = RiaApplication::instance()->activeGridView() != nullptr;
|
||||||
|
|
||||||
m_drawStyleLinesAction->setEnabled(enable);
|
m_drawStyleLinesAction->setEnabled(enable);
|
||||||
m_drawStyleLinesSolidAction->setEnabled(enable);
|
m_drawStyleLinesSolidAction->setEnabled(enable);
|
||||||
@@ -1458,9 +1459,9 @@ void RiuMainWindow::refreshDrawStyleActions()
|
|||||||
m_disableLightingAction->setChecked(lightingDisabledInView);
|
m_disableLightingAction->setChecked(lightingDisabledInView);
|
||||||
m_disableLightingAction->blockSignals(false);
|
m_disableLightingAction->blockSignals(false);
|
||||||
|
|
||||||
if (enable)
|
m_drawStyleHideGridCellsAction->setEnabled(isGridView);
|
||||||
|
if (isGridView)
|
||||||
{
|
{
|
||||||
m_drawStyleHideGridCellsAction->setEnabled(true);
|
|
||||||
m_drawStyleHideGridCellsAction->blockSignals(true);
|
m_drawStyleHideGridCellsAction->blockSignals(true);
|
||||||
m_drawStyleHideGridCellsAction->setChecked(!view->isGridVisualizationMode());
|
m_drawStyleHideGridCellsAction->setChecked(!view->isGridVisualizationMode());
|
||||||
m_drawStyleHideGridCellsAction->blockSignals(false);
|
m_drawStyleHideGridCellsAction->blockSignals(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user