mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
pass the wordlist name too
This commit is contained in:
parent
10f509ea1f
commit
54efffa635
9 changed files with 24 additions and 15 deletions
|
@ -1862,12 +1862,14 @@ public class BoardDelegate extends DelegateBase
|
|||
}
|
||||
|
||||
@Override
|
||||
public void informWordBlocked( final String word )
|
||||
public void informWordBlocked( final String word, final String dict )
|
||||
{
|
||||
runOnUiThread( new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String msg = String.format( "Word \"%s\" blocked", word );
|
||||
String msg = LocUtils
|
||||
.getString( m_activity, R.string.word_blocked_by_phony,
|
||||
word, dict );
|
||||
makeOkOnlyBuilder( msg ).show();
|
||||
}
|
||||
} );
|
||||
|
|
|
@ -62,7 +62,7 @@ public interface UtilCtxt {
|
|||
void remSelected();
|
||||
void timerSelected( boolean inDuplicateMode, boolean canPause );
|
||||
void setIsServer( boolean isServer );
|
||||
void informWordBlocked( String word );
|
||||
void informWordBlocked( String word, String dict );
|
||||
|
||||
void bonusSquareHeld( int bonus );
|
||||
void playerScoreHeld( int player );
|
||||
|
|
|
@ -107,7 +107,7 @@ public class UtilCtxtImpl implements UtilCtxt {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void informWordBlocked( String word )
|
||||
public void informWordBlocked( String word, String dict )
|
||||
{
|
||||
subclassOverride( "informWordBlocked" );
|
||||
}
|
||||
|
|
|
@ -2527,6 +2527,8 @@
|
|||
another crash. Do you want to open it anyway?</string>
|
||||
<string name="unsafe_open_disregard">Open anyway</string>
|
||||
|
||||
<string name="word_blocked_by_phony">Word %1$s not found in wordlist %2$s</string>
|
||||
|
||||
<string name="gamel_menu_logs">Debug logs</string>
|
||||
<!-- Debug-build-only menu to turn on saving of logs -->
|
||||
<string name="gamel_menu_logstore_on">Enable log storage</string>
|
||||
|
|
|
@ -707,12 +707,13 @@ and_util_setIsServer( XW_UtilCtxt* uc, XP_Bool isServer )
|
|||
}
|
||||
|
||||
static void
|
||||
and_util_informWordBlocked( XW_UtilCtxt* uc, const XP_UCHAR* word )
|
||||
and_util_informWordBlocked( XW_UtilCtxt* uc, const XP_UCHAR* word, const XP_UCHAR* dict )
|
||||
{
|
||||
UTIL_CBK_HEADER( "informWordBlocked", "(Ljava/lang/String;)V" );
|
||||
UTIL_CBK_HEADER( "informWordBlocked", "(Ljava/lang/String;Ljava/lang/String;)V" );
|
||||
jstring jword = (*env)->NewStringUTF( env, word );
|
||||
(*env)->CallVoidMethod( env, util->jutil, mid, jword );
|
||||
deleteLocalRef( env, jword );
|
||||
jstring jdict = (*env)->NewStringUTF( env, dict );
|
||||
(*env)->CallVoidMethod( env, util->jutil, mid, jword, jdict );
|
||||
deleteLocalRefs( env, jword, DELETE_NO_REF );
|
||||
UTIL_CBK_TAIL();
|
||||
}
|
||||
|
||||
|
|
|
@ -282,7 +282,8 @@ checkScoreMove( ModelCtxt* model, XP_S16 turn, EngineCtxt* engine,
|
|||
engine, stream, notifyInfo );
|
||||
if ( checkDict && '\0' != bcs.word[0] ) {
|
||||
if ( !silent ) {
|
||||
util_informWordBlocked( model->vol.util, bcs.word );
|
||||
DictionaryCtxt* dict = model_getPlayerDict( model, turn );
|
||||
util_informWordBlocked( model->vol.util, bcs.word, dict_getName( dict ) );
|
||||
}
|
||||
} else {
|
||||
score = tmpScore;
|
||||
|
|
|
@ -173,7 +173,8 @@ typedef struct UtilVtable {
|
|||
void (*m_util_setIsServer)(XW_UtilCtxt* uc, XP_Bool isServer );
|
||||
#endif
|
||||
|
||||
void (*m_util_informWordBlocked)( XW_UtilCtxt* uc, const XP_UCHAR* word );
|
||||
void (*m_util_informWordBlocked)( XW_UtilCtxt* uc, const XP_UCHAR* word,
|
||||
const XP_UCHAR* dictName );
|
||||
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
XP_Bool (*m_util_getTraySearchLimits)(XW_UtilCtxt* uc,
|
||||
|
@ -310,7 +311,8 @@ struct XW_UtilCtxt {
|
|||
# define util_addrChange( uc, addro, addrn )
|
||||
#endif
|
||||
|
||||
#define util_informWordBlocked(uc, w) (uc)->vtable->m_util_informWordBlocked( (uc), (w) )
|
||||
#define util_informWordBlocked(uc, w, d) \
|
||||
(uc)->vtable->m_util_informWordBlocked( (uc), (w), (d) )
|
||||
|
||||
#ifdef XWFEATURE_SEARCHLIMIT
|
||||
#define util_getTraySearchLimits(uc,min,max) \
|
||||
|
|
|
@ -1051,9 +1051,10 @@ curses_util_cellSquareHeld( XW_UtilCtxt* uc, XWStreamCtxt* words )
|
|||
|
||||
static void
|
||||
curses_util_informWordBlocked( XW_UtilCtxt* XP_UNUSED(uc),
|
||||
const XP_UCHAR* XP_UNUSED_DBG(word) )
|
||||
const XP_UCHAR* XP_UNUSED_DBG(word),
|
||||
const XP_UCHAR* XP_UNUSED_DBG(dict) )
|
||||
{
|
||||
XP_LOGFF( "(word=%s)", word );
|
||||
XP_LOGFF( "(word=%s, dict=%s)", word, dict );
|
||||
}
|
||||
|
||||
#ifndef XWFEATURE_STANDALONE_ONLY
|
||||
|
|
|
@ -1998,10 +1998,10 @@ gtk_util_cellSquareHeld( XW_UtilCtxt* uc, XWStreamCtxt* words )
|
|||
#endif
|
||||
|
||||
static void
|
||||
gtk_util_informWordBlocked( XW_UtilCtxt* uc, const XP_UCHAR* word )
|
||||
gtk_util_informWordBlocked( XW_UtilCtxt* uc, const XP_UCHAR* word, const XP_UCHAR* dict )
|
||||
{
|
||||
GtkGameGlobals* globals = (GtkGameGlobals*)uc->closure;
|
||||
gchar* msg = g_strdup_printf( "Word \"%s\" blocked by phonies setting", word );
|
||||
gchar* msg = g_strdup_printf( "Word \"%s\" not found in %s", word, dict );
|
||||
gtkUserError( globals, msg );
|
||||
g_free( msg );
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue