Added donation panel

This commit is contained in:
2018-10-02 00:38:35 +01:00
parent 5947c9a020
commit a7fdfce094
4 changed files with 62 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -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[]) { public static void main(String args[]) {

View File

@@ -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);
}
}

View File

@@ -30,4 +30,5 @@ public class Icons {
static public final ImageIcon mic = new ImageIcon(Icons.class.getResource("icons/mic.png")); 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 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 zoomOut = new ImageIcon(Icons.class.getResource("icons/zoom-out.png"));
static public final ImageIcon dollar = new ImageIcon(Icons.class.getResource("icons/dollar.png"));
} }