Show version in frame title when auto-update is not supported (e.g. MSI package)

This commit is contained in:
Reinhard Pointner 2017-02-11 01:05:41 +08:00
parent 699795e1d8
commit c0b0c1c8a6
3 changed files with 4 additions and 6 deletions

View File

@ -103,8 +103,8 @@ public final class Settings {
return isApplicationDeployment("mas"); return isApplicationDeployment("mas");
} }
public static boolean isInstalled() { public static boolean isAutoUpdateEnabled() {
return isApplicationDeployment("mas", "appx", "snap", "msi", "spk", "aur"); return isApplicationDeployment("mas", "appx", "snap", "spk", "aur");
} }
private static boolean isApplicationDeployment(String... ids) { private static boolean isApplicationDeployment(String... ids) {

View File

@ -52,7 +52,7 @@ public class MainFrame extends JFrame {
private HeaderPanel headerPanel; private HeaderPanel headerPanel;
public MainFrame(PanelBuilder[] panels) { public MainFrame(PanelBuilder[] panels) {
super(isInstalled() ? getApplicationName() : String.format("%s %s", getApplicationName(), getApplicationVersion())); super(isAutoUpdateEnabled() ? getApplicationName() : String.format("%s %s", getApplicationName(), getApplicationVersion()));
selectionList = new PanelSelectionList(panels); selectionList = new PanelSelectionList(panels);
headerPanel = new HeaderPanel(); headerPanel = new HeaderPanel();

View File

@ -1,7 +1,5 @@
package net.filebot.ui; package net.filebot.ui;
import static net.filebot.Settings.*;
import java.awt.Dimension; import java.awt.Dimension;
import javax.swing.JComponent; import javax.swing.JComponent;
@ -14,7 +12,7 @@ import net.miginfocom.swing.MigLayout;
public class SinglePanelFrame extends JFrame { public class SinglePanelFrame extends JFrame {
public SinglePanelFrame(PanelBuilder builder) { public SinglePanelFrame(PanelBuilder builder) {
super(String.format("%s %s", getApplicationName(), builder.getName())); super(builder.getName());
JComponent panel = builder.create(); JComponent panel = builder.create();
JComponent c = (JComponent) getContentPane(); JComponent c = (JComponent) getContentPane();