mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-09 05:24:44 +01:00
disable reset context menu too when game selected
This commit is contained in:
parent
4d24fd38f5
commit
7a865f279b
2 changed files with 10 additions and 3 deletions
|
@ -150,8 +150,9 @@ public class GameUtils {
|
||||||
return lockDest;
|
return lockDest;
|
||||||
} // resetGame
|
} // resetGame
|
||||||
|
|
||||||
public static void resetGame( Context context, long rowidIn )
|
public static boolean resetGame( Context context, long rowidIn )
|
||||||
{
|
{
|
||||||
|
boolean success = false;
|
||||||
GameLock lock = new GameLock( rowidIn, true ).lock( 500 );
|
GameLock lock = new GameLock( rowidIn, true ).lock( 500 );
|
||||||
if ( null != lock ) {
|
if ( null != lock ) {
|
||||||
tellDied( context, lock, true );
|
tellDied( context, lock, true );
|
||||||
|
@ -159,9 +160,11 @@ public class GameUtils {
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
|
||||||
Utils.cancelNotification( context, (int)rowidIn );
|
Utils.cancelNotification( context, (int)rowidIn );
|
||||||
|
success = true;
|
||||||
} else {
|
} else {
|
||||||
DbgUtils.logf( "resetGame: unable to open rowid %d", rowidIn );
|
DbgUtils.logf( "resetGame: unable to open rowid %d", rowidIn );
|
||||||
}
|
}
|
||||||
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int setFromFeedImpl( FeedUtilsImpl feedImpl )
|
private static int setFromFeedImpl( FeedUtilsImpl feedImpl )
|
||||||
|
|
|
@ -1211,10 +1211,13 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
break;
|
break;
|
||||||
case RESET_GAMES:
|
case RESET_GAMES:
|
||||||
long[] rowids = (long[])params[0];
|
long[] rowids = (long[])params[0];
|
||||||
|
boolean changed = false;
|
||||||
for ( long rowid : rowids ) {
|
for ( long rowid : rowids ) {
|
||||||
GameUtils.resetGame( m_activity, rowid );
|
changed = GameUtils.resetGame( m_activity, rowid ) || changed;
|
||||||
|
}
|
||||||
|
if ( changed ) {
|
||||||
|
mkListAdapter(); // required because position may change
|
||||||
}
|
}
|
||||||
mkListAdapter(); // required because position may change
|
|
||||||
break;
|
break;
|
||||||
case SYNC_MENU:
|
case SYNC_MENU:
|
||||||
doSyncMenuitem();
|
doSyncMenuitem();
|
||||||
|
@ -1578,6 +1581,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
|
|
||||||
enable = !m_launchedGames.contains( rowID );
|
enable = !m_launchedGames.contains( rowID );
|
||||||
Utils.setItemVisible( menu, R.id.games_game_delete, enable );
|
Utils.setItemVisible( menu, R.id.games_game_delete, enable );
|
||||||
|
Utils.setItemVisible( menu, R.id.games_game_reset, enable );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue