diff options
| author | Michael Wilson | 2014-08-25 13:35:56 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-08-25 13:35:56 +0200 |
| commit | b06e2710fa3461302773ab5f1cad959d5e5cad57 (patch) | |
| tree | 8828cf947667b19c6e47af1cce7c3e04bbe8f158 /Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java | |
| parent | Anleitung zur Nutzung einer VMDK hinzugefügt (diff) | |
| download | tutor-module-b06e2710fa3461302773ab5f1cad959d5e5cad57.tar.gz tutor-module-b06e2710fa3461302773ab5f1cad959d5e5cad57.tar.xz tutor-module-b06e2710fa3461302773ab5f1cad959d5e5cad57.zip | |
Abfrage bei Schließen währen Up-Download
Diffstat (limited to 'Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java')
| -rw-r--r-- | Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java index 17b7449d..5b2ffe90 100644 --- a/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPEditUploader_GUI.java @@ -89,25 +89,42 @@ public class FTPEditUploader_GUI extends JFrame implements * Create the frame. */ public FTPEditUploader_GUI() { + + final Object[] options = { "Beenden", "Abbrechen" }; + addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent arg0) { if (taskrun == true) { - try { - - client.DeleteFtpUser(user.userName); - } catch (TException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - task.cancel(true); - } - con.closeThriftConnection(); - System.exit(0); + // check if user wants to quit. + int choice = JOptionPane + .showOptionDialog( + null, + "Aktuell ist ein Upload aktiv. Wollen Sie diesen Abbrechen und das Programm beenden?", + "Upload aktiv", + JOptionPane.YES_NO_CANCEL_OPTION, + JOptionPane.QUESTION_MESSAGE, null, + options, options[1]); + // 0=beenden, 1=abbrechen + if (choice == 0) { + + try { + + client.DeleteFtpUser(user.userName); + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + task.cancel(true); + con.closeThriftConnection(); + System.exit(0); + }// end if choice + }// end if taskrun }// end window closing }); setResizable(false); - // setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); + // Aktion die beim Schliessen durchgefuehrt werden soll + setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); |
