diff --git a/pom.xml b/pom.xml index b5c859ed1..2a7786e4d 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.tonikelope MegaBasterd - 8.11 + 8.12 jar diff --git a/src/main/java/com/tonikelope/megabasterd/MainPanel.java b/src/main/java/com/tonikelope/megabasterd/MainPanel.java index 8f4ca35b6..ef8936b78 100644 --- a/src/main/java/com/tonikelope/megabasterd/MainPanel.java +++ b/src/main/java/com/tonikelope/megabasterd/MainPanel.java @@ -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; diff --git a/src/main/java/com/tonikelope/megabasterd/MainPanelView.form b/src/main/java/com/tonikelope/megabasterd/MainPanelView.form index 3fa164ea8..ab3c86254 100644 --- a/src/main/java/com/tonikelope/megabasterd/MainPanelView.form +++ b/src/main/java/com/tonikelope/megabasterd/MainPanelView.form @@ -382,10 +382,11 @@ - + + @@ -559,8 +560,11 @@ - + + + + @@ -572,7 +576,10 @@ - + + + + @@ -673,6 +680,20 @@ + + + + + + + + + + + + + + diff --git a/src/main/java/com/tonikelope/megabasterd/MainPanelView.java b/src/main/java/com/tonikelope/megabasterd/MainPanelView.java index ea6df5163..54c4369e7 100644 --- a/src/main/java/com/tonikelope/megabasterd/MainPanelView.java +++ b/src/main/java/com/tonikelope/megabasterd/MainPanelView.java @@ -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(); @@ -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) @@ -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( @@ -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) @@ -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) @@ -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; @@ -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; diff --git a/src/main/java/com/tonikelope/megabasterd/UploadManager.java b/src/main/java/com/tonikelope/megabasterd/UploadManager.java index 2ecb99002..8bac82384 100644 --- a/src/main/java/com/tonikelope/megabasterd/UploadManager.java +++ b/src/main/java/com/tonikelope/megabasterd/UploadManager.java @@ -92,4 +92,57 @@ public void remove(Transference[] uploads) { secureNotify(); } + public int copyAllLinksToClipboard() { + + int total = 0; + + ArrayList 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; + + } + } diff --git a/src/main/java/com/tonikelope/megabasterd/UploadView.java b/src/main/java/com/tonikelope/megabasterd/UploadView.java index 14ba38731..eef71e6be 100644 --- a/src/main/java/com/tonikelope/megabasterd/UploadView.java +++ b/src/main/java/com/tonikelope/megabasterd/UploadView.java @@ -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")); @@ -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")); diff --git a/src/main/resources/images/mbasterd_screen.png b/src/main/resources/images/mbasterd_screen.png index ff861ef05..373b5a7a7 100644 Binary files a/src/main/resources/images/mbasterd_screen.png and b/src/main/resources/images/mbasterd_screen.png differ