mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3810 HoloLens : Fix update of checkable toolbar button
This commit is contained in:
parent
9bb4cb3e1a
commit
17f42df110
@ -92,20 +92,21 @@ bool RicHoloLensAutoExportToSharingServerFeature::isCommandEnabled()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RicHoloLensAutoExportToSharingServerFeature::onActionTriggered(bool isChecked)
|
void RicHoloLensAutoExportToSharingServerFeature::onActionTriggered(bool isChecked)
|
||||||
{
|
{
|
||||||
|
m_isActive = !m_isActive;
|
||||||
|
|
||||||
if (!isSessionValid())
|
if (!isSessionValid())
|
||||||
{
|
{
|
||||||
RiaLogging::error("No valid HoloLens session present");
|
RiaLogging::error("No valid HoloLens session present");
|
||||||
return;
|
m_isActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
RimGridView* activeView = RiaApplication::instance()->activeGridView();
|
||||||
if (!activeView)
|
if (!activeView)
|
||||||
{
|
{
|
||||||
RiaLogging::error("No active view");
|
RiaLogging::error("No active view");
|
||||||
return;
|
m_isActive = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_isActive = isChecked;
|
|
||||||
if (m_isActive)
|
if (m_isActive)
|
||||||
{
|
{
|
||||||
triggerUpdateSession();
|
triggerUpdateSession();
|
||||||
@ -124,6 +125,7 @@ void RicHoloLensAutoExportToSharingServerFeature::setupActionLook(QAction* actio
|
|||||||
actionToSetup->setIcon(QIcon(combinedPixmap));
|
actionToSetup->setIcon(QIcon(combinedPixmap));
|
||||||
|
|
||||||
actionToSetup->setText("Automatically Export to Sharing Server");
|
actionToSetup->setText("Automatically Export to Sharing Server");
|
||||||
|
actionToSetup->setCheckable(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -123,9 +123,10 @@ void RicHoloLensSessionManager::refreshToolbarState()
|
|||||||
|
|
||||||
commandIds << "RicHoloLensCreateSessionFeature";
|
commandIds << "RicHoloLensCreateSessionFeature";
|
||||||
commandIds << "RicHoloLensExportToSharingServerFeature";
|
commandIds << "RicHoloLensExportToSharingServerFeature";
|
||||||
|
commandIds << "RicHoloLensAutoExportToSharingServerFeature";
|
||||||
commandIds << "RicHoloLensTerminateSessionFeature";
|
commandIds << "RicHoloLensTerminateSessionFeature";
|
||||||
|
|
||||||
caf::CmdFeatureManager::instance()->refreshEnabledState(commandIds);
|
caf::CmdFeatureManager::instance()->refreshStates(commandIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user