mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-30 10:26:58 +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.*;
|
||||
|
||||
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 CONFIRM_DELETE_ALL = Utils.DIALOG_LAST + 2;
|
||||
|
@ -57,6 +58,8 @@ public class GamesList extends XWListActivity
|
|||
private String m_missingDict;
|
||||
private Handler m_handler;
|
||||
|
||||
private Object[] m_dlgObjects = null;
|
||||
|
||||
@Override
|
||||
protected Dialog onCreateDialog( int id )
|
||||
{
|
||||
|
@ -96,7 +99,7 @@ public class GamesList extends XWListActivity
|
|||
.create();
|
||||
break;
|
||||
default:
|
||||
dialog = Utils.onCreateDialog( this, id );
|
||||
dialog = Utils.onCreateDialog( this, id, m_dlgObjects );
|
||||
}
|
||||
return dialog;
|
||||
}
|
||||
|
@ -179,6 +182,12 @@ public class GamesList extends XWListActivity
|
|||
} );
|
||||
}
|
||||
|
||||
// RefreshMsgsTask.RefreshMsgsIface interface
|
||||
public void RefreshMsgsResults( String[] relayIDs )
|
||||
{
|
||||
HandleRelaysIDs( relayIDs );
|
||||
}
|
||||
|
||||
// @Override
|
||||
// protected void onNewIntent( Intent intent )
|
||||
// {
|
||||
|
@ -251,12 +260,24 @@ public class GamesList extends XWListActivity
|
|||
startActivity( intent );
|
||||
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:
|
||||
intent = new Intent( this, PrefsActivity.class );
|
||||
startActivity( intent );
|
||||
break;
|
||||
|
||||
case R.id.gamel_menu_about:
|
||||
m_dlgObjects = null;
|
||||
showDialog( Utils.DIALOG_ABOUT );
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue