disable sharing of hidden files by default, add option to enable

This commit is contained in:
Zlatin Balevsky
2019-10-17 05:46:27 +01:00
parent 02441ca1e3
commit 946d9c8f32
8 changed files with 26 additions and 7 deletions

View File

@@ -82,6 +82,10 @@ class OptionsController {
boolean shareDownloaded = view.shareDownloadedCheckbox.model.isSelected()
model.shareDownloadedFiles = shareDownloaded
settings.shareDownloadedFiles = shareDownloaded
boolean shareHidden = view.shareHiddenCheckbox.model.isSelected()
model.shareHiddenFiles = shareHidden
settings.shareHiddenFiles = shareHidden
String downloadLocation = model.downloadLocation
settings.downloadLocation = new File(downloadLocation)

View File

@@ -13,6 +13,7 @@ class OptionsModel {
@Observable String updateCheckInterval
@Observable boolean autoDownloadUpdate
@Observable boolean shareDownloadedFiles
@Observable boolean shareHiddenFiles
@Observable String downloadLocation
@Observable boolean searchComments
@@ -50,6 +51,7 @@ class OptionsModel {
updateCheckInterval = settings.updateCheckInterval
autoDownloadUpdate = settings.autoDownloadUpdate
shareDownloadedFiles = settings.shareDownloadedFiles
shareHiddenFiles = settings.shareHiddenFiles
downloadLocation = settings.downloadLocation.getAbsolutePath()
searchComments = settings.searchComments

View File

@@ -852,7 +852,7 @@ class MainFrameView {
def shareFiles = {
def chooser = new JFileChooser()
chooser.setFileHidingEnabled(false)
chooser.setFileHidingEnabled(!model.core.muOptions.shareHiddenFiles)
chooser.setDialogTitle("Select file to share")
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY)
chooser.setMultiSelectionEnabled(true)

View File

@@ -35,6 +35,7 @@ class OptionsView {
def updateField
def autoDownloadUpdateCheckbox
def shareDownloadedCheckbox
def shareHiddenCheckbox
def searchCommentsCheckbox
def inboundLengthField
@@ -86,10 +87,13 @@ class OptionsView {
label(text : "Share downloaded files", constraints : gbc(gridx : 0, gridy:4))
shareDownloadedCheckbox = checkBox(selected : bind {model.shareDownloadedFiles}, constraints : gbc(gridx :1, gridy:4))
label(text : "Share hidden files", constraints : gbc(gridx : 0, gridy:5))
shareHiddenCheckbox = checkBox(selected : bind {model.shareHiddenFiles}, constraints : gbc(gridx :1, gridy:5))
label(text : "Save downloaded files to:", constraints: gbc(gridx:0, gridy:5))
button(text : "Choose", constraints : gbc(gridx : 1, gridy:5), downloadLocationAction)
label(text : bind {model.downloadLocation}, constraints: gbc(gridx:0, gridy:6, gridwidth:2))
label(text : "Save downloaded files to:", constraints: gbc(gridx:0, gridy:6))
button(text : "Choose", constraints : gbc(gridx : 1, gridy:6), downloadLocationAction)
label(text : bind {model.downloadLocation}, constraints: gbc(gridx:0, gridy:7, gridwidth:2))
}
i = builder.panel {