comparison src/com/five_ten_sg/connectbot/HostEditorActivity.java @ 88:1c22e6a7efff

convert ctrl keys to virtual keys; use proper android home directory
author Carl Byington <carl@five-ten-sg.com>
date Mon, 16 Jun 2014 12:26:51 -0700
parents 4ccfde0bc506
children bb27518ac2e9
comparison
equal deleted inserted replaced
87:1bc2229562f8 88:1c22e6a7efff
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 264
265 // disable all preferences that are not applicable to this host 265 // disable all preferences that are not applicable to this host
266 findPreference(HostDatabase.FIELD_HOST_USEKEYS).setEnabled(enableSSHFeatures); 266 findPreference(HostDatabase.FIELD_HOST_PUBKEYID).setEnabled(enableSSHFeatures);
267 findPreference(HostDatabase.FIELD_HOST_USEAUTHAGENT).setEnabled(enableSSHFeatures); 267 findPreference(HostDatabase.FIELD_HOST_USEAUTHAGENT).setEnabled(enableSSHFeatures);
268 findPreference(HostDatabase.FIELD_HOST_COMPRESSION).setEnabled(enableSSHFeatures); 268 findPreference(HostDatabase.FIELD_HOST_COMPRESSION).setEnabled(enableSSHFeatures);
269 findPreference(HostDatabase.FIELD_HOST_HTTPPROXY).setEnabled(enableAsyncFeatures); 269 findPreference(HostDatabase.FIELD_HOST_HTTPPROXY).setEnabled(enableAsyncFeatures);
270 findPreference(HostDatabase.FIELD_HOST_WANTSESSION).setEnabled(enableSSHFeatures); 270 findPreference(HostDatabase.FIELD_HOST_WANTSESSION).setEnabled(enableSSHFeatures);
271 findPreference(HostDatabase.FIELD_HOST_USERNAME).setEnabled(enableSSHFeatures); 271 findPreference(HostDatabase.FIELD_HOST_USERNAME).setEnabled(enableSSHFeatures);
276 findPreference(HostDatabase.FIELD_HOST_X11PORT).setEnabled(enableSSHFeatures); 276 findPreference(HostDatabase.FIELD_HOST_X11PORT).setEnabled(enableSSHFeatures);
277 277
278 // add all existing pubkeys to our listpreference for user to choose from 278 // add all existing pubkeys to our listpreference for user to choose from
279 // TODO: may be an issue here when this activity is recycled after adding a new pubkey 279 // TODO: may be an issue here when this activity is recycled after adding a new pubkey
280 // TODO: should consider moving into onStart, but we dont have a good way of resetting the listpref after filling once 280 // TODO: should consider moving into onStart, but we dont have a good way of resetting the listpref after filling once
281 ListPreference pubkeyPref = (ListPreference)this.findPreference(HostDatabase.FIELD_HOST_PUBKEYID); 281 ListPreference pubkeyPref = (ListPreference)findPreference(HostDatabase.FIELD_HOST_PUBKEYID);
282 List<CharSequence> pubkeyNicks = new LinkedList<CharSequence> (Arrays.asList(pubkeyPref.getEntries())); 282 List<CharSequence> pubkeyNicks = new LinkedList<CharSequence> (Arrays.asList(pubkeyPref.getEntries()));
283 pubkeyNicks.addAll(pubkeydb.allValues(PubkeyDatabase.FIELD_PUBKEY_NICKNAME)); 283 pubkeyNicks.addAll(pubkeydb.allValues(PubkeyDatabase.FIELD_PUBKEY_NICKNAME));
284 pubkeyPref.setEntries(pubkeyNicks.toArray(new CharSequence[pubkeyNicks.size()])); 284 pubkeyPref.setEntries(pubkeyNicks.toArray(new CharSequence[pubkeyNicks.size()]));
285 List<CharSequence> pubkeyIds = new LinkedList<CharSequence> (Arrays.asList(pubkeyPref.getEntryValues())); 285 List<CharSequence> pubkeyIds = new LinkedList<CharSequence> (Arrays.asList(pubkeyPref.getEntryValues()));
286 pubkeyIds.addAll(pubkeydb.allValues("_id")); 286 pubkeyIds.addAll(pubkeydb.allValues("_id"));
287 pubkeyPref.setEntryValues(pubkeyIds.toArray(new CharSequence[pubkeyIds.size()])); 287 pubkeyPref.setEntryValues(pubkeyIds.toArray(new CharSequence[pubkeyIds.size()]));
288 // Populate the character set encoding list with all available 288 // Populate the character set encoding list with all available
289 final ListPreference charsetPref = (ListPreference) findPreference(HostDatabase.FIELD_HOST_ENCODING); 289 final ListPreference charsetPref = (ListPreference)findPreference(HostDatabase.FIELD_HOST_ENCODING);
290 290
291 if (CharsetHolder.isInitialized()) { 291 if (CharsetHolder.isInitialized()) {
292 initCharsetPref(charsetPref); 292 initCharsetPref(charsetPref);
293 } 293 }
294 else { 294 else {