mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-06 20:45:54 +01:00
don't allow removing players when game is locked
This commit is contained in:
parent
3b6a0cda74
commit
83baa5a00c
1 changed files with 12 additions and 2 deletions
|
@ -557,7 +557,6 @@ public class GameConfigDelegate extends DelegateBase
|
|||
m_gameLockedCheck =
|
||||
(CheckBox)findViewById( R.id.game_locked_check );
|
||||
m_gameLockedCheck.setVisibility( View.VISIBLE );
|
||||
m_gameLockedCheck.setChecked( true );
|
||||
m_gameLockedCheck.setOnClickListener( this );
|
||||
}
|
||||
handleLockedChange();
|
||||
|
@ -795,6 +794,8 @@ public class GameConfigDelegate extends DelegateBase
|
|||
};
|
||||
|
||||
boolean localGame = localOnlyGame();
|
||||
boolean unlocked = null == m_gameLockedCheck
|
||||
|| !m_gameLockedCheck.isChecked();
|
||||
for ( int ii = 0; ii < names.length; ++ii ) {
|
||||
final XWListItem view = XWListItem.inflate( m_activity, null );
|
||||
view.setPosition( ii );
|
||||
|
@ -806,6 +807,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
view.setDeleteCallback( this );
|
||||
}
|
||||
|
||||
view.setEnabled( unlocked );
|
||||
view.setOnClickListener( lstnr );
|
||||
m_playerLayout.addView( view );
|
||||
|
||||
|
@ -1040,7 +1042,15 @@ public class GameConfigDelegate extends DelegateBase
|
|||
m_isLocked = locking;
|
||||
for ( int id : s_disabledWhenLocked ) {
|
||||
View view = findViewById( id );
|
||||
view.setEnabled( !m_isLocked );
|
||||
view.setEnabled( !locking );
|
||||
}
|
||||
|
||||
int nChildren = m_playerLayout.getChildCount();
|
||||
for ( int ii = 0; ii < nChildren; ++ii ) {
|
||||
View child = m_playerLayout.getChildAt( ii );
|
||||
if ( child instanceof XWListItem ) {
|
||||
((XWListItem)child).setEnabled( !locking );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue