put up an alert when SMS game opened but SMS is disabled. (Does not

have a button taking you to settings.)
This commit is contained in:
Eric House 2012-07-25 07:15:57 -07:00
parent 6405294f2f
commit bc91956e20
3 changed files with 17 additions and 1 deletions

View file

@ -1986,4 +1986,8 @@
<string name="confirm_sms_unlimited">I have an unlimited texting plan</string>
<string name="confirm_sms_willpay">I will happily pay all charges</string>
<string name="warn_sms_disabled">SMS is currently disabled, so no
moves will be sent for this game. (If you want to enable SMS, go
to Settings->Network game settings.) </string>
</resources>

View file

@ -1640,6 +1640,7 @@ public class BoardActivity extends XWActivity
}
if ( null != m_xport ) {
warnIfNoTransport();
trySendChats();
removeNotifications();
m_xport.tickle( m_connType );
@ -1803,6 +1804,17 @@ public class BoardActivity extends XWActivity
}
}
private void warnIfNoTransport()
{
switch( m_connType ) {
case COMMS_CONN_SMS:
if ( XWApp.SMSSUPPORTED && !XWPrefs.getSMSEnabled( this ) ) {
showOKOnlyDialog( R.string.warn_sms_disabled );
}
break;
}
}
private void trySendChats()
{
if ( null != m_jniThread ) {

View file

@ -57,7 +57,7 @@ public class SMSCheckBoxPreference extends CheckBoxPreference {
public void setChecked( boolean checked )
{
if ( !checked || !m_attached ) {
super.setChecked( false );
super_setChecked( checked );
} else {
m_activity.showDialog( PrefsActivity.CONFIRM_SMS );
}