tonikelope 2019-12-09 14:11:32 +01:00
parent 815723c1c2
commit 591ca33c67
8 changed files with 29 additions and 8 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>6.79</version>
<version>6.80</version>
<packaging>jar</packaging>
<dependencies>
<dependency>

View File

@ -193,6 +193,10 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
}
public boolean isCanceled() {
return _canceled;
}
public boolean isTurbo() {
return _turbo;
}
@ -493,6 +497,12 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
_closed = true;
try {
deleteDownload(_url);
} catch (SQLException ex) {
LOG.log(SEVERE, null, ex);
}
_main_panel.getDownload_manager().getTransference_remove_queue().add(this);
_main_panel.getDownload_manager().secureNotify();
@ -863,7 +873,7 @@ public class Download implements Transference, Runnable, SecureSingleThreadNotif
}
}
if (_status_error == null) {
if (_status_error == null && !_canceled) {
try {
deleteDownload(_url);

View File

@ -386,7 +386,6 @@ public class DownloadView extends javax.swing.JPanel implements TransferenceView
private void close_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_close_buttonActionPerformed
_download.close();
close_button.setVisible(false);
}//GEN-LAST:event_close_buttonActionPerformed
private void copy_link_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copy_link_buttonActionPerformed

View File

@ -53,7 +53,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "6.79";
public static final String VERSION = "6.80";
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
public static final int STREAMER_PORT = 1337;
@ -939,7 +939,7 @@ public final class MainPanel {
options[0]);
if (n == 1) {
Files.copy(Paths.get(System.getProperty("user.home") + "/.megabasterd_old_backups/.megabasterd" + old_version + "/" + SqliteSingleton.SQLITE_FILE), Paths.get(System.getProperty("user.home") + "/.megabasterd" + MainPanel.VERSION + "/" + SqliteSingleton.SQLITE_FILE), StandardCopyOption.REPLACE_EXISTING);
Files.move(Paths.get(System.getProperty("user.home") + "/.megabasterd_old_backups/.megabasterd" + old_version + "/" + SqliteSingleton.SQLITE_FILE), Paths.get(System.getProperty("user.home") + "/.megabasterd" + MainPanel.VERSION + "/" + SqliteSingleton.SQLITE_FILE), StandardCopyOption.REPLACE_EXISTING);
JOptionPane.showMessageDialog(getView(), LabelTranslatorSingleton.getInstance().translate("MegaBasterd will restart"), LabelTranslatorSingleton.getInstance().translate("Restart required"), JOptionPane.WARNING_MESSAGE);

View File

@ -38,6 +38,8 @@ public interface Transference {
boolean isRestart();
boolean isCanceled();
void unfreeze();
void upWaitQueue();

View File

@ -247,7 +247,7 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
public void closeAllFinished() {
_transference_finished_queue.stream().filter((t) -> (!t.isStatusError())).map((t) -> {
_transference_finished_queue.stream().filter((t) -> (!t.isStatusError() && !t.isCanceled())).map((t) -> {
_transference_finished_queue.remove(t);
return t;
}).forEachOrdered((t) -> {
@ -487,7 +487,7 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
private boolean _isOKFinishedInQueue() {
return _transference_finished_queue.stream().anyMatch((t) -> (!t.isStatusError()));
return _transference_finished_queue.stream().anyMatch((t) -> (!t.isStatusError() && !t.isCanceled()));
}
@Override

View File

@ -146,6 +146,10 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_temp_mac_data = null;
}
public boolean isCanceled() {
return _canceled;
}
public String getTemp_mac_data() {
return _temp_mac_data;
}
@ -521,6 +525,12 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
_closed = true;
try {
DBTools.deleteUpload(_file_name, _ma.getFull_email());
} catch (SQLException ex) {
LOG.log(Level.SEVERE, ex.getMessage());
}
_main_panel.getUpload_manager().getTransference_remove_queue().add(this);
_main_panel.getUpload_manager().secureNotify();
@ -947,7 +957,7 @@ public class Upload implements Transference, Runnable, SecureSingleThreadNotifia
getView().printStatusNormal("Upload CANCELED!");
}
if (_status_error == null || _main_panel.isExit()) {
if ((_status_error == null && !_canceled) || _main_panel.isExit()) {
try {
DBTools.deleteUpload(_file_name, _ma.getFull_email());

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

After

Width:  |  Height:  |  Size: 190 KiB