Skip to content
Snippets Groups Projects
Commit b48f55fc authored by Fabian Reister's avatar Fabian Reister
Browse files

Merge branch 'fix/reload-on-property-edit' into 'master'

ScenarioManager: Fix reload on property edit

See merge request !101
parents 7b1e1f10 330e3843
No related branches found
No related tags found
1 merge request!101ScenarioManager: Fix reload on property edit
Pipeline #20579 passed
Pipeline: RobotAPI

#20580

    ...@@ -1049,8 +1049,10 @@ DetailedApplicationView::on_fileUpdate() ...@@ -1049,8 +1049,10 @@ DetailedApplicationView::on_fileUpdate()
    lastAppInstance->save(); lastAppInstance->save();
    } }
    // we want to ignore any file changes made by us to avoid unnecessarily updating the GUI
    ignoreFileChanges = true;
    emit saveScenario(lastAppInstance); emit saveScenario(lastAppInstance);
    ignoreFileChanges = false;
    } }
    else if (lastScenario.get() != nullptr) else if (lastScenario.get() != nullptr)
    { {
    ...@@ -1097,6 +1099,12 @@ DetailedApplicationView::on_makeLocalButton_clicked() ...@@ -1097,6 +1099,12 @@ DetailedApplicationView::on_makeLocalButton_clicked()
    void void
    DetailedApplicationView::on_fileWatcherUpdate(const QString& path) DetailedApplicationView::on_fileWatcherUpdate(const QString& path)
    { {
    if (ignoreFileChanges)
    {
    ARMARX_VERBOSE << "Ignoring file change from: " << path.toStdString();
    return;
    }
    ARMARX_VERBOSE << "File changed: " << path.toStdString() << " -> reloading config"; ARMARX_VERBOSE << "File changed: " << path.toStdString() << " -> reloading config";
    if (lastAppInstance.get() != nullptr) if (lastAppInstance.get() != nullptr)
    ......
    ...@@ -155,6 +155,7 @@ private: ...@@ -155,6 +155,7 @@ private:
    QTimer updateTimer; QTimer updateTimer;
    QFileSystemWatcher fileSystemWatcher; QFileSystemWatcher fileSystemWatcher;
    bool ignoreFileChanges = false;
    }; };
    using DetailedApplicationViewPtr = std::shared_ptr<DetailedApplicationView>; using DetailedApplicationViewPtr = std::shared_ptr<DetailedApplicationView>;
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment