do not show Restart button if there is no AutoUpdater

dbus-notify
Zlatin Balevsky 2022-02-22 16:33:10 +00:00
parent a83853b892
commit 901c626d0a
No known key found for this signature in database
GPG Key ID: A72832072D525E41
2 changed files with 5 additions and 3 deletions

View File

@ -168,6 +168,7 @@ public class Core {
final WatchedDirectoryManager watchedDirectoryManager final WatchedDirectoryManager watchedDirectoryManager
final NegativeFiles negativeFiles final NegativeFiles negativeFiles
private final TrackerResponder trackerResponder private final TrackerResponder trackerResponder
final AutoUpdater autoUpdater
private final Router router private final Router router
@ -536,9 +537,10 @@ public class Core {
String className = System.getProperty("auto.updater.class") String className = System.getProperty("auto.updater.class")
log.info("initializing auto-updater $className") log.info("initializing auto-updater $className")
Class<?> clazz = Class.forName(className) Class<?> clazz = Class.forName(className)
AutoUpdater autoUpdater = (AutoUpdater) clazz.newInstance() autoUpdater = (AutoUpdater) clazz.newInstance()
autoUpdater.init(this) autoUpdater.init(this)
} } else
autoUpdater = null
File modulesProps = new File(home, "mwmodules.list") File modulesProps = new File(home, "mwmodules.list")
if (modulesProps.exists()) { if (modulesProps.exists()) {

View File

@ -42,7 +42,7 @@ class UpdateView {
panel (constraints : BorderLayout.SOUTH) { panel (constraints : BorderLayout.SOUTH) {
if (model.available != null) if (model.available != null)
button(text : trans("FIND"), toolTipText: trans("TOOLTIP_FIND"), searchAction) button(text : trans("FIND"), toolTipText: trans("TOOLTIP_FIND"), searchAction)
else if (model.downloaded != null) else if (model.downloaded != null && model.core.autoUpdater != null)
button(text : trans("RESTART"), toolTipText: trans("TOOLTIP_RESTART"), restartAction) button(text : trans("RESTART"), toolTipText: trans("TOOLTIP_RESTART"), restartAction)
button(text : trans("CLOSE"), closeAction) button(text : trans("CLOSE"), closeAction)
} }