mirror of https://github.com/zlatinb/muwire
do not show Restart button if there is no AutoUpdater
parent
a83853b892
commit
901c626d0a
|
@ -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()) {
|
||||||
|
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue