general fixes (#1)
All checks were successful
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 60.67% (15276/25178)
* Branch Coverage: 53.64% (5782/10779)
* Lines of Code: 25178
* Cyclomatic Complexity: 9960
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 11, passed: 545
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
All checks were successful
JaCoCo Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 60.67% (15276/25178)
* Branch Coverage: 53.64% (5782/10779)
* Lines of Code: 25178
* Cyclomatic Complexity: 9960
#### Quality Gates Summary
Output truncated.
Test / Build skipped: 11, passed: 545
Intrepid/Prometeu/Studio/pipeline/head This commit looks good
Reviewed-on: #1 Co-authored-by: bQUARKz <bquarkz@gmail.com> Co-committed-by: bQUARKz <bquarkz@gmail.com>
This commit is contained in:
parent
7b0cf2feb4
commit
676e40d088
@ -1,5 +1,6 @@
|
||||
package p.studio.controls.shell;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
@ -12,6 +13,7 @@ import p.studio.Container;
|
||||
import p.studio.controls.lifecycle.StudioControlLifecycle;
|
||||
import p.studio.controls.lifecycle.StudioControlLifecycleSupport;
|
||||
import p.studio.execution.StudioExecutionSessionService;
|
||||
import p.studio.execution.StudioExecutionSnapshot;
|
||||
import p.studio.execution.StudioExecutionState;
|
||||
import p.studio.utilities.events.EventSubscription;
|
||||
import p.studio.utilities.i18n.I18n;
|
||||
@ -78,7 +80,15 @@ public final class StudioRunSurfaceControl extends HBox implements StudioControl
|
||||
if (sessionSubscription != null) {
|
||||
return;
|
||||
}
|
||||
sessionSubscription = executionSessionService.subscribe(snapshot -> running.set(isRunningState(snapshot.state())));
|
||||
sessionSubscription = executionSessionService.subscribe(this::handleSessionUpdate);
|
||||
}
|
||||
|
||||
private void handleSessionUpdate(final StudioExecutionSnapshot snapshot) {
|
||||
if (Platform.isFxApplicationThread()) {
|
||||
running.set(isRunningState(snapshot.state()));
|
||||
return;
|
||||
}
|
||||
Platform.runLater(() -> running.set(isRunningState(snapshot.state())));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -15,7 +15,7 @@ fn init() -> void
|
||||
fn abs_i(v: int) -> int
|
||||
{
|
||||
if (v < 0) {
|
||||
return 0 - v;
|
||||
return -v;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user