mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
Merge branch 'android_branch' into android_thumbnail
This commit is contained in:
commit
8bdde9765d
8 changed files with 21 additions and 101 deletions
|
@ -59,9 +59,6 @@
|
|||
<string name="board_menu_game_resend">Reenvia els missatges</string>
|
||||
<string name="board_menu_file_about">Quant al Crosswords</string>
|
||||
|
||||
<string name="gamel_menu_delete_all">Suprimeix-les totes</string>
|
||||
<!-- <string name="gamel_menu_view_hidden">Partides amagades</string> -->
|
||||
|
||||
<!-- returned by util_getUserString -->
|
||||
<string name="strd_robot_traded">El robot ha canviat %d fitxes en aquest torn.</string>
|
||||
<string name="str_robot_moved">El robot ha fet aquesta jugada:</string>
|
||||
|
|
|
@ -58,9 +58,6 @@
|
|||
<string name="board_menu_game_resend">Přeposlat zprávy</string>
|
||||
<string name="board_menu_file_about">O Crosswords</string>
|
||||
|
||||
<string name="gamel_menu_delete_all">Vymazat vše</string>
|
||||
<!-- <string name="gamel_menu_view_hidden">Hidden games</string> -->
|
||||
|
||||
<!-- returned by util_getUserString -->
|
||||
<string name="strd_robot_traded">Robot v tomto tahu vyměnil %d kamenů.</string>
|
||||
<string name="str_robot_moved">Robot provedl tento tah:</string>
|
||||
|
|
|
@ -107,9 +107,6 @@
|
|||
<string name="no_games_to_refresh">Nenhum jogo encontrado que conecta
|
||||
pelo servidor.</string>
|
||||
|
||||
<!-- Deletes all games on the device (after confirmation) -->
|
||||
<string name="gamel_menu_delete_all">Excluir todos</string>
|
||||
|
||||
<!-- Brings up "About Crosswords" dialog -->
|
||||
<string name="board_menu_file_about">Sobre Crosswords</string>
|
||||
|
||||
|
@ -160,11 +157,6 @@
|
|||
list_item_rename) -->
|
||||
<string name="rename_label">Mudar o nome desse jogo para:</string>
|
||||
|
||||
<!-- Text of confirmation dialog posted when list_item_delete menu is
|
||||
selected -->
|
||||
<string name="confirm_delete">Você tem certeza que quer excluir
|
||||
esse jogo?</string>
|
||||
|
||||
<!-- Text of confirmation dialog posted when list_item_reset menu
|
||||
is selected -->
|
||||
<string name="confirm_reset">Você tem certeza que quer reiniciar
|
||||
|
@ -916,14 +908,6 @@
|
|||
etc. -->
|
||||
<string name="game_summary_field_state">Estado do jogo</string>
|
||||
|
||||
<!-- The main screen, by default, has a "add game" button and some
|
||||
text at the top that take up space and are unnecessary for
|
||||
experienced users. This checkbox hides them. -->
|
||||
<string name="hide_intro">Esconder dicas da tela principal</string>
|
||||
<!-- clarification of above -->
|
||||
<string name="hide_intro_summary">São úteis somente quando você
|
||||
está começando...</string>
|
||||
|
||||
<!-- Checkbox that when set prevents showing a title bar in the
|
||||
game board window to save space -->
|
||||
<string name="hide_title">Esconder barra de título</string>
|
||||
|
@ -2141,7 +2125,6 @@
|
|||
lista de palavras?</string>
|
||||
<string name="button_decline">Recusar</string>
|
||||
|
||||
<string name="downloadingf">Baixando %s...</string>
|
||||
<string name="download_done">Download concluído</string>
|
||||
<string name="download_failed">Download falhou</string>
|
||||
|
||||
|
|
|
@ -57,9 +57,6 @@
|
|||
<string name="board_menu_game_resend">Preposlať správy</string>
|
||||
<string name="board_menu_file_about">O Crosswords</string>
|
||||
|
||||
<string name="gamel_menu_delete_all">Vymazať všetko</string>
|
||||
<!-- <string name="gamel_menu_view_hidden">Hidden games</string> -->
|
||||
|
||||
<!-- returned by util_getUserString -->
|
||||
<string name="strd_robot_traded">Robot v tomto ťahu vymenil %d kameňov.</string>
|
||||
<string name="str_robot_moved">Robot uskutočnil tento ťah:</string>
|
||||
|
|
|
@ -105,9 +105,6 @@
|
|||
<string name="no_games_to_refresh">No games found that connect via
|
||||
the relay.</string>
|
||||
|
||||
<!-- Deletes all games on the device (after confirmation) -->
|
||||
<string name="gamel_menu_delete_all">Delete all</string>
|
||||
|
||||
<!-- Brings up "About Crosswords" dialog -->
|
||||
<string name="board_menu_file_about">About Crosswords…</string>
|
||||
|
||||
|
@ -157,11 +154,6 @@
|
|||
list_item_rename) -->
|
||||
<string name="rename_label">Change the name of this game to:</string>
|
||||
|
||||
<!-- Text of confirmation dialog posted when list_item_delete menu is
|
||||
selected -->
|
||||
<string name="confirm_delete">Are you sure you want to delete this
|
||||
game?</string>
|
||||
|
||||
<string name="confirm_seldeletesf">Are you sure you want to delete
|
||||
the %d selected game[s]? This action cannot be undone.</string>
|
||||
|
||||
|
@ -905,14 +897,6 @@
|
|||
etc. -->
|
||||
<string name="game_summary_field_state">Game state</string>
|
||||
|
||||
<!-- The main screen, by default, has a "add game" button and some
|
||||
text at the top that take up space and are unnecessary for
|
||||
experienced users. This checkbox hides them. -->
|
||||
<string name="hide_intro">Hide main-page hint</string>
|
||||
<!-- clarification of above -->
|
||||
<string name="hide_intro_summary">It\'s useful only when you\'re
|
||||
starting out…</string>
|
||||
|
||||
<!-- Checkbox that when set prevents showing a title bar in the
|
||||
game board window to save space -->
|
||||
<string name="hide_title">Hide titlebar</string>
|
||||
|
@ -2107,7 +2091,6 @@
|
|||
wordlist?</string>
|
||||
<string name="button_decline">Decline</string>
|
||||
|
||||
<string name="downloadingf">Downloading %s…</string>
|
||||
<string name="download_done">Download finished</string>
|
||||
<string name="download_failed">Download unsuccessful</string>
|
||||
|
||||
|
|
|
@ -726,7 +726,6 @@ public class DBUtils {
|
|||
public static GameLock saveNewGame( Context context, byte[] bytes,
|
||||
long groupID )
|
||||
{
|
||||
Assert.assertTrue( -1 != groupID ); // DON'T SHIP
|
||||
GameLock lock = null;
|
||||
|
||||
initDB( context );
|
||||
|
@ -1051,33 +1050,6 @@ public class DBUtils {
|
|||
return result;
|
||||
}
|
||||
|
||||
public static Set<Long> getAllGames( Context context )
|
||||
{
|
||||
HashSet<Long> result = null;
|
||||
initDB( context );
|
||||
String[] columns = { ROW_ID };
|
||||
synchronized( s_dbHelper ) {
|
||||
SQLiteDatabase db = s_dbHelper.getReadableDatabase();
|
||||
Cursor cursor = db.query( DBHelper.TABLE_NAME_SUM, columns,
|
||||
null, // selection
|
||||
null, // args
|
||||
null, // groupBy
|
||||
null, // having
|
||||
null
|
||||
);
|
||||
int index = cursor.getColumnIndex( ROW_ID );
|
||||
result = new HashSet<Long>( cursor.getCount() );
|
||||
for ( int ii = 0; cursor.moveToNext(); ++ii ) {
|
||||
long rowid = cursor.getInt( index );
|
||||
result.add( rowid );
|
||||
}
|
||||
cursor.close();
|
||||
db.close();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static long getGroupForGame( Context context, long rowid )
|
||||
{
|
||||
long result = ROWID_NOTFOUND;
|
||||
|
|
|
@ -189,10 +189,6 @@ public class GameListAdapter implements ExpandableListAdapter {
|
|||
DBUtils.setGroupExpanded( m_context, groupid, false );
|
||||
|
||||
long[] rowids = DBUtils.getGroupGames( m_context, groupid );
|
||||
// HashSet<Long> asSet = new HashSet<Long>(rowids.length);
|
||||
// for ( long rowid : rowids ) {
|
||||
// asSet.add( rowid );
|
||||
// }
|
||||
deselectGames( rowids );
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ import android.widget.AdapterView.OnItemLongClickListener;
|
|||
import android.widget.AdapterView;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
// import android.widget.ExpandableListView.ExpandableListContextMenuInfo;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.ListView;
|
||||
|
@ -94,7 +93,7 @@ public class GamesList extends XWExpandableListActivity
|
|||
,CLEAR_SELS
|
||||
};
|
||||
|
||||
private static final int[] DEBUGITEMS = {
|
||||
private static final int[] DEBUG_ITEMS = {
|
||||
R.id.games_menu_loaddb,
|
||||
R.id.games_menu_storedb,
|
||||
R.id.games_menu_checkupdates,
|
||||
|
@ -665,24 +664,14 @@ public class GamesList extends XWExpandableListActivity
|
|||
if ( m_menuPrepared ) {
|
||||
boolean nothingSelected = 0 == (nGroupsSelected + nGamesSelected);
|
||||
|
||||
boolean visible = XWPrefs.getDebugEnabled( this );
|
||||
for ( int id : DEBUGITEMS ) {
|
||||
Utils.setItemVisible( menu, id, nothingSelected && visible );
|
||||
}
|
||||
boolean showDbg = XWPrefs.getDebugEnabled( this );
|
||||
showItemsIf( DEBUG_ITEMS, menu, nothingSelected && showDbg );
|
||||
Utils.setItemVisible( menu, R.id.games_menu_loaddb,
|
||||
showDbg && !DBUtils.gameDBExists( this ) );
|
||||
|
||||
if ( visible && !DBUtils.gameDBExists( this ) ) {
|
||||
Utils.setItemVisible( menu, R.id.games_menu_loaddb, false );
|
||||
}
|
||||
|
||||
for ( int id : NOSEL_ITEMS ) {
|
||||
Utils.setItemVisible( menu, id, nothingSelected );
|
||||
}
|
||||
for ( int id : ONEGAME_ITEMS ) {
|
||||
Utils.setItemVisible( menu, id, 1 == nGamesSelected );
|
||||
}
|
||||
for ( int id : ONEGROUP_ITEMS ) {
|
||||
Utils.setItemVisible( menu, id, 1 == nGroupsSelected );
|
||||
}
|
||||
showItemsIf( NOSEL_ITEMS, menu, nothingSelected );
|
||||
showItemsIf( ONEGAME_ITEMS, menu, 1 == nGamesSelected );
|
||||
showItemsIf( ONEGROUP_ITEMS, menu, 1 == nGroupsSelected );
|
||||
|
||||
int selGroupPos = -1;
|
||||
if ( 1 == nGroupsSelected ) {
|
||||
|
@ -701,9 +690,10 @@ public class GamesList extends XWExpandableListActivity
|
|||
|
||||
// Move up/down enabled for groups if not the top-most or bottommost
|
||||
// selected
|
||||
boolean enable = 0 < selGroupPos;
|
||||
Utils.setItemVisible( menu, R.id.games_group_moveup, enable );
|
||||
enable = 0 <= selGroupPos && selGroupPos + 1 < m_adapter.getGroupCount();
|
||||
Utils.setItemVisible( menu, R.id.games_group_moveup,
|
||||
0 < selGroupPos );
|
||||
boolean enable = 0 <= selGroupPos
|
||||
&& (selGroupPos + 1) < m_adapter.getGroupCount();
|
||||
Utils.setItemVisible( menu, R.id.games_group_movedown, enable );
|
||||
|
||||
// New game available when nothing selected or one group
|
||||
|
@ -716,7 +706,7 @@ public class GamesList extends XWExpandableListActivity
|
|||
Utils.setItemVisible( menu, R.id.games_group_delete,
|
||||
0 < nGroupsSelected );
|
||||
|
||||
// multiple games can be regrouped/reset. (Later....)
|
||||
// multiple games can be regrouped/reset.
|
||||
Utils.setItemVisible( menu, R.id.games_game_move,
|
||||
(1 < m_adapter.getGroupCount()
|
||||
&& 0 < nGamesSelected) );
|
||||
|
@ -759,8 +749,7 @@ public class GamesList extends XWExpandableListActivity
|
|||
break;
|
||||
|
||||
case R.id.games_game_config:
|
||||
long rowid = m_selGames.iterator().next();
|
||||
GameUtils.doConfig( this, rowid, GameConfig.class );
|
||||
GameUtils.doConfig( this, selRowIDs[0], GameConfig.class );
|
||||
break;
|
||||
|
||||
case R.id.games_menu_dicts:
|
||||
|
@ -1242,7 +1231,6 @@ public class GamesList extends XWExpandableListActivity
|
|||
if ( !m_gameLaunched ) {
|
||||
m_gameLaunched = true;
|
||||
GameUtils.launchGame( this, rowid, invited );
|
||||
// clearSelectedGames();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1323,6 +1311,13 @@ public class GamesList extends XWExpandableListActivity
|
|||
return result;
|
||||
}
|
||||
|
||||
private void showItemsIf( int[] items, Menu menu, boolean select )
|
||||
{
|
||||
for ( int item : items ) {
|
||||
Utils.setItemVisible( menu, item, select );
|
||||
}
|
||||
}
|
||||
|
||||
public static void onGameDictDownload( Context context, Intent intent )
|
||||
{
|
||||
intent.setClass( context, GamesList.class );
|
||||
|
|
Loading…
Add table
Reference in a new issue