mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-04 23:02:02 +01:00
don't allow duplicate group names
If group already exists, warn rather than create another with the same name.
This commit is contained in:
parent
c2eff7d3f2
commit
607567cd35
2 changed files with 14 additions and 3 deletions
|
@ -755,9 +755,18 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
lstnr = new OnClickListener() {
|
||||
public void onClick( DialogInterface dlg, int item ) {
|
||||
String name = namer.getName();
|
||||
DBUtils.addGroup( m_activity, name );
|
||||
mkListAdapter();
|
||||
showNewGroupIf();
|
||||
long hasName = DBUtils.getGroup( m_activity, name );
|
||||
if ( DBUtils.GROUPID_UNSPEC == hasName ) {
|
||||
DBUtils.addGroup( m_activity, name );
|
||||
mkListAdapter();
|
||||
showNewGroupIf();
|
||||
} else {
|
||||
String msg = LocUtils
|
||||
.getString( m_activity,
|
||||
R.string.duplicate_group_name_fmt,
|
||||
name );
|
||||
makeOkOnlyBuilder( msg ).show();
|
||||
}
|
||||
}
|
||||
};
|
||||
lstnr2 = new OnClickListener() {
|
||||
|
|
|
@ -2161,6 +2161,8 @@
|
|||
<string name="button_archive">Archive\u200C</string>
|
||||
<string name="group_name_archive">Archive</string>
|
||||
|
||||
<string name="duplicate_group_name_fmt">The group \"%1$s\" already exists.</string>
|
||||
|
||||
<string name="button_reconnect">Reconnect</string>
|
||||
|
||||
<string name="square_tiles">Square rack tiles</string>
|
||||
|
|
Loading…
Reference in a new issue