mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
Don't allow copy of relay-connected game.
This commit is contained in:
parent
7cf4535b4c
commit
5a5c73916e
3 changed files with 16 additions and 4 deletions
|
@ -386,6 +386,9 @@
|
|||
<string name="notify_body">New game data available on relay</string>
|
||||
<string name="gamel_menu_checkmoves">Check server</string>
|
||||
|
||||
<string name="no_copy_network">Games that have already connected
|
||||
to the relay cannot be copied.</string>
|
||||
|
||||
<string name="no_games_to_refresh">No games found that connect via
|
||||
the meetup server.</string>
|
||||
|
||||
|
|
|
@ -354,10 +354,14 @@ public class GamesList extends XWListActivity
|
|||
break;
|
||||
|
||||
case R.id.list_item_copy:
|
||||
stream = GameUtils.savedGame( this, path );
|
||||
newName = GameUtils.saveGame( this, stream );
|
||||
DBUtils.saveSummary( newName,
|
||||
DBUtils.getSummary( this, path ) );
|
||||
GameSummary summary = DBUtils.getSummary( this, path );
|
||||
if ( summary.inNetworkGame() ) {
|
||||
showOKOnlyDialog( R.string.no_copy_network );
|
||||
} else {
|
||||
stream = GameUtils.savedGame( this, path );
|
||||
newName = GameUtils.saveGame( this, stream );
|
||||
DBUtils.saveSummary( newName, summary );
|
||||
}
|
||||
break;
|
||||
|
||||
// These require some notion of predictable sort order.
|
||||
|
|
|
@ -34,4 +34,9 @@ public class GameSummary {
|
|||
public String roomName;
|
||||
public String relayID;
|
||||
public boolean msgsPending;
|
||||
|
||||
public boolean inNetworkGame()
|
||||
{
|
||||
return null != relayID;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue