chetan51/sidestep — pull request #53 by coneybeare (2012-11-05 12:17:20+00:00)
Title: Add Advanced Preferences Tab With Goodies

As discussed in #52, I have added an "Advanced" tab to the preference panel. Currently, the advanced tab has two features:

1. Additional SSH Arguments
2. SSH Command Preview

**Additional SSH Arguments**
The Additional SSH Arguments field is simply a string that gets split by whitespace and appended to the `NSTask`s arguments. The field is hooks up the `AppController` as a delegate, so realtime edits are instantly reflected in the SSH Command Preview field, discussed further below. The string has checks for length, and the resulting component array has a check for count to protect it. Obviously, anything entered here has the ability to run on the system, so perhaps in the future, certain protective measures could be added such as removing anything after a semi-colon. I am not sure why anybody would want to hack their own system, but it would be a good idea to protect it anyway.

**SSH Command Preview**
I pulled out the `NSTask` creation from the SSHConnector into a helper method. The SSH Command Preview box uses this method to generate an NSTask identical to what would be called on "Connect", then outputs it's launch path and args to create this string. All Textfield in preferences and also the compression checkbox are hooked up to regenerate this preview string when done editing, and the Additional SSH Arguments field live updates it because it lives on the same view. It is selectable for power users who may want to copy/paste the command themselves into terminal.