1. Fix including resources in swing and branding bundles

cusax-fix
Damian Minkov 18 years ago
parent e506093830
commit fd8d790d9d

@ -1354,7 +1354,15 @@ javax.swing.event, javax.swing.border"/>
prefix="net/java/sip/communicator/service/gui"/>
<zipfileset dir="${dest}/net/java/sip/communicator/impl/gui"
prefix="net/java/sip/communicator/impl/gui"/>
<zipfileset dir="${resources}"
<zipfileset dir="${resources}/images/logo"
prefix="resources/images/logo"/>
<zipfileset dir="${resources}/images/impl/gui"
prefix="resources/images/impl/gui"/>
<zipfileset dir="${resources}/styles"
prefix="resources/styles"/>
<zipfileset dir="${resources}/colors"
prefix="resources/colors"/>
<zipfileset dir="${resources}" includes="application.properties"
prefix="resources"/>
</jar>
</target>
@ -1555,7 +1563,13 @@ javax.swing.event, javax.swing.border"/>
manifest="${src}/net/java/sip/communicator/plugin/branding/branding.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/plugin/branding"
prefix="net/java/sip/communicator/plugin/branding"/>
<zipfileset dir="${resources}"
<zipfileset dir="${resources}/images/plugin/branding"
prefix="resources/images/plugin/branding"/>
<zipfileset dir="${resources}/styles"
prefix="resources/styles"/>
<zipfileset dir="${resources}/colors"
prefix="resources/colors"/>
<zipfileset dir="${resources}" includes="application.properties"
prefix="resources"/>
</jar>
</target>

@ -962,30 +962,46 @@ public void moveMetaContact(MetaContact metaContact,
( (MetaContactGroupImpl) newMetaGroup).addMetaContact(
(MetaContactImpl) metaContact);
//first make sure that the new meta contact group path is resolved
//against all protocols that the MetaContact requires. then move
//the meta contact in there and move all prot contacts inside it.
Iterator contacts = metaContact.getContacts();
while (contacts.hasNext())
try
{
Contact protoContact = (Contact) contacts.next();
//first make sure that the new meta contact group path is resolved
//against all protocols that the MetaContact requires. then move
//the meta contact in there and move all prot contacts inside it.
Iterator contacts = metaContact.getContacts();
ContactGroup protoGroup = resolveProtoPath(protoContact
.getProtocolProvider(), (MetaContactGroupImpl) newMetaGroup);
while (contacts.hasNext())
{
Contact protoContact = (Contact) contacts.next();
//get a persistent or non persistent presence operation set
OperationSetPersistentPresence opSetPresence
= (OperationSetPersistentPresence) protoContact
.getProtocolProvider().getSupportedOperationSets()
.get(OperationSetPersistentPresence.class.getName());
ContactGroup protoGroup = resolveProtoPath(protoContact
.getProtocolProvider(), (MetaContactGroupImpl) newMetaGroup);
if (opSetPresence == null)
{
/** @todo handle non persistent presence operation sets */
//get a persistent or non persistent presence operation set
OperationSetPersistentPresence opSetPresence
= (OperationSetPersistentPresence) protoContact
.getProtocolProvider().getSupportedOperationSets()
.get(OperationSetPersistentPresence.class.getName());
if (opSetPresence == null)
{
/** @todo handle non persistent presence operation sets */
}
opSetPresence.moveContactToGroup(protoContact, protoGroup);
}
}
catch (Exception ex)
{
logger.error("Cannot move contact", ex);
// now move the contact to prevoius parent
((MetaContactGroupImpl)newMetaGroup).
removeMetaContact( (MetaContactImpl) metaContact);
opSetPresence.moveContactToGroup(protoContact, protoGroup);
currentParent.addMetaContact((MetaContactImpl) metaContact);
throw new MetaContactListException(ex.getMessage(),
MetaContactListException.CODE_MOVE_CONTACT_ERROR);
}
//fire the mved event.
@ -1105,27 +1121,35 @@ public void removeMetaContactGroup(
" is not an instance of MetaContactGroupImpl");
}
//remove all proto groups and then remove the meta group as well.
Iterator protoGroups
= ( (MetaContactGroupImpl) groupToRemove).getContactGroups();
while (protoGroups.hasNext())
try
{
ContactGroup protoGroup = (ContactGroup) protoGroups.next();
//remove all proto groups and then remove the meta group as well.
Iterator protoGroups
= ( (MetaContactGroupImpl) groupToRemove).getContactGroups();
OperationSetPersistentPresence opSetPersPresence
= (OperationSetPersistentPresence) protoGroup
.getProtocolProvider().getSupportedOperationSets().get(
OperationSetPersistentPresence.class.getName());
if (opSetPersPresence == null)
while (protoGroups.hasNext())
{
/** @todo handle removal of non persistent proto groups */
return;
}
ContactGroup protoGroup = (ContactGroup) protoGroups.next();
OperationSetPersistentPresence opSetPersPresence
= (OperationSetPersistentPresence) protoGroup
.getProtocolProvider().getSupportedOperationSets().get(
OperationSetPersistentPresence.class.getName());
opSetPersPresence.removeServerStoredContactGroup(protoGroup);
if (opSetPersPresence == null)
{
/** @todo handle removal of non persistent proto groups */
return;
}
opSetPersPresence.removeServerStoredContactGroup(protoGroup);
}
}catch(Exception ex)
{
throw new MetaContactListException(ex.getMessage(),
MetaContactListException.CODE_REMOVE_GROUP_ERROR);
}
MetaContactGroupImpl parentMetaGroup = (MetaContactGroupImpl)
findParentMetaContactGroup( (MetaContactGroupImpl) groupToRemove);

@ -189,6 +189,7 @@ moveSubcontactMsg=Select the contact, where you would like to move.
moveSubcontact=M&ove Subcontact
moveSubcontactInSameContact=The contact you have choosen is the same as \n the source one. Please choose another contact!
moveToGroup=&Move to group
moveContactError=&Contact cannot be moved
msgDeliveryFailure=The above message could not be delivered
msgDeliveryOfflineNotSupported=The protocol you are using doesn't support offline messages. You could try to reach this contact through another protocol or wait until he/she becomes online.
msgDeliveryInternalError=An internal error occured. This is most probably a bug. Please report it here: http://www.sip-communicator.org/index.php/Development/BugsAndIssues

@ -18,6 +18,8 @@
import net.java.sip.communicator.impl.gui.main.*;
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.impl.gui.i18n.*;
import net.java.sip.communicator.impl.gui.customcontrols.*;
import net.java.sip.communicator.service.contactlist.*;
import net.java.sip.communicator.service.contactlist.event.*;
import net.java.sip.communicator.service.protocol.*;
@ -871,8 +873,21 @@ else if (!contactDest.contains(
}
else if (!contactDest.contains(draggedElement.getMetaContact()))
{
mainFrame.getContactList().moveMetaContact(
draggedElement.getMetaContact(), contactDest);
try
{
mainFrame.getContactList().moveMetaContact(
draggedElement.getMetaContact(), contactDest);
}
catch (Exception ex)
{
new ErrorDialog(
mainFrame,
Messages.getI18NString(
"moveToGroup").getText(),
Messages.getI18NString(
"moveContactError").getText(),
ex).showDialog();
}
}
}

@ -497,9 +497,23 @@ else if (itemName.startsWith(moveToPrefix)) {
MetaContactGroup group
= mainFrame.getGroupByID(
itemName.substring(moveToPrefix.length()));
if(group != null) {
mainFrame.getContactList().moveMetaContact(contactItem, group);
try
{
if(group != null) {
mainFrame.getContactList().
moveMetaContact(contactItem, group);
}
}
catch (Exception ex)
{
new ErrorDialog(
mainFrame,
Messages.getI18NString(
"moveToGroup").getText(),
Messages.getI18NString(
"moveContactError").getText(),
ex).showDialog();
}
}
else if (itemName.startsWith(removeContactPrefix)) {
@ -569,30 +583,42 @@ public RemoveContactThread(Contact contact) {
this.contact = contact;
}
public void run() {
if(Constants.REMOVE_CONTACT_ASK) {
String message = "<HTML>Are you sure you want to remove <B>"
+ contact.getDisplayName()
+ "</B><BR>from your contact list?</html>";
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("removeContact").getText(),
message,
Messages.getI18NString("remove").getText());
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE) {
mainFrame.getContactList().removeContact(contact);
try
{
if(Constants.REMOVE_CONTACT_ASK) {
String message = "<HTML>Are you sure you want to remove <B>"
+ contact.getDisplayName()
+ "</B><BR>from your contact list?</html>";
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("removeContact").getText(),
message,
Messages.getI18NString("remove").getText());
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE) {
mainFrame.getContactList().removeContact(contact);
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE) {
mainFrame.getContactList().removeContact(contact);
Constants.REMOVE_CONTACT_ASK = false;
}
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE) {
else {
mainFrame.getContactList().removeContact(contact);
Constants.REMOVE_CONTACT_ASK = false;
}
}
else {
mainFrame.getContactList().removeContact(contact);
catch (Exception ex)
{
new ErrorDialog(mainFrame,
Messages.getI18NString(
"removeContact").getText(),
ex.getMessage(),
ex)
.showDialog();
}
}
}

@ -198,32 +198,44 @@ public RemoveGroupThread(MetaContactGroup group) {
}
public void run()
{
if(Constants.REMOVE_CONTACT_ASK) {
try
{
if(Constants.REMOVE_CONTACT_ASK) {
String message = "<HTML>Are you sure you want to remove <B>"
+ this.group.getGroupName()
+ this.group.getGroupName()
+ "</B><BR>from your contact list?</html>";
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("removeGroup").getText(),
message,
Messages.getI18NString("remove").getText());
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("removeGroup").getText(),
message,
Messages.getI18NString("remove").getText());
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE) {
mainFrame.getContactList()
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE) {
mainFrame.getContactList()
.removeMetaContactGroup(group);
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE) {
mainFrame.getContactList()
.removeMetaContactGroup(group);
Constants.REMOVE_CONTACT_ASK = false;
}
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE) {
mainFrame.getContactList()
.removeMetaContactGroup(group);
Constants.REMOVE_CONTACT_ASK = false;
else {
mainFrame.getContactList().removeMetaContactGroup(group);
}
}
else {
mainFrame.getContactList().removeMetaContactGroup(group);
catch (Exception ex)
{
new ErrorDialog(mainFrame,
Messages.getI18NString(
"removeGroup").getText(),
ex.getMessage(),
ex)
.showDialog();
}
}
}

@ -152,9 +152,13 @@ public void runLogin(MainFrame parent)
for (int i = 0; i < accountsList.size(); i++)
{
hasRegisteredAccounts = true;
accountID = (AccountID) accountsList.get(i);
boolean isHidden =
accountID.getAccountProperties().get("HIDDEN_PROTOCOL") != null;
if(!isHidden)
hasRegisteredAccounts = true;
serRef = providerFactory.getProviderForAccount(accountID);

@ -35,6 +35,8 @@ public class StatusPanel
private GlobalStatusSelectorBox globalStatusBox;
private MainFrame mainFrame;
private int hiddenProviders = 0;
/**
* Creates an instance of <tt>StatusPanel</tt>.
@ -74,8 +76,15 @@ public void addAccount(ProtocolProviderService protocolProvider)
}
protocolStatusCombo.addComponentListener(this);
if (protocolStatusCombos.size() == 1)
boolean isHidden =
protocolProvider.getAccountID().
getAccountProperties().get("HIDDEN_PROTOCOL") != null;
if(isHidden)
hiddenProviders++;
if (protocolStatusCombos.size() - hiddenProviders == 1)
{
this.globalStatusBox = new GlobalStatusSelectorBox(mainFrame);
@ -88,9 +97,13 @@ public void addAccount(ProtocolProviderService protocolProvider)
this.protocolStatusCombos.put(protocolProvider, protocolStatusCombo);
this.add(protocolStatusCombo);
if(!isHidden)
{
this.add(protocolStatusCombo);
this.getParent().validate();
this.getParent().validate();
}
}
/**
@ -104,13 +117,24 @@ public void removeAccount(ProtocolProviderService pps)
StatusSelectorBox protocolStatusCombo =
(StatusSelectorBox) this.protocolStatusCombos.get(pps);
boolean isHidden =
pps.getAccountID().getAccountProperties().
get("HIDDEN_PROTOCOL") != null;
if(isHidden)
hiddenProviders--;
this.protocolStatusCombos.remove(pps);
if (protocolStatusCombos.size() == 1 && globalStatusBox != null)
if (protocolStatusCombos.size() - hiddenProviders == 1 &&
globalStatusBox != null)
{
this.remove(globalStatusBox);
}
if(protocolStatusCombo == null)
return;
this.remove(protocolStatusCombo);
this.revalidate();
@ -127,6 +151,9 @@ public void updateAccountIndex(ProtocolProviderService protocolProvider)
StatusSelectorBox protocolStatusCombo =
(StatusSelectorBox) this.protocolStatusCombos.get(protocolProvider);
if(protocolStatusCombo == null)
return;
protocolStatusCombo.setAccountIndex(mainFrame
.getProviderIndex(protocolProvider));
@ -142,10 +169,12 @@ public void updateAccountIndex(ProtocolProviderService protocolProvider)
*/
public void startConnecting(ProtocolProviderService protocolProvider)
{
StatusSelectorBox selectorBox =
(StatusSelectorBox) protocolStatusCombos.get(protocolProvider);
if(selectorBox == null)
return;
BufferedImage[] animatedImage =
ImageLoader.getAnimatedImage(protocolProvider.getProtocolIcon()
.getConnectingIcon());
@ -333,7 +362,7 @@ public void updateStatus(ProtocolProviderService pps, PresenceStatus status)
* in the <tt>StatusPanel</tt>.
*
* @param pps The protocol provider to check.
* @return True if the protcol has already its StatusSelectorBox in the
* @return True if the protocol has already its StatusSelectorBox in the
* StatusPanel, False otherwise.
*/
public boolean containsAccount(ProtocolProviderService pps)
@ -400,4 +429,4 @@ public void componentResized(ComponentEvent e)
public void componentShown(ComponentEvent e)
{
}
}
}

@ -49,16 +49,28 @@ public class MetaContactListException
public static final int CODE_UNKNOWN_ERROR = 5;
/**
* An error code indicating the nature of this excepiton.
* An error code indicating the nature of this exception.
*/
private int errCode = CODE_UNKNOWN_ERROR;
/**
* Indicates that the exception was caused by the fact that we tried to
* remove a group that cannot be removed or an error occur during remove.
*/
public static final int CODE_REMOVE_GROUP_ERROR = 6;
/**
* Indicates that the exception was caused by the fact that we tried to
* move a contact that cannot be moved or an error occur during move.
*/
public static final int CODE_MOVE_CONTACT_ERROR = 7;
/**
* Creates a MetaContactListException with the specified message cause and
* code.
* @param message a human readable message describing the exception.
* @param cause the Exception/Error (if any) that caused this Exception.
* @param code one of the statuc CODE_XXX variable, describing the nature
* @param code one of the status CODE_XXX variable, describing the nature
* of the exception.
*/
public MetaContactListException(String message, Exception cause, int code)
@ -71,7 +83,7 @@ public MetaContactListException(String message, Exception cause, int code)
* Creates a MetaContactListException with the specified message error code.
*
* @param message a human readable message describing the exception.
* @param code one of the statuc CODE_XXX variable, describing the nature
* @param code one of the status CODE_XXX variable, describing the nature
* of the exception.
*/
public MetaContactListException(String message, int code)

Loading…
Cancel
Save