display names of groups to be deleted

This commit is contained in:
Eric House 2020-08-19 10:40:46 -07:00
parent f55796f845
commit 4d69366a82
9 changed files with 29 additions and 41 deletions

View file

@ -1,6 +1,6 @@
/* -*- compile-command: "find-and-gradle.sh inXw4dDeb"; -*- */
/*
* Copyright 2009 - 2019 by Eric House (xwords@eehouse.org). All rights
* Copyright 2009 - 2020 by Eric House (xwords@eehouse.org). All rights
* reserved.
*
* This program is free software; you can redistribute it and/or
@ -344,6 +344,22 @@ public class GamesListDelegate extends ListDelegateBase
return m_groupPositions;
}
String formatGroupNames( long[] groupIDs )
{
List<String> names = new ArrayList<>();
// Iterate in-order to produce strings in order
long[] inOrder = getGroupPositions();
for ( long id : inOrder ) {
for ( long inSet : groupIDs ) {
if ( id == inSet ) {
names.add( groupName( id ) );
break;
}
}
}
return TextUtils.join( ", ", names );
}
int getChildrenCount( long groupID )
{
GameGroupInfo ggi = DBUtils.getGroups( m_activity ).get( groupID );
@ -2045,8 +2061,9 @@ public class GamesListDelegate extends ListDelegateBase
makeOkOnlyBuilder( msg ).show();
} else {
Assert.assertTrue( 0 < groupIDs.length );
String names = m_adapter.formatGroupNames( groupIDs );
msg = getQuantityString( R.plurals.groups_confirm_del_fmt,
groupIDs.length, groupIDs.length );
groupIDs.length, names );
int nGames = 0;
for ( long tmp : groupIDs ) {

View file

@ -1956,14 +1956,16 @@
<string name="list_group_movedown">Move down</string>
<string name="group_cur_games">My games</string>
<string name="group_new_games">New games</string>
<!-- Shown to confirm deletion of one or more game-groups. Names
of the groups, joined by ", ", are substituted for %1$s. -->
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Are you sure you want to delete
the selected group?</item>
<item quantity="other">Are you sure you want to delete
the %1$d selected group[s]?</item>
<item quantity="one">Are you sure you want to delete
the group %1$s?</item>
<item quantity="other">Are you sure you want to delete
the groups %1$s?</item>
</plurals>
<plurals name="groups_confirm_del_games_fmt">
<item quantity="one">\n\n(one game will also be deleted.)</item>
<item quantity="one">\n\n(One game will also be deleted.)</item>
<item quantity="other">\n\n(%1$d games will also be
deleted.)</item>
</plurals>

View file

@ -454,10 +454,6 @@ Introduïu el vostre nom aquí. S\'usarà en crear partides noves. (Podreu
<string name="list_group_movedown">Mou avall</string>
<string name="group_cur_games">Partides</string>
<string name="group_new_games">Partides noves</string>
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Esteu segur de voler suprimir el grup seleccionat?</item>
<item quantity="other">Esteu segur de voler suprimir els %1$d grups seleccionats?</item>
</plurals>
<string name="rename_group_label">Canvia el nom d\'aquest grup a:</string>
<plurals name="group_name_fmt">
<item quantity="one">%1$s (%2$d partida)</item>

View file

@ -518,10 +518,6 @@
<string name="list_group_movedown">Nach unten verschieben</string>
<string name="group_cur_games">Meine Partien</string>
<string name="group_new_games">Neue Partien</string>
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Wollen Sie die ausgewählte Gruppe wirklich löschen?</item>
<item quantity="other">Wollen Sie die %1$d ausgewählten Gruppen wirklich löschen?</item>
</plurals>
<plurals name="groups_confirm_del_games_fmt">
<item quantity="one">"
\n

View file

@ -2257,14 +2257,7 @@ mots ?</string>
<string name="group_cur_games">Mes parties</string>
<!--<string name="group_new_games">New games</string>-->
<string name="group_new_games">Nouvelles parties</string>
<!--<string name="groups_confirm_del_fmt">Are you sure you want to delete
the %1$d selected group[s]?</string>-->
<!--<string name="groups_confirm_del_fmt">Êtes-vous sûr de vouloir effacer les
%1$d groupes sélectionnés ?</string>-->
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Êtes-vous sûr de vouloir supprimer le groupe sélectionné ?</item>
<item quantity="other">Êtes-vous sûr de vouloir supprimer les %1$d groupes sélectionnés ?</item>
</plurals>
<!--<string name="groups_confirm_del_games_fmt">\n\n(%1$d game[s] will
also be deleted.)</string>-->
<!--<string name="groups_confirm_del_games_fmt">\n\n(%1$d parties seront aussi

View file

@ -473,9 +473,7 @@
<string name="list_group_movedown">下に移動</string>
<string name="group_cur_games">マイ ゲーム</string>
<string name="group_new_games">新しいゲーム</string>
<plurals name="groups_confirm_del_fmt">
<item quantity="other">%1$d の選択したグループを削除してもよろしいですか\?</item>
</plurals>
<plurals name="groups_confirm_del_games_fmt">
<item quantity="other">"
\n

View file

@ -794,10 +794,6 @@
</plurals>
<string name="invite_dict_missing_body_fmt">%1$s har inviter deg til å spille CrossWords ved bruk av ordlisten %2$s (for spill i %3$s), men den er ikke installert. Ønsker du å laste ned ordlisten, eller avslå invitasjonen?</string>
<string name="invite_dict_missing_body_noname_fmt">Du har blitt invitert til å spille CrossWords ved bruk av ordlisten %2$s (for spill i %3$s), men den er ikke installert. Ønsker du å laste ned ordlisten?</string>
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Er du sikker på at du ønsker å slette valgt gruppe?</item>
<item quantity="other">Er du sikker på at du ønsker å slette %1$d valgt[e] gruppe[r]?</item>
</plurals>
<plurals name="groups_confirm_del_games_fmt">
<item quantity="one">"
\n

View file

@ -461,10 +461,6 @@
<string name="list_group_movedown">Beweeg omlaag</string>
<string name="group_cur_games">Mijn spellen</string>
<string name="group_new_games">Nieuwe spellen</string>
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Weet je zeker dat je de geselecteerde groep wilt verwijderen?</item>
<item quantity="other">Weet je zeker dat je de %1$d geselecteerde groepen wilt verwijderen?</item>
</plurals>
<plurals name="groups_confirm_del_games_fmt">
<item quantity="one">\n\n(een spel zal ook verwijderd worden.)</item>
<item quantity="other">\n\n(%1$d spellen zullen ook verwijderd worden.)</item>

View file

@ -988,15 +988,9 @@
<string name="pause_notify_fmt">Gracz %1$s zatrzymał tę grę.</string>
<string name="pause_expl_hint">Czemu to robię</string>
<string name="game_unpaused_title">Gra odpauzowana</string>
<plurals name="groups_confirm_del_fmt">
<item quantity="one">Czy jesteś pewien, że chcesz usunąć wybraną grupę\?</item>
<item quantity="few">Czy jesteś pewien, że chcesz usunąć %1$d wybrane grupy\?</item>
<item quantity="many">Czy jesteś pewien, że chcesz usunąć %1$d wybranych grup\?</item>
<item quantity="other">Czy jesteś pewien, że chcesz usunąć %1$d wybranych grup\?</item>
</plurals>
<string name="bonus_w3x_summary">3W</string>
<string name="bonus_l3x_summary">3L</string>
<string name="bonus_w2x_summary">2W</string>
<string name="bonus_l2x_summary">2L</string>
<string name="use_duptimer">Włącz licznik na ruch</string>
</resources>
</resources>