Support running jobs without blocking GUI (#13040)

* Add view job log command.
* Add stop job command.
* Do not block ui while job is running.
* Show progress while job is running
* Make sure user gets notified of running jobs when exiting ResInsight or closing current project.
This commit is contained in:
JJ authored and GitHub committed 2025-10-18 02:42:11 +02:00
1 parent c38819bac7
commit 1eaf50b6b9
29 files changed
+809 -122

No files matched your search

@@ -48,6 +48,7 @@
#include "SummaryPlotCommands/RicSummaryPlotFeatureImpl.h"
#include "Formations/RimFormationNamesCollection.h"
#include "Jobs/RimJobCollection.h"
#include "Rim2dIntersectionViewCollection.h"
#include "RimAnnotationCollection.h"
#include "RimAnnotationInViewCollection.h"
@@ -289,6 +290,34 @@ bool RiaGuiApplication::saveProjectAs( const QString& fileName )
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaGuiApplication::notifyUserAboutRunningJobs()
{
if ( m_project->jobCollection()->numberOfRunningJobs() > 0 )
{
QMessageBox::critical( nullptr,
"Active running jobs",
"One or more jobs are still running, you need to stop all jobs before continuing." );
return false;
}
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RiaGuiApplication::checkWithUserBeforeClose()
{
// check for any running jobs
if ( !notifyUserAboutRunningJobs() ) return false;
// ask user to save modified project if needed
if ( !askUserToSaveModifiedProject() ) return false;
return true;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -88,9 +88,10 @@ public:
bool saveProject();
QString promptForProjectSaveAsFileName() const;
bool askUserToSaveModifiedProject();
bool saveProjectAs( const QString& fileName );
bool checkWithUserBeforeClose();
void runMultiCaseSnapshots( const QString& templateProjectFileName, std::vector<QString> gridFileNames, const QString& snapshotFolderName );
bool useShaders() const;
@@ -127,6 +128,10 @@ public:
protected:
bool notify( QObject* receiver, QEvent* event ) override;
// use the checkWithUserBeforeClose function, to get all checks in one go
bool notifyUserAboutRunningJobs();
bool askUserToSaveModifiedProject();
// Protected RiaApplication overrides
void invokeProcessEvents( QEventLoop::ProcessEventsFlags flags = QEventLoop::AllEvents ) override;
void onFileSuccessfullyLoaded( const QString& fileName, RiaDefines::ImportFileType fileType ) override;