Tunning Smart Proxy timeouts
New option to force Smart Proxy always on (useful for testing)
This commit is contained in:
tonikelope 2023-10-15 19:59:47 +02:00
parent e9a1219ee6
commit c55c6bcba4
13 changed files with 526 additions and 329 deletions

View File

@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>7.84</version>
<version>7.85</version>
<packaging>jar</packaging>
<repositories>
<repository>

View File

@ -143,7 +143,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
SmartMegaProxyManager proxy_manager = MainPanel.getProxy_manager();
if (MainPanel.FORCE_SMART_PROXY) {
if (proxy_manager.isForce_smart_proxy()) {
String[] smart_proxy = proxy_manager.getProxy(_excluded_proxy_list);
@ -195,7 +195,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
if (_current_smart_proxy != null && chunk_error) {
proxy_manager.blockProxy(_current_smart_proxy, "HTTP " + String.valueOf(http_error));
proxy_manager.blockProxy(_current_smart_proxy, timeout ? "TIMEOUT!" : "HTTP " + String.valueOf(http_error));
String[] smart_proxy = proxy_manager.getProxy(_excluded_proxy_list);
@ -259,7 +259,7 @@ public class ChunkDownloader implements Runnable, SecureSingleThreadNotifiable {
if (_current_smart_proxy != null) {
con.setConnectTimeout(MainPanel.getProxy_manager().getProxy_timeout());
con.setReadTimeout(Transference.HTTP_PROXY_READ_TIMEOUT);
con.setReadTimeout(MainPanel.getProxy_manager().getProxy_timeout() * 2);
} else {
con.setConnectTimeout(Transference.HTTP_CONNECT_TIMEOUT);
con.setReadTimeout(Transference.HTTP_READ_TIMEOUT);

View File

@ -69,7 +69,7 @@ import javax.swing.UIManager;
*/
public final class MainPanel {
public static final String VERSION = "7.84";
public static final String VERSION = "7.85";
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;

View File

@ -384,7 +384,7 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="global_speed_down_label" pref="484" max="32767" attributes="0"/>
<Component id="global_speed_down_label" pref="474" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="force_chunk_reset_button" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
@ -534,7 +534,7 @@
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="ff" green="ff" red="ff" type="rgb"/>
</Property>
<Property name="text" type="java.lang.String" value="FORCE ALL CURRENT CHUNK RESET"/>
<Property name="text" type="java.lang.String" value="FORCE ALL CURRENT CHUNKS RESET"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="force_chunk_reset_buttonActionPerformed"/>

View File

@ -684,7 +684,7 @@ public final class MainPanelView extends javax.swing.JFrame {
force_chunk_reset_button.setBackground(new java.awt.Color(255, 0, 153));
force_chunk_reset_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
force_chunk_reset_button.setForeground(new java.awt.Color(255, 255, 255));
force_chunk_reset_button.setText("FORCE ALL CURRENT CHUNK RESET");
force_chunk_reset_button.setText("FORCE ALL CURRENT CHUNKS RESET");
force_chunk_reset_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
force_chunk_reset_buttonActionPerformed(evt);
@ -696,7 +696,7 @@ public final class MainPanelView extends javax.swing.JFrame {
downloads_panelLayout.setHorizontalGroup(
downloads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(downloads_panelLayout.createSequentialGroup()
.addComponent(global_speed_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, 484, Short.MAX_VALUE)
.addComponent(global_speed_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, 474, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(force_chunk_reset_button)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

View File

@ -381,7 +381,7 @@ public class MegaAPI implements Serializable {
SmartMegaProxyManager proxy_manager = MainPanel.getProxy_manager();
if (MainPanel.FORCE_SMART_PROXY) {
if (proxy_manager.isForce_smart_proxy()) {
String[] smart_proxy = proxy_manager.getProxy(excluded_proxy_list);

View File

@ -1011,7 +1011,7 @@ public class MiscTools {
ArrayList<String> excluded_proxy_list = new ArrayList<>();
if (MainPanel.FORCE_SMART_PROXY) {
if (proxy_manager.isForce_smart_proxy()) {
String[] smart_proxy = proxy_manager.getProxy(excluded_proxy_list);
@ -1089,8 +1089,8 @@ public class MiscTools {
}
if (current_smart_proxy != null) {
con.setConnectTimeout(Transference.HTTP_PROXY_CONNECT_TIMEOUT);
con.setReadTimeout(Transference.HTTP_PROXY_READ_TIMEOUT);
con.setConnectTimeout(MainPanel.getProxy_manager().getProxy_timeout());
con.setReadTimeout(MainPanel.getProxy_manager().getProxy_timeout() * 2);
}
con.setUseCaches(false);

View File

@ -38,7 +38,7 @@
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="cancel_button" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="panel_tabs" alignment="0" pref="1030" max="32767" attributes="0"/>
<Component id="panel_tabs" alignment="0" pref="935" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -478,30 +478,39 @@
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
<Component id="rec_smart_proxy_label1" alignment="0" max="32767" attributes="0"/>
<Component id="custom_proxy_list_label" alignment="0" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" min="-2" pref="1151" max="-2" attributes="0"/>
<Component id="rec_smart_proxy_label" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="rec_smart_proxy_label2" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
<Component id="rec_smart_proxy_label1" alignment="0" max="32767" attributes="0"/>
<Component id="custom_proxy_list_label" alignment="0" max="32767" attributes="0"/>
<Component id="jScrollPane1" alignment="0" min="-2" pref="1151" max="-2" attributes="0"/>
<Component id="rec_smart_proxy_label" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="rec_smart_proxy_label2" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="bad_proxy_time_spinner" max="32767" attributes="0"/>
<Component id="proxy_timeout_spinner" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="force_smart_proxy_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="bad_proxy_time_spinner" max="32767" attributes="0"/>
<Component id="proxy_timeout_spinner" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
<Component id="jLabel6" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
@ -530,6 +539,11 @@
<Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="force_smart_proxy_checkbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="jLabel7" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="custom_proxy_list_label" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jScrollPane1" min="-2" pref="344" max="-2" attributes="0"/>
@ -655,6 +669,22 @@
</Property>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="force_smart_proxy_checkbox">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Noto Sans" size="16" style="1"/>
</Property>
<Property name="text" type="java.lang.String" value="FORCE SMART PROXY"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="jLabel7">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Noto Sans" size="16" style="2"/>
</Property>
<Property name="text" type="java.lang.String" value="Forces the use of smart proxy even if we still have direct bandwidth available (useful to test proxies)."/>
</Properties>
</Component>
</SubComponents>
</Container>
</SubComponents>
@ -1175,7 +1205,7 @@
<Component class="javax.swing.JLabel" name="jLabel1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
<Font name="Dialog" size="14" style="2"/>
</Property>
<Property name="text" type="java.lang.String" value="Note: you can use a (optional) alias for your email addresses -&gt; bob@supermail.com#bob_mail (don&apos;t forget to save after entering your accounts)."/>
<Property name="doubleBuffered" type="boolean" value="true"/>
@ -1225,56 +1255,41 @@
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="proxy_panel" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="run_command_test_button" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="run_command_textbox" max="32767" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Group type="103" groupAlignment="0" 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" min="-2" pref="100" max="-2" attributes="0"/>
</Group>
<Component id="start_frozen_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="debug_file_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="custom_chunks_dir_checkbox" min="-2" max="-2" attributes="0"/>
<Component id="debug_file_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="custom_chunks_dir_button" min="-2" max="-2" attributes="0"/>
<Component id="debug_file_path" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace min="-2" pref="165" max="-2" attributes="0"/>
<Component id="custom_chunks_dir_current_label" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="rec_zoom_label" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="run_command_checkbox" alignment="0" min="-2" max="-2" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="run_command_checkbox" min="-2" max="-2" attributes="0"/>
<Component id="custom_chunks_dir_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="run_command_test_button" min="-2" max="-2" attributes="0"/>
<Component id="custom_chunks_dir_button" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="103" alignment="0" groupAlignment="1" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="language_combo" max="32767" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="import_settings_button" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="export_settings_button" max="-2" attributes="0"/>
</Group>
<Group type="102" attributes="0">
<Component id="font_label" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="font_combo" max="32767" attributes="0"/>
</Group>
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
<Component id="jPanel2" alignment="0" max="32767" attributes="0"/>
</Group>
<Component id="jButton1" min="-2" pref="484" max="-2" attributes="0"/>
</Group>
<EmptySpace min="0" pref="644" max="32767" attributes="0"/>
<EmptySpace min="0" pref="409" max="32767" attributes="0"/>
</Group>
<Component id="run_command_textbox" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -1284,28 +1299,10 @@
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="import_settings_button" alignment="3" max="-2" attributes="0"/>
<Component id="export_settings_button" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="jPanel1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="font_label" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="font_combo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace 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"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="language_combo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="jPanel2" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="custom_chunks_dir_checkbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="custom_chunks_dir_button" alignment="3" min="-2" max="-2" attributes="0"/>
@ -1315,14 +1312,17 @@
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="start_frozen_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="debug_file_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="run_command_checkbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="debug_file_checkbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="debug_file_path" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="run_command_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="run_command_textbox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="run_command_test_button" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="run_command_textbox" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="proxy_panel" min="-2" max="-2" attributes="0"/>
<EmptySpace type="separate" max="-2" attributes="0"/>
@ -1452,7 +1452,7 @@
<Component class="javax.swing.JLabel" name="proxy_warning_label">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="14" style="0"/>
<Font name="Dialog" size="14" style="2"/>
</Property>
<Property name="text" type="java.lang.String" value="Note: MegaBasterd will use this proxy for ALL connections."/>
<Property name="enabled" type="boolean" value="false"/>
@ -1542,53 +1542,6 @@
</Container>
</SubComponents>
</Container>
<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="18" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/icons8-import-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="IMPORT SETTINGS"/>
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="import_settings_buttonActionPerformed"/>
</Events>
</Component>
<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="18" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/icons8-export-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="EXPORT SETTINGS"/>
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="export_settings_buttonActionPerformed"/>
</Events>
</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 (%):"/>
<Property name="doubleBuffered" type="boolean" value="true"/>
</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>
<Property name="doubleBuffered" type="boolean" value="true"/>
</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">
@ -1598,65 +1551,6 @@
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="1"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/icons8-cancel-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="RESET MEGABASTERD"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JLabel" name="jLabel2">
<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="Language:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="language_combo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="0"/>
</Property>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JLabel" name="font_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:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="font_combo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="0"/>
</Property>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JButton" name="custom_chunks_dir_button">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
@ -1737,7 +1631,215 @@
<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="Save debug info to file"/>
<Property name="text" type="java.lang.String" value="Save debug info to file -&gt; "/>
</Properties>
</Component>
<Container class="javax.swing.JPanel" name="jPanel1">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jButton1" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="import_settings_button" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="export_settings_button" min="-2" pref="232" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="import_settings_button" alignment="3" max="-2" attributes="0"/>
<Component id="export_settings_button" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JButton" name="jButton1">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="1"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="0" green="0" red="ff" type="rgb"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/icons8-cancel-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="RESET MEGABASTERD"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
</Events>
</Component>
<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="18" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/icons8-import-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="IMPORT SETTINGS"/>
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="import_settings_buttonActionPerformed"/>
</Events>
</Component>
<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="18" style="1"/>
</Property>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/images/icons8-export-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="EXPORT SETTINGS"/>
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="export_settings_buttonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Container class="javax.swing.JPanel" name="jPanel2">
<Layout>
<DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="0" max="-2" attributes="0">
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="zoom_label" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="font_label" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="32767" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="font_combo" max="32767" attributes="0"/>
<Component id="zoom_spinner" min="-2" pref="351" max="-2" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
<EmptySpace max="32767" attributes="0"/>
<Component id="language_combo" min="-2" pref="351" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
<DimensionLayout dim="1">
<Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="font_label" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="font_combo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace 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"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="language_combo" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
</Group>
</DimensionLayout>
</Layout>
<SubComponents>
<Component class="javax.swing.JLabel" name="jLabel2">
<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="Language:"/>
</Properties>
</Component>
<Component class="javax.swing.JLabel" name="font_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:"/>
</Properties>
</Component>
<Component class="javax.swing.JComboBox" name="language_combo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="0"/>
</Property>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</Component>
<Component class="javax.swing.JComboBox" name="font_combo">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="18" style="0"/>
</Property>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
</Property>
</Properties>
<AuxValues>
<AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="&lt;String&gt;"/>
</AuxValues>
</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 (%):"/>
<Property name="doubleBuffered" type="boolean" value="true"/>
</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>
<Property name="doubleBuffered" type="boolean" value="true"/>
</Properties>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JLabel" name="debug_file_path">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Noto Sans" size="18" style="0"/>
</Property>
<Property name="text" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="MainPanel.MEGABASTERD_HOME_DIR + &quot;/.MEGABASTERD_DEBUG.log&quot;" type="code"/>
</Property>
</Properties>
</Component>
</SubComponents>

View File

@ -338,7 +338,7 @@ public class SettingsDialog extends javax.swing.JDialog {
String smartproxy_timeout = DBTools.selectSettingValue("smartproxy_timeout");
int smartproxy_timeout_int = (int) ((float) Transference.HTTP_PROXY_CONNECT_TIMEOUT / 1000);
int smartproxy_timeout_int = (int) ((float) Transference.HTTP_PROXY_TIMEOUT / 1000);
if (smartproxy_timeout != null) {
smartproxy_timeout_int = Integer.parseInt(smartproxy_timeout);
@ -585,6 +585,17 @@ public class SettingsDialog extends javax.swing.JDialog {
MiscTools.containerSetEnabled(smart_proxy_settings, use_smart_proxy);
boolean force_smart_proxy = MainPanel.FORCE_SMART_PROXY;
String force_smart_proxy_string = DBTools.selectSettingValue("force_smart_proxy");
if (force_smart_proxy_string != null) {
force_smart_proxy = force_smart_proxy_string.equals("yes");
}
force_smart_proxy_checkbox.setSelected(force_smart_proxy);
boolean run_command = false;
String run_command_string = DBTools.selectSettingValue("run_command");
@ -754,6 +765,8 @@ public class SettingsDialog extends javax.swing.JDialog {
rec_smart_proxy_label2 = new javax.swing.JLabel();
rec_smart_proxy_label = new javax.swing.JLabel();
proxy_timeout_spinner = new javax.swing.JSpinner();
force_smart_proxy_checkbox = new javax.swing.JCheckBox();
jLabel7 = new javax.swing.JLabel();
uploads_scrollpane = new javax.swing.JScrollPane();
uploads_panel = new javax.swing.JPanel();
default_slots_up_label = new javax.swing.JLabel();
@ -799,16 +812,7 @@ public class SettingsDialog extends javax.swing.JDialog {
proxy_user_textfield = new javax.swing.JTextField();
proxy_pass_label = new javax.swing.JLabel();
proxy_pass_textfield = new javax.swing.JPasswordField();
import_settings_button = new javax.swing.JButton();
export_settings_button = new javax.swing.JButton();
zoom_label = new javax.swing.JLabel();
zoom_spinner = new javax.swing.JSpinner();
rec_zoom_label = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
language_combo = new javax.swing.JComboBox<>();
font_label = new javax.swing.JLabel();
font_combo = new javax.swing.JComboBox<>();
custom_chunks_dir_button = new javax.swing.JButton();
custom_chunks_dir_current_label = new javax.swing.JLabel();
custom_chunks_dir_checkbox = new javax.swing.JCheckBox();
@ -818,6 +822,18 @@ public class SettingsDialog extends javax.swing.JDialog {
run_command_textbox.addMouseListener(new ContextMenuMouseListener());
run_command_test_button = new javax.swing.JButton();
debug_file_checkbox = new javax.swing.JCheckBox();
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
import_settings_button = new javax.swing.JButton();
export_settings_button = new javax.swing.JButton();
jPanel2 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
font_label = new javax.swing.JLabel();
language_combo = new javax.swing.JComboBox<>();
font_combo = new javax.swing.JComboBox<>();
zoom_label = new javax.swing.JLabel();
zoom_spinner = new javax.swing.JSpinner();
debug_file_path = new javax.swing.JLabel();
status = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
@ -999,31 +1015,43 @@ public class SettingsDialog extends javax.swing.JDialog {
proxy_timeout_spinner.setFont(new java.awt.Font("Noto Sans", 0, 16)); // NOI18N
proxy_timeout_spinner.setModel(new javax.swing.SpinnerNumberModel(10, 1, null, 1));
force_smart_proxy_checkbox.setFont(new java.awt.Font("Noto Sans", 1, 16)); // NOI18N
force_smart_proxy_checkbox.setText("FORCE SMART PROXY");
jLabel7.setFont(new java.awt.Font("Noto Sans", 2, 16)); // NOI18N
jLabel7.setText("Forces the use of smart proxy even if we still have direct bandwidth available (useful to test proxies).");
javax.swing.GroupLayout smart_proxy_settingsLayout = new javax.swing.GroupLayout(smart_proxy_settings);
smart_proxy_settings.setLayout(smart_proxy_settingsLayout);
smart_proxy_settingsLayout.setHorizontalGroup(
smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(smart_proxy_settingsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(rec_smart_proxy_label1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(custom_proxy_list_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1151, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(rec_smart_proxy_label)
.addComponent(rec_smart_proxy_label2))
.addGroup(smart_proxy_settingsLayout.createSequentialGroup()
.addContainerGap()
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel5))
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(rec_smart_proxy_label1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(custom_proxy_list_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1151, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(rec_smart_proxy_label)
.addComponent(rec_smart_proxy_label2))
.addGroup(smart_proxy_settingsLayout.createSequentialGroup()
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel5))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(bad_proxy_time_spinner)
.addComponent(proxy_timeout_spinner))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel6)))))
.addGroup(smart_proxy_settingsLayout.createSequentialGroup()
.addComponent(force_smart_proxy_checkbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(bad_proxy_time_spinner)
.addComponent(proxy_timeout_spinner))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel6))))
.addComponent(jLabel7)))
.addContainerGap())
);
smart_proxy_settingsLayout.setVerticalGroup(
@ -1046,6 +1074,10 @@ public class SettingsDialog extends javax.swing.JDialog {
.addComponent(proxy_timeout_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(smart_proxy_settingsLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(force_smart_proxy_checkbox)
.addComponent(jLabel7))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(custom_proxy_list_label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 344, javax.swing.GroupLayout.PREFERRED_SIZE)
@ -1412,7 +1444,7 @@ public class SettingsDialog extends javax.swing.JDialog {
}
});
jLabel1.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
jLabel1.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
jLabel1.setText("Note: you can use a (optional) alias for your email addresses -> bob@supermail.com#bob_mail (don't forget to save after entering your accounts).");
jLabel1.setDoubleBuffered(true);
@ -1524,7 +1556,7 @@ public class SettingsDialog extends javax.swing.JDialog {
}
});
proxy_warning_label.setFont(new java.awt.Font("Dialog", 0, 14)); // NOI18N
proxy_warning_label.setFont(new java.awt.Font("Dialog", 2, 14)); // NOI18N
proxy_warning_label.setText("Note: MegaBasterd will use this proxy for ALL connections.");
proxy_warning_label.setEnabled(false);
@ -1618,57 +1650,10 @@ public class SettingsDialog extends javax.swing.JDialog {
.addContainerGap())
);
import_settings_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
import_settings_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-import-30.png"))); // NOI18N
import_settings_button.setText("IMPORT SETTINGS");
import_settings_button.setDoubleBuffered(true);
import_settings_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
import_settings_buttonActionPerformed(evt);
}
});
export_settings_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
export_settings_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-export-30.png"))); // NOI18N
export_settings_button.setText("EXPORT SETTINGS");
export_settings_button.setDoubleBuffered(true);
export_settings_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
export_settings_buttonActionPerformed(evt);
}
});
zoom_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
zoom_label.setText("Font ZOOM (%):");
zoom_label.setDoubleBuffered(true);
zoom_spinner.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
zoom_spinner.setDoubleBuffered(true);
rec_zoom_label.setFont(new java.awt.Font("Dialog", 2, 16)); // NOI18N
rec_zoom_label.setText("Note: restart might be required.");
rec_zoom_label.setDoubleBuffered(true);
jButton1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jButton1.setForeground(new java.awt.Color(255, 0, 0));
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-cancel-30.png"))); // NOI18N
jButton1.setText("RESET MEGABASTERD");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel2.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel2.setText("Language:");
language_combo.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
font_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
font_label.setText("Font:");
font_combo.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
custom_chunks_dir_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
custom_chunks_dir_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-folder-30.png"))); // NOI18N
custom_chunks_dir_button.setText("Change it");
@ -1713,7 +1698,122 @@ public class SettingsDialog extends javax.swing.JDialog {
});
debug_file_checkbox.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
debug_file_checkbox.setText("Save debug info to file");
debug_file_checkbox.setText("Save debug info to file -> ");
jButton1.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jButton1.setForeground(new java.awt.Color(255, 0, 0));
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-cancel-30.png"))); // NOI18N
jButton1.setText("RESET MEGABASTERD");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
import_settings_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
import_settings_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-import-30.png"))); // NOI18N
import_settings_button.setText("IMPORT SETTINGS");
import_settings_button.setDoubleBuffered(true);
import_settings_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
import_settings_buttonActionPerformed(evt);
}
});
export_settings_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
export_settings_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-export-30.png"))); // NOI18N
export_settings_button.setText("EXPORT SETTINGS");
export_settings_button.setDoubleBuffered(true);
export_settings_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
export_settings_buttonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(import_settings_button)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(export_settings_button, javax.swing.GroupLayout.PREFERRED_SIZE, 232, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(import_settings_button)
.addComponent(export_settings_button))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1)
.addContainerGap())
);
jLabel2.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
jLabel2.setText("Language:");
font_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
font_label.setText("Font:");
language_combo.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
font_combo.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
zoom_label.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
zoom_label.setText("Font ZOOM (%):");
zoom_label.setDoubleBuffered(true);
zoom_spinner.setFont(new java.awt.Font("Dialog", 0, 18)); // NOI18N
zoom_spinner.setDoubleBuffered(true);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(zoom_label)
.addComponent(font_label))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(font_combo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(zoom_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(language_combo, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(font_label)
.addComponent(font_combo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel2Layout.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)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(language_combo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap())
);
debug_file_path.setFont(new java.awt.Font("Noto Sans", 0, 18)); // NOI18N
debug_file_path.setText(MainPanel.MEGABASTERD_HOME_DIR + "/.MEGABASTERD_DEBUG.log");
javax.swing.GroupLayout advanced_panelLayout = new javax.swing.GroupLayout(advanced_panel);
advanced_panel.setLayout(advanced_panelLayout);
@ -1723,65 +1823,39 @@ public class SettingsDialog extends javax.swing.JDialog {
.addContainerGap()
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(proxy_panel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(advanced_panelLayout.createSequentialGroup()
.addComponent(run_command_test_button)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(run_command_textbox))
.addGroup(advanced_panelLayout.createSequentialGroup()
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(advanced_panelLayout.createSequentialGroup()
.addComponent(zoom_label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(zoom_spinner, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(start_frozen_checkbox)
.addComponent(debug_file_checkbox)
.addGroup(advanced_panelLayout.createSequentialGroup()
.addComponent(custom_chunks_dir_checkbox)
.addComponent(debug_file_checkbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(custom_chunks_dir_button))
.addComponent(debug_file_path))
.addGroup(advanced_panelLayout.createSequentialGroup()
.addGap(165, 165, 165)
.addComponent(custom_chunks_dir_current_label))
.addComponent(rec_zoom_label)
.addComponent(run_command_checkbox)
.addGroup(advanced_panelLayout.createSequentialGroup()
.addComponent(run_command_checkbox)
.addComponent(custom_chunks_dir_checkbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(run_command_test_button))
.addComponent(custom_chunks_dir_button))
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, advanced_panelLayout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(language_combo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, advanced_panelLayout.createSequentialGroup()
.addComponent(import_settings_button)
.addGap(18, 18, 18)
.addComponent(export_settings_button))
.addGroup(advanced_panelLayout.createSequentialGroup()
.addComponent(font_label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(font_combo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 484, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(0, 644, Short.MAX_VALUE))
.addComponent(run_command_textbox))
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGap(0, 409, Short.MAX_VALUE)))
.addContainerGap())
);
advanced_panelLayout.setVerticalGroup(
advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(advanced_panelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(import_settings_button)
.addComponent(export_settings_button))
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(font_label)
.addComponent(font_combo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(advanced_panelLayout.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)
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(language_combo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(custom_chunks_dir_checkbox)
@ -1791,13 +1865,15 @@ public class SettingsDialog extends javax.swing.JDialog {
.addGap(18, 18, 18)
.addComponent(start_frozen_checkbox)
.addGap(18, 18, 18)
.addComponent(debug_file_checkbox)
.addGap(18, 18, 18)
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(run_command_checkbox)
.addComponent(run_command_test_button))
.addComponent(debug_file_checkbox)
.addComponent(debug_file_path))
.addGap(18, 18, 18)
.addComponent(run_command_checkbox)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(run_command_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(advanced_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(run_command_textbox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(run_command_test_button))
.addGap(18, 18, 18)
.addComponent(proxy_panel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
@ -1825,7 +1901,7 @@ public class SettingsDialog extends javax.swing.JDialog {
.addComponent(save_button)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(cancel_button))
.addComponent(panel_tabs, javax.swing.GroupLayout.DEFAULT_SIZE, 1030, Short.MAX_VALUE))
.addComponent(panel_tabs, javax.swing.GroupLayout.DEFAULT_SIZE, 935, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
@ -1910,6 +1986,7 @@ public class SettingsDialog extends javax.swing.JDialog {
settings.put("clipboardspy", clipboardspy_checkbox.isSelected() ? "yes" : "no");
settings.put("thumbnails", thumbnail_checkbox.isSelected() ? "yes" : "no");
settings.put("upload_log", upload_log_checkbox.isSelected() ? "yes" : "no");
settings.put("force_smart_proxy", force_smart_proxy_checkbox.isSelected() ? "yes" : "no");
settings.put("upload_public_folder", upload_public_folder_checkbox.isSelected() ? "yes" : "no");
settings.put("smartproxy_ban_time", String.valueOf(bad_proxy_time_spinner.getValue()));
settings.put("smartproxy_timeout", String.valueOf(proxy_timeout_spinner.getValue()));
@ -3208,6 +3285,7 @@ public class SettingsDialog extends javax.swing.JDialog {
private javax.swing.JLabel custom_proxy_list_label;
private javax.swing.JTextArea custom_proxy_textarea;
private javax.swing.JCheckBox debug_file_checkbox;
private javax.swing.JLabel debug_file_path;
private javax.swing.JLabel default_dir_label;
private javax.swing.JLabel default_slots_down_label;
private javax.swing.JSpinner default_slots_down_spinner;
@ -3224,6 +3302,7 @@ public class SettingsDialog extends javax.swing.JDialog {
private javax.swing.JButton export_settings_button;
private javax.swing.JComboBox<String> font_combo;
private javax.swing.JLabel font_label;
private javax.swing.JCheckBox force_smart_proxy_checkbox;
private javax.swing.JButton import_mega_button;
private javax.swing.JButton import_settings_button;
private javax.swing.JButton jButton1;
@ -3233,6 +3312,9 @@ public class SettingsDialog extends javax.swing.JDialog {
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JProgressBar jProgressBar1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JComboBox<String> language_combo;

View File

@ -45,6 +45,7 @@ public final class SmartMegaProxyManager {
private final MainPanel _main_panel;
private volatile int _ban_time;
private volatile int _proxy_timeout;
private volatile boolean _force_smart_proxy;
public int getBan_time() {
return _ban_time;
@ -54,6 +55,10 @@ public final class SmartMegaProxyManager {
return _proxy_timeout;
}
public boolean isForce_smart_proxy() {
return _force_smart_proxy;
}
public SmartMegaProxyManager(String proxy_list_url, MainPanel main_panel) {
_proxy_list_url = (proxy_list_url != null && !"".equals(proxy_list_url)) ? proxy_list_url : DEFAULT_SMART_PROXY_URL;
_proxy_list = new LinkedHashMap<>();
@ -78,10 +83,19 @@ public final class SmartMegaProxyManager {
if (smartproxy_timeout != null) {
_proxy_timeout = Integer.parseInt(smartproxy_timeout) * 1000;
} else {
_proxy_timeout = Transference.HTTP_PROXY_CONNECT_TIMEOUT;
_proxy_timeout = Transference.HTTP_PROXY_TIMEOUT;
}
LOG.log(Level.INFO, "SmartProxy BAN_TIME: " + String.valueOf(_ban_time) + " TIMEOUT: " + String.valueOf(_proxy_timeout / 1000));
String force_smart_proxy_string = DBTools.selectSettingValue("force_smart_proxy");
if (force_smart_proxy_string != null) {
_force_smart_proxy = force_smart_proxy_string.equals("yes");
} else {
_force_smart_proxy = MainPanel.FORCE_SMART_PROXY;
}
LOG.log(Level.INFO, "SmartProxy BAN_TIME: " + String.valueOf(_ban_time) + " TIMEOUT: " + String.valueOf(_proxy_timeout / 1000) + " FORCE: " + String.valueOf(_force_smart_proxy));
}
public synchronized int getProxyCount() {
@ -131,7 +145,7 @@ public final class SmartMegaProxyManager {
_proxy_list.remove(proxy);
LOG.log(Level.WARNING, "{0} Smart Proxy Manager: DELETING PROXY -> {1} ({2})", new Object[]{Thread.currentThread().getName(), proxy, cause});
LOG.log(Level.WARNING, "[Smart Proxy] REMOVING PROXY {0} ({1})", new Object[]{proxy, cause});
} else {
@ -141,7 +155,7 @@ public final class SmartMegaProxyManager {
_proxy_list.put(proxy, proxy_data);
LOG.log(Level.WARNING, "{0} Smart Proxy Manager: BLOCKING PROXY -> {1} ({2} secs) ({3})", new Object[]{Thread.currentThread().getName(), proxy, this._ban_time, cause});
LOG.log(Level.WARNING, "[Smart Proxy] BLOCKING PROXY {0} ({1} secs) ({2})", new Object[]{proxy, _ban_time, cause});
}
}

View File

@ -66,7 +66,7 @@ public class StreamChunkDownloader implements Runnable {
ArrayList<String> excluded_proxy_list = new ArrayList<>();
if (MainPanel.FORCE_SMART_PROXY) {
if (proxy_manager.isForce_smart_proxy()) {
String[] smart_proxy = proxy_manager.getProxy(excluded_proxy_list);
@ -165,8 +165,8 @@ public class StreamChunkDownloader implements Runnable {
}
if (current_smart_proxy != null) {
con.setConnectTimeout(Transference.HTTP_PROXY_CONNECT_TIMEOUT);
con.setReadTimeout(Transference.HTTP_PROXY_READ_TIMEOUT);
con.setConnectTimeout(MainPanel.getProxy_manager().getProxy_timeout());
con.setReadTimeout(MainPanel.getProxy_manager().getProxy_timeout() * 2);
}
con.setUseCaches(false);

View File

@ -19,8 +19,7 @@ public interface Transference {
int MIN_WORKERS = 1;
int MAX_WORKERS = 20;
int HTTP_PROXY_CONNECT_TIMEOUT = 5000;
int HTTP_PROXY_READ_TIMEOUT = 20000;
int HTTP_PROXY_TIMEOUT = 5000;
int HTTP_CONNECT_TIMEOUT = 60000;
int HTTP_READ_TIMEOUT = 60000;
int MAX_SIM_TRANSFERENCES = 50;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

After

Width:  |  Height:  |  Size: 213 KiB