Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.u17od.upm"
android:versionCode="15"
android:versionName="1.14">
android:versionCode="14"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unnecessary.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't change anything in AndroidManifest.xml. I added it to my changes by mistake.

android:versionName="1.13">

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
Expand Down
4 changes: 0 additions & 4 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ Features

History
-------
v1.14 28-Oct-2012
* Added support for syncing to Dropbox
* Hide account details in screenshots and task manager

v1.13 12-Aug-2012
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unnecessary.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with this one...I didn't added on purpose

* Added support for all API levels up to and including 16
* Fixed a few bugs
Expand Down
3 changes: 2 additions & 1 deletion res/menu/account_context_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<item android:title="@string/edit_account" android:id="@+id/edit_account"></item><item android:title="@string/copy_username" android:id="@+id/copy_username"></item>
<item android:title="@string/copy_password" android:id="@+id/copy_password"></item>
<item android:id="@+id/launch_url" android:title="@string/launch_url"></item>
<item android:id="@+id/launch_url" android:title="@string/launch_url"></item><item android:id="@+id/delete" android:title="@string/delete" android:icon="@android:drawable/ic_menu_delete" android:alphabeticShortcut="d"></item>


</menu>
1 change: 1 addition & 0 deletions res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<string name="db_sync_error">Database Sync Error\n\n%s</string>
<string name="sync_required">A sync is required before carrying out this operation</string>
<string name="delete_db">Delete Database</string>
<string name="confirm_delete_dialog">Are you sure you want to delete your Account? Once deleted the account is gone forever.</string>
<string name="confirm_delete_db">Are you sure you want to delete your db? Once deleted the database is gone forever.</string>
<string name="confirm_exit_title">Exit UPM?</string>
<string name="confirm_exit_message">Are you sure you want to exit UPM? You\'ll be requested to enter your master password next time you open UPM.</string>
Expand Down
10 changes: 10 additions & 0 deletions src/com/u17od/upm/AccountsList.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
import com.u17od.upm.database.PasswordDatabase;

public class AccountsList extends ListActivity {
private static final int DELETE_DIALOG = 5;
public static AccountInformation account;
private int editAccountResultCode = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
Expand Down Expand Up @@ -67,6 +70,13 @@ public boolean onContextItemSelected(MenuItem item) {
case R.id.launch_url:
launchURL(getURL(getAccount(info.targetView)));
return true;
case R.id.delete:
if (Utilities.isSyncRequired(this)) {
UIUtilities.showToast(this, R.string.sync_required);
} else {
showDialog(DELETE_DIALOG);
}
break;
}
return super.onContextItemSelected(item);
}
Expand Down
34 changes: 34 additions & 0 deletions src/com/u17od/upm/FullAccountList.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class FullAccountList extends AccountsList {
private static final int DIALOG_ABOUT = 2;
private static final int CONFIRM_DELETE_DB_DIALOG = 3;
private static final int IMPORT_CERT_DIALOG = 4;
private static final int DELETE_DIALOG = 5;

public static final int RESULT_EXIT = 0;
public static final int RESULT_ENTER_PW = 1;
Expand Down Expand Up @@ -337,6 +338,39 @@ public void onClick(DialogInterface dialog, int id) {
}
});
break;
case DELETE_DIALOG:

dialogBuilder.setMessage(getString(R.string.confirm_delete_dialog))//setting the dialog of confirm_delete_dialog from string.xml
.setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
getPasswordDatabase().deleteAccount(account.getAccountName());//insert into database and erase the account selected
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run this I get a NullPointerException on this line. The problem is the "account" variable is null.

To determine the name of the account to delete you'll need to find out what account name was long-clicked.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will give it a try

final String accountName = account.getAccountName();

new SaveDatabaseAsyncTask(FullAccountList.this, new Callback() {
@Override
public void execute() {
String message = String.format(getString(R.string.account_deleted), accountName);
Toast.makeText(FullAccountList.this, message, Toast.LENGTH_SHORT).show();
//Β Set this flag so that when we're returned to the FullAccountList
// activity the list is refreshed
FullAccountList.this.setResult(AddEditAccount.EDIT_ACCOUNT_RESULT_CODE_TRUE);
finish();
}
}).execute(getPasswordDatabase());
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {

dialog.cancel();//if the selection is "No" cancel the dialog
}
});
break;
}

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 372 - 375 seem unnecessary.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will erase that. thanks!

return dialogBuilder.create();
}
}

return dialogBuilder.create();
Expand Down