Skip to content

Commit

Permalink
8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tonikelope committed Oct 22, 2023
1 parent a14dd57 commit f894d80
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 7 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>8.2</version>
<version>8.3</version>
<packaging>jar</packaging>
<repositories>
<repository>
Expand Down
22 changes: 21 additions & 1 deletion src/main/java/com/tonikelope/megabasterd/FileGrabberDialog.form
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,12 @@
<Component id="add_folder_button" max="32767" attributes="0"/>
</Group>
<Component id="dir_name_textfield" max="32767" attributes="0"/>
<Component id="account_combobox" max="32767" attributes="0"/>
<Component id="used_space_label" alignment="0" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Component id="account_combobox" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="copy_email_button" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
</Group>
</Group>
Expand All @@ -174,6 +178,7 @@
<Group type="103" groupAlignment="3" attributes="0">
<Component id="account_label" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="account_combobox" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="copy_email_button" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="separate" max="-2" attributes="0"/>
<Component id="used_space_label" min="-2" max="-2" attributes="0"/>
Expand Down Expand Up @@ -305,6 +310,21 @@
<Property name="enabled" type="boolean" value="false"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="copy_email_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-copy-to-clipboard-30.png"/>
</Property>
<Property name="text" type="java.lang.String" value="Copy email"/>
<Property name="enabled" type="boolean" value="false"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="copy_email_buttonActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
<Component class="javax.swing.JButton" name="dance_button">
Expand Down
42 changes: 38 additions & 4 deletions src/main/java/com/tonikelope/megabasterd/FileGrabberDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ private void initComponents() {
add_files_button = new javax.swing.JButton();
upload_log_checkbox = new javax.swing.JCheckBox();
priority_checkbox = new javax.swing.JCheckBox();
copy_email_button = new javax.swing.JButton();
dance_button = new javax.swing.JButton();
total_file_size_label = new javax.swing.JLabel();
warning_label = new javax.swing.JLabel();
Expand Down Expand Up @@ -354,6 +355,16 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
priority_checkbox.setDoubleBuffered(true);
priority_checkbox.setEnabled(false);

copy_email_button.setFont(new java.awt.Font("Dialog", 1, 18)); // NOI18N
copy_email_button.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-copy-to-clipboard-30.png"))); // NOI18N
copy_email_button.setText("Copy email");
copy_email_button.setEnabled(false);
copy_email_button.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
copy_email_buttonActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
Expand All @@ -376,8 +387,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(add_folder_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addComponent(dir_name_textfield)
.addComponent(account_combobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(used_space_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addComponent(used_space_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(account_combobox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(copy_email_button)))))
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
Expand All @@ -390,7 +404,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGap(18, 18, 18)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(account_label)
.addComponent(account_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(account_combobox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(copy_email_button))
.addGap(18, 18, 18)
.addComponent(used_space_label)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
Expand Down Expand Up @@ -718,6 +733,7 @@ private void account_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//G
used_space_label.setText(LabelTranslatorSingleton.getInstance().translate("Checking account quota, please wait..."));

account_combobox.setEnabled(false);
copy_email_button.setEnabled(false);
account_label.setEnabled(false);
dance_button.setEnabled(false);
add_files_button.setEnabled(false);
Expand Down Expand Up @@ -760,7 +776,7 @@ private void account_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//G

used_space_label.setForeground(used_space_color);

for (JComponent c : new JComponent[]{used_space_label, add_files_button, add_folder_button, account_combobox, account_label, upload_log_checkbox, priority_checkbox}) {
for (JComponent c : new JComponent[]{copy_email_button, used_space_label, add_files_button, add_folder_button, account_combobox, account_label, upload_log_checkbox, priority_checkbox}) {

c.setEnabled(true);
}
Expand All @@ -775,6 +791,7 @@ private void account_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//G
account_combobox.setEnabled(true);
account_label.setEnabled(true);
account_combobox.setSelectedIndex(-1);
copy_email_button.setEnabled(true);
used_space_label.setForeground(Color.red);
used_space_label.setText(LabelTranslatorSingleton.getInstance().translate("ERROR checking account quota!"));
used_space_label.setEnabled(true);
Expand All @@ -799,6 +816,7 @@ private void account_comboboxItemStateChanged(java.awt.event.ItemEvent evt) {//G
account_combobox.setEnabled(true);
account_label.setEnabled(true);
account_combobox.setSelectedIndex(-1);
copy_email_button.setEnabled(true);
used_space_label.setForeground(Color.red);
used_space_label.setText(LabelTranslatorSingleton.getInstance().translate("ERROR checking account quota!"));
used_space_label.setEnabled(true);
Expand Down Expand Up @@ -861,6 +879,21 @@ private void skip_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-F
}
}//GEN-LAST:event_skip_buttonActionPerformed

private void copy_email_buttonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copy_email_buttonActionPerformed
// TODO add your handling code here:
if (account_combobox.getSelectedIndex() >= 0) {
copy_email_button.setEnabled(false);

copy_email_button.setText(LabelTranslatorSingleton.getInstance().translate("Please wait..."));

copyTextToClipboard((String) account_combobox.getSelectedItem());

copy_email_button.setText(LabelTranslatorSingleton.getInstance().translate("Copy email"));

copy_email_button.setEnabled(true);
}
}//GEN-LAST:event_copy_email_buttonActionPerformed

private void _genFileTree(String directoryName, DefaultMutableTreeNode root, File[] files) {

File directory = new File(directoryName);
Expand Down Expand Up @@ -954,6 +987,7 @@ private void _genFileList() {
private javax.swing.JLabel account_label;
private javax.swing.JButton add_files_button;
private javax.swing.JButton add_folder_button;
private javax.swing.JButton copy_email_button;
private javax.swing.JButton dance_button;
private javax.swing.JLabel dir_name_label;
private javax.swing.JTextField dir_name_textfield;
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 @@ -70,7 +70,7 @@
*/
public final class MainPanel {

public static final String VERSION = "8.2";
public static final String VERSION = "8.3";
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;
Expand Down

0 comments on commit f894d80

Please sign in to comment.