invalidate menu when board destroyed; shorten rematch name

GamesList menu was in a bad state after a game closed because hadn't
been rebuilt. It's simplest to invalidate it surgically, when the
BoardDelegate notifies that the board's closed, though doing in in
onWindowFocusChanged() might catch more edge cases. We'll see. I want a
low-risk impact right now.
This commit is contained in:
Eric House 2017-01-09 07:04:58 -08:00
parent 8c680b50f7
commit 084a45296e
5 changed files with 7 additions and 4 deletions

View file

@ -39,6 +39,7 @@
installing from F-Droid.)</li> installing from F-Droid.)</li>
<li>Stop mis-identifying tablets as data-SMS-capable (only GSM <li>Stop mis-identifying tablets as data-SMS-capable (only GSM
phones are)</li> phones are)</li>
<li>Shorten default rematch game name</li>
<li>Allow board &quot;squares&quot; to be wider than tall if it <li>Allow board &quot;squares&quot; to be wider than tall if it
fills the screen better</li> fills the screen better</li>
<li>Improvements in localization for French, Catalan, Dutch, <li>Improvements in localization for French, Catalan, Dutch,

View file

@ -2457,7 +2457,7 @@
<string name="new_game">New one-device game</string> <string name="new_game">New one-device game</string>
<string name="new_game_networked">New networked game</string> <string name="new_game_networked">New networked game</string>
<string name="rematch_name_fmt">Rematch: %1$s</string> <string name="rematch_name_fmt">%1$s</string>
<string name="new_game_message">Would you like to create this game <string name="new_game_message">Would you like to create this game
using default settings?\n\nOr would you like to configure it using default settings?\n\nOr would you like to configure it

View file

@ -2110,7 +2110,7 @@
<string name="title_addrs_pref">Etacinummoc aiv</string> <string name="title_addrs_pref">Etacinummoc aiv</string>
<string name="new_game">Wen ecived-eno emag</string> <string name="new_game">Wen ecived-eno emag</string>
<string name="new_game_networked">Wen dekrowten emag</string> <string name="new_game_networked">Wen dekrowten emag</string>
<string name="rematch_name_fmt">Hctamer: %1$s</string> <string name="rematch_name_fmt">%1$s</string>
<string name="new_game_message">Dluow uoy ekil ot etaerc siht emag <string name="new_game_message">Dluow uoy ekil ot etaerc siht emag
gnisu tluafed ?sgnittes\n\nRo dluow uoy ekil ot erugifnoc ti gnisu tluafed ?sgnittes\n\nRo dluow uoy ekil ot erugifnoc ti
?tsrif</string> ?tsrif</string>

View file

@ -2110,7 +2110,7 @@
<string name="title_addrs_pref">COMMUNICATE VIA</string> <string name="title_addrs_pref">COMMUNICATE VIA</string>
<string name="new_game">NEW ONE-DEVICE GAME</string> <string name="new_game">NEW ONE-DEVICE GAME</string>
<string name="new_game_networked">NEW NETWORKED GAME</string> <string name="new_game_networked">NEW NETWORKED GAME</string>
<string name="rematch_name_fmt">REMATCH: %1$s</string> <string name="rematch_name_fmt">%1$s</string>
<string name="new_game_message">WOULD YOU LIKE TO CREATE THIS GAME <string name="new_game_message">WOULD YOU LIKE TO CREATE THIS GAME
USING DEFAULT SETTINGS?\n\nOR WOULD YOU LIKE TO CONFIGURE IT USING DEFAULT SETTINGS?\n\nOR WOULD YOU LIKE TO CONFIGURE IT
FIRST?</string> FIRST?</string>

View file

@ -1083,7 +1083,7 @@ public class GamesListDelegate extends ListDelegateBase
if ( hasFocus ) { if ( hasFocus ) {
updateField(); updateField();
m_launchedGames.clear(); m_launchedGames.clear(); // This is probably wrong!!!
} }
} }
@ -2663,7 +2663,9 @@ public class GamesListDelegate extends ListDelegateBase
public static void boardDestroyed( long rowid ) public static void boardDestroyed( long rowid )
{ {
if ( null != s_self ) { if ( null != s_self ) {
// remove likely a no-op: launching clears the set, but shouldn't
s_self.m_launchedGames.remove( rowid ); s_self.m_launchedGames.remove( rowid );
s_self.invalidateOptionsMenuIf();
} }
} }