mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-09 22:09:47 -04:00
Experiment with PGP signed messages
This commit is contained in:
parent
c0544c101a
commit
cdc1430072
@ -3,6 +3,7 @@ package net.filebot;
|
||||
import static java.awt.GraphicsEnvironment.*;
|
||||
import static java.util.stream.Collectors.*;
|
||||
import static net.filebot.Logging.*;
|
||||
import static net.filebot.MediaTypes.*;
|
||||
import static net.filebot.Settings.*;
|
||||
import static net.filebot.util.FileUtilities.*;
|
||||
import static net.filebot.util.XPathUtilities.*;
|
||||
@ -185,11 +186,7 @@ public class Main {
|
||||
args.getLicenseFile().ifPresent(f -> configureLicense(f));
|
||||
|
||||
// make sure license is validated and cached
|
||||
try {
|
||||
LICENSE.check();
|
||||
} catch (Throwable e) {
|
||||
debug.finest(e::toString);
|
||||
}
|
||||
SwingEventBus.getInstance().post(LICENSE);
|
||||
}
|
||||
|
||||
// JavaFX is used for ProgressMonitor and GettingStartedDialog
|
||||
@ -253,8 +250,9 @@ public class Main {
|
||||
if (isMacApp()) {
|
||||
// Mac specific configuration
|
||||
MacAppUtilities.initializeApplication(FileBotMenuBar.createHelp(), files -> {
|
||||
if (LICENSE.isFile() && files.size() == 1 && files.get(0).getName().endsWith(".psm")) {
|
||||
if (LICENSE.isFile() && files.size() == 1 && containsOnly(files, LICENSE_FILES)) {
|
||||
configureLicense(files.get(0));
|
||||
SwingEventBus.getInstance().post(LICENSE);
|
||||
} else {
|
||||
SwingEventBus.getInstance().post(new FileTransferable(files));
|
||||
}
|
||||
|
@ -71,4 +71,6 @@ public class MediaTypes {
|
||||
public static final ExtensionFileFilter LIST_FILES = getTypeFilter("application/list");
|
||||
public static final ExtensionFileFilter TORRENT_FILES = getTypeFilter("application/torrent");
|
||||
|
||||
public static final ExtensionFileFilter LICENSE_FILES = getTypeFilter("application/filebot-license");
|
||||
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
application/filebot-license: psm
|
||||
|
||||
application/torrent: torrent tor
|
||||
application/list: list txt
|
||||
application/nfo: nfo url
|
||||
|
@ -177,6 +177,10 @@ public final class Settings {
|
||||
return getApplicationProperty("link.app.help") + '#' + getApplicationDeployment();
|
||||
}
|
||||
|
||||
public static String getWindowTitle() {
|
||||
return isAutoUpdateEnabled() ? getApplicationName() : String.format("%s %s", getApplicationName(), getApplicationVersion());
|
||||
}
|
||||
|
||||
public static String getApplicationIdentifier() {
|
||||
return String.format("%s %s (r%d)", getApplicationName(), getApplicationVersion(), getApplicationRevisionNumber());
|
||||
}
|
||||
|
@ -37,6 +37,7 @@ import javax.swing.Timer;
|
||||
import com.google.common.eventbus.Subscribe;
|
||||
|
||||
import net.filebot.CacheManager;
|
||||
import net.filebot.LicenseModel;
|
||||
import net.filebot.Settings;
|
||||
import net.filebot.cli.GroovyPad;
|
||||
import net.filebot.util.PreferencesMap.PreferencesEntry;
|
||||
@ -53,7 +54,7 @@ public class MainFrame extends JFrame {
|
||||
private HeaderPanel headerPanel;
|
||||
|
||||
public MainFrame(PanelBuilder[] panels) {
|
||||
super(isAutoUpdateEnabled() ? getApplicationName() : String.format("%s %s", getApplicationName(), getApplicationVersion()));
|
||||
super(getWindowTitle());
|
||||
|
||||
selectionList = new PanelSelectionList(panels);
|
||||
headerPanel = new HeaderPanel();
|
||||
@ -132,6 +133,16 @@ public class MainFrame extends JFrame {
|
||||
SwingEventBus.getInstance().register(this);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void updateLicense(LicenseModel licence) {
|
||||
try {
|
||||
licence.check();
|
||||
setTitle(getWindowTitle());
|
||||
} catch (Throwable e) {
|
||||
setTitle(String.format("%s (%s)", getWindowTitle(), e.getMessage()));
|
||||
}
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
public void selectPanel(PanelBuilder panel) {
|
||||
selectionList.setSelectedValue(panel, false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user