mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-28 04:20:19 +02:00
7.21
Better error messages for folder links
This commit is contained in:
parent
23ac0ef27c
commit
dc27145212
2
pom.xml
2
pom.xml
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.tonikelope</groupId>
|
||||
<artifactId>MegaBasterd</artifactId>
|
||||
<version>7.20</version>
|
||||
<version>7.21</version>
|
||||
<packaging>jar</packaging>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -34,7 +34,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
||||
|
||||
private long _total_space;
|
||||
|
||||
private boolean _mega_error;
|
||||
private int _mega_error;
|
||||
|
||||
public List<HashMap> getDownload_links() {
|
||||
return Collections.unmodifiableList(_download_links);
|
||||
@ -44,7 +44,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
||||
return _download;
|
||||
}
|
||||
|
||||
public boolean isMega_error() {
|
||||
public int isMega_error() {
|
||||
return _mega_error;
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
||||
|
||||
translateLabels(this);
|
||||
|
||||
_mega_error = false;
|
||||
_mega_error = 0;
|
||||
_total_space = 0L;
|
||||
_download = false;
|
||||
_download_links = new ArrayList<>();
|
||||
@ -79,7 +79,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
||||
THREAD_POOL.execute(() -> {
|
||||
_loadMegaDirTree();
|
||||
|
||||
if (!_mega_error) {
|
||||
if (_mega_error == 0) {
|
||||
|
||||
_genDownloadLiks();
|
||||
|
||||
@ -87,6 +87,12 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
||||
|
||||
pack();
|
||||
|
||||
} else if (_mega_error == -18) {
|
||||
|
||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("MEGA LINK TEMPORARILY UNAVAILABLE!"), "Error", JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
setVisible(false);
|
||||
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("MEGA LINK ERROR!"), "Error", JOptionPane.ERROR_MESSAGE);
|
||||
|
||||
@ -388,23 +394,37 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
||||
} while (current_node != root);
|
||||
}
|
||||
|
||||
final JTree ftree = file_tree;
|
||||
if (root == null) {
|
||||
LOG.log(SEVERE, null, "MEGA FOLDER ERROR (EMPTY?)");
|
||||
|
||||
final MegaMutableTreeNode roott = root;
|
||||
_mega_error = 2;
|
||||
|
||||
swingInvoke(() -> {
|
||||
ftree.setModel(new DefaultTreeModel(sortTree(roott)));
|
||||
} else {
|
||||
final JTree ftree = file_tree;
|
||||
|
||||
ftree.setRootVisible(roott != null ? roott.getChildCount() > 0 : false);
|
||||
final MegaMutableTreeNode roott = root;
|
||||
|
||||
ftree.setEnabled(true);
|
||||
});
|
||||
swingInvoke(() -> {
|
||||
ftree.setModel(new DefaultTreeModel(sortTree(roott)));
|
||||
|
||||
ftree.setRootVisible(roott != null ? roott.getChildCount() > 0 : false);
|
||||
|
||||
ftree.setEnabled(true);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
} catch (MegaAPIException mex) {
|
||||
|
||||
LOG.log(SEVERE, null, mex);
|
||||
|
||||
_mega_error = mex.getCode();
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
||||
LOG.log(SEVERE, null, ex);
|
||||
|
||||
_mega_error = true;
|
||||
_mega_error = 1;
|
||||
}
|
||||
|
||||
swingInvoke(() -> {
|
||||
|
@ -265,6 +265,8 @@ public class LabelTranslatorSingleton {
|
||||
_addTranslation("UPLOAD FAILED: too many errors", "LA SUBIDA FALLÓ: demasiados errores");
|
||||
_addTranslation("UPLOAD FAILED: FATAL ERROR", "LA SUBIDA FALLÓ: ERROR FATAL");
|
||||
_addTranslation("BAD NEWS :( File is DAMAGED!", "MALAS NOTICIAS :( El archivo está corrupto!");
|
||||
_addTranslation("MEGA LINK TEMPORARILY UNAVAILABLE!", "¡ENLACE TEMPORALMENTE NO DISPONIBLE!");
|
||||
|
||||
_addTranslation("File temporarily unavailable! (Retrying in ", "¡Archivo temporalmente no disponible! (Reintentando en ");
|
||||
_addTranslation(" secs...)", " segundos...)");
|
||||
_addTranslation(" (Retrying in ", " (Reintentando en ");
|
||||
|
@ -57,7 +57,7 @@ import javax.swing.UIManager;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "7.20";
|
||||
public static final String VERSION = "7.21";
|
||||
public static final boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
|
||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||
public static final int DEFAULT_BYTE_BUFFER_SIZE = 16 * 1024;
|
||||
|
@ -1001,7 +1001,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
|
||||
FolderLinkDialog fdialog = new FolderLinkDialog(_main_panel.getView(), true, url);
|
||||
|
||||
if (!fdialog.isMega_error()) {
|
||||
if (fdialog.isMega_error() == 0) {
|
||||
|
||||
fdialog.setLocationRelativeTo(_main_panel.getView());
|
||||
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 205 KiB |
Loading…
x
Reference in New Issue
Block a user