1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Experiment with PGP signed messages

This commit is contained in:
Reinhard Pointner 2018-06-10 14:47:00 +07:00
parent d835ce6fdc
commit 68bfed8aa3
4 changed files with 21 additions and 23 deletions

View File

@ -3,21 +3,20 @@ application.name: FileBot
application.version: 4.8.2
# Script Base URL
github.stable: https://app.filebot.net/scripts/m1.jar.xz
github.master: https://raw.githubusercontent.com/filebot/scripts/master/
# Update Descriptor
update.url: https://app.filebot.net/update.xml
donate.url: https://www.filebot.net/donate.php
# Store
link.mas: macappstore://itunes.apple.com/app/id905384638
link.mws: ms-windows-store://review/?ProductId=9NBLGGH52T9X
# Tutorials
# Links
link.app.help: https://www.filebot.net/getting-started/embed.html
link.app.purchase: https://www.filebot.net/purchase.html
# Help
link.intro: https://www.filebot.net/getting-started/index.html

View File

@ -25,6 +25,8 @@ import net.filebot.util.PreferencesMap.StringAdapter;
public final class Settings {
public static final LicenseModel LICENSE = LicenseModel.get();
public static String getApplicationName() {
return getApplicationProperty("application.name");
}
@ -157,8 +159,8 @@ public final class Settings {
return null;
}
public static String getDonateURL() {
return getApplicationProperty("donate.url") + "?src=" + getApplicationDeployment();
public static String getPurchaseURL() {
return getApplicationProperty("link.app.purchase") + "?src=" + getApplicationDeployment();
}
public static String getEmbeddedHelpURL() {

View File

@ -3,7 +3,6 @@ application.version: @{application.version}
application.revision: @{revision}
update.url: @{update.url}
donate.url: @{donate.url}
github.stable: @{github.stable}
github.master: @{github.master}
@ -12,6 +11,7 @@ link.mas: @{link.mas}
link.mws: @{link.mws}
link.app.help: @{link.app.help}
link.app.purchase: @{link.app.purchase}
link.intro: @{link.intro}
link.forums: @{link.forums}
@ -29,4 +29,4 @@ apikey.themoviedb: @{apikey.themoviedb}
apikey.omdb: @{apikey.omdb}
apikey.acoustid: @{apikey.acoustid}
apikey.anidb: @{apikey.anidb}
apikey.opensubtitles: @{apikey.opensubtitles}
apikey.opensubtitles: @{apikey.opensubtitles}

View File

@ -8,7 +8,6 @@ import static net.filebot.util.StringUtilities.*;
import static net.filebot.util.ui.SwingUI.*;
import java.util.List;
import java.util.function.Predicate;
import java.util.logging.Level;
import java.util.stream.Stream;
@ -22,44 +21,42 @@ import net.filebot.util.PreferencesMap.PreferencesEntry;
public enum SupportDialog {
Donation {
Purchase {
@Override
String getMessage(int renameCount) {
return String.format("<html><p style='font-size:16pt; font-weight:bold'>Thank you for using FileBot!</p><br><p>It has taken thousands of hours to develop this application. If you enjoy using it,<br>please consider making a donation. It'll help make FileBot even better!<p><p style='font-size:14pt; font-weight:bold'>You've renamed %,d files.</p><br><html>", renameCount);
return String.format("<html><p style='font-size:16pt; font-weight:bold'>Thank you for using FileBot!</p><br><p>It has taken thousands of hours to develop this application. If it works well for you,<br>please purchase a license. It'll help make FileBot even better!<p><p style='font-size:14pt; font-weight:bold'>You've renamed %,d files.</p><br><html>", renameCount);
}
@Override
String[] getActions(boolean first) {
if (first)
return new String[] { "Donate! :)", "Nope! Maybe next time." };
else
return new String[] { "Donate again! :)", "Nope! Not this time." };
return new String[] { "Purchase! :)", "Nope! Maybe another time." };
}
@Override
Icon getIcon() {
return ResourceManager.getIcon("message.donate");
return ResourceManager.getIcon("window.icon.large");
}
@Override
String getTitle() {
return "Please Donate";
return "Purchase FileBot";
}
@Override
public boolean feelingLucky(int sessionRenameCount, int totalRenameCount, int currentRevision, int lastSupportRevision, int supportRevisionCount) {
// annoy users that chose not to purchase FileBot on the Store
if (sessionRenameCount > 0 && Stream.of("Mac OS X", "Windows 10").anyMatch(Predicate.isEqual(System.getProperty("os.name")))) {
return true;
try {
LICENSE.check();
return false;
} catch (Throwable e) {
log.log(Level.WARNING, e::toString);
return false;
}
return super.feelingLucky(sessionRenameCount, totalRenameCount, currentRevision, lastSupportRevision, supportRevisionCount);
}
@Override
String getURI() {
return getDonateURL();
return getPurchaseURL();
}
},
@ -167,7 +164,7 @@ public enum SupportDialog {
int totalRenameCount = HistorySpooler.getInstance().getPersistentHistoryTotalSize();
// show donation / review reminders to power users
SupportDialog dialog = isAppStore() ? AppStoreReview : Donation;
SupportDialog dialog = isAppStore() ? AppStoreReview : Purchase;
if (dialog.feelingLucky(sessionRenameCount, totalRenameCount, currentRevision, lastSupportRevision, supportRevision.size())) {
if (dialog.show(totalRenameCount, supportRevision.isEmpty())) {