2012-07-23 21:46:01 +00:00
|
|
|
ownerclass = 'DirectoryPanel'
|
|
|
|
ownerimport = 'DirectoryPanel.h'
|
|
|
|
|
|
|
|
result = Window(425, 300, "dupeGuru")
|
|
|
|
promptLabel = Label(result, "Select folders to scan and press \"Scan\".")
|
|
|
|
directoryOutline = OutlineView(result)
|
|
|
|
directoryOutline.OBJC_CLASS = 'HSOutlineView'
|
|
|
|
addButton = Button(result, "")
|
|
|
|
removeButton = Button(result, "")
|
|
|
|
loadResultsButton = Button(result, "Load Results")
|
|
|
|
scanButton = Button(result, "Scan")
|
|
|
|
addPopup = Popup(None)
|
|
|
|
loadRecentPopup = Popup(None)
|
|
|
|
|
|
|
|
owner.outlineView = directoryOutline
|
|
|
|
owner.removeButton = removeButton
|
|
|
|
owner.loadResultsButton = loadResultsButton
|
|
|
|
owner.addButtonPopUp = addPopup
|
|
|
|
owner.loadRecentButtonPopUp = loadRecentPopup
|
|
|
|
|
|
|
|
result.autosaveName = 'DirectoryPanel'
|
|
|
|
result.canMinimize = False
|
|
|
|
result.minSize = Size(370, 270)
|
2012-07-29 20:57:27 +00:00
|
|
|
addButton.bezelStyle = removeButton.bezelStyle = const.NSTexturedRoundedBezelStyle
|
2012-07-23 21:46:01 +00:00
|
|
|
addButton.image = 'NSAddTemplate'
|
|
|
|
removeButton.image = 'NSRemoveTemplate'
|
|
|
|
for button in (addButton, removeButton):
|
|
|
|
button.style = const.NSTexturedRoundedBezelStyle
|
|
|
|
button.imagePosition = const.NSImageOnly
|
|
|
|
scanButton.keyEquivalent = '\\r'
|
|
|
|
addButton.action = Action(owner, 'popupAddDirectoryMenu:')
|
|
|
|
removeButton.action = Action(owner, 'removeSelectedDirectory')
|
|
|
|
loadResultsButton.action = Action(owner, 'popupLoadRecentMenu:')
|
2012-07-27 22:30:34 +00:00
|
|
|
scanButton.action = Action(None, 'startScanning')
|
2012-07-23 21:46:01 +00:00
|
|
|
|
|
|
|
directoryOutline.font = Font(FontFamily.System, FontSize.SmallSystem)
|
|
|
|
col = directoryOutline.addColumn('name', "Name", 100)
|
|
|
|
col.editable = False
|
|
|
|
col.autoResizable = True
|
|
|
|
col = directoryOutline.addColumn('state', "State", 85)
|
|
|
|
col.editable = True
|
|
|
|
col.autoResizable = False
|
|
|
|
col.dataCell = Popup(None, ["Normal", "Reference", "Excluded"])
|
|
|
|
col.dataCell.controlSize = const.NSSmallControlSize
|
|
|
|
|
|
|
|
for button in (addButton, removeButton):
|
|
|
|
button.width = 28
|
|
|
|
for button in (loadResultsButton, scanButton):
|
|
|
|
button.width = 118
|
|
|
|
|
2012-07-24 15:31:18 +00:00
|
|
|
buttonLayout = HLayout([addButton, removeButton, None, loadResultsButton, scanButton])
|
2012-07-23 21:46:01 +00:00
|
|
|
promptLabel.packToCorner(Pack.UpperLeft)
|
|
|
|
promptLabel.fill(Pack.Right)
|
|
|
|
directoryOutline.packRelativeTo(promptLabel, Pack.Below)
|
|
|
|
buttonLayout.packRelativeTo(directoryOutline, Pack.Below, margin=8)
|
|
|
|
directoryOutline.fill(Pack.LowerRight)
|
2012-07-24 15:31:18 +00:00
|
|
|
buttonLayout.fill(Pack.Right)
|
2012-07-23 21:46:01 +00:00
|
|
|
|
|
|
|
promptLabel.setAnchor(Pack.UpperLeft, growX=True)
|
|
|
|
directoryOutline.setAnchor(Pack.UpperLeft, growX=True, growY=True)
|
|
|
|
buttonLayout.setAnchor(Pack.Below)
|