// // LibraryController.swift // DocHub // // Created by Tristan Juricek on 6/23/14. // Copyright (c) 2014 Perforce. All rights reserved. // import AppKit import Foundation class LibraryController : NSViewController, NSOutlineViewDelegate { @IBOutlet var outlineView:NSOutlineView func outlineView(outlineView: NSOutlineView!, viewForTableColumn tableColumn: NSTableColumn!, item: AnyObject!) -> NSView! { if item is Library ? true : false { let library:Library = item! as Library let cell = outlineView.makeViewWithIdentifier("HeaderCell", owner: self) as NSTableCellView! cell.textField.stringValue = library.name return cell } else if item is Area ? true : false { let area:Area = item! as Area let cell = outlineView.makeViewWithIdentifier("DataCell", owner: self) as NSTableCellView! cell.textField.stringValue = area.name return cell } return nil } func reload() { let ds = (outlineView.dataSource()!) as LibraryDataSource ds.updateLibraries() outlineView.reloadItem(nil, reloadChildren:true) } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 9555 | tjuricek | Changing how the main splitter is toggled | ||
#2 | 9546 | tjuricek | Apply correct header styling for the source list, and cache the areas with each library call. | ||
#1 | 9545 | tjuricek |
Use the left column to navigate p4 servers as "libraries" with their depots as "areas". I've had to stop using the output of login -p at the moment, since it doesn't quite work with the Objective-C API in lieu of a password. |