dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

🐛 [BUG] - Double Click on open project while task is running leads to warning #1196

Closed jensschmeink closed 4 days ago

jensschmeink commented 4 months ago

Summary

If you have a open Project and you double click it in the explorer while a task is running there will be a warning in a dialog

Expected Behaviour

As the project is the open project no warning should occur

Reproduction steps

Open GTlab with a project and open this project.

Start a process which takes a while. 

Double click the projec tin the explorer while the process is running

Screenshots

grafik

Logs

No response

GTlab environment

GTlab Version: 2.0.6
Module 1 Version: X.Y.Z
Module 2 Version: X.Y.Z

OS

Windows

rainman110 commented 4 months ago

I would even say, that if a task is running, other projects should be greyed out / be inactive instead of showing a warning.

NitenIchiry commented 2 weeks ago

@rainman110 I would in this case disconnect all signals and turn the project dockwidget into the background/unclickable. But I do not really understand how all of this works. I would use gt::currentProcessExecutor().taskCurrentlyRunning() to check whether a task is running, but at what point can I access the widgets and diasble them ? Is there a loop for the execution ? This should work with a signal slot in the app, shouldnt it ?

rainman110 commented 2 weeks ago

@NitenIchiry Without having had a look into the code. I would not disconnect any signals though. There is a QSignalBlocker object that you can use to temporarily disable passing signals .

I would though check in the code, where the warning message widget is created, to only generate it, if a task is running and if the project is not the current project. Let me find out, where the message box is generated...

rainman110 commented 2 weeks ago

@NitenIchiry Please see here:

https://github.com/dlr-gtlab/gtlab-core/blob/4fdcad7be02f2d32f5d8a079066f761703d8197f/src/gui/object_ui/gt_projectui.cpp#L350-L364

You simply need to add a check, whether the current project is not the one to switch

NitenIchiry commented 4 days ago

fixed in https://github.com/dlr-gtlab/gtlab-core/pull/1282