mirror of https://github.com/zlatinb/muwire
add button for downloading full collection
parent
c27a09473f
commit
65e96eacc2
|
@ -15,6 +15,11 @@ class CollectionTabController {
|
|||
@MVCMember @Nonnull
|
||||
CollectionTabView view
|
||||
|
||||
@ControllerAction
|
||||
void downloadCollection() {
|
||||
|
||||
}
|
||||
|
||||
@ControllerAction
|
||||
void download() {
|
||||
|
||||
|
|
|
@ -546,3 +546,4 @@ DELETE=Delete
|
|||
## Collection tab
|
||||
COLLECTION_SELECT=Select a collection to view it's description
|
||||
DESCRIPTION=Description
|
||||
COLLECTION_DOWNLOAD=Download Full Collection
|
||||
|
|
|
@ -45,6 +45,7 @@ class CollectionTabModel {
|
|||
@Observable int totalCollections
|
||||
@Observable boolean viewCommentButtonEnabled
|
||||
@Observable boolean downloadItemButtonEnabled
|
||||
@Observable boolean downloadCollectionButtonEnabled
|
||||
|
||||
void mvcGroupInit(Map<String,String> args) {
|
||||
root = new DefaultMutableTreeNode()
|
||||
|
|
|
@ -46,24 +46,24 @@ class CollectionTabView {
|
|||
panel {
|
||||
borderLayout()
|
||||
panel(constraints : BorderLayout.NORTH) {
|
||||
borderLayout()
|
||||
panel(constraints : BorderLayout.NORTH) {
|
||||
label(text : trans("STATUS") + ":")
|
||||
label(text : bind {trans(model.status.name())})
|
||||
}
|
||||
scrollPane(constraints : BorderLayout.CENTER, border : etchedBorder()) {
|
||||
collectionsTable = table(autoCreateRowSorter : true, rowHeight : rowHeight) {
|
||||
tableModel(list : model.collections) {
|
||||
closureColumn(header: trans("NAME"), preferredWidth: 200, type : String, read : {it.name})
|
||||
closureColumn(header: trans("AUTHOR"), preferredWidth: 200, type : String, read : {it.author.getHumanReadableName()})
|
||||
closureColumn(header: trans("COLLECTION_TOTAL_FILES"), preferredWidth: 20, type: Integer, read : {it.numFiles()})
|
||||
closureColumn(header: trans("COLLECTION_TOTAL_SIZE"), preferredWidth: 20, type: Long, read : {it.totalSize()})
|
||||
closureColumn(header: trans("COMMENT"), preferredWidth: 20, type: Boolean, read: {it.comment != ""})
|
||||
closureColumn(header: trans("CREATED"), preferredWidth: 50, type: Long, read: {it.timestamp})
|
||||
}
|
||||
label(text : trans("STATUS") + ":")
|
||||
label(text : bind {trans(model.status.name())})
|
||||
}
|
||||
scrollPane(constraints : BorderLayout.CENTER, border : etchedBorder()) {
|
||||
collectionsTable = table(autoCreateRowSorter : true, rowHeight : rowHeight) {
|
||||
tableModel(list : model.collections) {
|
||||
closureColumn(header: trans("NAME"), preferredWidth: 200, type : String, read : {it.name})
|
||||
closureColumn(header: trans("AUTHOR"), preferredWidth: 200, type : String, read : {it.author.getHumanReadableName()})
|
||||
closureColumn(header: trans("COLLECTION_TOTAL_FILES"), preferredWidth: 20, type: Integer, read : {it.numFiles()})
|
||||
closureColumn(header: trans("COLLECTION_TOTAL_SIZE"), preferredWidth: 20, type: Long, read : {it.totalSize()})
|
||||
closureColumn(header: trans("COMMENT"), preferredWidth: 20, type: Boolean, read: {it.comment != ""})
|
||||
closureColumn(header: trans("CREATED"), preferredWidth: 50, type: Long, read: {it.timestamp})
|
||||
}
|
||||
}
|
||||
}
|
||||
panel(constraints : BorderLayout.SOUTH) {
|
||||
button(text : trans("COLLECTION_DOWNLOAD"), enabled : bind{model.downloadCollectionButtonEnabled}, downloadCollectionAction)
|
||||
}
|
||||
}
|
||||
panel {
|
||||
borderLayout()
|
||||
|
@ -161,6 +161,7 @@ class CollectionTabView {
|
|||
int row = selectedCollection()
|
||||
if (row < 0)
|
||||
return
|
||||
model.downloadCollectionButtonEnabled = true
|
||||
FileCollection selected = model.collections.get(row)
|
||||
model.comment = selected.comment
|
||||
|
||||
|
|
Loading…
Reference in New Issue