mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +01:00
When rematching an Archived game save in default new-game group
This commit is contained in:
parent
db641c4664
commit
c87161307c
3 changed files with 14 additions and 3 deletions
|
@ -2650,9 +2650,7 @@ public class BoardDelegate extends DelegateBase
|
||||||
|
|
||||||
private boolean inArchiveGroup()
|
private boolean inArchiveGroup()
|
||||||
{
|
{
|
||||||
String archiveName = LocUtils
|
long archiveGroup = DBUtils.getArchiveGroup( m_activity );
|
||||||
.getString( m_activity, R.string.group_name_archive );
|
|
||||||
long archiveGroup = DBUtils.getGroup( m_activity, archiveName );
|
|
||||||
long curGroup = DBUtils.getGroupForGame( m_activity, m_rowid );
|
long curGroup = DBUtils.getGroupForGame( m_activity, m_rowid );
|
||||||
return curGroup == archiveGroup;
|
return curGroup == archiveGroup;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1791,6 +1791,14 @@ public class DBUtils {
|
||||||
invalGroupsCache();
|
invalGroupsCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long getArchiveGroup( Context context )
|
||||||
|
{
|
||||||
|
String archiveName = LocUtils
|
||||||
|
.getString( context, R.string.group_name_archive );
|
||||||
|
long archiveGroup = getGroup( context, archiveName );
|
||||||
|
return archiveGroup;
|
||||||
|
}
|
||||||
|
|
||||||
// Change group id of a game
|
// Change group id of a game
|
||||||
public static void moveGame( Context context, long rowid, long groupID )
|
public static void moveGame( Context context, long rowid, long groupID )
|
||||||
{
|
{
|
||||||
|
|
|
@ -2246,7 +2246,12 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
int lang = extras.getInt( REMATCH_LANG_EXTRA, -1 );
|
int lang = extras.getInt( REMATCH_LANG_EXTRA, -1 );
|
||||||
String json = extras.getString( REMATCH_PREFS_EXTRA );
|
String json = extras.getString( REMATCH_PREFS_EXTRA );
|
||||||
|
|
||||||
|
// Don't save rematch in Archive group
|
||||||
long groupID = DBUtils.getGroupForGame( m_activity, srcRowID );
|
long groupID = DBUtils.getGroupForGame( m_activity, srcRowID );
|
||||||
|
if ( groupID == DBUtils.getArchiveGroup( m_activity ) ) {
|
||||||
|
groupID = XWPrefs.getDefaultNewGameGroup( m_activity );
|
||||||
|
}
|
||||||
|
|
||||||
newid = GameUtils.makeNewMultiGame( m_activity, groupID, dict,
|
newid = GameUtils.makeNewMultiGame( m_activity, groupID, dict,
|
||||||
lang, json, addrs, gameName );
|
lang, json, addrs, gameName );
|
||||||
DBUtils.addRematchInfo( m_activity, newid, btAddr, phone,
|
DBUtils.addRematchInfo( m_activity, newid, btAddr, phone,
|
||||||
|
|
Loading…
Add table
Reference in a new issue