From 0499fb1ea1c7b5f48ad5f70e76cbaf1beea223e8 Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Fri, 24 Jun 2022 17:41:15 +0100 Subject: [PATCH] fix confidential status being always set and show it in the download details --- .../groovy/com/muwire/core/download/NetworkDownloader.groovy | 3 ++- gui/griffon-app/i18n/messages.properties | 1 + gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/groovy/com/muwire/core/download/NetworkDownloader.groovy b/core/src/main/groovy/com/muwire/core/download/NetworkDownloader.groovy index 46a8a067..6f086c74 100644 --- a/core/src/main/groovy/com/muwire/core/download/NetworkDownloader.groovy +++ b/core/src/main/groovy/com/muwire/core/download/NetworkDownloader.groovy @@ -250,7 +250,8 @@ class NetworkDownloader extends Downloader { activeWorkers.values().each { rv &= it.confidential } - confidential = rv + if (!activeWorkers.isEmpty()) + confidential = rv rv } diff --git a/gui/griffon-app/i18n/messages.properties b/gui/griffon-app/i18n/messages.properties index 480148b7..c3219dd2 100644 --- a/gui/griffon-app/i18n/messages.properties +++ b/gui/griffon-app/i18n/messages.properties @@ -132,6 +132,7 @@ SELECT_DOWNLOAD_VIEW_DETAILS=Select a download to view details DOWNLOAD_LOCATION=Download Location PIECE_SIZE=Piece Size SEQUENTIAL=Sequential +CONFIDENTIAL=Confidential KNOWN_SOURCES=Known Sources ACTIVE_SOURCES=Active Sources HOPELESS_SOURCES=Hopeless Sources diff --git a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy index d3c6af51..e540364f 100644 --- a/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy +++ b/gui/griffon-app/views/com/muwire/gui/MainFrameView.groovy @@ -336,6 +336,8 @@ class MainFrameView { label(text : bind {model.downloader?.getNPieces()}, constraints : gbc(gridx:6, gridy:0, insets : [0,0,0,20])) label(text : trans("DONE_PIECES") + ":", constraints: gbc(gridx:5, gridy: 1)) label(text : bind {model.downloader?.donePieces()}, constraints : gbc(gridx:6, gridy:1, insets : [0,0,0,20])) + label(text : trans("CONFIDENTIAL") + ":", constraints: gbc(gridx:5, gridy: 2)) + label(text : bind {model.downloader?.isConfidential()}, constraints: gbc(gridx: 6, gridy: 2, insets : [0,0,0,20])) } } }