#1401 Disable model change notification for several features

This commit is contained in:
Magne Sjaastad
2017-04-20 10:38:58 +02:00
parent 530400fb28
commit 31852ba94f
21 changed files with 44 additions and 0 deletions

View File

@@ -37,6 +37,8 @@ bool RicCloseProjectFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicCloseProjectFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;

View File

@@ -42,6 +42,8 @@ bool RicEditPreferencesFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicEditPreferencesFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QStringList tabNames = app->preferences()->tabNames();

View File

@@ -37,7 +37,11 @@ bool RicExitApplicationFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExitApplicationFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
if (!app->askUserToSaveModifiedProject()) return;
app->closeAllWindows();
}

View File

@@ -48,6 +48,8 @@ bool RicHelpAboutFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicHelpAboutFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
caf::AboutDialog dlg(NULL);
dlg.setApplicationName(RI_APPLICATION_NAME);

View File

@@ -39,6 +39,8 @@ bool RicLaunchUnitTestsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicLaunchUnitTestsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication::instance()->launchUnitTestsWithConsole();
}

View File

@@ -40,6 +40,8 @@ bool RicSaveProjectAsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveProjectAsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
RicSaveProjectFeature::storeTreeViewState();

View File

@@ -46,6 +46,8 @@ bool RicSaveProjectFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveProjectFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
RicSaveProjectFeature::storeTreeViewState();

View File

@@ -39,6 +39,8 @@ bool RicShowMainWindowFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowMainWindowFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiuMainWindow* mainWnd = RiuMainWindow::instance();
if (mainWnd->isMinimized())

View File

@@ -188,6 +188,8 @@ bool RicShowPlotDataFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowPlotDataFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::vector<RimSummaryPlot*> selectedSummaryPlots;
caf::SelectionManager::instance()->objectsByType(&selectedSummaryPlots);

View File

@@ -37,6 +37,8 @@ bool RicShowPlotWindowFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowPlotWindowFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication::instance()->getOrCreateAndShowMainPlotWindow();
}

View File

@@ -47,6 +47,8 @@ bool RicTileWindowsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicTileWindowsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiuMainWindow* mainWindow = RiuMainWindow::instance();
if (mainWindow)
{