From 6d898ddf886ce0d6617c384544bfe24d46dfe3e8 Mon Sep 17 00:00:00 2001 From: zeapo Date: Thu, 18 Dec 2014 21:28:01 +0100 Subject: [PATCH] remember the connection mode and the auth mode --- .../java/com/zeapo/pwdstore/git/GitActivity.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java index c777d8f2..551f17e3 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.java @@ -83,7 +83,6 @@ public class GitActivity extends ActionBarActivity { final Spinner protcol_spinner = (Spinner) findViewById(R.id.clone_protocol); final Spinner connection_mode_spinner = (Spinner) findViewById(R.id.connection_mode); - // init the spinner for connection modes final ArrayAdapter connection_mode_adapter = ArrayAdapter.createFromResource(this, R.array.connection_modes, android.R.layout.simple_spinner_item); @@ -103,6 +102,13 @@ public class GitActivity extends ActionBarActivity { } }); + + if (protocol.equals("ssh://")) { + protcol_spinner.setSelection(0); + } else { + protcol_spinner.setSelection(1); + } + // init the spinner for protocols ArrayAdapter protocol_adapter = ArrayAdapter.createFromResource(this, R.array.clone_protocols, android.R.layout.simple_spinner_item); @@ -139,6 +145,11 @@ public class GitActivity extends ActionBarActivity { } ); + if (connectionMode.equals("ssh-key")) { + protcol_spinner.setSelection(0); + } else { + protcol_spinner.setSelection(1); + } // init the server information final EditText server_url = ((EditText) findViewById(R.id.server_url)); @@ -503,7 +514,8 @@ public class GitActivity extends ActionBarActivity { //This is what happens when jgit fails :( //TODO Handle the diffent cases of exceptions e.printStackTrace(); - } } + } + } } /**