mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
#2412 Disable irrelevant toolbar commands
This commit is contained in:
parent
6dead054c4
commit
f931b92341
@ -34,7 +34,7 @@ CAF_CMD_SOURCE_INIT(RicTogglePerspectiveViewFeature, "RicTogglePerspectiveViewFe
|
||||
bool RicTogglePerspectiveViewFeature::isCommandEnabled()
|
||||
{
|
||||
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)
|
||||
{
|
||||
if(RiaApplication::instance()->activeReservoirView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
||||
if(RiaApplication::instance()->activeGridView() && RiaApplication::instance()->activeReservoirView()->viewer())
|
||||
{
|
||||
bool isPerspective = RiaApplication::instance()->activeReservoirView()->isPerspectiveView();
|
||||
RiaApplication::instance()->activeReservoirView()->isPerspectiveView = !isPerspective;
|
||||
|
@ -723,7 +723,7 @@ void RiuMainWindow::slotRefreshEditActions()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMainWindow::slotRefreshViewActions()
|
||||
{
|
||||
bool enabled = true;
|
||||
bool enabled = RiaApplication::instance()->activeGridView() != nullptr;
|
||||
m_viewFromNorth->setEnabled(enabled);
|
||||
m_viewFromSouth->setEnabled(enabled);
|
||||
m_viewFromEast->setEnabled(enabled);
|
||||
@ -1445,6 +1445,7 @@ void RiuMainWindow::refreshDrawStyleActions()
|
||||
{
|
||||
Rim3dView* view = RiaApplication::instance()->activeReservoirView();
|
||||
bool enable = view != NULL;
|
||||
bool isGridView = RiaApplication::instance()->activeGridView() != nullptr;
|
||||
|
||||
m_drawStyleLinesAction->setEnabled(enable);
|
||||
m_drawStyleLinesSolidAction->setEnabled(enable);
|
||||
@ -1458,9 +1459,9 @@ void RiuMainWindow::refreshDrawStyleActions()
|
||||
m_disableLightingAction->setChecked(lightingDisabledInView);
|
||||
m_disableLightingAction->blockSignals(false);
|
||||
|
||||
if (enable)
|
||||
m_drawStyleHideGridCellsAction->setEnabled(isGridView);
|
||||
if (isGridView)
|
||||
{
|
||||
m_drawStyleHideGridCellsAction->setEnabled(true);
|
||||
m_drawStyleHideGridCellsAction->blockSignals(true);
|
||||
m_drawStyleHideGridCellsAction->setChecked(!view->isGridVisualizationMode());
|
||||
m_drawStyleHideGridCellsAction->blockSignals(false);
|
||||
|
Loading…
Reference in New Issue
Block a user