Revision 5d668a55 src/com/rackspace/cloud/android/ListAccountsActivity.java
b/src/com/rackspace/cloud/android/ListAccountsActivity.java | ||
---|---|---|
229 | 229 |
public boolean onOptionsItemSelected(MenuItem item) { |
230 | 230 |
switch (item.getItemId()) { |
231 | 231 |
case R.id.add_account: |
232 |
startActivityForResult(new Intent(this, AddAccountActivity.class), 78); // arbitrary number; never used again |
|
232 |
Intent intent = new Intent(this, PithosLoginActivity.class); |
|
233 |
intent.putExtra("login", "https://pithos.dev.grnet.gr/im/login"); |
|
234 |
intent.putExtra("auth", Preferences.PITHOS_DEV_SERVER); |
|
235 |
startActivityForResult(intent, 78); // arbitrary number; never used again |
|
233 | 236 |
return true; |
234 | 237 |
|
235 | 238 |
case R.id.contact_rackspace: |
... | ... | |
351 | 354 |
acc.setAuthServer(b.getString("server")); |
352 | 355 |
Log.d("info", "the set server was " + b.getString("server")); |
353 | 356 |
Log.d("info", "the server is " + acc.getAuthServer()); |
354 |
accounts.add(acc); |
|
357 |
boolean found = false; |
|
358 |
for(Account a : accounts){ |
|
359 |
if(a.getUsername().equals(acc.getUsername())&&a.getAuthServer().equals(acc.getAuthServer())){ |
|
360 |
a.setPassword(acc.getPassword()); |
|
361 |
found=true; |
|
362 |
} |
|
363 |
} |
|
364 |
if(!found) |
|
365 |
accounts.add(acc); |
|
355 | 366 |
writeAccounts(); |
356 | 367 |
loadAccounts(); |
357 | 368 |
} |
Also available in: Unified diff