mirror of
https://github.com/tonikelope/megabasterd.git
synced 2025-04-29 22:24:32 +02:00
2.67
This commit is contained in:
parent
9448b7bd73
commit
b4d1ea1d5d
@ -40,7 +40,8 @@ javac.classpath=\
|
||||
${file.reference.sqlite-jdbc-3.8.11.2.jar}:\
|
||||
${file.reference.jackson-core-asl-1.9.13.jar}:\
|
||||
${file.reference.jackson-mapper-asl-1.9.13.jar}:\
|
||||
${libs.ApacheHttpClient.classpath}
|
||||
${libs.ApacheHttpClient.classpath}:\
|
||||
${libs.absolutelayout.classpath}
|
||||
# Space-separated list of extra javac options
|
||||
javac.compilerargs=
|
||||
javac.deprecation=false
|
||||
|
@ -7,6 +7,7 @@
|
||||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.ComponentChooserEditor">
|
||||
<ComponentRef name="null"/>
|
||||
</Property>
|
||||
<Property name="resizable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
<SyntheticProperties>
|
||||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/>
|
||||
@ -27,27 +28,32 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="subtitle_label" max="32767" attributes="0"/>
|
||||
<Component id="title_label" alignment="0" pref="636" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="made_in_spain_label" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="made_in_spain_label" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="pica_roja_label" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="pica_roja_label" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="mc_logo_label" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="mc_logo_label" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="author_webpage_label" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="author_webpage_label" alignment="1" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="mcdown_url_button" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="mcdown_url_button" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="check_version_button" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="check_version_button" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="title_label" alignment="0" max="-2" attributes="0"/>
|
||||
<Component id="subtitle_label" alignment="0" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -66,7 +72,7 @@
|
||||
<Component id="mcdown_url_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="check_version_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="34" max="32767" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="made_in_spain_label" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
@ -191,6 +197,7 @@
|
||||
<Font name="Dialog" size="14" style="1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Check version"/>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="check_version_buttonActionPerformed"/>
|
||||
|
@ -23,7 +23,9 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, parent.getMain_panel().getZoom_factor());
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,6 +49,7 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
setTitle("About");
|
||||
setIconImage(null);
|
||||
setResizable(false);
|
||||
|
||||
title_label.setFont(new java.awt.Font("Dialog", 1, 48)); // NOI18N
|
||||
title_label.setText("MegaBasterd " + VERSION);
|
||||
@ -112,6 +115,7 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
|
||||
check_version_button.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N
|
||||
check_version_button.setText("Check version");
|
||||
check_version_button.setDoubleBuffered(true);
|
||||
check_version_button.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
check_version_buttonActionPerformed(evt);
|
||||
@ -122,12 +126,10 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(subtitle_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(title_label, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 636, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(made_in_spain_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
@ -136,10 +138,15 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(mc_logo_label))
|
||||
.addComponent(author_webpage_label, javax.swing.GroupLayout.Alignment.TRAILING)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(mcdown_url_button)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(check_version_button)))
|
||||
.addComponent(check_version_button))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(title_label)
|
||||
.addComponent(subtitle_label))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
@ -153,7 +160,7 @@ public final class AboutDialog extends javax.swing.JDialog {
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(mcdown_url_button)
|
||||
.addComponent(check_version_button))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 34, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(made_in_spain_label)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
|
@ -109,7 +109,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
String worker_url = _upload.getUl_url();
|
||||
Chunk chunk;
|
||||
int reads, conta_error, re, http_status, tot_bytes_up;
|
||||
int reads, conta_error, http_status, tot_bytes_up;
|
||||
boolean error;
|
||||
OutputStream out;
|
||||
|
||||
@ -126,9 +126,7 @@ public class ChunkUploader implements Runnable, SecureSingleThreadNotifiable {
|
||||
|
||||
do {
|
||||
|
||||
re = f.read(buffer, 0, Math.min((int) (chunk.getSize() - chunk.getOutputStream().size()), buffer.length));
|
||||
|
||||
chunk.getOutputStream().write(buffer, 0, re);
|
||||
chunk.getOutputStream().write(buffer, 0, f.read(buffer, 0, Math.min((int) (chunk.getSize() - chunk.getOutputStream().size()), buffer.length)));
|
||||
|
||||
} while (!_exit && !_upload.isStopped() && chunk.getOutputStream().size() < chunk.getSize());
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class ChunkUploaderMono extends ChunkUploader {
|
||||
|
||||
String worker_url = getUpload().getUl_url();
|
||||
Chunk chunk;
|
||||
int reads, conta_error, re, http_status, tot_bytes_up = -1;
|
||||
int reads, conta_error, http_status, tot_bytes_up = -1;
|
||||
boolean error = false;
|
||||
|
||||
try (CloseableHttpClient httpclient = getApacheKissHttpClient(); RandomAccessFile f = new RandomAccessFile(getUpload().getFile_name(), "r");) {
|
||||
@ -68,9 +68,7 @@ public class ChunkUploaderMono extends ChunkUploader {
|
||||
|
||||
do {
|
||||
|
||||
re = f.read(buffer, 0, Math.min((int) (chunk.getSize() - chunk.getOutputStream().size()), buffer.length));
|
||||
|
||||
chunk.getOutputStream().write(buffer, 0, re);
|
||||
chunk.getOutputStream().write(buffer, 0, f.read(buffer, 0, Math.min((int) (chunk.getSize() - chunk.getOutputStream().size()), buffer.length)));
|
||||
|
||||
} while (!isExit() && !getUpload().isStopped() && chunk.getOutputStream().size() < chunk.getSize());
|
||||
|
||||
|
@ -1166,34 +1166,27 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
}
|
||||
|
||||
private boolean verifyFileCBCMAC(String filename) throws FileNotFoundException, Exception, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException {
|
||||
|
||||
int[] int_key = bin2i32a(UrlBASE642Bin(_file_key));
|
||||
|
||||
int[] iv = new int[2];
|
||||
|
||||
iv[0] = int_key[4];
|
||||
iv[1] = int_key[5];
|
||||
|
||||
int[] meta_mac = new int[2];
|
||||
|
||||
meta_mac[0] = int_key[6];
|
||||
meta_mac[1] = int_key[7];
|
||||
|
||||
int[] iv = new int[]{int_key[4], int_key[5]};
|
||||
int[] meta_mac = new int[]{int_key[6], int_key[7]};
|
||||
int[] file_mac = {0, 0, 0, 0};
|
||||
|
||||
int[] cbc_iv = {0, 0, 0, 0};
|
||||
|
||||
Cipher cryptor = genCrypter("AES", "AES/CBC/NoPadding", _chunkwriter.getByte_file_key(), i32a2bin(cbc_iv));
|
||||
|
||||
try (FileInputStream is = new FileInputStream(new File(filename))) {
|
||||
|
||||
long chunk_id = 1;
|
||||
long chunk_id = 1L;
|
||||
long tot = 0L;
|
||||
byte[] chunk_buffer = new byte[MainPanel.DEFAULT_BYTE_BUFFER_SIZE];
|
||||
byte[] byte_block = new byte[16];
|
||||
int[] int_block;
|
||||
int re, reads, to_read;
|
||||
int reads;
|
||||
|
||||
try {
|
||||
while (!_exit) {
|
||||
|
||||
Chunk chunk = new Chunk(chunk_id++, _file_size, null);
|
||||
|
||||
tot += chunk.getSize();
|
||||
@ -1201,18 +1194,16 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
int[] chunk_mac = {iv[0], iv[1], iv[0], iv[1]};
|
||||
|
||||
do {
|
||||
to_read = chunk.getSize() - chunk.getOutputStream().size() >= chunk_buffer.length ? chunk_buffer.length : (int) (chunk.getSize() - chunk.getOutputStream().size());
|
||||
|
||||
re = is.read(chunk_buffer, 0, to_read);
|
||||
|
||||
chunk.getOutputStream().write(chunk_buffer, 0, re);
|
||||
chunk.getOutputStream().write(chunk_buffer, 0, is.read(chunk_buffer, 0, Math.min((int) (chunk.getSize() - chunk.getOutputStream().size()), chunk_buffer.length)));
|
||||
|
||||
} while (!_exit && chunk.getOutputStream().size() < chunk.getSize());
|
||||
|
||||
InputStream chunk_is = chunk.getInputStream();
|
||||
|
||||
while (!_exit && (reads = chunk_is.read(byte_block)) != -1) {
|
||||
|
||||
if (reads < byte_block.length) {
|
||||
|
||||
for (int i = reads; i < byte_block.length; i++) {
|
||||
byte_block[i] = 0;
|
||||
}
|
||||
@ -1234,7 +1225,6 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
file_mac = bin2i32a(cryptor.doFinal(i32a2bin(file_mac)));
|
||||
|
||||
setProgress(tot);
|
||||
|
||||
}
|
||||
|
||||
} catch (ChunkInvalidException e) {
|
||||
@ -1244,7 +1234,6 @@ public final class Download implements Transference, Runnable, SecureSingleThrea
|
||||
|
||||
return (cbc[0] == meta_mac[0] && cbc[1] == meta_mac[1]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void stopDownloader() {
|
||||
|
@ -89,7 +89,7 @@ public final class DownloadView extends javax.swing.JPanel implements Transferen
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this, DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(this, DEFAULT_FONT, download.getMain_panel().getZoom_factor());
|
||||
|
||||
_download = download;
|
||||
|
||||
@ -98,15 +98,17 @@ public final class DownloadView extends javax.swing.JPanel implements Transferen
|
||||
((JSpinner.DefaultEditor) slots_spinner.getEditor()).getTextField().setEditable(false);
|
||||
|
||||
speed_label.setForeground(new Color(0, 128, 255));
|
||||
|
||||
progress_pbar.setMinimum(0);
|
||||
progress_pbar.setMaximum(MAX_VALUE);
|
||||
progress_pbar.setStringPainted(true);
|
||||
|
||||
status_label.setText("");
|
||||
|
||||
for (JComponent c : new JComponent[]{slots_spinner, slots_label, pause_button, stop_button, speed_label, progress_pbar, keep_temp_checkbox, file_name_label, close_button, copy_link_button, restart_button, file_size_label, open_folder_button}) {
|
||||
|
||||
c.setVisible(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void hideAllExceptStatus() {
|
||||
|
@ -63,9 +63,11 @@ public final class FileGrabberDialog extends javax.swing.JDialog {
|
||||
|
||||
super(parent, modal);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, _main_panel.getZoom_factor());
|
||||
|
||||
_last_selected_account = null;
|
||||
_total_space = 0L;
|
||||
@ -76,8 +78,6 @@ public final class FileGrabberDialog extends javax.swing.JDialog {
|
||||
|
||||
dir_name_textfield.addMouseListener(new ContextMenuMouseListener());
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
|
||||
if (_main_panel.getMega_accounts().size() > 0) {
|
||||
|
||||
for (Object o : _main_panel.getMega_accounts().keySet()) {
|
||||
@ -90,6 +90,8 @@ public final class FileGrabberDialog extends javax.swing.JDialog {
|
||||
used_space_label.setForeground(Color.red);
|
||||
used_space_label.setText("No MEGA accounts available (Go to Settings > Accounts)");
|
||||
}
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@ public final class FolderLinkDialog extends javax.swing.JDialog {
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ((MainPanelView) parent).getMain_panel().getZoom_factor());
|
||||
|
||||
_mega_error = false;
|
||||
_total_space = 0L;
|
||||
@ -72,6 +72,8 @@ public final class FolderLinkDialog extends javax.swing.JDialog {
|
||||
|
||||
_genDownloadLiks();
|
||||
}
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,9 +59,10 @@ public class GetMasterPasswordDialog extends javax.swing.JDialog {
|
||||
*/
|
||||
public GetMasterPasswordDialog(java.awt.Frame parent, boolean modal, String current_pass_hash, String salt) {
|
||||
super(parent, modal);
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ((MainPanelView) parent).getMain_panel().getZoom_factor());
|
||||
|
||||
_current_pass_hash = current_pass_hash;
|
||||
|
||||
@ -71,6 +72,8 @@ public class GetMasterPasswordDialog extends javax.swing.JDialog {
|
||||
|
||||
_salt = salt;
|
||||
|
||||
pack();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,7 +73,7 @@
|
||||
<Component id="change_dir_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="down_dir_to_label" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="download_dir_label" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="dance_button" alignment="3" min="-2" pref="37" max="-2" attributes="0"/>
|
||||
<Component id="dance_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -61,11 +61,11 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
|
||||
super(parent, modal);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, _main_panel.getZoom_factor());
|
||||
|
||||
_download = false;
|
||||
|
||||
@ -87,6 +87,8 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
use_mega_account_down_label.setEnabled(false);
|
||||
use_mega_account_down_label.setVisible(false);
|
||||
}
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -213,7 +215,7 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
.addComponent(change_dir_button)
|
||||
.addComponent(down_dir_to_label)
|
||||
.addComponent(download_dir_label)
|
||||
.addComponent(dance_button, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(dance_button))
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@ -243,6 +245,8 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
_download_path = file.getAbsolutePath();
|
||||
|
||||
download_dir_label.setText(truncateText(_download_path, 80));
|
||||
|
||||
pack();
|
||||
}
|
||||
}//GEN-LAST:event_change_dir_buttonActionPerformed
|
||||
|
||||
@ -256,6 +260,8 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
|
||||
dance_button.setEnabled(false);
|
||||
|
||||
pack();
|
||||
|
||||
javax.swing.JFileChooser filechooser = new javax.swing.JFileChooser();
|
||||
|
||||
filechooser.setDialogTitle("Select DLC container");
|
||||
@ -330,6 +336,8 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
links_textarea.setEnabled(true);
|
||||
|
||||
dance_button.setEnabled(true);
|
||||
|
||||
pack();
|
||||
}
|
||||
});
|
||||
|
||||
@ -342,6 +350,8 @@ public final class LinkGrabberDialog extends javax.swing.JDialog implements Clip
|
||||
links_textarea.setEnabled(true);
|
||||
|
||||
dance_button.setEnabled(true);
|
||||
|
||||
pack();
|
||||
}
|
||||
}//GEN-LAST:event_dlc_buttonActionPerformed
|
||||
|
||||
|
@ -47,14 +47,14 @@ import org.apache.http.auth.UsernamePasswordCredentials;
|
||||
*/
|
||||
public final class MainPanel {
|
||||
|
||||
public static final String VERSION = "2.66";
|
||||
public static final String VERSION = "2.67";
|
||||
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;
|
||||
public static final int WATCHDOG_PORT = 1338;
|
||||
public static final int DEFAULT_MEGA_PROXY_PORT = 9999;
|
||||
public static final Font DEFAULT_FONT = createAndRegisterFont("Itim-Regular.ttf");
|
||||
public static final float ZOOM_FACTOR = 1.1f;
|
||||
public static final float ZOOM_FACTOR = 1.0f;
|
||||
public static final String DEFAULT_USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0";
|
||||
public static final String ICON_FILE = "mbasterd_med.png";
|
||||
public static final ExecutorService THREAD_POOL = newCachedThreadPool();
|
||||
@ -63,14 +63,10 @@ public final class MainPanel {
|
||||
private static Credentials _proxy_credentials;
|
||||
private static boolean _use_proxy;
|
||||
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
setNimbusLookAndFeel();
|
||||
|
||||
UIManager.put("OptionPane.messageFont", DEFAULT_FONT.deriveFont(15f * ZOOM_FACTOR));
|
||||
UIManager.put("OptionPane.buttonFont", DEFAULT_FONT.deriveFont(13f * ZOOM_FACTOR));
|
||||
|
||||
if (args.length > 0) {
|
||||
|
||||
try {
|
||||
@ -116,9 +112,36 @@ public final class MainPanel {
|
||||
private MegaProxyServer _mega_proxy_server;
|
||||
private int _megacrypter_reverse_port;
|
||||
private boolean _megacrypter_reverse;
|
||||
private float _zoom_factor;
|
||||
|
||||
public MainPanel() {
|
||||
|
||||
_restart = false;
|
||||
|
||||
_elc_accounts = new HashMap<>();
|
||||
|
||||
_master_pass = null;
|
||||
|
||||
_mega_active_accounts = new HashMap<>();
|
||||
|
||||
_proxy_host = null;
|
||||
|
||||
_proxy_port = 3128;
|
||||
|
||||
_proxy_credentials = null;
|
||||
|
||||
_use_proxy = false;
|
||||
|
||||
_use_smart_proxy = false;
|
||||
|
||||
_use_smart_proxy_url = null;
|
||||
|
||||
loadUserSettings();
|
||||
|
||||
UIManager.put("OptionPane.messageFont", DEFAULT_FONT.deriveFont(15f * getZoom_factor()));
|
||||
|
||||
UIManager.put("OptionPane.buttonFont", DEFAULT_FONT.deriveFont(13f * getZoom_factor()));
|
||||
|
||||
_view = new MainPanelView(this);
|
||||
|
||||
if (checkAppIsRunning()) {
|
||||
@ -142,28 +165,6 @@ public final class MainPanel {
|
||||
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex);
|
||||
}
|
||||
|
||||
_restart = false;
|
||||
|
||||
_elc_accounts = new HashMap<>();
|
||||
|
||||
_master_pass = null;
|
||||
|
||||
_mega_active_accounts = new HashMap<>();
|
||||
|
||||
_proxy_host = null;
|
||||
|
||||
_proxy_port = 3128;
|
||||
|
||||
_proxy_credentials = null;
|
||||
|
||||
_use_proxy = false;
|
||||
|
||||
_use_smart_proxy = false;
|
||||
|
||||
_use_smart_proxy_url = null;
|
||||
|
||||
loadUserSettings();
|
||||
|
||||
THREAD_POOL.execute((_download_manager = new DownloadManager(this)));
|
||||
|
||||
THREAD_POOL.execute((_upload_manager = new UploadManager(this)));
|
||||
@ -176,9 +177,8 @@ public final class MainPanel {
|
||||
|
||||
THREAD_POOL.execute((_clipboardspy = new ClipboardSpy()));
|
||||
|
||||
_streamserver = new KissVideoStreamServer(this);
|
||||
|
||||
try {
|
||||
_streamserver = new KissVideoStreamServer(this);
|
||||
_streamserver.start(STREAMER_PORT, "/video");
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(MainPanel.class.getName()).log(SEVERE, null, ex);
|
||||
@ -198,8 +198,11 @@ public final class MainPanel {
|
||||
});
|
||||
|
||||
if (_megacrypter_reverse) {
|
||||
|
||||
_mega_proxy_server = new MegaProxyServer(this, UUID.randomUUID().toString(), _megacrypter_reverse_port);
|
||||
|
||||
THREAD_POOL.execute(_mega_proxy_server);
|
||||
|
||||
} else {
|
||||
_mega_proxy_server = null;
|
||||
}
|
||||
@ -207,6 +210,7 @@ public final class MainPanel {
|
||||
if (_use_smart_proxy) {
|
||||
|
||||
_proxy_manager = new SmartMegaProxyManager(this, _use_smart_proxy_url);
|
||||
|
||||
THREAD_POOL.execute(_proxy_manager);
|
||||
}
|
||||
|
||||
@ -225,6 +229,10 @@ public final class MainPanel {
|
||||
resumeUploads();
|
||||
}
|
||||
|
||||
public float getZoom_factor() {
|
||||
return _zoom_factor;
|
||||
}
|
||||
|
||||
public void setProxy_manager(SmartMegaProxyManager _proxy_manager) {
|
||||
this._proxy_manager = _proxy_manager;
|
||||
}
|
||||
@ -428,6 +436,15 @@ public final class MainPanel {
|
||||
}
|
||||
|
||||
public void loadUserSettings() {
|
||||
|
||||
String zoom_factor = selectSettingValue("font_zoom");
|
||||
|
||||
if (zoom_factor != null) {
|
||||
_zoom_factor = Float.parseFloat(zoom_factor) / 100;
|
||||
} else {
|
||||
_zoom_factor = ZOOM_FACTOR;
|
||||
}
|
||||
|
||||
String def_slots = selectSettingValue("default_slots_down");
|
||||
|
||||
if (def_slots != null) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<NonVisualComponents>
|
||||
<Menu class="javax.swing.JMenuBar" name="main_menubar">
|
||||
<SubComponents>
|
||||
@ -171,11 +171,11 @@
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jTabbedPane1" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="kiss_server_status" max="32767" attributes="0"/>
|
||||
<Component id="kiss_server_status" pref="206" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="mc_reverse_status" max="32767" attributes="0"/>
|
||||
<Component id="mc_reverse_status" pref="210" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_status" max="32767" attributes="0"/>
|
||||
<Component id="smart_proxy_status" pref="215" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="logo_label" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -192,10 +192,10 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="logo_label" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_status" alignment="1" min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_status" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" alignment="1" groupAlignment="0" attributes="0">
|
||||
<Component id="mc_reverse_status" min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="kiss_server_status" min="-2" pref="24" max="-2" attributes="0"/>
|
||||
<Component id="mc_reverse_status" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="kiss_server_status" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="2" max="-2" attributes="0"/>
|
||||
@ -220,6 +220,7 @@
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="kiss server"/>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@ -231,6 +232,7 @@
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="mc reverse"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="smart_proxy_status">
|
||||
@ -241,6 +243,7 @@
|
||||
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
|
||||
<Color blue="66" green="66" red="66" type="rgb"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="smart proxy"/>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@ -273,7 +276,7 @@
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="status_down_label" pref="699" max="32767" attributes="0"/>
|
||||
<Component id="status_down_label" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="close_all_finished_down_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -290,7 +293,7 @@
|
||||
<Component id="status_down_label" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane_down" pref="319" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane_down" pref="355" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="down_remtime_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
@ -399,7 +402,7 @@
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="status_up_label" pref="699" max="32767" attributes="0"/>
|
||||
<Component id="status_up_label" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="close_all_finished_up_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -416,7 +419,7 @@
|
||||
<Component id="status_up_label" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane_up" pref="319" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane_up" pref="355" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="up_remtime_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
|
@ -21,6 +21,7 @@ import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JOptionPane;
|
||||
import static javax.swing.JOptionPane.QUESTION_MESSAGE;
|
||||
import static javax.swing.JOptionPane.YES_NO_CANCEL_OPTION;
|
||||
import static javax.swing.JOptionPane.showOptionDialog;
|
||||
@ -130,7 +131,8 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
getKiss_server_status().setText(status);
|
||||
getKiss_server_status().setText(status + " ");
|
||||
pack();
|
||||
}
|
||||
});
|
||||
|
||||
@ -143,7 +145,8 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
getSmart_proxy_status().setText(status);
|
||||
getSmart_proxy_status().setText(status + " ");
|
||||
pack();
|
||||
}
|
||||
});
|
||||
|
||||
@ -156,7 +159,8 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
getMc_reverse_status().setText(status);
|
||||
getMc_reverse_status().setText(status + " ");
|
||||
pack();
|
||||
}
|
||||
});
|
||||
|
||||
@ -168,7 +172,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(getRootPane(), DEFAULT_FONT, _main_panel.getZoom_factor());
|
||||
|
||||
setTitle("MegaBasterd " + VERSION);
|
||||
|
||||
@ -186,6 +190,8 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
clean_all_up_menu.setEnabled(false);
|
||||
jScrollPane_down.getVerticalScrollBar().setUnitIncrement(20);
|
||||
jScrollPane_up.getVerticalScrollBar().setUnitIncrement(20);
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -241,13 +247,16 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
|
||||
kiss_server_status.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
|
||||
kiss_server_status.setForeground(new java.awt.Color(102, 102, 102));
|
||||
kiss_server_status.setText("kiss server");
|
||||
kiss_server_status.setDoubleBuffered(true);
|
||||
|
||||
mc_reverse_status.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
|
||||
mc_reverse_status.setForeground(new java.awt.Color(102, 102, 102));
|
||||
mc_reverse_status.setText("mc reverse");
|
||||
|
||||
smart_proxy_status.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
|
||||
smart_proxy_status.setForeground(new java.awt.Color(102, 102, 102));
|
||||
smart_proxy_status.setText("smart proxy");
|
||||
smart_proxy_status.setDoubleBuffered(true);
|
||||
|
||||
jTabbedPane1.setDoubleBuffered(true);
|
||||
@ -298,7 +307,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addComponent(pause_all_down_button))
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(status_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
|
||||
.addComponent(status_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(close_all_finished_down_button))
|
||||
.addComponent(jScrollPane_down)
|
||||
@ -312,7 +321,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addComponent(close_all_finished_down_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(status_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jScrollPane_down, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane_down, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(down_remtime_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@ -367,7 +376,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addComponent(pause_all_up_button))
|
||||
.addGroup(uploads_panelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(status_up_label, javax.swing.GroupLayout.DEFAULT_SIZE, 699, Short.MAX_VALUE)
|
||||
.addComponent(status_up_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(close_all_finished_up_button))
|
||||
.addComponent(jScrollPane_up)
|
||||
@ -381,7 +390,7 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addComponent(close_all_finished_up_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(status_up_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jScrollPane_up, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane_up, javax.swing.GroupLayout.DEFAULT_SIZE, 355, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(up_remtime_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
@ -504,11 +513,11 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jTabbedPane1)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(kiss_server_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(kiss_server_status, javax.swing.GroupLayout.DEFAULT_SIZE, 206, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(mc_reverse_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(mc_reverse_status, javax.swing.GroupLayout.DEFAULT_SIZE, 210, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(smart_proxy_status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(smart_proxy_status, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(logo_label)))
|
||||
.addContainerGap())
|
||||
@ -521,10 +530,10 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(logo_label)
|
||||
.addComponent(smart_proxy_status, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(smart_proxy_status)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(mc_reverse_status, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(kiss_server_status, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(mc_reverse_status)
|
||||
.addComponent(kiss_server_status)))
|
||||
.addGap(2, 2, 2))
|
||||
);
|
||||
|
||||
@ -828,6 +837,8 @@ public final class MainPanelView extends javax.swing.JFrame {
|
||||
|
||||
if (_main_panel.isRestart()) {
|
||||
|
||||
JOptionPane.showMessageDialog(this, "MegaBasterd will restart", "Restart required", JOptionPane.WARNING_MESSAGE);
|
||||
|
||||
restartApplication(1);
|
||||
}
|
||||
|
||||
|
@ -288,7 +288,7 @@ public final class MiscTools {
|
||||
|
||||
Font old_font = component.getFont();
|
||||
|
||||
Font new_font = font.deriveFont(old_font.getStyle(), (float) Math.floor(old_font.getSize() * zoom_factor));
|
||||
Font new_font = font.deriveFont(old_font.getStyle(), (float) Math.round(old_font.getSize() * zoom_factor));
|
||||
|
||||
component.setFont(new_font);
|
||||
}
|
||||
|
@ -49,9 +49,12 @@ public class SetMasterPasswordDialog extends javax.swing.JDialog {
|
||||
* Creates new form MegaPassDialog
|
||||
*/
|
||||
public SetMasterPasswordDialog(java.awt.Frame parent, boolean modal, String salt) {
|
||||
|
||||
super(parent, modal);
|
||||
|
||||
initComponents();
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ((MainPanelView) parent).getMain_panel().getZoom_factor());
|
||||
|
||||
_pass_ok = false;
|
||||
|
||||
@ -60,6 +63,8 @@ public class SetMasterPasswordDialog extends javax.swing.JDialog {
|
||||
_new_pass_hash = null;
|
||||
|
||||
_salt = salt;
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -30,10 +30,10 @@
|
||||
<Component id="jTabbedPane1" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="status" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="548" max="-2" attributes="0"/>
|
||||
<Component id="save_button" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="save_button" min="-2" pref="130" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="cancel_button" min="-2" pref="130" max="-2" attributes="0"/>
|
||||
<Component id="cancel_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
@ -118,7 +118,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="downloads_scroll_pane" pref="474" max="32767" attributes="0"/>
|
||||
<Component id="downloads_scroll_pane" pref="478" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@ -146,26 +146,26 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_downloads_label" min="-2" pref="359" max="-2" attributes="0"/>
|
||||
<Component id="max_downloads_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_downloads_spinner" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<Component id="use_mega_label" min="-2" pref="138" max="-2" attributes="0"/>
|
||||
<Component id="use_mega_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="use_mega_account_down_combobox" min="-2" pref="569" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<Component id="default_slots_down_label" min="-2" pref="346" max="-2" attributes="0"/>
|
||||
<Component id="default_slots_down_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="default_slots_down_spinner" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<Component id="megacrypter_reverse_port_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="megacrypter_reverse_port_spinner" min="-2" pref="120" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
@ -177,14 +177,10 @@
|
||||
<Component id="multi_slot_down_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="use_mega_account_down_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="verify_file_down_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="limit_download_speed_checkbox" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="15" pref="15" max="-2" attributes="0"/>
|
||||
<Component id="max_down_speed_label" min="-2" pref="294" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="limit_download_speed_checkbox" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="15" pref="15" max="-2" attributes="0"/>
|
||||
<Component id="max_down_speed_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_down_speed_spinner" min="-2" pref="151" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -206,7 +202,7 @@
|
||||
<Component id="jSeparator1" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="33" max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_url_label" min="-2" pref="70" max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_url_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="smart_proxy_url_text" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
@ -552,7 +548,7 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="21" max="-2" attributes="0"/>
|
||||
<Component id="default_slots_up_label" min="-2" pref="283" max="-2" attributes="0"/>
|
||||
<Component id="default_slots_up_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="default_slots_up_spinner" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
@ -564,7 +560,7 @@
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="max_uploads_label" min="-2" pref="303" max="-2" attributes="0"/>
|
||||
<Component id="max_uploads_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_uploads_spinner" min="-2" pref="100" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -572,8 +568,8 @@
|
||||
<Component id="multi_slot_up_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="21" pref="21" max="-2" attributes="0"/>
|
||||
<Component id="max_up_speed_label" min="-2" pref="243" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
|
||||
<Component id="max_up_speed_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="max_up_speed_spinner" min="-2" pref="150" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="limit_upload_speed_checkbox" min="-2" max="-2" attributes="0"/>
|
||||
@ -615,7 +611,7 @@
|
||||
<Component id="max_up_speed_label" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="max_up_speed_spinner" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="278" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="282" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -774,7 +770,7 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="mega_accounts_scrollpane" pref="133" max="32767" attributes="0"/>
|
||||
<Component id="mega_accounts_scrollpane" pref="137" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="remove_mega_account_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
@ -783,7 +779,7 @@
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="elc_accounts_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="elc_accounts_scrollpane" pref="133" max="32767" attributes="0"/>
|
||||
<Component id="elc_accounts_scrollpane" pref="136" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="remove_elc_account_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
@ -817,7 +813,9 @@
|
||||
<Color id="Cursor Por defecto"/>
|
||||
</Property>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
<Property name="rowHeight" type="int" value="24"/>
|
||||
<Property name="rowHeight" type="int" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="(int)(24*_main_panel.getZoom_factor())" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
@ -920,7 +918,9 @@
|
||||
<Column editable="true" title="API-KEY" type="java.lang.String"/>
|
||||
</Table>
|
||||
</Property>
|
||||
<Property name="rowHeight" type="int" value="24"/>
|
||||
<Property name="rowHeight" type="int" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="(int)(24*_main_panel.getZoom_factor())" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
@ -985,11 +985,23 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="proxy_panel" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="import_settings_button" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jSeparator9" alignment="0" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="zoom_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="zoom_spinner" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="import_settings_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="export_settings_button" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="rec_zoom_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -1000,7 +1012,16 @@
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="proxy_panel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="248" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jSeparator9" min="-2" pref="10" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="5" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="zoom_label" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="zoom_spinner" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="rec_zoom_label" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="181" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="export_settings_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="import_settings_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
@ -1124,7 +1145,7 @@
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="18" style="1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Use HTTP(S) PROXY (app restart required)"/>
|
||||
<Property name="text" type="java.lang.String" value="Use HTTP(S) PROXY"/>
|
||||
<Property name="doubleBuffered" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
@ -1136,7 +1157,7 @@
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="14" style="2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="WARNING: Megabasterd will use this proxy for ALL connections."/>
|
||||
<Property name="text" type="java.lang.String" value="Note: Megabasterd will use this proxy for ALL connections (restart required)."/>
|
||||
<Property name="enabled" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
@ -1227,7 +1248,7 @@
|
||||
<Component class="javax.swing.JButton" name="import_settings_button">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="22" style="1"/>
|
||||
<Font name="Dialog" size="18" style="1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="IMPORT SETTINGS"/>
|
||||
</Properties>
|
||||
@ -1238,7 +1259,7 @@
|
||||
<Component class="javax.swing.JButton" name="export_settings_button">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="22" style="1"/>
|
||||
<Font name="Dialog" size="18" style="1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="EXPORT SETTINGS"/>
|
||||
</Properties>
|
||||
@ -1246,6 +1267,31 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="export_settings_buttonActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSeparator" name="jSeparator9">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="zoom_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="18" style="1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Font ZOOM (%):"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="zoom_spinner">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="18" style="0"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="rec_zoom_label">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="14" style="2"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Note: restart required."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
@ -64,13 +64,14 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
}
|
||||
|
||||
public SettingsDialog(javax.swing.JFrame parent, boolean modal) {
|
||||
|
||||
super(parent, modal);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, _main_panel.getZoom_factor());
|
||||
|
||||
smart_proxy_url_text.addMouseListener(new ContextMenuMouseListener());
|
||||
|
||||
@ -78,6 +79,17 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
downloads_scroll_pane.getHorizontalScrollBar().setUnitIncrement(20);
|
||||
|
||||
String zoom_factor = DBTools.selectSettingValue("font_zoom");
|
||||
|
||||
int int_zoom_factor = Math.round(_main_panel.getZoom_factor() * 100);
|
||||
|
||||
if (zoom_factor != null) {
|
||||
int_zoom_factor = Integer.parseInt(zoom_factor);
|
||||
}
|
||||
|
||||
zoom_spinner.setModel(new SpinnerNumberModel(int_zoom_factor, 50, 200, 10));
|
||||
((JSpinner.DefaultEditor) zoom_spinner.getEditor()).getTextField().setEditable(false);
|
||||
|
||||
String default_download_dir = DBTools.selectSettingValue("default_down_dir");
|
||||
|
||||
if (default_download_dir == null) {
|
||||
@ -473,6 +485,8 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
|
||||
_settings_ok = false;
|
||||
|
||||
pack();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -563,6 +577,10 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
proxy_pass_textfield = new javax.swing.JPasswordField();
|
||||
import_settings_button = new javax.swing.JButton();
|
||||
export_settings_button = new javax.swing.JButton();
|
||||
jSeparator9 = new javax.swing.JSeparator();
|
||||
zoom_label = new javax.swing.JLabel();
|
||||
zoom_spinner = new javax.swing.JSpinner();
|
||||
rec_zoom_label = new javax.swing.JLabel();
|
||||
status = new javax.swing.JLabel();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
@ -707,23 +725,23 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(max_downloads_label, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(max_downloads_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_downloads_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(27, 27, 27)
|
||||
.addComponent(use_mega_label, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(use_mega_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(use_mega_account_down_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, 569, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(27, 27, 27)
|
||||
.addComponent(default_slots_down_label, javax.swing.GroupLayout.PREFERRED_SIZE, 346, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(default_slots_down_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(default_slots_down_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(27, 27, 27)
|
||||
.addComponent(megacrypter_reverse_port_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(megacrypter_reverse_port_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
@ -734,12 +752,10 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addComponent(multi_slot_down_checkbox)
|
||||
.addComponent(use_mega_account_down_checkbox)
|
||||
.addComponent(verify_file_down_checkbox)
|
||||
.addComponent(limit_download_speed_checkbox)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(limit_download_speed_checkbox)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(15, 15, 15)
|
||||
.addComponent(max_down_speed_label, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGap(15, 15, 15)
|
||||
.addComponent(max_down_speed_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_down_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(megacrypter_reverse_warning_label)
|
||||
@ -755,7 +771,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(jPanel3Layout.createSequentialGroup()
|
||||
.addGap(33, 33, 33)
|
||||
.addComponent(smart_proxy_url_label, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(smart_proxy_url_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(smart_proxy_url_text))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
|
||||
@ -845,7 +861,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(downloads_panelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(downloads_scroll_pane, javax.swing.GroupLayout.DEFAULT_SIZE, 474, Short.MAX_VALUE)
|
||||
.addComponent(downloads_scroll_pane, javax.swing.GroupLayout.DEFAULT_SIZE, 478, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
@ -900,7 +916,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(uploads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(uploads_panelLayout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addComponent(default_slots_up_label, javax.swing.GroupLayout.PREFERRED_SIZE, 283, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(default_slots_up_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(default_slots_up_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
@ -911,15 +927,15 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(uploads_panelLayout.createSequentialGroup()
|
||||
.addGroup(uploads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(uploads_panelLayout.createSequentialGroup()
|
||||
.addComponent(max_uploads_label, javax.swing.GroupLayout.PREFERRED_SIZE, 303, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(max_uploads_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_uploads_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(rec_upload_slots_label)
|
||||
.addComponent(multi_slot_up_checkbox)
|
||||
.addGroup(uploads_panelLayout.createSequentialGroup()
|
||||
.addGap(21, 21, 21)
|
||||
.addComponent(max_up_speed_label, javax.swing.GroupLayout.PREFERRED_SIZE, 243, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(3, 3, 3)
|
||||
.addComponent(max_up_speed_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(max_up_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(limit_upload_speed_checkbox))
|
||||
.addGap(0, 361, Short.MAX_VALUE)))
|
||||
@ -950,7 +966,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(uploads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(max_up_speed_label)
|
||||
.addComponent(max_up_speed_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addContainerGap(278, Short.MAX_VALUE))
|
||||
.addContainerGap(282, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jTabbedPane1.addTab("Uploads", uploads_panel);
|
||||
@ -974,7 +990,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
});
|
||||
mega_accounts_table.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
mega_accounts_table.setDoubleBuffered(true);
|
||||
mega_accounts_table.setRowHeight(24);
|
||||
mega_accounts_table.setRowHeight((int)(24*_main_panel.getZoom_factor()));
|
||||
mega_accounts_scrollpane.setViewportView(mega_accounts_table);
|
||||
|
||||
mega_accounts_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
@ -1047,7 +1063,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
return types [columnIndex];
|
||||
}
|
||||
});
|
||||
elc_accounts_table.setRowHeight(24);
|
||||
elc_accounts_table.setRowHeight((int)(24*_main_panel.getZoom_factor()));
|
||||
elc_accounts_scrollpane.setViewportView(elc_accounts_table);
|
||||
|
||||
elc_accounts_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
@ -1122,7 +1138,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(mega_accounts_scrollpane, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
|
||||
.addComponent(mega_accounts_scrollpane, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(accounts_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(remove_mega_account_button)
|
||||
@ -1130,7 +1146,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(elc_accounts_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(elc_accounts_scrollpane, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE)
|
||||
.addComponent(elc_accounts_scrollpane, javax.swing.GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(accounts_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(remove_elc_account_button)
|
||||
@ -1164,7 +1180,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
proxy_port_textfield.addMouseListener(new ContextMenuMouseListener());
|
||||
|
||||
use_proxy_checkbox.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
use_proxy_checkbox.setText("Use HTTP(S) PROXY (app restart required)");
|
||||
use_proxy_checkbox.setText("Use HTTP(S) PROXY");
|
||||
use_proxy_checkbox.setDoubleBuffered(true);
|
||||
use_proxy_checkbox.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
@ -1173,7 +1189,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
});
|
||||
|
||||
proxy_warning_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
|
||||
proxy_warning_label.setText("WARNING: Megabasterd will use this proxy for ALL connections.");
|
||||
proxy_warning_label.setText("Note: Megabasterd will use this proxy for ALL connections (restart required).");
|
||||
proxy_warning_label.setEnabled(false);
|
||||
|
||||
proxy_auth_panel.setBorder(javax.swing.BorderFactory.createTitledBorder("Authentication"));
|
||||
@ -1265,7 +1281,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addContainerGap())
|
||||
);
|
||||
|
||||
import_settings_button.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
|
||||
import_settings_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
import_settings_button.setText("IMPORT SETTINGS");
|
||||
import_settings_button.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -1273,7 +1289,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
export_settings_button.setFont(new java.awt.Font("Dialog", 1, 22)); // NOI18N
|
||||
export_settings_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
export_settings_button.setText("EXPORT SETTINGS");
|
||||
export_settings_button.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
@ -1281,6 +1297,14 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
}
|
||||
});
|
||||
|
||||
zoom_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
|
||||
zoom_label.setText("Font ZOOM (%):");
|
||||
|
||||
zoom_spinner.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
|
||||
|
||||
rec_zoom_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
|
||||
rec_zoom_label.setText("Note: restart required.");
|
||||
|
||||
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
|
||||
jPanel1.setLayout(jPanel1Layout);
|
||||
jPanel1Layout.setHorizontalGroup(
|
||||
@ -1289,10 +1313,19 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addContainerGap()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(proxy_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(import_settings_button)
|
||||
.addComponent(jSeparator9)
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(zoom_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(zoom_spinner))
|
||||
.addComponent(import_settings_button))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(export_settings_button)))
|
||||
.addComponent(export_settings_button))
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(rec_zoom_label)
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
@ -1300,7 +1333,15 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addGroup(jPanel1Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(proxy_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 248, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jSeparator9, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(5, 5, 5)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(zoom_label)
|
||||
.addComponent(zoom_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(rec_zoom_label)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 181, Short.MAX_VALUE)
|
||||
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(export_settings_button)
|
||||
.addComponent(import_settings_button))
|
||||
@ -1322,10 +1363,10 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
.addComponent(jTabbedPane1)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(status, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGap(548, 548, 548)
|
||||
.addComponent(save_button)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(save_button, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(18, 18, 18)
|
||||
.addComponent(cancel_button, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addComponent(cancel_button)))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
@ -1364,6 +1405,8 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
default_dir_label.setText(truncateText(_download_path, 80));
|
||||
|
||||
}
|
||||
|
||||
pack();
|
||||
}//GEN-LAST:event_change_download_dir_buttonActionPerformed
|
||||
|
||||
private void cancel_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancel_buttonActionPerformed
|
||||
@ -1403,6 +1446,15 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
settings.put("smart_proxy", smart_proxy_checkbox.isSelected() ? "yes" : "no");
|
||||
settings.put("smart_proxy_url", smart_proxy_url_text.getText());
|
||||
|
||||
String old_zoom = DBTools.selectSettingValue("font_zoom");
|
||||
|
||||
if (old_zoom == null) {
|
||||
|
||||
old_zoom = "";
|
||||
}
|
||||
|
||||
String zoom = String.valueOf(zoom_spinner.getValue());
|
||||
|
||||
boolean old_use_proxy = false;
|
||||
|
||||
String use_proxy_val = DBTools.selectSettingValue("use_proxy");
|
||||
@ -1454,10 +1506,16 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
settings.put("proxy_port", proxy_port);
|
||||
settings.put("proxy_user", proxy_user);
|
||||
settings.put("proxy_pass", proxy_pass);
|
||||
settings.put("font_zoom", zoom);
|
||||
|
||||
insertSettingsValues(settings);
|
||||
|
||||
if (use_proxy != old_use_proxy || !proxy_host.equals(old_proxy_host) || !proxy_port.equals(old_proxy_port) || !proxy_user.equals(old_proxy_user) || !proxy_pass.equals(old_proxy_pass)) {
|
||||
if (!zoom.equals(old_zoom)
|
||||
|| use_proxy != old_use_proxy
|
||||
|| !proxy_host.equals(old_proxy_host)
|
||||
|| !proxy_port.equals(old_proxy_port)
|
||||
|| !proxy_user.equals(old_proxy_user)
|
||||
|| !proxy_pass.equals(old_proxy_pass)) {
|
||||
|
||||
_main_panel.setRestart(true);
|
||||
}
|
||||
@ -2371,6 +2429,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
private javax.swing.JSeparator jSeparator6;
|
||||
private javax.swing.JSeparator jSeparator7;
|
||||
private javax.swing.JSeparator jSeparator8;
|
||||
private javax.swing.JSeparator jSeparator9;
|
||||
private javax.swing.JTabbedPane jTabbedPane1;
|
||||
private javax.swing.JCheckBox limit_download_speed_checkbox;
|
||||
private javax.swing.JCheckBox limit_upload_speed_checkbox;
|
||||
@ -2405,6 +2464,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
private javax.swing.JLabel rec_download_slots_label;
|
||||
private javax.swing.JLabel rec_smart_proxy_label;
|
||||
private javax.swing.JLabel rec_upload_slots_label;
|
||||
private javax.swing.JLabel rec_zoom_label;
|
||||
private javax.swing.JButton remove_elc_account_button;
|
||||
private javax.swing.JButton remove_mega_account_button;
|
||||
private javax.swing.JButton save_button;
|
||||
@ -2419,5 +2479,7 @@ public final class SettingsDialog extends javax.swing.JDialog {
|
||||
private javax.swing.JLabel use_mega_label;
|
||||
private javax.swing.JCheckBox use_proxy_checkbox;
|
||||
private javax.swing.JCheckBox verify_file_down_checkbox;
|
||||
private javax.swing.JLabel zoom_label;
|
||||
private javax.swing.JSpinner zoom_spinner;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
}
|
||||
|
@ -50,7 +50,7 @@
|
||||
<Component id="original_link_textfield" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="20" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="dance_button" alignment="3" min="-2" pref="37" max="-2" attributes="0"/>
|
||||
<Component id="dance_button" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="use_mega_account_down_combobox" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="use_mega_account_down_label" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -47,13 +47,14 @@ public final class StreamerDialog extends javax.swing.JDialog implements Clipboa
|
||||
* @param clipboardspy
|
||||
*/
|
||||
public StreamerDialog(java.awt.Frame parent, boolean modal, ClipboardSpy clipboardspy) {
|
||||
|
||||
super(parent, modal);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, ZOOM_FACTOR);
|
||||
|
||||
_main_panel = ((MainPanelView) parent).getMain_panel();
|
||||
updateFonts(this.getRootPane(), DEFAULT_FONT, _main_panel.getZoom_factor());
|
||||
|
||||
_clipboardspy = clipboardspy;
|
||||
|
||||
@ -75,6 +76,7 @@ public final class StreamerDialog extends javax.swing.JDialog implements Clipboa
|
||||
use_mega_account_down_label.setVisible(false);
|
||||
}
|
||||
|
||||
pack();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -149,7 +151,7 @@ public final class StreamerDialog extends javax.swing.JDialog implements Clipboa
|
||||
.addComponent(original_link_textfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 20, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(dance_button, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(dance_button)
|
||||
.addComponent(use_mega_account_down_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(use_mega_account_down_label))
|
||||
.addContainerGap())
|
||||
|
@ -31,15 +31,16 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
private int _max_running_trans;
|
||||
private final MainPanel _main_panel;
|
||||
private final Object _secure_notify_lock;
|
||||
private final Object _pre_lock;
|
||||
private final Object _pre_count_lock;
|
||||
private final Object _queue_flag_lock;
|
||||
private boolean _notified;
|
||||
private volatile boolean _removing_transferences;
|
||||
private volatile boolean _provisioning_transferences;
|
||||
private volatile boolean _starting_transferences;
|
||||
private volatile boolean _preprocessing_transferences;
|
||||
private volatile int _pre_count;
|
||||
private volatile boolean _tray_icon_finish;
|
||||
protected volatile long _total_transferences_size;
|
||||
private boolean _tray_icon_finish;
|
||||
protected long _total_transferences_size;
|
||||
|
||||
public TransferenceManager(MainPanel main_panel, int max_running_trans, javax.swing.JLabel status, javax.swing.JPanel scroll_panel, javax.swing.JButton close_all_button, javax.swing.JButton pause_all_button, javax.swing.MenuElement clean_all_menu) {
|
||||
_notified = false;
|
||||
@ -58,7 +59,8 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
_clean_all_menu = clean_all_menu;
|
||||
_total_transferences_size = 0L;
|
||||
_secure_notify_lock = new Object();
|
||||
_pre_lock = new Object();
|
||||
_pre_count_lock = new Object();
|
||||
_queue_flag_lock = new Object();
|
||||
_transference_waitstart_queue = new ConcurrentLinkedQueue<>();
|
||||
_transference_provision_queue = new ConcurrentLinkedQueue<>();
|
||||
_transference_remove_queue = new ConcurrentLinkedQueue<>();
|
||||
@ -72,11 +74,17 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
abstract public void remove(Transference[] transference);
|
||||
|
||||
public boolean isRemoving_transferences() {
|
||||
return _removing_transferences;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
return _removing_transferences;
|
||||
}
|
||||
}
|
||||
|
||||
public void setRemoving_transferences(boolean removing) {
|
||||
_removing_transferences = removing;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
_removing_transferences = removing;
|
||||
}
|
||||
}
|
||||
|
||||
public long getTotal_transferences_size() {
|
||||
@ -84,23 +92,41 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
}
|
||||
|
||||
public boolean isProvisioning_transferences() {
|
||||
return _provisioning_transferences;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
return _provisioning_transferences;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setProvisioning_transferences(boolean provisioning) {
|
||||
_provisioning_transferences = provisioning;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
_provisioning_transferences = provisioning;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean isStarting_transferences() {
|
||||
return _starting_transferences;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
return _starting_transferences;
|
||||
}
|
||||
}
|
||||
|
||||
public void setStarting_transferences(boolean starting) {
|
||||
_starting_transferences = starting;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
_starting_transferences = starting;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPreprocessing_transferences(boolean preprocessing) {
|
||||
_preprocessing_transferences = preprocessing;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
_preprocessing_transferences = preprocessing;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ConcurrentLinkedQueue<Runnable> getTransference_preprocess_queue() {
|
||||
@ -109,7 +135,7 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
|
||||
public void addPre_count(int pre_count) {
|
||||
|
||||
synchronized (_pre_lock) {
|
||||
synchronized (_pre_count_lock) {
|
||||
|
||||
_pre_count += pre_count;
|
||||
|
||||
@ -160,7 +186,11 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
}
|
||||
|
||||
public boolean isPreprocessing_transferences() {
|
||||
return _preprocessing_transferences;
|
||||
|
||||
synchronized (_queue_flag_lock) {
|
||||
return _preprocessing_transferences;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ConcurrentLinkedQueue<Transference> getTransference_provision_queue() {
|
||||
@ -423,6 +453,7 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
}
|
||||
|
||||
if (!isRemoving_transferences() && !isStarting_transferences() && !getTransference_waitstart_queue().isEmpty() && getTransference_running_list().size() < _max_running_trans) {
|
||||
|
||||
setStarting_transferences(true);
|
||||
|
||||
THREAD_POOL.execute(new Runnable() {
|
||||
@ -442,14 +473,13 @@ abstract public class TransferenceManager implements Runnable, SecureSingleThrea
|
||||
setStarting_transferences(false);
|
||||
|
||||
secureNotify();
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_updateView();
|
||||
|
||||
secureWait();
|
||||
|
||||
_updateView();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -78,7 +78,7 @@ public final class UploadView extends javax.swing.JPanel implements Transference
|
||||
|
||||
initComponents();
|
||||
|
||||
updateFonts(this, DEFAULT_FONT, ZOOM_FACTOR);
|
||||
updateFonts(this, DEFAULT_FONT, upload.getMain_panel().getZoom_factor());
|
||||
|
||||
_upload = upload;
|
||||
|
||||
@ -86,17 +86,18 @@ public final class UploadView extends javax.swing.JPanel implements Transference
|
||||
|
||||
((JSpinner.DefaultEditor) slots_spinner.getEditor()).getTextField().setEditable(false);
|
||||
|
||||
for (JComponent c : new JComponent[]{slots_spinner, slots_label, pause_button, stop_button, speed_label, progress_pbar, file_name_label, close_button, restart_button, file_size_label}) {
|
||||
|
||||
c.setVisible(false);
|
||||
}
|
||||
|
||||
speed_label.setForeground(new Color(0, 128, 255));
|
||||
|
||||
progress_pbar.setMinimum(0);
|
||||
progress_pbar.setMaximum(MAX_VALUE);
|
||||
progress_pbar.setStringPainted(true);
|
||||
|
||||
status_label.setText("");
|
||||
|
||||
for (JComponent c : new JComponent[]{slots_spinner, slots_label, pause_button, stop_button, speed_label, progress_pbar, file_name_label, close_button, restart_button, file_size_label}) {
|
||||
|
||||
c.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user