mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
unselect any game moved into a closed group
Fixes GameOver game moved via "archive" checkbox remaining selected
This commit is contained in:
parent
76957fe4eb
commit
989f7524d6
3 changed files with 21 additions and 13 deletions
|
@ -2656,14 +2656,8 @@ public class BoardDelegate extends DelegateBase
|
|||
|
||||
private void archiveGame( boolean closeAfter )
|
||||
{
|
||||
String archiveName = LocUtils
|
||||
.getString( m_activity, R.string.group_name_archive );
|
||||
long archiveGroupID = DBUtils.getGroup( m_activity, archiveName );
|
||||
|
||||
if ( DBUtils.GROUPID_UNSPEC == archiveGroupID ) {
|
||||
archiveGroupID = DBUtils.addGroup( m_activity, archiveName );
|
||||
}
|
||||
DBUtils.moveGame( m_activity, m_rowid, archiveGroupID );
|
||||
long gid = DBUtils.getArchiveGroup( m_activity );
|
||||
DBUtils.moveGame( m_activity, m_rowid, gid );
|
||||
if ( closeAfter ) {
|
||||
waitCloseGame( false );
|
||||
finish();
|
||||
|
|
|
@ -1803,6 +1803,9 @@ public class DBUtils {
|
|||
String archiveName = LocUtils
|
||||
.getString( context, R.string.group_name_archive );
|
||||
long archiveGroup = getGroup( context, archiveName );
|
||||
if ( DBUtils.GROUPID_UNSPEC == archiveGroup ) {
|
||||
archiveGroup = DBUtils.addGroup( context, archiveName );
|
||||
}
|
||||
return archiveGroup;
|
||||
}
|
||||
|
||||
|
|
|
@ -1076,18 +1076,28 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
boolean destOpen = DBUtils.getGroups( m_activity ).get( gid ).m_expanded;
|
||||
for ( long rowid : games ) {
|
||||
DBUtils.moveGame( m_activity, rowid, gid );
|
||||
if ( !destOpen ) {
|
||||
m_mySIS.selGames.remove( rowid );
|
||||
}
|
||||
unselIfHidden( rowid, gid );
|
||||
}
|
||||
}
|
||||
|
||||
// Invalidate if there could have been change
|
||||
if ( ! destOpen ) {
|
||||
private void unselIfHidden( long rowid, long gid )
|
||||
{
|
||||
boolean groupOpen = DBUtils.getGroups( m_activity )
|
||||
.get( gid ).m_expanded;
|
||||
if ( !groupOpen ) {
|
||||
m_mySIS.selGames.remove( rowid );
|
||||
// Invalidate if there could have been change
|
||||
invalidateOptionsMenuIf();
|
||||
setTitle();
|
||||
}
|
||||
}
|
||||
|
||||
private void unselIfHidden( long rowid )
|
||||
{
|
||||
long gid = DBUtils.getGroupForGame( m_activity, rowid );
|
||||
unselIfHidden( rowid, gid );
|
||||
}
|
||||
|
||||
public void invalidateOptionsMenuIf()
|
||||
{
|
||||
super.invalidateOptionsMenuIf();
|
||||
|
@ -1158,6 +1168,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
setSelGame( rowid );
|
||||
break;
|
||||
case GAME_MOVED:
|
||||
unselIfHidden( rowid );
|
||||
mkListAdapter();
|
||||
break;
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue