comparison src/com/five_ten_sg/connectbot/HostEditorActivity.java @ 112:77ac18bc1b2f

cleanup java formatting
author Carl Byington <carl@five-ten-sg.com>
date Wed, 18 Jun 2014 13:03:01 -0700
parents bb27518ac2e9
children 5eda34fb607f
comparison
equal deleted inserted replaced
111:6a0ad4d384ea 112:77ac18bc1b2f
259 } 259 }
260 }; 260 };
261 this.pref = new CursorPreferenceHack(HostDatabase.TABLE_HOSTS, hostId); 261 this.pref = new CursorPreferenceHack(HostDatabase.TABLE_HOSTS, hostId);
262 this.pref.registerOnSharedPreferenceChangeListener(this); 262 this.pref.registerOnSharedPreferenceChangeListener(this);
263 this.addPreferencesFromResource(R.xml.host_prefs); 263 this.addPreferencesFromResource(R.xml.host_prefs);
264
265 // disable all preferences that are not applicable to this host 264 // disable all preferences that are not applicable to this host
266 findPreference(HostDatabase.FIELD_HOST_PUBKEYID).setEnabled(enableSSHFeatures); 265 findPreference(HostDatabase.FIELD_HOST_PUBKEYID).setEnabled(enableSSHFeatures);
267 findPreference(HostDatabase.FIELD_HOST_USEAUTHAGENT).setEnabled(enableSSHFeatures); 266 findPreference(HostDatabase.FIELD_HOST_USEAUTHAGENT).setEnabled(enableSSHFeatures);
268 findPreference(HostDatabase.FIELD_HOST_POSTLOGIN).setEnabled(!enable5250Features); 267 findPreference(HostDatabase.FIELD_HOST_POSTLOGIN).setEnabled(!enable5250Features);
269 findPreference(HostDatabase.FIELD_HOST_COMPRESSION).setEnabled(enableSSHFeatures); 268 findPreference(HostDatabase.FIELD_HOST_COMPRESSION).setEnabled(enableSSHFeatures);
273 findPreference(HostDatabase.FIELD_HOST_EMULATION).setEnabled(!enable5250Features); 272 findPreference(HostDatabase.FIELD_HOST_EMULATION).setEnabled(!enable5250Features);
274 findPreference(HostDatabase.FIELD_HOST_ENCRYPTION5250).setEnabled(enable5250Features); 273 findPreference(HostDatabase.FIELD_HOST_ENCRYPTION5250).setEnabled(enable5250Features);
275 findPreference(HostDatabase.FIELD_HOST_WANTX11FORWARD).setEnabled(enableSSHFeatures); 274 findPreference(HostDatabase.FIELD_HOST_WANTX11FORWARD).setEnabled(enableSSHFeatures);
276 findPreference(HostDatabase.FIELD_HOST_X11HOST).setEnabled(enableSSHFeatures); 275 findPreference(HostDatabase.FIELD_HOST_X11HOST).setEnabled(enableSSHFeatures);
277 findPreference(HostDatabase.FIELD_HOST_X11PORT).setEnabled(enableSSHFeatures); 276 findPreference(HostDatabase.FIELD_HOST_X11PORT).setEnabled(enableSSHFeatures);
278
279 // add all existing pubkeys to our listpreference for user to choose from 277 // add all existing pubkeys to our listpreference for user to choose from
280 // TODO: may be an issue here when this activity is recycled after adding a new pubkey 278 // TODO: may be an issue here when this activity is recycled after adding a new pubkey
281 // TODO: should consider moving into onStart, but we dont have a good way of resetting the listpref after filling once 279 // TODO: should consider moving into onStart, but we dont have a good way of resetting the listpref after filling once
282 ListPreference pubkeyPref = (ListPreference)findPreference(HostDatabase.FIELD_HOST_PUBKEYID); 280 ListPreference pubkeyPref = (ListPreference)findPreference(HostDatabase.FIELD_HOST_PUBKEYID);
283 List<CharSequence> pubkeyNicks = new LinkedList<CharSequence> (Arrays.asList(pubkeyPref.getEntries())); 281 List<CharSequence> pubkeyNicks = new LinkedList<CharSequence> (Arrays.asList(pubkeyPref.getEntries()));
337 335
338 private void updateSummaries() { 336 private void updateSummaries() {
339 // for all text preferences, set hint as current database value 337 // for all text preferences, set hint as current database value
340 for (String key : this.pref.values.keySet()) { 338 for (String key : this.pref.values.keySet()) {
341 if (key.equals(HostDatabase.FIELD_HOST_POSTLOGIN)) continue; 339 if (key.equals(HostDatabase.FIELD_HOST_POSTLOGIN)) continue;
340
342 if (key.equals(HostDatabase.FIELD_HOST_EMULATION)) continue; 341 if (key.equals(HostDatabase.FIELD_HOST_EMULATION)) continue;
342
343 if (key.equals(HostDatabase.FIELD_HOST_MONITOR)) continue; 343 if (key.equals(HostDatabase.FIELD_HOST_MONITOR)) continue;
344 344
345 Preference pref = this.findPreference(key); 345 Preference pref = this.findPreference(key);
346 346
347 if (pref == null) continue; 347 if (pref == null) continue;