mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-05-29 04:50:14 +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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.tonikelope</groupId>
|
<groupId>com.tonikelope</groupId>
|
||||||
<artifactId>MegaBasterd</artifactId>
|
<artifactId>MegaBasterd</artifactId>
|
||||||
<version>7.20</version>
|
<version>7.21</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -34,7 +34,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
|||||||
|
|
||||||
private long _total_space;
|
private long _total_space;
|
||||||
|
|
||||||
private boolean _mega_error;
|
private int _mega_error;
|
||||||
|
|
||||||
public List<HashMap> getDownload_links() {
|
public List<HashMap> getDownload_links() {
|
||||||
return Collections.unmodifiableList(_download_links);
|
return Collections.unmodifiableList(_download_links);
|
||||||
@ -44,7 +44,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
|||||||
return _download;
|
return _download;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isMega_error() {
|
public int isMega_error() {
|
||||||
return _mega_error;
|
return _mega_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
|||||||
|
|
||||||
translateLabels(this);
|
translateLabels(this);
|
||||||
|
|
||||||
_mega_error = false;
|
_mega_error = 0;
|
||||||
_total_space = 0L;
|
_total_space = 0L;
|
||||||
_download = false;
|
_download = false;
|
||||||
_download_links = new ArrayList<>();
|
_download_links = new ArrayList<>();
|
||||||
@ -79,7 +79,7 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
|||||||
THREAD_POOL.execute(() -> {
|
THREAD_POOL.execute(() -> {
|
||||||
_loadMegaDirTree();
|
_loadMegaDirTree();
|
||||||
|
|
||||||
if (!_mega_error) {
|
if (_mega_error == 0) {
|
||||||
|
|
||||||
_genDownloadLiks();
|
_genDownloadLiks();
|
||||||
|
|
||||||
@ -87,6 +87,12 @@ public class FolderLinkDialog extends javax.swing.JDialog {
|
|||||||
|
|
||||||
pack();
|
pack();
|
||||||
|
|
||||||
|
} else if (_mega_error == -18) {
|
||||||
|
|
||||||
|
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("MEGA LINK TEMPORARILY UNAVAILABLE!"), "Error", JOptionPane.ERROR_MESSAGE);
|
||||||
|
|
||||||
|
setVisible(false);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(tthis, LabelTranslatorSingleton.getInstance().translate("MEGA LINK ERROR!"), "Error", JOptionPane.ERROR_MESSAGE);
|
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);
|
} 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(() -> {
|
} else {
|
||||||
ftree.setModel(new DefaultTreeModel(sortTree(roott)));
|
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) {
|
} catch (Exception ex) {
|
||||||
|
|
||||||
LOG.log(SEVERE, null, ex);
|
LOG.log(SEVERE, null, ex);
|
||||||
|
|
||||||
_mega_error = true;
|
_mega_error = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
swingInvoke(() -> {
|
swingInvoke(() -> {
|
||||||
|
@ -265,6 +265,8 @@ public class LabelTranslatorSingleton {
|
|||||||
_addTranslation("UPLOAD FAILED: too many errors", "LA SUBIDA FALLÓ: demasiados errores");
|
_addTranslation("UPLOAD FAILED: too many errors", "LA SUBIDA FALLÓ: demasiados errores");
|
||||||
_addTranslation("UPLOAD FAILED: FATAL ERROR", "LA SUBIDA FALLÓ: ERROR FATAL");
|
_addTranslation("UPLOAD FAILED: FATAL ERROR", "LA SUBIDA FALLÓ: ERROR FATAL");
|
||||||
_addTranslation("BAD NEWS :( File is DAMAGED!", "MALAS NOTICIAS :( El archivo está corrupto!");
|
_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("File temporarily unavailable! (Retrying in ", "¡Archivo temporalmente no disponible! (Reintentando en ");
|
||||||
_addTranslation(" secs...)", " segundos...)");
|
_addTranslation(" secs...)", " segundos...)");
|
||||||
_addTranslation(" (Retrying in ", " (Reintentando en ");
|
_addTranslation(" (Retrying in ", " (Reintentando en ");
|
||||||
|
@ -57,7 +57,7 @@ import javax.swing.UIManager;
|
|||||||
*/
|
*/
|
||||||
public final class MainPanel {
|
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 boolean FORCE_SMART_PROXY = false; //TRUE FOR DEBUGING SMART PROXY
|
||||||
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
public static final int THROTTLE_SLICE_SIZE = 16 * 1024;
|
||||||
public static final int DEFAULT_BYTE_BUFFER_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);
|
FolderLinkDialog fdialog = new FolderLinkDialog(_main_panel.getView(), true, url);
|
||||||
|
|
||||||
if (!fdialog.isMega_error()) {
|
if (fdialog.isMega_error() == 0) {
|
||||||
|
|
||||||
fdialog.setLocationRelativeTo(_main_panel.getView());
|
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