Skip to content

Commit

Permalink
8.12
Browse files Browse the repository at this point in the history
New button COPY ALL UPLOADS LINKS
Upload button copy folder/file link includes email
  • Loading branch information
tonikelope committed Oct 30, 2023
1 parent 858e1c1 commit 02d5582
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.tonikelope</groupId>
<artifactId>MegaBasterd</artifactId>
<version>8.11</version>
<version>8.12</version>
<packaging>jar</packaging>
<repositories>
<repository>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/tonikelope/megabasterd/MainPanel.java
Expand Up @@ -70,7 +70,7 @@
*/
public final class MainPanel {

public static final String VERSION = "8.11";
public static final String VERSION = "8.12";
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
27 changes: 24 additions & 3 deletions src/main/java/com/tonikelope/megabasterd/MainPanelView.form
Expand Up @@ -382,10 +382,11 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="status_down_label" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
<Component id="close_all_finished_down_button" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane_down" alignment="0" max="32767" attributes="0"/>
<Component id="down_remtime_label" alignment="0" max="32767" attributes="0"/>
Expand Down Expand Up @@ -559,8 +560,11 @@
</Group>
<Group type="102" alignment="0" attributes="0">
<Component id="status_up_label" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<EmptySpace min="-2" pref="3" max="-2" attributes="0"/>
<Component id="close_all_finished_up_button" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="copy_all_uploads" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
</Group>
<Component id="jScrollPane_up" alignment="0" max="32767" attributes="0"/>
<Component id="up_remtime_label" alignment="0" max="32767" attributes="0"/>
Expand All @@ -572,7 +576,10 @@
<Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" max="-2" attributes="0">
<Component id="close_all_finished_up_button" alignment="0" max="32767" attributes="0"/>
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
<Component id="close_all_finished_up_button" alignment="3" max="32767" attributes="0"/>
<Component id="copy_all_uploads" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<Component id="status_up_label" alignment="0" max="32767" attributes="0"/>
</Group>
<EmptySpace max="-2" attributes="0"/>
Expand Down Expand Up @@ -673,6 +680,20 @@
</Component>
<Component class="javax.swing.JProgressBar" name="upload_status_bar">
</Component>
<Component class="javax.swing.JButton" name="copy_all_uploads">
<Properties>
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
<Font name="Dialog" size="16" 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 ALL UPLOAD LINKS"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="copy_all_uploadsActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>
Expand Down
33 changes: 29 additions & 4 deletions src/main/java/com/tonikelope/megabasterd/MainPanelView.java
Expand Up @@ -582,6 +582,7 @@ private void initComponents() {
pause_all_up_button = new javax.swing.JButton();
up_remtime_label = new javax.swing.JLabel();
upload_status_bar = new javax.swing.JProgressBar();
copy_all_uploads = new javax.swing.JButton();
unfreeze_transferences_button = new javax.swing.JButton();
main_menubar = new javax.swing.JMenuBar();
file_menu = new javax.swing.JMenu();
Expand Down Expand Up @@ -695,10 +696,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(pause_all_down_button))
.addGroup(downloads_panelLayout.createSequentialGroup()
.addComponent(status_down_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGap(18, 18, 18)
.addComponent(close_all_finished_down_button)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jButton1))
.addComponent(jButton1)
.addContainerGap())
.addComponent(jScrollPane_down)
.addComponent(down_remtime_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(download_status_bar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
Expand Down Expand Up @@ -762,6 +764,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

up_remtime_label.setFont(new java.awt.Font("Dialog", 1, 20)); // NOI18N

copy_all_uploads.setFont(new java.awt.Font("Dialog", 1, 16)); // NOI18N
copy_all_uploads.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/icons8-copy-to-clipboard-30.png"))); // NOI18N
copy_all_uploads.setText("COPY ALL UPLOAD LINKS");
copy_all_uploads.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
copy_all_uploadsActionPerformed(evt);
}
});

javax.swing.GroupLayout uploads_panelLayout = new javax.swing.GroupLayout(uploads_panel);
uploads_panel.setLayout(uploads_panelLayout);
uploads_panelLayout.setHorizontalGroup(
Expand All @@ -772,8 +783,11 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addComponent(pause_all_up_button))
.addGroup(uploads_panelLayout.createSequentialGroup()
.addComponent(status_up_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(3, 3, 3)
.addComponent(close_all_finished_up_button)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(close_all_finished_up_button))
.addComponent(copy_all_uploads)
.addContainerGap())
.addComponent(jScrollPane_up)
.addComponent(up_remtime_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(upload_status_bar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
Expand All @@ -783,7 +797,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, uploads_panelLayout.createSequentialGroup()
.addContainerGap()
.addGroup(uploads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(close_all_finished_up_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(uploads_panelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(close_all_finished_up_button, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(copy_all_uploads))
.addComponent(status_up_label, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(upload_status_bar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
Expand Down Expand Up @@ -1586,6 +1602,14 @@ private void force_chunk_reset_buttonActionPerformed(java.awt.event.ActionEvent

}//GEN-LAST:event_force_chunk_reset_buttonActionPerformed

private void copy_all_uploadsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copy_all_uploadsActionPerformed
// TODO add your handling code here:
int total = _main_panel.getUpload_manager().copyAllLinksToClipboard();

JOptionPane.showMessageDialog(this, LabelTranslatorSingleton.getInstance().translate(total > 0 ? "ALL UPLOAD LINKS COPIED!" : "NO UPLOAD LINKS TO COPY"));

}//GEN-LAST:event_copy_all_uploadsActionPerformed

// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JMenuItem about_menu;
private javax.swing.JCheckBoxMenuItem auto_close_menu;
Expand All @@ -1594,6 +1618,7 @@ private void force_chunk_reset_buttonActionPerformed(java.awt.event.ActionEvent
private javax.swing.JMenuItem clean_all_up_menu;
private javax.swing.JButton close_all_finished_down_button;
private javax.swing.JButton close_all_finished_up_button;
private javax.swing.JButton copy_all_uploads;
private javax.swing.JLabel down_remtime_label;
private javax.swing.JProgressBar download_status_bar;
private javax.swing.JPanel downloads_panel;
Expand Down
53 changes: 53 additions & 0 deletions src/main/java/com/tonikelope/megabasterd/UploadManager.java
Expand Up @@ -92,4 +92,57 @@ public void remove(Transference[] uploads) {
secureNotify();
}

public int copyAllLinksToClipboard() {

int total = 0;

ArrayList<String> links = new ArrayList<>();

String out = "";

for (Transference t : _transference_waitstart_aux_queue) {
Upload up = (Upload) t;
links.add(up.getFile_name() + " [" + up.getMa().getEmail() + "] " + (up.getFolder_link() != null ? up.getFolder_link() : ""));
}

for (Transference t : _transference_waitstart_queue) {

Upload up = (Upload) t;
links.add(up.getFile_name() + " [" + up.getMa().getEmail() + "] " + (up.getFolder_link() != null ? up.getFolder_link() : ""));
}

out += String.join("\r\n", links);

total += links.size();

links.clear();

for (Transference t : _transference_running_list) {

Upload up = (Upload) t;
links.add(up.getFile_name() + " [" + up.getMa().getEmail() + "] " + (up.getFolder_link() != null ? up.getFolder_link() : "") + (up.getFile_link() != null ? " " + up.getFile_link() : ""));
}

out += String.join("\r\n", links);

total += links.size();

links.clear();

for (Transference t : _transference_finished_queue) {

Upload up = (Upload) t;
links.add("(UPLOAD FINISHED) " + up.getFile_name() + " [" + up.getMa().getEmail() + "] " + (up.getFolder_link() != null ? up.getFolder_link() : "") + (up.getFile_link() != null ? " " + up.getFile_link() : ""));
}

out += String.join("\r\n", links);

total += links.size();

MiscTools.copyTextToClipboard(out);

return total;

}

}
4 changes: 2 additions & 2 deletions src/main/java/com/tonikelope/megabasterd/UploadView.java
Expand Up @@ -472,7 +472,7 @@ private void folder_link_buttonActionPerformed(java.awt.event.ActionEvent evt) {

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

copyTextToClipboard(_upload.getFolder_link());
copyTextToClipboard("[" + _upload.getMa().getEmail() + "] " + _upload.getFolder_link());

folder_link_button.setText(LabelTranslatorSingleton.getInstance().translate("Copy folder link"));

Expand All @@ -485,7 +485,7 @@ private void file_link_buttonActionPerformed(java.awt.event.ActionEvent evt) {//

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

copyTextToClipboard(_upload.getFile_link());
copyTextToClipboard("[" + _upload.getMa().getEmail() + "] " + _upload.getFile_link());

file_link_button.setText(LabelTranslatorSingleton.getInstance().translate("Copy file link"));

Expand Down
Binary file modified src/main/resources/images/mbasterd_screen.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 02d5582

Please sign in to comment.