Skip to content

Commit d57fd20

Browse files
authored
Merge pull request #125 from eharris369/124-stopUpdateIfDisabled
Issue #124: Don't continue with update if project is disabled
2 parents d424ec7 + 6ac7352 commit d57fd20

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

dev/com.ibm.microclimate.core/src/com/ibm/microclimate/core/internal/MicroclimateApplication.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,12 @@ public synchronized void setAutoBuild(boolean enabled) {
129129
}
130130

131131
public synchronized void setEnabled(boolean enabled) {
132+
boolean reenabled = enabled && !this.enabled;
132133
this.enabled = enabled;
134+
if (reenabled) {
135+
mcConnection.refreshApps(projectID);
136+
MCUtil.updateApplication(this);
137+
}
133138
}
134139

135140
public synchronized void setContainerId(String id) {

dev/com.ibm.microclimate.core/src/com/ibm/microclimate/core/internal/MicroclimateApplicationFactory.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,12 @@ public static void updateApp(MicroclimateApplication mcApp, JSONObject appJso) {
146146
// Set the app state
147147
if (appJso.has(MCConstants.KEY_OPEN_STATE)) {
148148
String state = appJso.getString(MCConstants.KEY_OPEN_STATE);
149-
mcApp.setEnabled(!MCConstants.VALUE_STATE_CLOSED.equals(state));
149+
if (MCConstants.VALUE_STATE_CLOSED.equals(state)) {
150+
mcApp.setEnabled(false);
151+
return;
152+
}
150153
}
154+
mcApp.setEnabled(true);
151155

152156
// Set the app status
153157
if (appJso.has(MCConstants.KEY_APP_STATUS)) {

dev/com.ibm.microclimate.ui/src/com/ibm/microclimate/ui/internal/actions/AttachDebuggerAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void run() {
7070

7171
public boolean showAction() {
7272
// Don't show the action if the app does not support debug
73-
return (app != null && app.supportsDebug());
73+
return (app != null && app.isAvailable() && app.supportsDebug());
7474
}
7575

7676
}

0 commit comments

Comments
 (0)