comparison src/com/five_ten_sg/connectbot/HostListActivity.java @ 198:a9fb5061cca3

read deployment.connections on startup for global preferences also
author Carl Byington <carl@five-ten-sg.com>
date Wed, 02 Jul 2014 18:46:17 -0700
parents e762997c3911
children 33928f24b40d
comparison
equal deleted inserted replaced
197:e762997c3911 198:a9fb5061cca3
143 @Override 143 @Override
144 protected void onActivityResult(int requestCode, int resultCode, Intent data) { 144 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
145 if (requestCode == REQUEST_EULA) { 145 if (requestCode == REQUEST_EULA) {
146 if (resultCode == Activity.RESULT_OK) { 146 if (resultCode == Activity.RESULT_OK) {
147 // yay they agreed, so store that info 147 // yay they agreed, so store that info
148 Editor edit = prefs.edit(); 148 Editor editor = prefs.edit();
149 edit.putBoolean(PreferenceConstants.EULA, true); 149 editor.putBoolean(PreferenceConstants.EULA, true);
150 edit.commit(); 150 editor.commit();
151 } 151 }
152 else { 152 else {
153 // user didnt agree, so close 153 // user didnt agree, so close
154 this.finish(); 154 this.finish();
155 } 155 }
459 for (String key : values.keySet()) { 459 for (String key : values.keySet()) {
460 if (types.containsKey(key)) { 460 if (types.containsKey(key)) {
461 char stype = types.get(key).charAt(0); 461 char stype = types.get(key).charAt(0);
462 switch (stype) { 462 switch (stype) {
463 case 'b': 463 case 'b':
464 editor.putBoolean(key, values.getAsBoolean(key)); 464 boolean bv = values.getAsBoolean(key);
465 editor.putBoolean(key, bv);
465 break; 466 break;
466 467
467 case 'i': 468 case 'i':
468 editor.putInt(key, values.getAsInteger(key)); 469 int iv = values.getAsInteger(key);
470 editor.putInt(key, iv);
469 break; 471 break;
470 472
471 case 'f': 473 case 'f':
472 editor.putFloat(key, values.getAsFloat(key)); 474 float fv = values.getAsFloat(key);
475 editor.putFloat(key, fv);
473 break; 476 break;
474 477
475 case 's': 478 case 's':
476 editor.putString(key, values.getAsString(key)); 479 String sv = values.getAsString(key);
480 editor.putString(key, sv);
477 break; 481 break;
478 } 482 }
479 } 483 }
480 } 484 }
481 editor.commit(); 485 editor.commit();
504 } 508 }
505 } 509 }
506 510
507 protected void updateList() { 511 protected void updateList() {
508 if (prefs.getBoolean(PreferenceConstants.SORT_BY_COLOR, false) != sortedByColor) { 512 if (prefs.getBoolean(PreferenceConstants.SORT_BY_COLOR, false) != sortedByColor) {
509 Editor edit = prefs.edit(); 513 Editor editor = prefs.edit();
510 edit.putBoolean(PreferenceConstants.SORT_BY_COLOR, sortedByColor); 514 editor.putBoolean(PreferenceConstants.SORT_BY_COLOR, sortedByColor);
511 edit.commit(); 515 editor.commit();
512 } 516 }
513 517
514 if (hostdb == null) 518 if (hostdb == null)
515 hostdb = new HostDatabase(this); 519 hostdb = new HostDatabase(this);
516 520