mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-22 07:28:16 +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() {
|
lstnr = new OnClickListener() {
|
||||||
public void onClick( DialogInterface dlg, int item ) {
|
public void onClick( DialogInterface dlg, int item ) {
|
||||||
String name = namer.getName();
|
String name = namer.getName();
|
||||||
|
long hasName = DBUtils.getGroup( m_activity, name );
|
||||||
|
if ( DBUtils.GROUPID_UNSPEC == hasName ) {
|
||||||
DBUtils.addGroup( m_activity, name );
|
DBUtils.addGroup( m_activity, name );
|
||||||
mkListAdapter();
|
mkListAdapter();
|
||||||
showNewGroupIf();
|
showNewGroupIf();
|
||||||
|
} else {
|
||||||
|
String msg = LocUtils
|
||||||
|
.getString( m_activity,
|
||||||
|
R.string.duplicate_group_name_fmt,
|
||||||
|
name );
|
||||||
|
makeOkOnlyBuilder( msg ).show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
lstnr2 = new OnClickListener() {
|
lstnr2 = new OnClickListener() {
|
||||||
|
|
|
@ -2161,6 +2161,8 @@
|
||||||
<string name="button_archive">Archive\u200C</string>
|
<string name="button_archive">Archive\u200C</string>
|
||||||
<string name="group_name_archive">Archive</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="button_reconnect">Reconnect</string>
|
||||||
|
|
||||||
<string name="square_tiles">Square rack tiles</string>
|
<string name="square_tiles">Square rack tiles</string>
|
||||||
|
|
Loading…
Reference in a new issue