mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
fix bugs: chosen dict was being pulled by index from non-sorted
version of the list user saw when choosing the index. Fix is to use same list. Cancel after selecting dict didn't work as the selection listener had already copied the selected dict name over. Now the listener leaves that for the Ok button's onclick listener.
This commit is contained in:
parent
3fd0bb056a
commit
9956bc417d
1 changed files with 6 additions and 6 deletions
|
@ -348,9 +348,11 @@ public class GameConfig extends XWActivity
|
|||
Spinner spinner =
|
||||
(Spinner)((Dialog)di).findViewById( R.id.dict_spinner );
|
||||
int position = spinner.getSelectedItemPosition();
|
||||
String[] dicts = DictLangCache.getHaveLang( this, m_gi.dictLang );
|
||||
if ( position < dicts.length ) {
|
||||
lp.dictName = dicts[position];
|
||||
ArrayAdapter<String> adapter =
|
||||
(ArrayAdapter<String>)spinner.getAdapter();
|
||||
|
||||
if ( position < adapter.getCount() ) {
|
||||
lp.dictName = adapter.getItem(position);
|
||||
}
|
||||
|
||||
lp.setIsRobot( Utils.getChecked( dialog, R.id.robot_check ) );
|
||||
|
@ -683,7 +685,7 @@ public class GameConfig extends XWActivity
|
|||
return result;
|
||||
}
|
||||
|
||||
private void configDictSpinner( final Dialog dialog, final LocalPlayer lp )
|
||||
private void configDictSpinner( final Dialog dialog, LocalPlayer lp )
|
||||
{
|
||||
Spinner dictsSpinner =
|
||||
(Spinner)dialog.findViewById( R.id.dict_spinner );
|
||||
|
@ -703,8 +705,6 @@ public class GameConfig extends XWActivity
|
|||
if ( chosen.equals( m_browseText ) ) {
|
||||
DictsActivity.launchAndDownload( GameConfig.this,
|
||||
m_gi.dictLang );
|
||||
} else {
|
||||
lp.dictName = chosen;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue