comparison src/com/five_ten_sg/connectbot/HostEditorActivity.java @ 130:2a0b10fd128d

host editor database values override summary text only if non-empty
author Carl Byington <carl@five-ten-sg.com>
date Thu, 19 Jun 2014 09:56:25 -0700
parents 50e1dead04a1
children adf9ca45675b
comparison
equal deleted inserted replaced
129:50e1dead04a1 130:2a0b10fd128d
53 public class CursorPreferenceHack implements SharedPreferences { 53 public class CursorPreferenceHack implements SharedPreferences {
54 protected final String table; 54 protected final String table;
55 protected final long id; 55 protected final long id;
56 56
57 protected Map<String, String> values = new HashMap<String, String>(); 57 protected Map<String, String> values = new HashMap<String, String>();
58 protected Map<String, CharSequence> summaries = new HashMap<String, CharSequence>();
59 58
60 public CursorPreferenceHack(String table, long id) { 59 public CursorPreferenceHack(String table, long id) {
61 this.table = table; 60 this.table = table;
62 this.id = id; 61 this.id = id;
63 cacheValues(); 62 cacheValues();
213 protected HostDatabase hostdb = null; 212 protected HostDatabase hostdb = null;
214 private PubkeyDatabase pubkeydb = null; 213 private PubkeyDatabase pubkeydb = null;
215 214
216 private CursorPreferenceHack pref; 215 private CursorPreferenceHack pref;
217 private ServiceConnection connection; 216 private ServiceConnection connection;
217 private Map<String, CharSequence> summaries = new HashMap<String, CharSequence>();
218 218
219 private HostBean host; 219 private HostBean host;
220 private boolean enableSSHFeatures; 220 private boolean enableSSHFeatures;
221 private boolean enable5250Features; 221 private boolean enable5250Features;
222 private boolean enableAsyncFeatures; 222 private boolean enableAsyncFeatures;
323 // get all the original text summaries 323 // get all the original text summaries
324 for (String key : this.pref.values.keySet()) { 324 for (String key : this.pref.values.keySet()) {
325 Preference pref = this.findPreference(key); 325 Preference pref = this.findPreference(key);
326 if (pref == null) continue; 326 if (pref == null) continue;
327 if (pref instanceof CheckBoxPreference) continue; 327 if (pref instanceof CheckBoxPreference) continue;
328 CharSequence value = this.pref.getSummary(key, ""); 328 CharSequence value = pref.getSummary();
329 summaries.put(key, value); 329 summaries.put(key, value);
330 } 330 }
331 } 331 }
332 332
333 private void updateSummaries() { 333 private void updateSummaries() {