# HG changeset patch # User marseille # Date 1240527318 -7200 # Node ID 6e008c3695ffe4737ec1eedee60cb1132191dd5d # Parent 72bfb4fe5815426f6f01321a2bd22d80a58a8ef1# Parent ff0f63e92986856a640f49446a9babe2c5d93f2b Modification de la liste de contact pour qu'elle se reconnecte comme il faut. diff -r 72bfb4fe5815 -r 6e008c3695ff AndroidManifest.xml --- a/AndroidManifest.xml Fri Apr 24 00:32:21 2009 +0200 +++ b/AndroidManifest.xml Fri Apr 24 00:55:18 2009 +0200 @@ -30,4 +30,5 @@ + diff -r 72bfb4fe5815 -r 6e008c3695ff src/com/beem/project/beem/BeemApplication.java --- a/src/com/beem/project/beem/BeemApplication.java Fri Apr 24 00:32:21 2009 +0200 +++ b/src/com/beem/project/beem/BeemApplication.java Fri Apr 24 00:55:18 2009 +0200 @@ -102,7 +102,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 72bfb4fe5815 -r 6e008c3695ff src/com/beem/project/beem/BeemService.java --- a/src/com/beem/project/beem/BeemService.java Fri Apr 24 00:32:21 2009 +0200 +++ b/src/com/beem/project/beem/BeemService.java Fri Apr 24 00:55:18 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 72bfb4fe5815 -r 6e008c3695ff src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Fri Apr 24 00:32:21 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Fri Apr 24 00:55:18 2009 +0200 @@ -65,6 +65,18 @@ mRosterListener = new BeemRosterListener(); mSettings = getSharedPreferences(getString(R.string.PreferenceFileName), MODE_PRIVATE); mBeemApplication.startBeemService(); + + // 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 + protected void onResume() { + super.onResume(); mBeemApplication.callWhenConnectedToServer(new Handler(), new Runnable() { @Override public void run() { @@ -147,22 +159,13 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == PREFERENCECHANGED) { if (resultCode == RESULT_OK) { - /* - List tmp = new ArrayList(); - tmp.add(""); - List tmpC = new ArrayList(); - tmpC.add(new Contact()); - showContactList(tmp, tmpC); - */ - setContentView(R.layout.changestatus); + setListAdapter(null); mBeemApplication.stopBeemService(); mBeemApplication.startBeemService(); - //callbackShowContactList(); } } } - private void showContactList(List listGroup, List listContact) { ExpandableListAdapter Adapter; List> groupData = new ArrayList>(); diff -r 72bfb4fe5815 -r 6e008c3695ff src/com/beem/project/beem/ui/ContactListSettings.java --- a/src/com/beem/project/beem/ui/ContactListSettings.java Fri Apr 24 00:32:21 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactListSettings.java Fri Apr 24 00:55:18 2009 +0200 @@ -103,8 +103,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)) { @@ -152,7 +152,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);