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
|
Core core
|
||||||
|
|
||||||
@Observable boolean syncActionEnabled
|
@Observable boolean syncActionEnabled
|
||||||
|
@Observable boolean configureActionEnabled
|
||||||
|
|
||||||
void mvcGroupInit(Map<String,String> args) {
|
void mvcGroupInit(Map<String,String> args) {
|
||||||
watchedDirectories.addAll(core.watchedDirectoryManager.watchedDirs.values())
|
watchedDirectories.addAll(core.watchedDirectoryManager.watchedDirs.values())
|
||||||
|
|
|
@ -64,7 +64,7 @@ class AdvancedSharingView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
panel (constraints : BorderLayout.SOUTH) {
|
panel (constraints : BorderLayout.SOUTH) {
|
||||||
button(text : "Configure", configureAction)
|
button(text : "Configure", enabled : bind{model.configureActionEnabled}, configureAction)
|
||||||
button(text : "Sync", enabled : bind{model.syncActionEnabled}, syncAction)
|
button(text : "Sync", enabled : bind{model.syncActionEnabled}, syncAction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,6 +91,7 @@ class AdvancedSharingView {
|
||||||
selectionModel.addListSelectionListener({
|
selectionModel.addListSelectionListener({
|
||||||
def directory = selectedWatchedDirectory()
|
def directory = selectedWatchedDirectory()
|
||||||
model.syncActionEnabled = !(directory == null || directory.autoWatch)
|
model.syncActionEnabled = !(directory == null || directory.autoWatch)
|
||||||
|
model.configureActionEnabled = directory != null
|
||||||
})
|
})
|
||||||
|
|
||||||
watchedDirsTable.addMouseListener(new MouseAdapter() {
|
watchedDirsTable.addMouseListener(new MouseAdapter() {
|
||||||
|
|
Loading…
Reference in New Issue