@@ -74,9 +74,28 @@ qx.Class.define("osparc.desktop.StudyEditor", {
74
74
osparc . store . Store . getInstance ( ) . setCurrentStudy ( study ) ;
75
75
study . buildWorkbench ( ) ;
76
76
study . openStudy ( ) ;
77
- this . __initDefault ( ) ;
77
+ this . __initViews ( ) ;
78
78
this . __connectEvents ( ) ;
79
79
this . __startAutoSaveTimer ( ) ;
80
+
81
+ this . __openOneNode ( ) ;
82
+ } ,
83
+
84
+ __openOneNode : function ( ) {
85
+ const validNodeIds = [ ] ;
86
+ const allNodes = this . getStudy ( ) . getWorkbench ( ) . getNodes ( true ) ;
87
+ Object . values ( allNodes ) . forEach ( node => {
88
+ if ( ! node . isFilePicker ( ) ) {
89
+ validNodeIds . push ( node . getNodeId ( ) ) ;
90
+ }
91
+ } ) ;
92
+
93
+ const preferencesSettings = osparc . desktop . preferences . Preferences . getInstance ( ) ;
94
+ if ( validNodeIds . length === 1 && preferencesSettings . getAutoOpenNode ( ) ) {
95
+ this . nodeSelected ( validNodeIds [ 0 ] ) ;
96
+ } else {
97
+ this . nodeSelected ( this . getStudy ( ) . getUuid ( ) ) ;
98
+ }
80
99
} ,
81
100
82
101
/**
@@ -87,7 +106,7 @@ qx.Class.define("osparc.desktop.StudyEditor", {
87
106
this . __stopAutoSaveTimer ( ) ;
88
107
} ,
89
108
90
- __initDefault : function ( ) {
109
+ __initViews : function ( ) {
91
110
const study = this . getStudy ( ) ;
92
111
93
112
const nodesTree = this . __nodesTree = new osparc . component . widget . NodesTree ( study ) ;
@@ -112,7 +131,6 @@ qx.Class.define("osparc.desktop.StudyEditor", {
112
131
const edgeId = e . getData ( ) ;
113
132
this . __removeEdge ( edgeId ) ;
114
133
} , this ) ;
115
- this . showInMainView ( workbenchUI , study . getUuid ( ) ) ;
116
134
117
135
this . __nodeView = new osparc . component . node . NodeView ( ) . set ( {
118
136
minHeight : 200
0 commit comments