mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-01 06:19:57 +01:00
don't allow deleting default group. Wording needs fixing, or better
yet, replace the menuitem with greyed-out "is default group". But this works for now.
This commit is contained in:
parent
82c39489f0
commit
1994ea788e
2 changed files with 12 additions and 5 deletions
|
@ -2145,4 +2145,7 @@
|
|||
|
||||
<string name="rename_group_label">Change the name of this group to:</string>
|
||||
<string name="game_rename_group_title">Rename group</string>
|
||||
|
||||
<string name="cannot_delete_default_group">The default group
|
||||
cannot be deleted."</string>
|
||||
</resources>
|
||||
|
|
|
@ -789,12 +789,16 @@ public class GamesList extends XWExpandableListActivity
|
|||
m_groupid = m_adapter.getGroupIDFor( groupPos );
|
||||
switch ( menuID ) {
|
||||
case R.id.list_group_delete:
|
||||
String msg = getString( R.string.group_confirm_del );
|
||||
int nGames = m_adapter.getChildrenCount( groupPos );
|
||||
if ( 0 < nGames ) {
|
||||
msg += getString( R.string.group_confirm_delf, nGames );
|
||||
if ( m_groupid == XWPrefs.getDefaultNewGameGroup( this ) ) {
|
||||
showOKOnlyDialog( R.string.cannot_delete_default_group );
|
||||
} else {
|
||||
String msg = getString( R.string.group_confirm_del );
|
||||
int nGames = m_adapter.getChildrenCount( groupPos );
|
||||
if ( 0 < nGames ) {
|
||||
msg += getString( R.string.group_confirm_delf, nGames );
|
||||
}
|
||||
showConfirmThen( msg, DELETE_GROUP_ACTION );
|
||||
}
|
||||
showConfirmThen( msg, DELETE_GROUP_ACTION );
|
||||
break;
|
||||
case R.id.list_group_rename:
|
||||
showDialog( RENAME_GROUP );
|
||||
|
|
Loading…
Reference in a new issue