add ability to disable updates completely, intended for 3rd party packaging
This commit is contained in:
@ -329,13 +329,13 @@ public class Core {
|
||||
log.info("initializing cache client")
|
||||
cacheClient = new CacheClient(eventBus,hostCache, connectionManager, i2pSession, props, 10000)
|
||||
|
||||
if (!props.plugin) {
|
||||
if (!(props.plugin || props.disableUpdates)) {
|
||||
log.info("initializing update client")
|
||||
updateClient = new UpdateClient(eventBus, i2pSession, myVersion, props, fileManager, me, spk)
|
||||
eventBus.register(FileDownloadedEvent.class, updateClient)
|
||||
eventBus.register(UIResultBatchEvent.class, updateClient)
|
||||
} else
|
||||
log.info("running as plugin, not initializing update client")
|
||||
log.info("running as plugin or updates disabled, not initializing update client")
|
||||
|
||||
log.info("initializing connector")
|
||||
I2PConnector i2pConnector = new I2PConnector(i2pSocketManager)
|
||||
|
@ -57,6 +57,7 @@ class MuWireSettings {
|
||||
int speedSmoothSeconds
|
||||
boolean embeddedRouter
|
||||
boolean plugin
|
||||
boolean disableUpdates
|
||||
int inBw, outBw
|
||||
Set<String> watchedKeywords
|
||||
Set<String> watchedRegexes
|
||||
@ -95,6 +96,7 @@ class MuWireSettings {
|
||||
meshExpiration = Integer.valueOf(props.getProperty("meshExpiration","60"))
|
||||
embeddedRouter = Boolean.valueOf(props.getProperty("embeddedRouter","false"))
|
||||
plugin = Boolean.valueOf(props.getProperty("plugin","false"))
|
||||
disableUpdates = Boolean.valueOf(props.getProperty("disableUpdates","false"))
|
||||
inBw = Integer.valueOf(props.getProperty("inBw","256"))
|
||||
outBw = Integer.valueOf(props.getProperty("outBw","128"))
|
||||
searchComments = Boolean.valueOf(props.getProperty("searchComments","true"))
|
||||
@ -170,6 +172,7 @@ class MuWireSettings {
|
||||
props.setProperty("meshExpiration", String.valueOf(meshExpiration))
|
||||
props.setProperty("embeddedRouter", String.valueOf(embeddedRouter))
|
||||
props.setProperty("plugin", String.valueOf(plugin))
|
||||
props.setProperty("disableUpdates", String.valueOf(disableUpdates))
|
||||
props.setProperty("inBw", String.valueOf(inBw))
|
||||
props.setProperty("outBw", String.valueOf(outBw))
|
||||
props.setProperty("searchComments", String.valueOf(searchComments))
|
||||
|
@ -50,6 +50,9 @@ class Ready extends AbstractLifecycleHandler {
|
||||
props = new MuWireSettings(props)
|
||||
if (props.incompleteLocation == null)
|
||||
props.incompleteLocation = new File(home, "incompletes")
|
||||
|
||||
if (System.getProperties().containsKey("disableUpdates"))
|
||||
props.disableUpdates = Boolean.valueOf(System.getProperty("disableUpdates"))
|
||||
} else {
|
||||
log.info("creating new properties")
|
||||
props = new MuWireSettings()
|
||||
@ -88,6 +91,7 @@ class Ready extends AbstractLifecycleHandler {
|
||||
|
||||
props.embeddedRouter = embeddedRouterAvailable
|
||||
props.updateType = System.getProperty("updateType","jar")
|
||||
props.disableUpdates = Boolean.parseBoolean(System.getProperty("disableUpdates", "false"))
|
||||
|
||||
|
||||
propsFile.withPrintWriter("UTF-8", {
|
||||
|
@ -76,6 +76,8 @@ class OptionsModel {
|
||||
@Observable int maxChatLines
|
||||
@Observable String chatWelcomeFile
|
||||
|
||||
boolean disableUpdates
|
||||
|
||||
void mvcGroupInit(Map<String, String> args) {
|
||||
MuWireSettings settings = application.context.get("muwire-settings")
|
||||
downloadRetryInterval = settings.downloadRetryInterval
|
||||
@ -139,5 +141,7 @@ class OptionsModel {
|
||||
advertiseChat = settings.advertiseChat
|
||||
maxChatLines = uiSettings.maxChatLines
|
||||
chatWelcomeFile = settings.chatWelcomeFile?.getAbsolutePath()
|
||||
|
||||
disableUpdates = settings.disableUpdates
|
||||
}
|
||||
}
|
@ -158,6 +158,7 @@ class OptionsView {
|
||||
shareHiddenCheckbox = checkBox(selected : bind {model.shareHiddenFiles}, constraints : gbc(gridx :1, gridy:1, weightx : 0))
|
||||
}
|
||||
|
||||
if (!model.disableUpdates) {
|
||||
panel (border : titledBorder(title : "Update Settings", border : etchedBorder(), titlePosition : TitledBorder.TOP,
|
||||
constraints : gbc(gridx : 0, gridy : 4, fill : GridBagConstraints.HORIZONTAL))) {
|
||||
gridBagLayout()
|
||||
@ -170,6 +171,7 @@ class OptionsView {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
i = builder.panel {
|
||||
gridBagLayout()
|
||||
label(text : "Changing any I2P settings requires a restart", constraints : gbc(gridx:0, gridy : 0))
|
||||
|
Reference in New Issue
Block a user