2012-07-23 14:14:50 +00:00
|
|
|
ownerclass = 'DeletionOptions'
|
|
|
|
ownerimport = 'DeletionOptions.h'
|
|
|
|
|
2012-08-01 16:36:23 +00:00
|
|
|
result = Window(450, 240, "Deletion Options")
|
2012-07-23 14:14:50 +00:00
|
|
|
messageLabel = Label(result, "")
|
2012-08-01 16:36:23 +00:00
|
|
|
linkCheckbox = Checkbox(result, "Link deleted files")
|
|
|
|
linkLabel = Label(result, "After having deleted a duplicate, place a link targeting the "
|
2012-07-23 14:14:50 +00:00
|
|
|
"reference file to replace the deleted file.")
|
2012-08-01 16:36:23 +00:00
|
|
|
linkTypeChoice = RadioButtons(result, ["Symlink", "Hardlink"], columns=2)
|
2012-07-23 14:14:50 +00:00
|
|
|
directCheckbox = Checkbox(result, "Directly delete files")
|
|
|
|
directLabel = Label(result, "Instead of sending files to trash, delete them directly. This option "
|
|
|
|
"is usually used as a workaround when the normal deletion method doesn't work.")
|
|
|
|
proceedButton = Button(result, "Proceed")
|
|
|
|
cancelButton = Button(result, "Cancel")
|
|
|
|
|
2012-08-01 16:36:23 +00:00
|
|
|
owner.linkButton = linkCheckbox
|
|
|
|
owner.linkTypeRadio = linkTypeChoice
|
2012-07-23 14:14:50 +00:00
|
|
|
owner.directButton = directCheckbox
|
|
|
|
owner.messageTextField = messageLabel
|
|
|
|
|
|
|
|
result.canMinimize = False
|
|
|
|
result.canResize = False
|
2012-08-01 16:36:23 +00:00
|
|
|
linkLabel.controlSize = ControlSize.Small
|
|
|
|
directLabel.controlSize = ControlSize.Small
|
|
|
|
linkTypeChoice.controlSize = ControlSize.Small
|
2012-07-23 14:14:50 +00:00
|
|
|
proceedButton.keyEquivalent = '\\r'
|
|
|
|
cancelButton.keyEquivalent = '\\e'
|
2012-08-01 16:36:23 +00:00
|
|
|
linkCheckbox.action = directCheckbox.action = linkTypeChoice.action = Action(owner, 'updateOptions')
|
2012-07-23 14:14:50 +00:00
|
|
|
proceedButton.action = Action(owner, 'proceed')
|
|
|
|
cancelButton.action = Action(owner, 'cancel')
|
|
|
|
|
2012-08-01 16:36:23 +00:00
|
|
|
linkLabel.height *= 2 # 2 lines
|
2012-07-23 14:14:50 +00:00
|
|
|
directLabel.height *= 3 # 3 lines
|
|
|
|
proceedButton.width = 92
|
|
|
|
cancelButton.width = 92
|
|
|
|
|
2012-08-01 16:36:23 +00:00
|
|
|
mainLayout = VLayout([messageLabel, linkCheckbox, linkLabel, linkTypeChoice, directCheckbox,
|
|
|
|
directLabel])
|
|
|
|
mainLayout.packToCorner(Pack.UpperLeft)
|
|
|
|
mainLayout.fill(Pack.Right)
|
|
|
|
buttonLayout = HLayout([cancelButton, proceedButton])
|
|
|
|
buttonLayout.packToCorner(Pack.LowerRight)
|
2012-07-23 14:14:50 +00:00
|
|
|
|
|
|
|
# indent the labels under checkboxes a little bit to the right
|
2012-08-01 16:36:23 +00:00
|
|
|
for indentedView in (linkLabel, directLabel, linkTypeChoice):
|
|
|
|
indentedView.x += 20
|
|
|
|
indentedView.width -= 20
|
|
|
|
# We actually don't want the link choice radio buttons to take all the width, it looks weird.
|
|
|
|
linkTypeChoice.width = 170
|