use new confirm-delete-all dialog to confirm deletion of dictionary

This commit is contained in:
Andy2 2010-10-27 06:33:13 -07:00
parent 4c17ea8802
commit 7ad4a43468
2 changed files with 14 additions and 3 deletions

View file

@ -186,6 +186,9 @@
these changes?</string>
<string name="confirm_delete_all">Are you sure you want to
delete all games? This action cannot be undone.</string>
<string name="confirm_delete_dict">Are you sure you want to delete
this dictionary? You will not be able to open any games that use
it.</string>
<string name="hints_allowed">Allow hints</string>
<string name="progress_title">Searching for moves</string>

View file

@ -26,6 +26,7 @@ import android.widget.Button;
import android.widget.TextView;
import android.widget.AdapterView;
import android.content.Context;
import android.content.DialogInterface;
import android.view.View;
import android.view.ViewGroup;
import android.view.ContextMenu;
@ -142,10 +143,17 @@ public class DictsActivity extends XWListActivity
}
// DeleteCallback interface
public void deleteCalled( int myPosition )
public void deleteCalled( final int myPosition )
{
GameUtils.deleteDict( this, m_dicts[myPosition] );
mkListAdapter();
DialogInterface.OnClickListener action =
new DialogInterface.OnClickListener() {
public void onClick( DialogInterface dlg, int item ) {
GameUtils.deleteDict( DictsActivity.this,
m_dicts[myPosition] );
mkListAdapter();
}
};
showConfirmThen( R.string.confirm_delete_dict, action );
}
private void mkListAdapter()