#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)
{

View File

@@ -51,6 +51,8 @@ bool RicSaveEclipseInputPropertyFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseInputPropertyFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RimEclipseInputProperty* inputProperty = selectedInputProperty();
if (!inputProperty) return;

View File

@@ -47,6 +47,8 @@ bool RicSaveEclipseResultAsInputPropertyFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSaveEclipseResultAsInputPropertyFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::vector<RimEclipseCellColors*> selection;
caf::SelectionManager::instance()->objectsByType(&selection);
if (selection.size() == 1)

View File

@@ -53,6 +53,8 @@ bool RicShowTotalAllocationDataFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicShowTotalAllocationDataFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::set<RimWellAllocationPlot*> wellAllocPlots = RicShowTotalAllocationDataFeature::selectedWellAllocationPlots();
CVF_ASSERT(wellAllocPlots.size() > 0);

View File

@@ -57,6 +57,8 @@ bool RicCopyReferencesToClipboardFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicCopyReferencesToClipboardFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
if (!isAnyCopyableObjectSelected()) return;
std::vector<QString> referenceList;

View File

@@ -57,6 +57,8 @@ bool RicExportFaultsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportFaultsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
std::vector<RimFault*> selectedFaults;
caf::SelectionManager::instance()->objectsByType(&selectedFaults);

View File

@@ -68,6 +68,8 @@ bool RicExportMultipleSnapshotsFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportMultipleSnapshotsFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RimProject* proj = RiaApplication::instance()->project();
if (proj)

View File

@@ -54,6 +54,8 @@ bool RicExportToLasFileFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
if (RicWellLogPlotCurveFeatureImpl::parentWellAllocationPlot()) return;
std::vector<RimWellLogCurve*> curves = RicWellLogPlotCurveFeatureImpl::selectedWellLogCurves();

View File

@@ -52,6 +52,8 @@ bool RicSnapshotViewToClipboardFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicSnapshotViewToClipboardFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RimViewWindow* viewWindow = RiaApplication::activeViewWindow();
if (viewWindow)

View File

@@ -56,6 +56,8 @@ bool RicAsciiExportSummaryPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicAsciiExportSummaryPlotFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString projectFolder = app->currentProjectPath();

View File

@@ -54,6 +54,8 @@ bool RicAsciiExportWellLogPlotFeature::isCommandEnabled()
//--------------------------------------------------------------------------------------------------
void RicAsciiExportWellLogPlotFeature::onActionTriggered(bool isChecked)
{
this->disableModelChangeContribution();
RiaApplication* app = RiaApplication::instance();
QString projectFolder = app->currentProjectPath();