Skip to content

Commit

Permalink
Make sure editing is quick and analyses are hidden in dataMode (jasp-…
Browse files Browse the repository at this point in the history
  • Loading branch information
JorisGoosen authored and RensDofferhoff committed Aug 21, 2023
1 parent c418300 commit 8cff078
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Desktop/components/JASP/Widgets/MainPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Item
// position of the rest)

property bool hasData: mainWindow.dataAvailable
property bool hasAnalysis: mainWindow.analysesAvailable
property bool hasAnalysis: mainWindow.analysesAvailable && !ribbonModel.dataMode

function minimizeDataPanel()
{
Expand Down
18 changes: 10 additions & 8 deletions Desktop/engine/enginesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,7 @@ void EngineSync::heartbeatTempFiles()
}

void EngineSync::stopEngines()
{
_stopProcessing = true;

{
auto timeout = QDateTime::currentSecsSinceEpoch() + 10;

for(EngineRepresentation * e : _engines)
Expand Down Expand Up @@ -1033,8 +1031,6 @@ void EngineSync::resumeEngines()
for(EngineRepresentation * engine : _engines)
startStoppedEngine(engine);

_stopProcessing = false;

while(!allEnginesResumed())
for (auto * engine : _engines)
engine->processReplies();
Expand Down Expand Up @@ -1074,13 +1070,19 @@ bool EngineSync::allEnginesInitializing(std::set<EngineRepresentation *> these)

void EngineSync::dataModeChanged(bool dataMode)
{
_stopProcessing = dataMode;

if(!dataMode)
{
Log::log() << "Data mode turned off, so restarting engines." << std::endl;

pauseEngines();
Log::log() << "Data mode turned off, resuming engines." << std::endl;
resumeEngines();
}
else
{
Log::log() << "Data mode turned on, pausing engines." << std::endl;
pauseEngines();
}

}

void EngineSync::enginesPrepareForData()
Expand Down
6 changes: 6 additions & 0 deletions Desktop/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,12 @@ void MainWindow::setCurrentJaspTheme()
_qml->rootContext()->setContextProperty("jaspTheme", JaspTheme::currentTheme());
}

void MainWindow::onDataModeChanged(bool dataMode)
{
if(dataMode && welcomePageVisible())
setWelcomePageVisible(false);
}

void MainWindow::initLog()
{
assert(_engineSync != nullptr && _preferences != nullptr);
Expand Down
2 changes: 1 addition & 1 deletion Desktop/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private slots:

void resetQmlCache();
void setCurrentJaspTheme();
void onDataModeChanged(bool dataMode) { if(dataMode && welcomePageVisible()) setWelcomePageVisible(false); }
void onDataModeChanged(bool dataMode);
void printQmlWarnings(const QList<QQmlError> &warnings);
void setQmlImportPaths();

Expand Down

0 comments on commit 8cff078

Please sign in to comment.