mirror of https://github.com/zlatinb/muwire
disable Configure button if no directory is selected
parent
944cb29901
commit
f2531c80d5
|
@ -28,6 +28,7 @@ class AdvancedSharingModel {
|
|||
Core core
|
||||
|
||||
@Observable boolean syncActionEnabled
|
||||
@Observable boolean configureActionEnabled
|
||||
|
||||
void mvcGroupInit(Map<String,String> args) {
|
||||
watchedDirectories.addAll(core.watchedDirectoryManager.watchedDirs.values())
|
||||
|
|
|
@ -64,7 +64,7 @@ class AdvancedSharingView {
|
|||
}
|
||||
}
|
||||
panel (constraints : BorderLayout.SOUTH) {
|
||||
button(text : "Configure", configureAction)
|
||||
button(text : "Configure", enabled : bind{model.configureActionEnabled}, configureAction)
|
||||
button(text : "Sync", enabled : bind{model.syncActionEnabled}, syncAction)
|
||||
}
|
||||
}
|
||||
|
@ -91,6 +91,7 @@ class AdvancedSharingView {
|
|||
selectionModel.addListSelectionListener({
|
||||
def directory = selectedWatchedDirectory()
|
||||
model.syncActionEnabled = !(directory == null || directory.autoWatch)
|
||||
model.configureActionEnabled = directory != null
|
||||
})
|
||||
|
||||
watchedDirsTable.addMouseListener(new MouseAdapter() {
|
||||
|
|
Loading…
Reference in New Issue