add option to disable browsing of files, make the dialog bigger

pull/24/head
Zlatin Balevsky 2019-10-19 00:53:13 +01:00
parent 383addbc37
commit 2b04374e23
4 changed files with 14 additions and 4 deletions

View File

@ -87,6 +87,10 @@ class OptionsController {
model.shareHiddenFiles = shareHidden
settings.shareHiddenFiles = shareHidden
boolean browseFiles = view.browseFilesCheckbox.model.isSelected()
model.browseFiles = browseFiles
settings.browseFiles = browseFiles
String downloadLocation = model.downloadLocation
settings.downloadLocation = new File(downloadLocation)

View File

@ -16,6 +16,7 @@ class OptionsModel {
@Observable boolean shareHiddenFiles
@Observable String downloadLocation
@Observable boolean searchComments
@Observable boolean browseFiles
// i2p options
@Observable String inboundLength
@ -56,6 +57,7 @@ class OptionsModel {
shareHiddenFiles = settings.shareHiddenFiles
downloadLocation = settings.downloadLocation.getAbsolutePath()
searchComments = settings.searchComments
browseFiles = settings.browseFiles
Core core = application.context.get("core")
inboundLength = core.i2pOptions["inbound.length"]

View File

@ -102,7 +102,7 @@ class BrowseView {
controller.register()
dialog.getContentPane().add(p)
dialog.pack()
dialog.setSize(700, 400)
dialog.setLocationRelativeTo(mainFrame)
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE)
dialog.addWindowListener( new WindowAdapter() {

View File

@ -38,6 +38,7 @@ class OptionsView {
def shareDownloadedCheckbox
def shareHiddenCheckbox
def searchCommentsCheckbox
def browseFilesCheckbox
def inboundLengthField
def inboundQuantityField
@ -92,10 +93,13 @@ class OptionsView {
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 : "Allow browsing", constraints : gbc(gridx : 0, gridy : 6))
browseFilesCheckbox = checkBox(selected : bind {model.browseFiles}, constraints : gbc(gridx : 1, gridy : 6))
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))
label(text : "Save downloaded files to:", constraints: gbc(gridx:0, gridy:7))
button(text : "Choose", constraints : gbc(gridx : 1, gridy:7), downloadLocationAction)
label(text : bind {model.downloadLocation}, constraints: gbc(gridx:0, gridy:8, gridwidth:2))
}
i = builder.panel {