* 1/10000 chance for the donation reminder to popup

This commit is contained in:
Reinhard Pointner 2013-02-25 18:06:50 +00:00
parent 2ed4df6ed5
commit a56c8bbc66
1 changed files with 2 additions and 1 deletions

View File

@ -32,6 +32,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Properties;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
@ -225,7 +226,7 @@ public class Main {
int donateStep = 10000;
int usage = history.totalSize();
if (usage / donateStep > donateLv) {
if (usage / donateStep > donateLv || new Random().nextInt(donateStep) == 777) {
persistentDonateLv.setValue(String.valueOf(Math.max(donateLv + 1, usage / donateStep)));
String message = String.format(Locale.ROOT, "<html><p style='font-size:16pt; font-weight:bold'>Thank you for using FileBot!</p><br><p>It has taken many nights to develop this application. If you enjoy using it,<br>please consider a donation to the author of this software. It will help to<br>make FileBot even better!<p><p style='font-size:14pt; font-weight:bold'>You've renamed %,d files.</p><br><html>", history.totalSize());