mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
when user has to download a dict in order to reset a game (bad, but
too hard a requirement to remove), once the dict's downloaded continue to reset, not open, the game.
This commit is contained in:
parent
a20339df99
commit
aa7c3a18e3
1 changed files with 23 additions and 5 deletions
|
@ -94,6 +94,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
private String m_missingDict;
|
private String m_missingDict;
|
||||||
private String m_missingDictName;
|
private String m_missingDictName;
|
||||||
private long m_missingDictRowId = DBUtils.ROWID_NOTFOUND;
|
private long m_missingDictRowId = DBUtils.ROWID_NOTFOUND;
|
||||||
|
private int m_missingDictMenuId;
|
||||||
private String[] m_sameLangDicts;
|
private String[] m_sameLangDicts;
|
||||||
private int m_missingDictLang;
|
private int m_missingDictLang;
|
||||||
private long m_rowid;
|
private long m_rowid;
|
||||||
|
@ -699,7 +700,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
final long[] selRowIDs = getSelRowIDs();
|
final long[] selRowIDs = getSelRowIDs();
|
||||||
|
|
||||||
if ( 1 == selRowIDs.length && R.id.games_game_delete != itemID
|
if ( 1 == selRowIDs.length && R.id.games_game_delete != itemID
|
||||||
&& !checkWarnNoDict( selRowIDs[0] ) ) {
|
&& !checkWarnNoDict( selRowIDs[0], itemID ) ) {
|
||||||
return true; // FIXME: RETURN FROM MIDDLE!!!
|
return true; // FIXME: RETURN FROM MIDDLE!!!
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -817,9 +818,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.games_game_reset:
|
case R.id.games_game_reset:
|
||||||
msg = getString( R.string.confirm_reset_fmt, selRowIDs.length );
|
doConfirmReset( selRowIDs );
|
||||||
showConfirmThen( msg, R.string.button_reset,
|
|
||||||
Action.RESET_GAMES, selRowIDs );
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.games_game_rename:
|
case R.id.games_game_rename:
|
||||||
|
@ -945,6 +944,11 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkWarnNoDict( long rowid )
|
private boolean checkWarnNoDict( long rowid )
|
||||||
|
{
|
||||||
|
return checkWarnNoDict( rowid, -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean checkWarnNoDict( long rowid, int forMenu )
|
||||||
{
|
{
|
||||||
String[][] missingNames = new String[1][];
|
String[][] missingNames = new String[1][];
|
||||||
int[] missingLang = new int[1];
|
int[] missingLang = new int[1];
|
||||||
|
@ -958,6 +962,7 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
m_missingDictName = null;
|
m_missingDictName = null;
|
||||||
}
|
}
|
||||||
m_missingDictRowId = rowid;
|
m_missingDictRowId = rowid;
|
||||||
|
m_missingDictMenuId = forMenu;
|
||||||
if ( 0 == DictLangCache.getLangCount( m_activity, m_missingDictLang ) ) {
|
if ( 0 == DictLangCache.getLangCount( m_activity, m_missingDictLang ) ) {
|
||||||
showDialog( DlgID.WARN_NODICT );
|
showDialog( DlgID.WARN_NODICT );
|
||||||
} else if ( null != m_missingDictName ) {
|
} else if ( null != m_missingDictName ) {
|
||||||
|
@ -1220,8 +1225,14 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
{
|
{
|
||||||
boolean madeGame = DBUtils.ROWID_NOTFOUND != m_missingDictRowId;
|
boolean madeGame = DBUtils.ROWID_NOTFOUND != m_missingDictRowId;
|
||||||
if ( madeGame ) {
|
if ( madeGame ) {
|
||||||
GameUtils.launchGame( m_activity, m_missingDictRowId );
|
if ( R.id.games_game_reset == m_missingDictMenuId ) {
|
||||||
|
long[] rowIDs = { m_missingDictRowId };
|
||||||
|
doConfirmReset( rowIDs );
|
||||||
|
} else {
|
||||||
|
GameUtils.launchGame( m_activity, m_missingDictRowId );
|
||||||
|
}
|
||||||
m_missingDictRowId = DBUtils.ROWID_NOTFOUND;
|
m_missingDictRowId = DBUtils.ROWID_NOTFOUND;
|
||||||
|
m_missingDictMenuId = -1;
|
||||||
}
|
}
|
||||||
return madeGame;
|
return madeGame;
|
||||||
}
|
}
|
||||||
|
@ -1330,6 +1341,13 @@ public class GamesListDelegate extends ListDelegateBase
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void doConfirmReset( long[] rowIDs )
|
||||||
|
{
|
||||||
|
String msg = getString( R.string.confirm_reset_fmt, rowIDs.length );
|
||||||
|
showConfirmThen( msg, R.string.button_reset, Action.RESET_GAMES,
|
||||||
|
rowIDs );
|
||||||
|
}
|
||||||
|
|
||||||
private GameListAdapter makeNewAdapter()
|
private GameListAdapter makeNewAdapter()
|
||||||
{
|
{
|
||||||
ListView listview = getListView();
|
ListView listview = getListView();
|
||||||
|
|
Loading…
Reference in a new issue