diff options
author | Simon Rettberg | 2022-03-22 09:42:05 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-03-22 09:42:05 +0100 |
commit | eb9e7f5b21c1ba122cfb4f766c11805c1a2471f2 (patch) | |
tree | 82f1eeae8a0e6f8f37ca784e8cc98f4b4e896c64 /dozentenmodul/src | |
parent | [client] Install default thread exception handler (diff) | |
download | tutor-module-eb9e7f5b21c1ba122cfb4f766c11805c1a2471f2.tar.gz tutor-module-eb9e7f5b21c1ba122cfb4f766c11805c1a2471f2.tar.xz tutor-module-eb9e7f5b21c1ba122cfb4f766c11805c1a2471f2.zip |
[client] Fix closing upload activity panel
Diffstat (limited to 'dozentenmodul/src')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java index 7e56b0e8..0ad07abc 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/activity/UploadPanel.java @@ -56,26 +56,30 @@ public class UploadPanel extends TransferPanel implements QuitNotification { state.upload.getUploadTask().addListener(this); } + /** + * Cancel/Close pressed + */ private class ButtonAction implements ActionListener { @Override public void actionPerformed(ActionEvent e) { - if (state == null) - return; - state.getUploadTask().removeListener(panel); - if (!state.getUploadTask().isCanceled()) { - if (!Gui.showMessageBox(panel, I18n.ACTIVITY.getString("UploadPanel.Message.yesNo.cancelTransfer"), - MessageType.QUESTION_YESNO, null, null)) - return; - final UploadInitiator fstate = state; - QuickTimer.scheduleOnce(new Task() { - @Override - public void fire() { - fstate.cancelError("UploadPanel: Requested by user through button press"); - } - }); + if (state != null) { + if (!state.getUploadTask().isCanceled()) { + if (!Gui.showMessageBox(panel, + I18n.ACTIVITY.getString("UploadPanel.Message.yesNo.cancelTransfer"), + MessageType.QUESTION_YESNO, null, null)) + return; + final UploadInitiator fstate = state; + QuickTimer.scheduleOnce(new Task() { + @Override + public void fire() { + fstate.cancelError("UploadPanel: Requested by user through button press"); + } + }); + } + state.getUploadTask().removeListener(panel); + state = null; } close(); - state = null; } } |