Skip to content

Commit 4ea063f

Browse files
authored
Merge pull request #386 from rupak0577/sdkmanager
Update button text after window is closed
2 parents 3a39486 + bfc6561 commit 4ea063f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/SDKUpdater/src/processing/mode/android/tools/SDKUpdater.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,7 @@ public String getColumnName(int column) {
415415
actionButton.addActionListener(new ActionListener() {
416416
public void actionPerformed(ActionEvent e) {
417417
if (downloadTaskRunning) { // i.e button state is Cancel
418-
downloadTask.cancel(true);
419-
status.setText("Download cancelled");
420-
actionButton.setText("Update");
418+
cancelTasks();
421419
} else { // i.e button state is Update
422420
downloadTask = new DownloadTask();
423421
progressBar.setIndeterminate(true);
@@ -499,9 +497,11 @@ public void windowClosing(WindowEvent e) {
499497
public void cancelTasks() {
500498
queryTask.cancel(true);
501499
if (downloadTaskRunning) {
500+
downloadTask.cancel(true);
501+
status.setText("Download cancelled");
502502
JOptionPane.showMessageDialog(null,
503503
"Download cancelled", "Warning", JOptionPane.WARNING_MESSAGE);
504-
downloadTask.cancel(true);
504+
actionButton.setText("Update");
505505
}
506506
}
507507

0 commit comments

Comments
 (0)