Skip to content

Commit

Permalink
2.93
Browse files Browse the repository at this point in the history
  • Loading branch information
tonikelope committed Feb 4, 2018
1 parent 41b86e5 commit 7bcffdf
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 74 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>2.92</version>
<version>2.93</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<Component id="remember_checkbox" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
</Group>
<Component id="please_label" alignment="0" pref="584" max="32767" attributes="0"/>
<Component id="please_label" alignment="0" pref="524" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createSequentialGroup()
.addComponent(remember_checkbox)
.addGap(0, 0, Short.MAX_VALUE))
.addComponent(please_label, javax.swing.GroupLayout.DEFAULT_SIZE, 584, Short.MAX_VALUE))))
.addComponent(please_label, javax.swing.GroupLayout.DEFAULT_SIZE, 524, Short.MAX_VALUE))))
.addContainerGap())
);
layout.setVerticalGroup(
Expand Down
80 changes: 47 additions & 33 deletions src/main/java/com/tonikelope/megabasterd/LinkGrabberDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public final class LinkGrabberDialog extends javax.swing.JDialog implements ClipboardChangeObserver {

private boolean _download;
private String _download_path;
private String _download_path, _selected_item;
private final ClipboardSpy _clipboardspy;
private final MainPanel _main_panel;

Expand Down Expand Up @@ -66,6 +66,8 @@ public LinkGrabberDialog(MainPanelView parent, boolean modal, String download_pa

_download_path = download_path;

_selected_item = null;

_clipboardspy = clipboardspy;

download_dir_label.setText(truncateText(download_path, 80));
Expand All @@ -79,7 +81,19 @@ public void run() {
swingInvoke(new Runnable() {
@Override
public void run() {
use_mega_account_down_combobox.addItem(_main_panel.getMega_account_down());

String mega_default_down = _main_panel.getMega_account_down();

use_mega_account_down_combobox.addItem(mega_default_down);

for (Object k : _main_panel.getMega_accounts().keySet()) {

if (!mega_default_down.equals(k)) {
use_mega_account_down_combobox.addItem((String) k);
}

}

use_mega_account_down_combobox.addItem("");
use_mega_account_down_combobox.setSelectedIndex(0);
}
Expand Down Expand Up @@ -366,56 +380,56 @@ public void run() {

private void use_mega_account_down_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_use_mega_account_down_comboboxItemStateChanged

String selected_item = (String) use_mega_account_down_combobox.getSelectedItem();
if (_selected_item == null || !((String) use_mega_account_down_combobox.getSelectedItem()).equals(_selected_item)) {
_selected_item = (String) use_mega_account_down_combobox.getSelectedItem();

if (_main_panel.isUse_mega_account_down() && !"".equals(selected_item)) {
if (_main_panel.isUse_mega_account_down() && !"".equals(_selected_item)) {

use_mega_account_down_combobox.setEnabled(false);
use_mega_account_down_combobox.setEnabled(false);

dance_button.setEnabled(false);
dance_button.setEnabled(false);

dance_button.setText("Checking MEGA account...");
dance_button.setText("Checking MEGA account...");

pack();
pack();

final String email = selected_item;
final LinkGrabberDialog tthis = this;

final LinkGrabberDialog tthis = this;
THREAD_POOL.execute(new Runnable() {
@Override
public void run() {

THREAD_POOL.execute(new Runnable() {
@Override
public void run() {
try {
checkMegaAccountLoginAndShowMasterPassDialog(_main_panel, tthis, _selected_item);
} catch (Exception ex) {

swingInvoke(new Runnable() {
@Override
public void run() {
use_mega_account_down_combobox.setSelectedIndex(_main_panel.getMega_accounts().size());

try {
checkMegaAccountLoginAndShowMasterPassDialog(_main_panel, tthis, email);
} catch (Exception ex) {
}
});
}

swingInvoke(new Runnable() {
@Override
public void run() {
use_mega_account_down_combobox.setSelectedIndex(1);
getUse_mega_account_down_combobox().setEnabled(true);

}
});
}

swingInvoke(new Runnable() {
@Override
public void run() {
getUse_mega_account_down_combobox().setEnabled(true);

getDance_button().setText("Let's dance, baby");
getDance_button().setText("Let's dance, baby");

getDance_button().setEnabled(true);
getDance_button().setEnabled(true);

pack();
pack();

}
});
}
});

}
});
}
});

}
}
}//GEN-LAST:event_use_mega_account_down_comboboxItemStateChanged

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/tonikelope/megabasterd/MainPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
*/
public final class MainPanel {

public static final String VERSION = "2.92";
public static final String VERSION = "2.93";
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;
Expand Down
12 changes: 10 additions & 2 deletions src/main/java/com/tonikelope/megabasterd/MainPanelView.form
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@
<Container class="javax.swing.JScrollPane" name="jScrollPane_down">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder>
<Color PropertyName="color" blue="99" green="99" red="99" type="rgb"/>
</LineBorder>
</Border>
</Property>
</Properties>

Expand Down Expand Up @@ -500,7 +504,11 @@
<Container class="javax.swing.JScrollPane" name="jScrollPane_up">
<Properties>
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor">
<Border info="null"/>
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo">
<LineBorder>
<Color PropertyName="color" blue="99" green="99" red="99" type="rgb"/>
</LineBorder>
</Border>
</Property>
</Properties>

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/tonikelope/megabasterd/MainPanelView.java
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

jScrollPane_down.setBorder(null);
jScrollPane_down.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));

jPanel_scroll_down.setLayout(new javax.swing.BoxLayout(jPanel_scroll_down, javax.swing.BoxLayout.Y_AXIS));
jScrollPane_down.setViewportView(jPanel_scroll_down);
Expand Down Expand Up @@ -343,7 +343,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
}
});

jScrollPane_up.setBorder(null);
jScrollPane_up.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(153, 153, 153)));

jPanel_scroll_up.setLayout(new javax.swing.BoxLayout(jPanel_scroll_up, javax.swing.BoxLayout.Y_AXIS));
jScrollPane_up.setViewportView(jPanel_scroll_up);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<Component class="javax.swing.JComboBox" name="use_mega_account_down_combobox">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="16" style="1"/>
<Font name="Dialog" size="16" style="0"/>
</Property>
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
<StringArray count="0"/>
Expand Down
79 changes: 47 additions & 32 deletions src/main/java/com/tonikelope/megabasterd/StreamerDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public final class StreamerDialog extends javax.swing.JDialog implements Clipboa
private final ClipboardSpy _clipboardspy;
private final MainPanelView _mainPanelView;
private final MainPanel _main_panel;
private String _selected_item;

public JButton getDance_button() {
return dance_button;
Expand Down Expand Up @@ -53,6 +54,8 @@ public StreamerDialog(MainPanelView parent, boolean modal, ClipboardSpy clipboar

_clipboardspy = clipboardspy;

_selected_item = null;

_mainPanelView = parent;

if (_main_panel.isUse_mega_account_down() && _main_panel.getMega_accounts().size() > 0) {
Expand All @@ -64,7 +67,17 @@ public void run() {
swingInvoke(new Runnable() {
@Override
public void run() {
use_mega_account_down_combobox.addItem(_main_panel.getMega_account_down());
String mega_default_down = _main_panel.getMega_account_down();

use_mega_account_down_combobox.addItem(mega_default_down);

for (Object k : _main_panel.getMega_accounts().keySet()) {

if (!mega_default_down.equals(k)) {
use_mega_account_down_combobox.addItem((String) k);
}

}
use_mega_account_down_combobox.addItem("");
use_mega_account_down_combobox.setSelectedIndex(0);
}
Expand Down Expand Up @@ -123,7 +136,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
use_mega_account_down_label.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
use_mega_account_down_label.setText("Use this account for streaming:");

use_mega_account_down_combobox.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
use_mega_account_down_combobox.setFont(new java.awt.Font("Dialog", 0, 16)); // NOI18N
use_mega_account_down_combobox.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
use_mega_account_down_comboboxItemStateChanged(evt);
Expand Down Expand Up @@ -258,55 +271,57 @@ public void run() {
}//GEN-LAST:event_dance_buttonActionPerformed

private void use_mega_account_down_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_use_mega_account_down_comboboxItemStateChanged
final String selected_item = (String) use_mega_account_down_combobox.getSelectedItem();

if (_main_panel.isUse_mega_account_down() && !"".equals(selected_item)) {
if (_selected_item == null || !((String) use_mega_account_down_combobox.getSelectedItem()).equals(_selected_item)) {
_selected_item = (String) use_mega_account_down_combobox.getSelectedItem();

use_mega_account_down_combobox.setEnabled(false);
if (_main_panel.isUse_mega_account_down() && !"".equals(_selected_item)) {

dance_button.setEnabled(false);
use_mega_account_down_combobox.setEnabled(false);

dance_button.setText("Checking MEGA account...");
dance_button.setEnabled(false);

pack();
dance_button.setText("Checking MEGA account...");

final String email = selected_item;
pack();

final StreamerDialog tthis = this;
final StreamerDialog tthis = this;

THREAD_POOL.execute(new Runnable() {
@Override
public void run() {
THREAD_POOL.execute(new Runnable() {
@Override
public void run() {

try {
checkMegaAccountLoginAndShowMasterPassDialog(_main_panel, tthis, _selected_item);
} catch (Exception ex) {

try {
checkMegaAccountLoginAndShowMasterPassDialog(_main_panel, tthis, email);
} catch (Exception ex) {
swingInvoke(new Runnable() {
@Override
public void run() {
use_mega_account_down_combobox.setSelectedIndex(_main_panel.getMega_accounts().size());

}
});
}

swingInvoke(new Runnable() {
@Override
public void run() {
use_mega_account_down_combobox.setSelectedIndex(1);

}
});
}
getUse_mega_account_down_combobox().setEnabled(true);

swingInvoke(new Runnable() {
@Override
public void run() {
getUse_mega_account_down_combobox().setEnabled(true);
getDance_button().setText("Let's dance, baby");

getDance_button().setText("Let's dance, baby");
getDance_button().setEnabled(true);

getDance_button().setEnabled(true);
pack();

pack();
}
});

}
});
}
});

}
});
}
}
}//GEN-LAST:event_use_mega_account_down_comboboxItemStateChanged

Expand Down

0 comments on commit 7bcffdf

Please sign in to comment.