mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-02 06:20:14 +01:00
implement new check-relay menu, and use new task to check for messages
if there are any connected games.
This commit is contained in:
parent
4a5c0832d4
commit
1fecf9dbb4
1 changed files with 23 additions and 2 deletions
|
@ -47,7 +47,8 @@ import junit.framework.Assert;
|
||||||
import org.eehouse.android.xw4.jni.*;
|
import org.eehouse.android.xw4.jni.*;
|
||||||
|
|
||||||
public class GamesList extends XWListActivity
|
public class GamesList extends XWListActivity
|
||||||
implements DispatchNotify.HandleRelaysIface {
|
implements DispatchNotify.HandleRelaysIface,
|
||||||
|
RefreshMsgsTask.RefreshMsgsIface {
|
||||||
|
|
||||||
private static final int WARN_NODICT = Utils.DIALOG_LAST + 1;
|
private static final int WARN_NODICT = Utils.DIALOG_LAST + 1;
|
||||||
private static final int CONFIRM_DELETE_ALL = Utils.DIALOG_LAST + 2;
|
private static final int CONFIRM_DELETE_ALL = Utils.DIALOG_LAST + 2;
|
||||||
|
@ -57,6 +58,8 @@ public class GamesList extends XWListActivity
|
||||||
private String m_missingDict;
|
private String m_missingDict;
|
||||||
private Handler m_handler;
|
private Handler m_handler;
|
||||||
|
|
||||||
|
private Object[] m_dlgObjects = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Dialog onCreateDialog( int id )
|
protected Dialog onCreateDialog( int id )
|
||||||
{
|
{
|
||||||
|
@ -96,7 +99,7 @@ public class GamesList extends XWListActivity
|
||||||
.create();
|
.create();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
dialog = Utils.onCreateDialog( this, id );
|
dialog = Utils.onCreateDialog( this, id, m_dlgObjects );
|
||||||
}
|
}
|
||||||
return dialog;
|
return dialog;
|
||||||
}
|
}
|
||||||
|
@ -179,6 +182,12 @@ public class GamesList extends XWListActivity
|
||||||
} );
|
} );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// RefreshMsgsTask.RefreshMsgsIface interface
|
||||||
|
public void RefreshMsgsResults( String[] relayIDs )
|
||||||
|
{
|
||||||
|
HandleRelaysIDs( relayIDs );
|
||||||
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
// protected void onNewIntent( Intent intent )
|
// protected void onNewIntent( Intent intent )
|
||||||
// {
|
// {
|
||||||
|
@ -251,12 +260,24 @@ public class GamesList extends XWListActivity
|
||||||
startActivity( intent );
|
startActivity( intent );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case R.id.gamel_menu_checkmoves:
|
||||||
|
if ( null == DBUtils.getRelayIDNoMsgs( this ) ) {
|
||||||
|
m_dlgObjects = new Object[] {
|
||||||
|
new Integer(R.string.no_games_to_refresh)
|
||||||
|
};
|
||||||
|
showDialog( Utils.DIALOG_OKONLY );
|
||||||
|
} else {
|
||||||
|
new RefreshMsgsTask( this, this ).execute();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case R.id.gamel_menu_prefs:
|
case R.id.gamel_menu_prefs:
|
||||||
intent = new Intent( this, PrefsActivity.class );
|
intent = new Intent( this, PrefsActivity.class );
|
||||||
startActivity( intent );
|
startActivity( intent );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.gamel_menu_about:
|
case R.id.gamel_menu_about:
|
||||||
|
m_dlgObjects = null;
|
||||||
showDialog( Utils.DIALOG_ABOUT );
|
showDialog( Utils.DIALOG_ABOUT );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue