Skip to content

Commit 9519e40

Browse files
committed
change AbstractSessionApp to have setup_internal method and base session app subclasses call it, fixes an issue where SessionListener never got set in single session app
1 parent 0225b1e commit 9519e40

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

widgets/+wt/+apps/AbstractSessionApp.m

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@
8787
% Call superclass constructor
8888
[email protected](varargin{:});
8989

90-
% Attach listeners to Session being set
91-
app.SessionSetListener = listener(app,"Session","PostSet",...
92-
@(~,~)app.onSessionSet_Private());
93-
9490
end %function
9591

9692
end %methods
@@ -99,6 +95,19 @@
9995
%% Protected Methods
10096
methods (Access = protected)
10197

98+
function setup_internal(app)
99+
% Preform internal pre-setup necessary
100+
101+
% Show output if Debug is on
102+
app.displayDebugText();
103+
104+
% Attach listeners to Session being set
105+
app.SessionSetListener = listener(app,"Session","PostSet",...
106+
@(~,~)app.onSessionSet_Private());
107+
108+
end %function
109+
110+
102111
function onSessionSet(app)
103112
% This method is called when the Session property has changed,
104113
% such as a session being added or removed from the app. The

widgets/+wt/+apps/BaseMultiSessionApp.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,9 @@ function selectSession(app, session)
309309
function setup_internal(app)
310310
% Preform internal pre-setup necessary
311311

312+
% Call superclass method
313+
app.setup_internal@wt.apps.AbstractSessionApp();
314+
312315
% Show output if Debug is on
313316
app.displayDebugText();
314317

widgets/+wt/+apps/BaseSingleSessionApp.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ function close(app)
141141
function setup_internal(app)
142142
% Preform internal pre-setup necessary
143143

144+
% Call superclass method
145+
app.setup_internal@wt.apps.AbstractSessionApp();
146+
144147
% Show output if Debug is on
145148
app.displayDebugText();
146149

0 commit comments

Comments
 (0)