mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
print all conn types, not just the first
This commit is contained in:
parent
11f7083eb6
commit
f14a1c095f
1 changed files with 34 additions and 51 deletions
|
@ -175,19 +175,20 @@ public class ConnStatusHandler {
|
||||||
msg = LocUtils.getString( context, R.string.connstat_nonet );
|
msg = LocUtils.getString( context, R.string.connstat_nonet );
|
||||||
} else {
|
} else {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
|
String tmp;
|
||||||
synchronized( s_lockObj ) {
|
synchronized( s_lockObj ) {
|
||||||
CommsConnType connType = connTypes.iterator().next();
|
|
||||||
String tmp = LocUtils.getString( context, connType2StrID( connType ) );
|
|
||||||
sb.append( LocUtils.getString( context,
|
sb.append( LocUtils.getString( context,
|
||||||
R.string.connstat_net_fmt,
|
R.string.connstat_net_fmt,
|
||||||
tmp ) );
|
connTypes.toString( context )));
|
||||||
sb.append("\n\n");
|
for ( CommsConnType typ : connTypes.getTypes() ) {
|
||||||
|
sb.append( String.format( "\n\n*** %s ***\n",
|
||||||
SuccessRecord record = recordFor( connType, false );
|
typ.longName( context ) ) );
|
||||||
|
SuccessRecord record = recordFor( typ, false );
|
||||||
tmp = LocUtils.getString( context, record.successNewer?
|
tmp = LocUtils.getString( context, record.successNewer?
|
||||||
R.string.connstat_succ :
|
R.string.connstat_succ :
|
||||||
R.string.connstat_unsucc );
|
R.string.connstat_unsucc );
|
||||||
sb.append( LocUtils.getString( context, R.string.connstat_lastsend_fmt,
|
sb.append( LocUtils
|
||||||
|
.getString( context, R.string.connstat_lastsend_fmt,
|
||||||
tmp, record.newerStr( context ) ) );
|
tmp, record.newerStr( context ) ) );
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
|
|
||||||
|
@ -203,11 +204,11 @@ public class ConnStatusHandler {
|
||||||
}
|
}
|
||||||
if ( 0 != fmtId ) {
|
if ( 0 != fmtId ) {
|
||||||
sb.append( LocUtils.getString( context, fmtId,
|
sb.append( LocUtils.getString( context, fmtId,
|
||||||
record.olderStr( context ) ) );
|
record.olderStr( context )));
|
||||||
}
|
}
|
||||||
sb.append( "\n\n" );
|
sb.append( "\n\n" );
|
||||||
|
|
||||||
record = recordFor( connType, true );
|
record = recordFor( typ, true );
|
||||||
if ( record.haveSuccess() ) {
|
if ( record.haveSuccess() ) {
|
||||||
sb.append( LocUtils.getString( context,
|
sb.append( LocUtils.getString( context,
|
||||||
R.string.connstat_lastreceipt_fmt,
|
R.string.connstat_lastreceipt_fmt,
|
||||||
|
@ -216,6 +217,7 @@ public class ConnStatusHandler {
|
||||||
sb.append( LocUtils.getString( context, R.string.connstat_noreceipt) );
|
sb.append( LocUtils.getString( context, R.string.connstat_noreceipt) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
msg = sb.toString();
|
msg = sb.toString();
|
||||||
}
|
}
|
||||||
return msg;
|
return msg;
|
||||||
|
@ -449,25 +451,6 @@ public class ConnStatusHandler {
|
||||||
icon.draw( canvas );
|
icon.draw( canvas );
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int connType2StrID( CommsConnType connType )
|
|
||||||
{
|
|
||||||
int resID = 0;
|
|
||||||
switch( connType ) {
|
|
||||||
case COMMS_CONN_RELAY:
|
|
||||||
resID = R.string.connstat_relay;
|
|
||||||
break;
|
|
||||||
case COMMS_CONN_SMS:
|
|
||||||
resID = R.string.connstat_sms;
|
|
||||||
break;
|
|
||||||
case COMMS_CONN_BT:
|
|
||||||
resID = R.string.invite_choice_bt;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Assert.fail();
|
|
||||||
}
|
|
||||||
return resID;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static SuccessRecord recordFor( CommsConnType connType, boolean isIn )
|
private static SuccessRecord recordFor( CommsConnType connType, boolean isIn )
|
||||||
{
|
{
|
||||||
SuccessRecord[] records = s_records.get(connType);
|
SuccessRecord[] records = s_records.get(connType);
|
||||||
|
|
Loading…
Add table
Reference in a new issue