# HG changeset patch # User Da Risk # Date 1240518740 -7200 # Node ID 52e96a8a743da9781f10192556197e148b0fb56e # Parent 2faf7174aa03fd10a193c357830a52fd77503586 correction d'un bug de status. Penser a decommenter le code dans ContactList pour fixer le bug diff -r 2faf7174aa03 -r 52e96a8a743d AndroidManifest.xml --- a/AndroidManifest.xml Thu Apr 23 17:18:49 2009 +0200 +++ b/AndroidManifest.xml Thu Apr 23 22:32:20 2009 +0200 @@ -30,4 +30,5 @@ + diff -r 2faf7174aa03 -r 52e96a8a743d src/com/beem/project/beem/BeemApplication.java --- a/src/com/beem/project/beem/BeemApplication.java Thu Apr 23 17:18:49 2009 +0200 +++ b/src/com/beem/project/beem/BeemApplication.java Thu Apr 23 22:32:20 2009 +0200 @@ -98,7 +98,7 @@ mBeemApp.mActivity = activity; mBeemApp.mProgressDialog = new ProgressDialog(activity); mBeemApp.mProgressDialog.setTitle("Beem"); - mBeemApp.mProgressDialog.setIcon(R.drawable.barthe_f); + mBeemApp.mProgressDialog.setIcon(R.drawable.signal); mBeemApp.mProgressDialog.setMessage("Connecting..."); mBeemApp.mApplicationContext = activity.getApplication(); mBeemApp.mPrivateResources = activity.getResources(); diff -r 2faf7174aa03 -r 52e96a8a743d src/com/beem/project/beem/BeemService.java --- a/src/com/beem/project/beem/BeemService.java Thu Apr 23 17:18:49 2009 +0200 +++ b/src/com/beem/project/beem/BeemService.java Thu Apr 23 22:32:20 2009 +0200 @@ -49,6 +49,7 @@ private String mLogin; private String mPassword; private String mHost; + private int mPort; private ConnectionConfiguration mConnectionConfiguration; private ProxyInfo mProxyInfo; private boolean mUseProxy; @@ -81,8 +82,10 @@ mLogin = mSettings.getString(getString(R.string.PreferenceLoginKey), ""); mPassword = mSettings.getString(getString(R.string.PreferencePasswordKey), ""); mHost = mSettings.getString(getString(R.string.PreferenceHostKey), ""); + mPort = mSettings.getInt(getString(R.string.PreferencePortKey), 5222); + // TODO penser a commenter - //mHost = "10.0.2.2"; + // mHost = "10.0.2.2"; initConnectionConfig(); mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); mConnection = new XmppConnectionAdapter(mConnectionConfiguration, mLogin, mPassword, this); @@ -136,9 +139,9 @@ int pport = mSettings.getInt(getString(R.string.PreferenceProxyPort), 1080); ProxyInfo.ProxyType type = ProxyType.valueOf(stype); mProxyInfo = new ProxyInfo(type, phost, pport, puser, ppass); - mConnectionConfiguration = new ConnectionConfiguration(mHost, mProxyInfo); + mConnectionConfiguration = new ConnectionConfiguration(mHost, mPort, mProxyInfo); } else { - mConnectionConfiguration = new ConnectionConfiguration(mHost); + mConnectionConfiguration = new ConnectionConfiguration(mHost, mPort); } mConnectionConfiguration.setDebuggerEnabled(false); mConnectionConfiguration.setSendPresence(true); diff -r 2faf7174aa03 -r 52e96a8a743d src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Thu Apr 23 17:18:49 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Thu Apr 23 22:32:20 2009 +0200 @@ -8,6 +8,7 @@ import android.app.ExpandableListActivity; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; @@ -81,6 +82,14 @@ callbackShowContactList(); } }); + + // bug fixe temporaire des betises de marseille + /* + SharedPreferences mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE); + SharedPreferences.Editor editor = mSettings.edit(); + editor.putInt(getString(R.string.PreferencePortKey), 5222); + editor.commit(); + */ } @Override @@ -181,10 +190,9 @@ childData.add(children); } - Adapter = new ContactExpandableListAdapter(this, groupData, R.layout.contactlistgroup, - new String[] { GROUP }, new int[] { R.id.textgroup }, childData, R.layout.contactlistcontact, - new String[] { CHILD }, new int[] { R.id.contactliststatus, R.id.contactlistpseudo, - R.id.contactlistmsgperso, R.id.contactlistavatar }); + Adapter = new ContactExpandableListAdapter(this, groupData, R.layout.contactlistgroup, new String[] { GROUP }, + new int[] { R.id.textgroup }, childData, R.layout.contactlistcontact, new String[] { CHILD }, new int[] { + R.id.contactliststatus, R.id.contactlistpseudo, R.id.contactlistmsgperso, R.id.contactlistavatar }); setListAdapter(Adapter); } diff -r 2faf7174aa03 -r 52e96a8a743d src/com/beem/project/beem/ui/ContactListSettings.java --- a/src/com/beem/project/beem/ui/ContactListSettings.java Thu Apr 23 17:18:49 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactListSettings.java Thu Apr 23 22:32:20 2009 +0200 @@ -100,8 +100,8 @@ editor.putString(getString(R.string.PreferenceHostKey), getWidgetText(R.id.host)); mIsChanged = true; } - if (isChanged(R.id.port, R.string.PreferencePortKey)) { - editor.putString(getString(R.string.PreferencePortKey), getWidgetText(R.id.port)); + if (Integer.parseInt(getWidgetText(R.id.port)) != mSettings.getInt(getString(R.string.PreferencePortKey), 5222) ) { + editor.putInt(getString(R.string.PreferencePortKey), Integer.parseInt(getWidgetText(R.id.port))); mIsChanged = true; } if (isChanged(R.id.userid, R.string.PreferenceLoginKey)) { @@ -147,7 +147,7 @@ EditText e = (EditText) findViewById(R.id.host); e.setText(getPreferenceString(R.string.PreferenceHostKey)); e = (EditText) findViewById(R.id.port); - e.setText(getPreferenceString(R.string.PreferencePortKey)); + e.setText(String.valueOf(mSettings.getInt(getString(R.string.PreferencePortKey), 1080))); e = (EditText) findViewById(R.id.userid); e.setText(getPreferenceString(R.string.PreferenceLoginKey)); e = (EditText) findViewById(R.id.password);