[sip-comm-dev] [RFC] Open the add contact wizard with pre-filled contact string


#1

Hi all,

I think it would be great if we had the possibility to open the add
contact wizard with the contact ID string already filled in. Use
cases:
- you find a person thanks to the LDAP search dialog (random example
:P) and you'd like to add her/him as contact using the add contact
wizard
- you receive a call from someone who is not in your contact list yet.
You could have a use of a "add to my contacts" button which would open
the add contact wizard.

Of course, in both cases it would be possible to simply create your
own wizard/menus to achieve the same goal, but what's the point in
code duplication? What do you think?

Attached is a quick and dirty implementation.

Cheers,

addcontactwizard.patch (2.45 KB)

···

--
Sébastien Mazy


#2

Hi Seb,

Thanks for the patch! I absolutely agree with you that we need to have an "Add contact" wizard that allows to specify the contact ID string.

I've started applying your patch, but here is what bothers me. At the moment we could obtain the "Add contact" wizard by calling UIService.getExportedWindow(ExportedWindow.ADD_CONTACT_WINDOW); , so adding a method openAddContactWizard to the UIService would be like duplicating the above one and providing a solution for one specific case. I was thinking if we could do the same thing by adding a new String[] parameter to the getExportedWindow method, which would pass the params to the given window and thus we could obtain a more generic solution that could work for other exportable ui components. What do you think about that? Any other suggestions?

Cheers,
Yana

S�bastien Mazy wrote:

···

Hi all,

I think it would be great if we had the possibility to open the add
contact wizard with the contact ID string already filled in. Use
cases:
- you find a person thanks to the LDAP search dialog (random example
:P) and you'd like to add her/him as contact using the add contact
wizard
- you receive a call from someone who is not in your contact list yet.
You could have a use of a "add to my contacts" button which would open
the add contact wizard.

Of course, in both cases it would be possible to simply create your
own wizard/menus to achieve the same goal, but what's the point in
code duplication? What do you think?

Attached is a quick and dirty implementation.

Cheers,

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi Yana!

I've started applying your patch, but here is what bothers me. At the moment
we could obtain the "Add contact" wizard by calling
UIService.getExportedWindow(ExportedWindow.ADD_CONTACT_WINDOW); , so adding
a method openAddContactWizard to the UIService would be like duplicating the
above one and providing a solution for one specific case.

Agreed. This was a short-term solution. And if one start to add a
method for a very specific use in UIService, you don't know where it
will end.

I was thinking if
we could do the same thing by adding a new String[] parameter to the
getExportedWindow method, which would pass the params to the given window
and thus we could obtain a more generic solution that could work for other
exportable ui components. What do you think about that? Any other
suggestions?

Clean solution. May I suggest to use a more generic "Object" (or even
Object[]) parameter? I can't think now of an example where you would
need it rather than a String but I'm sure someone will find one :wink:

Cheers,

···

On Thu, Oct 30, 2008 at 9:46 AM, Yana Stamcheva <yana@sip-communicator.org> wrote:

--
Sébastien Mazy


#4

Hi Sebastien,

Clean solution. May I suggest to use a more generic "Object" (or even
Object[]) parameter? I can't think now of an example where you would
need it rather than a String but I'm sure someone will find one :wink:

Agree. Would you like to do it or you prefer me to implement it?

Cheers,
Yana

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Hi Yana,

···

On Thu, Oct 30, 2008 at 11:16 AM, Yana Stamcheva <yana@sip-communicator.org> wrote:

Agree. Would you like to do it or you prefer me to implement it?

I'll do it as part of the LDAP integration.

Cheers,

--
Sébastien Mazy


#6

Hi Seb,

Great, thanks:) Just, could you send a separate patch for this one, as in terms of testing it's difficult to commit a patch containing very different functionalities (http://www.sip-communicator.org/index.php/Documentation/FAQ#patch).

Thanks again,
Yana

Sébastien Mazy wrote:

···

Hi Yana,

On Thu, Oct 30, 2008 at 11:16 AM, Yana Stamcheva > <yana@sip-communicator.org> wrote:

Agree. Would you like to do it or you prefer me to implement it?

I'll do it as part of the LDAP integration.

Cheers,

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#7

Hi Yana,

Just, could you send a separate patch for this one

Sorry, I meant "as it's related to LDAP integration".

The first part of the patch is attached. It's the straight-forward
creation of ExportedWindow.setParam(Object). By the way, there are
ugly DOS line feeds in the following files:
src/net/java/sip/communicator/impl/gui/main/menus/AboutWindow.java
src/net/java/sip/communicator/plugin/branding/AboutWindow.java

Cheers,

exported_window_param-0.patch (6.54 KB)

···

On Thu, Oct 30, 2008 at 11:35 AM, Yana Stamcheva <yana@sip-communicator.org> wrote:

--
Sébastien Mazy


#8

Hi Seb,

your patch is now applied, committed and ack-ed.

Thanks! It was just what I was thinking about. I've done only two modifications in order to make it more generic, hope you'd agree.

Modified:
- setParam(Object o) to setParams(Object[] o) - thus we could use this method if we need to pass more than one parameter.
Added a method:
- getExportedWindow(WindowID windowID, Object[] o) - one could directly call this method and won't need to call setParams afterwards.

Thanks again!

Cheers,
Yana

S�bastien Mazy wrote:

···

Hi Yana,

On Thu, Oct 30, 2008 at 11:35 AM, Yana Stamcheva > <yana@sip-communicator.org> wrote:

Just, could you send a separate patch for this one

Sorry, I meant "as it's related to LDAP integration".

The first part of the patch is attached. It's the straight-forward
creation of ExportedWindow.setParam(Object). By the way, there are
ugly DOS line feeds in the following files:
src/net/java/sip/communicator/impl/gui/main/menus/AboutWindow.java
src/net/java/sip/communicator/plugin/branding/AboutWindow.java

Cheers,

------------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#9

Hi Yana!

your patch is now applied, committed and ack-ed.

Thanks!

Thanks! It was just what I was thinking about. I've done only two
modifications in order to make it more generic, hope you'd agree.

Modified:
- setParam(Object o) to setParams(Object[] o) - thus we could use this
method if we need to pass more than one parameter.
Added a method:
- getExportedWindow(WindowID windowID, Object[] o) - one could directly call
this method and won't need to call setParams afterwards.

Yes, that makes sense.

Attached is the second part of the patch, which actually makes use of
the new setParams() method in the add contact wizard.

Cheers,

prefilled_add_contact.patch (2 KB)

···

On Fri, Nov 7, 2008 at 12:32 PM, Yana Stamcheva <yana@sip-communicator.org> wrote:

--
Sébastien Mazy


#10

bump

···

On Sat, Nov 08, 2008 at 02:58:03AM +0100, Sébastien Mazy wrote:

Attached is the second part of the patch, which actually makes use of
the new setParams() method in the add contact wizard.

--
Sébastien Mazy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#11

Hi Seb,

Sorry for the lag. Your patch is applied, committed and ack-ed.

Thanks again for all your patches and for your patience! :slight_smile:

Cheers,
Yana

Sébastien Mazy wrote:

···

On Sat, Nov 08, 2008 at 02:58:03AM +0100, Sébastien Mazy wrote:

Attached is the second part of the patch, which actually makes use of
the new setParams() method in the add contact wizard.

bump

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net