config option for update check interval
This commit is contained in:
@@ -21,6 +21,10 @@ class OptionsController {
|
|||||||
def settings = application.context.get("muwire-settings")
|
def settings = application.context.get("muwire-settings")
|
||||||
settings.downloadRetryInterval = Integer.valueOf(text)
|
settings.downloadRetryInterval = Integer.valueOf(text)
|
||||||
|
|
||||||
|
text = view.updateField.text
|
||||||
|
model.updateCheckInterval = text
|
||||||
|
settings.updateCheckInterval = Integer.valueOf(text)
|
||||||
|
|
||||||
File settingsFile = new File(application.context.get("core").home, "MuWire.properties")
|
File settingsFile = new File(application.context.get("core").home, "MuWire.properties")
|
||||||
settingsFile.withOutputStream {
|
settingsFile.withOutputStream {
|
||||||
settings.write(it)
|
settings.write(it)
|
||||||
|
@@ -7,8 +7,10 @@ import griffon.metadata.ArtifactProviderFor
|
|||||||
@ArtifactProviderFor(GriffonModel)
|
@ArtifactProviderFor(GriffonModel)
|
||||||
class OptionsModel {
|
class OptionsModel {
|
||||||
@Observable String downloadRetryInterval
|
@Observable String downloadRetryInterval
|
||||||
|
@Observable String updateCheckInterval
|
||||||
|
|
||||||
void mvcGroupInit(Map<String, String> args) {
|
void mvcGroupInit(Map<String, String> args) {
|
||||||
downloadRetryInterval = application.context.get("muwire-settings").downloadRetryInterval
|
downloadRetryInterval = application.context.get("muwire-settings").downloadRetryInterval
|
||||||
|
updateCheckInterval = application.context.get("muwire-settings").updateCheckInterval
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -22,6 +22,7 @@ class OptionsView {
|
|||||||
def d
|
def d
|
||||||
def p
|
def p
|
||||||
def retryField
|
def retryField
|
||||||
|
def updateField
|
||||||
def mainFrame
|
def mainFrame
|
||||||
|
|
||||||
void initUI() {
|
void initUI() {
|
||||||
@@ -34,8 +35,12 @@ class OptionsView {
|
|||||||
retryField = textField(text : bind { model.downloadRetryInterval }, columns : 2, constraints : gbc(gridx: 1, gridy: 0))
|
retryField = textField(text : bind { model.downloadRetryInterval }, columns : 2, constraints : gbc(gridx: 1, gridy: 0))
|
||||||
label(text : "minutes", constraints : gbc(gridx : 2, gridy: 0))
|
label(text : "minutes", constraints : gbc(gridx : 2, gridy: 0))
|
||||||
|
|
||||||
button(text : "Save", constraints : gbc(gridx : 1, gridy: 1), saveAction)
|
label(text : "Check for updates every", constraints : gbc(gridx : 0, gridy: 1))
|
||||||
button(text : "Cancel", constraints : gbc(gridx : 2, gridy: 1), cancelAction)
|
updateField = textField(text : bind {model.updateCheckInterval }, columns : 2, constraints : gbc(gridx : 1, gridy: 1))
|
||||||
|
label(text : "hours", constraints : gbc(gridx: 2, gridy : 1))
|
||||||
|
|
||||||
|
button(text : "Save", constraints : gbc(gridx : 1, gridy: 2), saveAction)
|
||||||
|
button(text : "Cancel", constraints : gbc(gridx : 2, gridy: 2), cancelAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user