Commit f9e40aeb895c0854aaac2e4588216d21e42b393a
1 parent
4f00ecfd
Exists in
master
and in
5 other branches
Corrigindo tela de configuração, reativando função reconnect
Showing
3 changed files
with
14 additions
and
17 deletions
Show diff stats
android/src/br/com/bb/pw3270/PW3270Activity.java
| ... | ... | @@ -75,17 +75,9 @@ public class PW3270Activity extends Activity |
| 75 | 75 | |
| 76 | 76 | Log.d(TAG, "Initializing UI"); |
| 77 | 77 | |
| 78 | -// if(host.dlgSysMessage == null) | |
| 79 | -// { | |
| 80 | - // Cria dialogo para as mensagems de sistema | |
| 81 | -// Log.d(TAG, "Creating dlgSysMessage"); | |
| 82 | - host.dlgSysMessage = new ProgressDialog(this); | |
| 83 | - host.dlgSysMessage.setCancelable(false); | |
| 84 | - host.dlgSysMessage.setTitle(host.res.getString(R.string.wait)); | |
| 85 | -// } | |
| 86 | - | |
| 87 | -// Log.d(TAG, "Creating terminal object"); | |
| 88 | -// autoconnect = settings.getString("hostname","") != "" && settings.getBoolean("autoconnect",false); | |
| 78 | + host.dlgSysMessage = new ProgressDialog(this); | |
| 79 | + host.dlgSysMessage.setCancelable(false); | |
| 80 | + host.dlgSysMessage.setTitle(host.res.getString(R.string.wait)); | |
| 89 | 81 | |
| 90 | 82 | // Reference: |
| 91 | 83 | // http://developer.android.com/reference/android/webkit/WebView.html | ... | ... |
android/src/br/com/bb/pw3270/SettingsActivity.java
| ... | ... | @@ -44,14 +44,18 @@ public class SettingsActivity extends Activity |
| 44 | 44 | |
| 45 | 45 | public stringSetting(Preference p) |
| 46 | 46 | { |
| 47 | + String text = p.getSharedPreferences().getString(p.getKey(),""); | |
| 48 | + | |
| 49 | + if(text != "") | |
| 50 | + p.setSummary(text); | |
| 51 | + | |
| 47 | 52 | p.setOnPreferenceChangeListener(this); |
| 48 | - this.onPreferenceChange(p,null); | |
| 49 | 53 | } |
| 50 | 54 | |
| 51 | - public boolean onPreferenceChange(Preference p, Object arg1) | |
| 55 | + public boolean onPreferenceChange(Preference p, Object value) | |
| 52 | 56 | { |
| 53 | - p.setSummary(p.getSharedPreferences().getString(p.getKey(),"")); | |
| 54 | - return false; | |
| 57 | + p.setSummary((String) value); | |
| 58 | + return true; | |
| 55 | 59 | } |
| 56 | 60 | } |
| 57 | 61 | ... | ... |
android/src/br/com/bb/pw3270/lib3270.java
| ... | ... | @@ -85,9 +85,10 @@ public class lib3270 |
| 85 | 85 | switch (msg.what) |
| 86 | 86 | { |
| 87 | 87 | case 0: // Reconnect |
| 88 | - if(!hSession.isConnected()) | |
| 88 | + if(!hSession.isConnected() && settings.getString("hostname","") != "" && settings.getBoolean("reconnect",false)) | |
| 89 | 89 | { |
| 90 | - Log.d(TAG,"------------------------------------Connecting"); | |
| 90 | + Log.d(TAG,"Connection lost, reconnecting"); | |
| 91 | + connect(); | |
| 91 | 92 | } |
| 92 | 93 | break; |
| 93 | 94 | ... | ... |