- Allow creating contacts in the root group.

- Set an empty image for jabber contacts if they miss a picture, so we won't query them again for pictures.
- Put a note in Facebook Account wizard explaining more about creating usernames.
cusax-fix
Damian Minkov 16 years ago
parent da87a7f210
commit 592933c623

@ -336,6 +336,7 @@ service.gui.SELECT_ACCOUNT=Select account
service.gui.SELECT_COLOR=Select color
service.gui.SELECT_GROUP=Select group
service.gui.SELECT_GROUP_WIZARD_MSG=The list below contains all groups in your Contact List. Select the one, where you would like to add the new contact.
service.gui.SELECT_GROUP_WIZARD_NO_GROUP=No group
service.gui.SELECT_GROUP_WIZARD=Specify group
service.gui.SELECT_PROVIDERS_FOR_CHAT_ROOM=The list below contains all accounts that support the multi user chat feature. Select the one you would like to use to create your chat room.
service.gui.SELECT_PROVIDERS_WIZARD_MSG=The list below contains all registered accounts. Select the one you would like to use to communicate with the new contact.
@ -537,7 +538,7 @@ plugin.callhistoryform.INCOMING=Incoming
plugin.callhistoryform.OUTGOING=Outgoing
# facebookaccregwizz
plugin.facebookaccregwizz.DESCRIPTION=<html><body><center><a href="https://register.facebook.com/editaccount.php">In order to use Facebook Chat you need to create a "Username" <br>from your "Account Settings" page on Facebook.</a></center></body></html>
plugin.facebookaccregwizz.DESCRIPTION=<html><body><center><a href="https://register.facebook.com/editaccount.php">In order to use Facebook Chat you need to create a "Username" <br>from your "Account Settings" page on Facebook.</a><br><br>Note: When you create username you must logout from the webpage <br>and it can take a while before you are able to login with your new username!</center></body></html>
plugin.facebookaccregwizz.INVALID_EMAIL_ADDRESS=Invalid username
plugin.facebookaccregwizz.PROTOCOL_DESCRIPTION=The Facebook Chat protocol
plugin.facebookaccregwizz.PROTOCOL_NAME=Facebook

@ -392,7 +392,11 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
try
{
//create the contact in the group
opSetPersPresence.subscribe(parentProtoGroup, contactID);
// if its the root group just call subscribe
if(parentMetaGroup.equals(rootMetaGroup))
opSetPersPresence.subscribe(contactID);
else
opSetPersPresence.subscribe(parentProtoGroup, contactID);
//wait for a confirmation event
evtRetriever.waitForEvent(CONTACT_LIST_MODIFICATION_TIMEOUT);
@ -403,13 +407,13 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
== OperationFailedException.SUBSCRIPTION_ALREADY_EXISTS)
{
throw new MetaContactListException(
"failed to create contact" + contactID
"failed to create contact " + contactID
, ex
, MetaContactListException.CODE_CONTACT_ALREADY_EXISTS_ERROR);
}
throw new MetaContactListException(
"failed to create contact" + contactID
"failed to create contact " + contactID
, ex
, MetaContactListException.CODE_NETWORK_ERROR);
@ -417,7 +421,7 @@ private void addNewContactToMetaContact( ProtocolProviderService provider,
catch (Exception ex)
{
throw new MetaContactListException(
"failed to create contact" + contactID
"failed to create contact " + contactID
, ex
, MetaContactListException.CODE_NETWORK_ERROR);
}

@ -95,13 +95,22 @@ public AddContactWizard(MainFrame mainFrame, String contactAddress)
page2 = new AddContactWizardPage2(this, newContact);
this.registerWizardPage(AddContactWizardPage2.IDENTIFIER, page2);
if (contactAddress != null)
page3 = new AddContactWizardPage3(this, newContact, contactAddress);
else
page3 = new AddContactWizardPage3(this, newContact);
if(page2.countGroups() == 1)
{
page2.commitPage();
page3.setBackPageIdentifier(AddContactWizardPage1.IDENTIFIER);
page1.setNextPageIdentifier(AddContactWizardPage3.IDENTIFIER);
}
else
{
this.registerWizardPage(AddContactWizardPage2.IDENTIFIER, page2);
}
this.registerWizardPage(AddContactWizardPage3.IDENTIFIER, page3);
this.setCurrentPage(AddContactWizardPage1.IDENTIFIER);

@ -32,6 +32,11 @@ public class AddContactWizardPage1
private WizardContainer wizard;
/**
* By default we are next to wizard page #2 but this can be changed.
*/
private String nextPageIdentifier = AddContactWizardPage2.IDENTIFIER;
/**
* Creates an instance of <tt>AddContactWizardPage1</tt>.
*
@ -103,7 +108,7 @@ public Object getIdentifier()
*/
public Object getNextPageIdentifier()
{
return AddContactWizardPage2.IDENTIFIER;
return nextPageIdentifier;
}
/**
@ -140,4 +145,13 @@ public void pageHiding() {}
public void pageShown() {}
public void pageBack() {}
/**
* Changes the back page for the current wizard page.
* @param identifier the new back page identifier.
*/
public void setNextPageIdentifier(String identifier)
{
this.nextPageIdentifier = identifier;
}
}

@ -113,4 +113,13 @@ public void commitPage()
public void pageBack()
{
}
/**
* The number of groups.
* @return The number of available groups.
*/
public int countGroups()
{
return selectGroupPanel.countGroups();
}
}

@ -25,6 +25,11 @@ public class AddContactWizardPage3
private NewContact newContact;
/**
* By default we are back to wizard page #2 but this can be changed.
*/
private String backPageIdentifier = AddContactWizardPage2.IDENTIFIER;
/**
* Creates an instance of <tt>AddContactWizardPage3</tt>.
* @param wizard the parent wizard
@ -66,7 +71,7 @@ public Object getNextPageIdentifier() {
* identifier of the previous wizard page.
*/
public Object getBackPageIdentifier() {
return AddContactWizardPage2.IDENTIFIER;
return backPageIdentifier;
}
/**
@ -103,4 +108,13 @@ public void setUIN(String uin)
{
addContactPanel.setUIN(uin);
}
/**
* Changes the back page for the current wizard page.
* @param identifier the new back page identifier.
*/
public void setBackPageIdentifier(String identifier)
{
this.backPageIdentifier = identifier;
}
}

@ -98,9 +98,11 @@ public SelectGroupPanel(AddContactWizard wizard,
this.add(iconLabel, BorderLayout.WEST);
this.add(rightPanel, BorderLayout.CENTER);
// groupCombo.addItem(new GroupWrapper(
// GuiActivator.getResources().getI18NString("service.gui.ROOT_GROUP").getText(),
// wizard.getRootGroup()));
// adding the root group
groupCombo.addItem(new GroupWrapper(
GuiActivator.getContactListService().getRoot(),
GuiActivator.getResources().
getI18NString("service.gui.SELECT_GROUP_WIZARD_NO_GROUP")));
String lastGroupName = ConfigurationManager.getLastContactParent();
@ -109,37 +111,28 @@ public SelectGroupPanel(AddContactWizard wizard,
Iterator<MetaContactGroup> groupsList
= GuiActivator.getContactListService().getRoot().getSubgroups();
if (groupsList.hasNext())
{
infoLabel.setText(
GuiActivator.getResources().
getI18NString("service.gui.SELECT_GROUP_WIZARD_MSG"));
this.groupPanel.add(groupLabel, BorderLayout.WEST);
this.groupPanel.add(groupCombo, BorderLayout.CENTER);
while(groupsList.hasNext())
{
MetaContactGroup group = groupsList.next();
GroupWrapper gr = new GroupWrapper(group);
if(lastGroupName != null &&
lastGroupName.equals(group.getGroupName()))
lastSelectedGroup = gr;
groupCombo.addItem(gr);
}
if(lastSelectedGroup != null)
groupCombo.setSelectedItem(lastSelectedGroup);
}
else
infoLabel.setText(
GuiActivator.getResources().
getI18NString("service.gui.SELECT_GROUP_WIZARD_MSG"));
this.groupPanel.add(groupLabel, BorderLayout.WEST);
this.groupPanel.add(groupCombo, BorderLayout.CENTER);
while(groupsList.hasNext())
{
infoLabel.setForeground(Color.RED);
infoLabel.setText(GuiActivator.getResources()
.getI18NString("service.gui.CREATE_FIRST_GROUP_WIZARD"));
MetaContactGroup group = groupsList.next();
GroupWrapper gr = new GroupWrapper(group);
if(lastGroupName != null &&
lastGroupName.equals(group.getGroupName()))
lastSelectedGroup = gr;
groupCombo.addItem(gr);
}
if(lastSelectedGroup != null)
groupCombo.setSelectedItem(lastSelectedGroup);
}
/**
@ -173,12 +166,22 @@ public void setNextButtonAccordingToComboBox()
/**
* Implements <tt>ItemListener.itemStateChanged</tt>.
* @param e the event.
*/
public void itemStateChanged(ItemEvent e)
{
this.setNextButtonAccordingToComboBox();
}
/**
* The number of groups.
* @return The number of available groups.
*/
public int countGroups()
{
return groupCombo.getItemCount();
}
private static class GroupWrapper
{
private final String groupName;

@ -1042,6 +1042,9 @@ public void run()
ContactPropertyChangeEvent.PROPERTY_IMAGE,
contact, oldImage, imgBytes);
}
else
// set an empty image data so it won't be queried again
contact.setImage(new byte[0]);
}
}
}

Loading…
Cancel
Save