# HG changeset patch # User dasilvj # Date 1256308019 -7200 # Node ID 04e6c855e58ebcdd90dce3a42fbb236cb553a207 # Parent c689a113b9f8d40c0ead04207f6209d7d52c21cb# Parent cdfe45072e7daa43211521b8af1824da85091ade Merge diff -r c689a113b9f8 -r 04e6c855e58e .classpath --- a/.classpath Fri Oct 23 16:24:42 2009 +0200 +++ b/.classpath Fri Oct 23 16:26:59 2009 +0200 @@ -1,29 +1,29 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c689a113b9f8 -r 04e6c855e58e AndroidManifest.xml --- a/AndroidManifest.xml Fri Oct 23 16:24:42 2009 +0200 +++ b/AndroidManifest.xml Fri Oct 23 16:26:59 2009 +0200 @@ -87,6 +87,6 @@ - + diff -r c689a113b9f8 -r 04e6c855e58e res/layout/changestatus.xml --- a/res/layout/changestatus.xml Fri Oct 23 16:24:42 2009 +0200 +++ b/res/layout/changestatus.xml Fri Oct 23 16:26:59 2009 +0200 @@ -13,8 +13,7 @@ android:textColor="@color/blue_sky" /> + android:layout_width="fill_parent" android:layout_height="wrap_content"/> diff -r c689a113b9f8 -r 04e6c855e58e res/layout/jingle_call_activity.xml --- a/res/layout/jingle_call_activity.xml Fri Oct 23 16:24:42 2009 +0200 +++ b/res/layout/jingle_call_activity.xml Fri Oct 23 16:26:59 2009 +0200 @@ -1,6 +1,6 @@ diff -r c689a113b9f8 -r 04e6c855e58e res/values-en/strings.xml --- a/res/values-en/strings.xml Fri Oct 23 16:24:42 2009 +0200 +++ b/res/values-en/strings.xml Fri Oct 23 16:26:59 2009 +0200 @@ -48,6 +48,7 @@ Error Contact not added Error Login Bad form + Contact already exist Beem - Chat @@ -86,7 +87,7 @@ Optional, allow to authenticate yourself on the proxy server Optional, allow to authenticate yourself on the proxy server Advanced option - Use specific proxy specific option + Use advanced option Check this box if you want to use different option for your connection Allow to edit the server address Allow to edit the server port @@ -240,4 +241,4 @@ No Are you sure you want to resend invit? - + \ No newline at end of file diff -r c689a113b9f8 -r 04e6c855e58e res/values-fr/strings.xml --- a/res/values-fr/strings.xml Fri Oct 23 16:24:42 2009 +0200 +++ b/res/values-fr/strings.xml Fri Oct 23 16:26:59 2009 +0200 @@ -1,7 +1,7 @@ Beem - Ok + Valider Annuler Accepter Refuser @@ -35,7 +35,7 @@ Chat - Appeller + Appeler Gestion utilisateur @@ -45,9 +45,10 @@ Groupe : Ok Contact ajouté - Erreur Contact pas ajouté + Erreur Contact non ajouté Error Nom d\'utilisateur Mauvais formulaire + Contact déjà ajouté Beem - Chat @@ -59,7 +60,7 @@ Erreur : %s\n et est entrain de parler depuis : Insérer un sourire - nom d'uilisateur + nom d\'utilisateur Aucun statut défini @@ -67,7 +68,7 @@ Beem - Changer statut Ajouter un nouveau contact Beem Project - Créé un compte + Créer un compte Modifier compte Mise à jour du statut Rien à changer @@ -92,9 +93,9 @@ Permet d'éditer le port du serveur - Abonnement accepté - Erreur d\'abonnement - Abonnement refusé + Inscription accepté + Erreur d\'inscription + Inscription refusé Vous avez une requête d\'ajout de la part de %s. Souhaitez-vous l\'accepter ? @@ -145,8 +146,8 @@ Fermer Créer un compte Paramètres - À propos - À propos + A propos + A propos BEEM est un EPITECH Innovative Project. Rencontrez nous sur http://www.beem-project.com ! @@ -209,12 +210,12 @@ Créer un compte - Erreur Changer mes paramètres Fermer - a été créé avec succès + A été créé avec succès Mauvais JabberID Les mots de passe ne correspondent pas Nom d\'utilisateur Mot de passe - Confirmer le mot de passe + Confirmation du mot de passe Alias Modifier groupe - Renvoyer l'invitation + Renvoyer l\'invitation Bloquer Supprimer Souscription réenvoyée - Etes vous sur de vouloir supprimer ce contact? + Etes vous sûr de vouloir supprimer ce contact? Oui Non - Etes vous sur de vouloir renvoyer l'invitation? + Etes vous sûr de vouloir renvoyer l'invitation? diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/jingle/demo/JingleCallActivity.java --- a/src/com/beem/project/beem/jingle/demo/JingleCallActivity.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/jingle/demo/JingleCallActivity.java Fri Oct 23 16:26:59 2009 +0200 @@ -47,8 +47,8 @@ java.security.Security.addProvider(new com.sun.security.sasl.Provider()); super.onCreate(savedInstanceState); setContentView(R.layout.jingle_call_activity); - // localhost mConf = new ConnectionConfiguration("10.0.2.2", 5222); - mConf = new ConnectionConfiguration("elyzion.net", DEFAULT_XMPP_PORT); + mConf = new ConnectionConfiguration("10.0.2.2", 5222); + //mConf = new ConnectionConfiguration("elyzion.net", DEFAULT_XMPP_PORT); mConf.setSecurityMode(SecurityMode.required); mEdJID = (EditText) findViewById(R.id.jingledemocalljid); mEdPassword = (EditText) findViewById(R.id.jingledemocallpassword); diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/service/RosterAdapter.java --- a/src/com/beem/project/beem/service/RosterAdapter.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/service/RosterAdapter.java Fri Oct 23 16:26:59 2009 +0200 @@ -101,7 +101,6 @@ try { mAdaptee.createGroup(groupname); } catch (IllegalArgumentException e) { - // pas grave, plus simple a gerer comme ca. Log.e(TAG, "Error while creating group", e); } } diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/ui/AddContact.java --- a/src/com/beem/project/beem/ui/AddContact.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/ui/AddContact.java Fri Oct 23 16:26:59 2009 +0200 @@ -136,10 +136,16 @@ if (mXmppFacade != null) { if (mXmppFacade.getRoster().getContact(login) != null) mGroup.addAll(mXmppFacade.getRoster().getContact(login).getGroups()); + if (mXmppFacade.getRoster().getContact(login) != null) { + Toast.makeText(AddContact.this, getString(R.string.AddCContactAlready), Toast.LENGTH_SHORT) + .show(); + return; + } if (mXmppFacade.getRoster().addContact(login, alias, mGroup.toArray(new String[mGroup.size()])) == null) { Toast.makeText(AddContact.this, getString(R.string.AddCContactAddedError), Toast.LENGTH_SHORT) .show(); return; + } else { Toast.makeText(AddContact.this, getString(R.string.AddCContactAdded), Toast.LENGTH_SHORT) .show(); diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/ui/ChangeStatus.java --- a/src/com/beem/project/beem/ui/ChangeStatus.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/ui/ChangeStatus.java Fri Oct 23 16:26:59 2009 +0200 @@ -10,6 +10,8 @@ import android.os.Bundle; import android.os.IBinder; import android.os.RemoteException; +import android.preference.PreferenceManager; +import android.util.Log; import android.view.View; import android.view.View.OnClickListener; import android.widget.ArrayAdapter; @@ -55,12 +57,60 @@ private BeemBroadcastReceiver mReceiver; /** - * constructor. + * Constructor. */ public ChangeStatus() { } /** + * {@inheritDoc} + */ + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + setContentView(R.layout.changestatus); + mStatusText = (TextView) findViewById(R.id.ChangeStatusText); + mOk = (Button) findViewById(R.id.ChangeStatusOk); + mClear = (Button) findViewById(R.id.ChangeStatusClear); + mOk.setOnClickListener(mOnClickOk); + mClear.setOnClickListener(mOnClickOk); + mSettings = PreferenceManager.getDefaultSharedPreferences(this); + + mSpinner = (Spinner) findViewById(R.id.ChangeStatusSpinner); + mAdapter = ArrayAdapter.createFromResource(this, R.array.status_types, android.R.layout.simple_spinner_item); + mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + mSpinner.setAdapter(mAdapter); + mToast = Toast.makeText(this, R.string.ChangeStatusOk, Toast.LENGTH_LONG); + mReceiver = new BeemBroadcastReceiver(mServConn); + mStatusText.setText(getPreferenceString(R.string.PreferenceStatusText)); + mSpinner.setSelection(getPreferenceStatusIndex()); + } + + /** + * {@inheritDoc} + */ + @Override + protected void onResume() { + super.onResume(); + bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE); + mReceiver.setBinded(); + this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED)); + } + + /** + * {@inheritDoc} + */ + @Override + protected void onPause() { + super.onPause(); + Log.d("TAG", "pause"); + this.unregisterReceiver(mReceiver); + if (mReceiver.isBinded()) + unbindService(mServConn); + } + + /** * Return the status index from status the settings. * @return the status index from status the settings. */ @@ -101,52 +151,8 @@ } } - /** - * {@inheritDoc} - */ - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - - setContentView(R.layout.changestatus); - mStatusText = (TextView) findViewById(R.id.ChangeStatusText); - mOk = (Button) findViewById(R.id.ChangeStatusOk); - mClear = (Button) findViewById(R.id.ChangeStatusClear); - mOk.setOnClickListener(mOnClickOk); - mClear.setOnClickListener(mOnClickOk); - mSettings = getSharedPreferences(getString(R.string.settings_filename), MODE_PRIVATE); - mSpinner = (Spinner) findViewById(R.id.ChangeStatusSpinner); - mAdapter = ArrayAdapter.createFromResource(this, R.array.status_types, android.R.layout.simple_spinner_item); - mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); - mSpinner.setAdapter(mAdapter); - mToast = Toast.makeText(this, R.string.ChangeStatusOk, Toast.LENGTH_LONG); - mReceiver = new BeemBroadcastReceiver(mServConn); - mStatusText.setText(getPreferenceString(R.string.PreferenceStatusText)); - mSpinner.setSelection(getPreferenceStatusIndex()); - } - /** - * {@inheritDoc} - */ - @Override - protected void onResume() { - super.onResume(); - bindService(new Intent(this, BeemService.class), mServConn, BIND_AUTO_CREATE); - mReceiver.setBinded(); - this.registerReceiver(mReceiver, new IntentFilter(BeemBroadcastReceiver.BEEM_CONNECTION_CLOSED)); - } - - /** - * {@inheritDoc} - */ - @Override - protected void onPause() { - super.onPause(); - this.unregisterReceiver(mReceiver); - if (mReceiver.isBinded()) - unbindService(mServConn); - } /** * connection to service. @@ -202,6 +208,7 @@ edit.commit(); if (status == Status.CONTACT_STATUS_DISCONNECT) { stopService(new Intent(ChangeStatus.this, BeemService.class)); + startActivity(new Intent(ChangeStatus.this, Login.class)); } else { try { mXmppFacade.changeStatus(status, msg.toString()); diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/ui/ContactDialog.java --- a/src/com/beem/project/beem/ui/ContactDialog.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactDialog.java Fri Oct 23 16:26:59 2009 +0200 @@ -9,6 +9,7 @@ import android.content.ServiceConnection; import android.os.IBinder; import android.os.RemoteException; +import android.util.Log; import android.view.View; import android.widget.Button; @@ -76,7 +77,7 @@ try { // TODO permettre a l'user de choisir a quel ressource il veut // faire le call. - mXmppFacade.call(mContact.getJID() + "/BEEM"); + mXmppFacade.call(mContact.getJID() + "/psi"); } catch (RemoteException e) { e.printStackTrace(); } @@ -120,6 +121,7 @@ public void onClick(View v) { Activity a = ContactDialog.this.getOwnerActivity(); Intent i = new Intent(mContext, UserInfo.class); + Log.i("OOO", mContact.getJID()); i.putExtra("contact_contactdialog", mContact.getJID()); a.startActivity(i); dismiss(); diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/ui/ContactList.java --- a/src/com/beem/project/beem/ui/ContactList.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/ui/ContactList.java Fri Oct 23 16:26:59 2009 +0200 @@ -23,7 +23,6 @@ import android.os.Handler; import android.os.IBinder; import android.os.RemoteException; -import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuInflater; @@ -169,7 +168,6 @@ */ @Override protected void onStop() { - Log.d("CONTACTLIST", "onStop"); super.onStop(); if (mReceiver.isBinded()) unbindService(mServConn); @@ -366,7 +364,7 @@ mContactOnGroup.put(group, tmplist); } mContactOnGroup.get(group).add(c); - if (group.equals(mCurGroup)) + if (group.equals(mCurGroup) && !mListContact.contains(c)) mListContact.add(c); } } @@ -402,6 +400,14 @@ */ @Override public void onEntriesUpdated(List addresses) throws RemoteException { + for (String adr : addresses) { + Contact c = mRoster.getContact(adr); + if (c.getGroups() != null) { + if (mContactOnGroup.get(getString(R.string.contact_list_no_group)).contains(c)) { + mContactOnGroup.get(getString(R.string.contact_list_no_group)).remove(c); + } + } + } mHandler.post(new RunnableChange()); } diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/ui/GroupList.java --- a/src/com/beem/project/beem/ui/GroupList.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/ui/GroupList.java Fri Oct 23 16:26:59 2009 +0200 @@ -161,7 +161,6 @@ CheckedTextView textView = (CheckedTextView) v; if (!textView.isChecked()) { try { - mRoster.createGroup(textView.getText().toString()); mRoster.addContactToGroup(textView.getText().toString(), mJID); } catch (RemoteException e) { e.printStackTrace(); diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/ui/UserInfo.java --- a/src/com/beem/project/beem/ui/UserInfo.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/ui/UserInfo.java Fri Oct 23 16:26:59 2009 +0200 @@ -307,6 +307,7 @@ } catch (RemoteException e) { e.printStackTrace(); } + finish(); } }).setNegativeButton(UserInfo.this.getString(R.string.userinfo_no), new DialogInterface.OnClickListener() { @@ -340,7 +341,10 @@ mRoster = mXmppFacade.getRoster(); mJID = getIntent().getStringExtra("contact_contactdialog"); mContact = mRoster.getContact(mJID); - mTextAlias.setText(mContact.getName()); + if (mContact.getName() != null) + mTextAlias.setText(mContact.getName()); + else + mTextAlias.setText(mContact.getJID()); mGalleryGroups.setAdapter(new BeemGroups(UserInfo.this, mContact.getGroups())); setTitle(mJID); } catch (RemoteException e) { diff -r c689a113b9f8 -r 04e6c855e58e src/com/beem/project/beem/utils/BeemBroadcastReceiver.java --- a/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Fri Oct 23 16:24:42 2009 +0200 +++ b/src/com/beem/project/beem/utils/BeemBroadcastReceiver.java Fri Oct 23 16:26:59 2009 +0200 @@ -4,6 +4,7 @@ import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; +import android.util.Log; import android.widget.Toast; import com.beem.project.beem.ui.Login; @@ -35,6 +36,7 @@ */ @Override public void onReceive(Context context, Intent intent) { + Log.d("Broadcast","onREceive"); context.unbindService(mService); mIsBinded = false; context.startActivity(new Intent(context, Login.class));