diff --git a/resources/uk/co/majenko/audiobookrecorder/icons/dollar.png b/resources/uk/co/majenko/audiobookrecorder/icons/dollar.png new file mode 100644 index 0000000..5594a50 Binary files /dev/null and b/resources/uk/co/majenko/audiobookrecorder/icons/dollar.png differ diff --git a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java index 761c528..fa395a6 100644 --- a/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java +++ b/src/uk/co/majenko/audiobookrecorder/AudiobookRecorder.java @@ -524,6 +524,11 @@ public class AudiobookRecorder extends JFrame { } } } + + if (!Options.getBoolean("interface.donations.hide")) { + JOptionPane.showMessageDialog(this, new DonationPanel(), "Thank you", JOptionPane.PLAIN_MESSAGE); + } + } public static void main(String args[]) { diff --git a/src/uk/co/majenko/audiobookrecorder/DonationPanel.java b/src/uk/co/majenko/audiobookrecorder/DonationPanel.java new file mode 100644 index 0000000..6a47dee --- /dev/null +++ b/src/uk/co/majenko/audiobookrecorder/DonationPanel.java @@ -0,0 +1,56 @@ +package uk.co.majenko.audiobookrecorder; + +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; +import javax.swing.border.*; +import java.net.*; + +public class DonationPanel extends JPanel { + public DonationPanel() { + super(); + setLayout(new BorderLayout()); + JLabel icon = new JLabel(Icons.dollar); + icon.setBorder(new EmptyBorder(10, 10, 10, 10)); + add(icon, BorderLayout.WEST); + + JTextArea label = new JTextArea( + "Thank you for using AudiobookRecorder by\n" + + "Majenko Technologies. This software is\n" + + "Free Open Source Software (FOSS). It is\n" + + "created and maintained voluntarily with\n" + + "no possibility of any profits from it.\n" + + "If you enjoy using this software and end\n" + + "up making millions of dollars from using\n" + + "it we hope that you would maybe kindly\n" + + "donate a couple of those dollars to the\n" + + "developer to help with the costs of maintaining\n" + + "the software.\n" + + "\n" + + "You can donate by going to:\n" + + "\n" + + "https://paypal.me/majenko" + ); + + label.setEditable(false); + label.setFocusable(false); + label.setBorder(new EmptyBorder(10, 10, 10, 10)); + add(label, BorderLayout.CENTER); + + JButton donate = new JButton("Donate!"); + donate.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (Desktop.isDesktopSupported()) { + try { + Desktop.getDesktop().browse(new URI("https://paypal.me/majenko")); + } catch (Exception ex) { + } + } + } + }); + + add(donate, BorderLayout.SOUTH); + + + } +} diff --git a/src/uk/co/majenko/audiobookrecorder/Icons.java b/src/uk/co/majenko/audiobookrecorder/Icons.java index d2a3330..7967ed5 100644 --- a/src/uk/co/majenko/audiobookrecorder/Icons.java +++ b/src/uk/co/majenko/audiobookrecorder/Icons.java @@ -30,4 +30,5 @@ public class Icons { static public final ImageIcon mic = new ImageIcon(Icons.class.getResource("icons/mic.png")); static public final ImageIcon zoomIn = new ImageIcon(Icons.class.getResource("icons/zoom-in.png")); static public final ImageIcon zoomOut = new ImageIcon(Icons.class.getResource("icons/zoom-out.png")); + static public final ImageIcon dollar = new ImageIcon(Icons.class.getResource("icons/dollar.png")); }