mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-31 19:57:06 +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="rename_group_label">Change the name of this group to:</string>
|
||||||
<string name="game_rename_group_title">Rename group</string>
|
<string name="game_rename_group_title">Rename group</string>
|
||||||
|
|
||||||
|
<string name="cannot_delete_default_group">The default group
|
||||||
|
cannot be deleted."</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -789,12 +789,16 @@ public class GamesList extends XWExpandableListActivity
|
||||||
m_groupid = m_adapter.getGroupIDFor( groupPos );
|
m_groupid = m_adapter.getGroupIDFor( groupPos );
|
||||||
switch ( menuID ) {
|
switch ( menuID ) {
|
||||||
case R.id.list_group_delete:
|
case R.id.list_group_delete:
|
||||||
|
if ( m_groupid == XWPrefs.getDefaultNewGameGroup( this ) ) {
|
||||||
|
showOKOnlyDialog( R.string.cannot_delete_default_group );
|
||||||
|
} else {
|
||||||
String msg = getString( R.string.group_confirm_del );
|
String msg = getString( R.string.group_confirm_del );
|
||||||
int nGames = m_adapter.getChildrenCount( groupPos );
|
int nGames = m_adapter.getChildrenCount( groupPos );
|
||||||
if ( 0 < nGames ) {
|
if ( 0 < nGames ) {
|
||||||
msg += getString( R.string.group_confirm_delf, nGames );
|
msg += getString( R.string.group_confirm_delf, nGames );
|
||||||
}
|
}
|
||||||
showConfirmThen( msg, DELETE_GROUP_ACTION );
|
showConfirmThen( msg, DELETE_GROUP_ACTION );
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case R.id.list_group_rename:
|
case R.id.list_group_rename:
|
||||||
showDialog( RENAME_GROUP );
|
showDialog( RENAME_GROUP );
|
||||||
|
|
Loading…
Add table
Reference in a new issue