mirror of https://github.com/zlatinb/muwire
config option for update check interval
parent
294605f5c7
commit
c91440cbfc
|
@ -20,7 +20,11 @@ class OptionsController {
|
|||
|
||||
def settings = application.context.get("muwire-settings")
|
||||
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")
|
||||
settingsFile.withOutputStream {
|
||||
settings.write(it)
|
||||
|
|
|
@ -7,8 +7,10 @@ import griffon.metadata.ArtifactProviderFor
|
|||
@ArtifactProviderFor(GriffonModel)
|
||||
class OptionsModel {
|
||||
@Observable String downloadRetryInterval
|
||||
@Observable String updateCheckInterval
|
||||
|
||||
void mvcGroupInit(Map<String, String> args) {
|
||||
downloadRetryInterval = application.context.get("muwire-settings").downloadRetryInterval
|
||||
updateCheckInterval = application.context.get("muwire-settings").updateCheckInterval
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ class OptionsView {
|
|||
def d
|
||||
def p
|
||||
def retryField
|
||||
def updateField
|
||||
def mainFrame
|
||||
|
||||
void initUI() {
|
||||
|
@ -34,8 +35,12 @@ class OptionsView {
|
|||
retryField = textField(text : bind { model.downloadRetryInterval }, columns : 2, constraints : gbc(gridx: 1, gridy: 0))
|
||||
label(text : "minutes", constraints : gbc(gridx : 2, gridy: 0))
|
||||
|
||||
button(text : "Save", constraints : gbc(gridx : 1, gridy: 1), saveAction)
|
||||
button(text : "Cancel", constraints : gbc(gridx : 2, gridy: 1), cancelAction)
|
||||
label(text : "Check for updates every", constraints : gbc(gridx : 0, gridy: 1))
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue