summaryrefslogtreecommitdiff
path: root/src/se/leap/leapclient/Dashboard.java
diff options
context:
space:
mode:
authorSean Leonard <meanderingcode@aetherislands.net>2013-08-13 09:28:13 -0600
committerSean Leonard <meanderingcode@aetherislands.net>2013-08-13 09:28:13 -0600
commit2dc51029679b04599c16ec728404ef2442e35510 (patch)
tree56e400bc805ba6f91aeb52b059d4fa7f9f4cca22 /src/se/leap/leapclient/Dashboard.java
parenta383161777a94eedb3911bfca1f0d79cf2eba81f (diff)
parentde28df6f62949e6142f8bc1b5363137906a6d7a3 (diff)
Merge branch 'feature/retry-login-retain-username' into develop
Diffstat (limited to 'src/se/leap/leapclient/Dashboard.java')
-rw-r--r--src/se/leap/leapclient/Dashboard.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/se/leap/leapclient/Dashboard.java b/src/se/leap/leapclient/Dashboard.java
index b652bb73..f666ae03 100644
--- a/src/se/leap/leapclient/Dashboard.java
+++ b/src/se/leap/leapclient/Dashboard.java
@@ -90,7 +90,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
buildDashboard();
if(data != null && data.hasExtra(ConfigHelper.LOG_IN)) {
View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0);
- logInDialog(view, "");
+ logInDialog(view, Bundle.EMPTY);
}
} else if(resultCode == RESULT_CANCELED && data.hasExtra(ConfigHelper.QUIT)) {
finish();
@@ -195,7 +195,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
return true;
case R.id.login_button:
View view = ((ViewGroup)findViewById(android.R.id.content)).getChildAt(0);
- logInDialog(view, "");
+ logInDialog(view, Bundle.EMPTY);
return true;
case R.id.logout_button:
logOut();
@@ -267,7 +267,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
* Shows the log in dialog.
* @param view from which the dialog is created.
*/
- public void logInDialog(View view, String user_message) {
+ public void logInDialog(View view, Bundle resultData) {
FragmentTransaction fragment_transaction = getFragmentManager().beginTransaction();
Fragment previous_log_in_dialog = getFragmentManager().findFragmentByTag(ConfigHelper.LOG_IN_DIALOG);
if (previous_log_in_dialog != null) {
@@ -276,9 +276,12 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
fragment_transaction.addToBackStack(null);
DialogFragment newFragment = LogInDialog.newInstance();
- if(user_message != null && !user_message.isEmpty()) {
+ if(resultData != null && !resultData.isEmpty()) {
Bundle user_message_bundle = new Bundle();
+ String user_message = resultData.getString(getResources().getString(R.string.user_message));
+ String username = resultData.getString(ConfigHelper.USERNAME_KEY);
user_message_bundle.putString(getResources().getString(R.string.user_message), user_message);
+ user_message_bundle.putString(ConfigHelper.USERNAME_KEY, username);
newFragment.setArguments(user_message_bundle);
}
newFragment.show(fragment_transaction, ConfigHelper.LOG_IN_DIALOG);
@@ -319,7 +322,7 @@ public class Dashboard extends Activity implements LogInDialog.LogInDialogInterf
downloadAuthedUserCertificate(session_id);
} else if(resultCode == ConfigHelper.SRP_AUTHENTICATION_FAILED) {
mProgressDialog.dismiss();
- logInDialog(getCurrentFocus(), resultData.getString(getResources().getString(R.string.user_message)));
+ logInDialog(getCurrentFocus(), resultData);
} else if(resultCode == ConfigHelper.LOGOUT_SUCCESSFUL) {
authed = false;
invalidateOptionsMenu();