- user asked for confirmation when moving contact using the drag&drop

- popup menu returned to lightweight - try to solve several problems on Mac (flicker problem, drop down selection problem)
- info button enhancements
- resizing issues
cusax-fix
Yana Stamcheva 18 years ago
parent c4dda493d5
commit 35b936d1f5

@ -1100,6 +1100,8 @@ javax.swing.event, javax.swing.border"/>
prefix="net/java/sip/communicator/impl/gui"/>
<zipfileset dir="${resources}/images/logo"
prefix="resources/images/logo"/>
<zipfileset dir="${resources}/images/plugin/branding"
prefix="resources/images/plugin/branding"/>
<zipfileset dir="${resources}/images/impl/gui"
prefix="resources/images/impl/gui"/>
<zipfileset dir="${resources}/styles"
@ -1587,7 +1589,7 @@ javax.swing.event, javax.swing.border"/>
prefix="resources/images/plugin/contactinfo"/>
</jar>
</target>
<!-- BUNDLE-PLUGIN-CHATALERTER -->
<target name="bundle-plugin-chatalerter">
<!-- Creates a bundle for the plugin Chat Alerter.-->

@ -193,9 +193,11 @@ loginWindowTitle=Login {0}
logoffNotSucceeded=An error occured while logging off with the following account: User name: {0}, Server name: {1}.
me=me
modify=&Modify
move=Move
moveSubcontactMsg=Select the contact, where you would like to move.
moveSubcontact=M&ove Subcontact
moveSubcontact=M&ove contact
moveSubcontactInSameContact=The contact you have choosen is the same as \n the source one. Please choose another contact!
moveSubcontactQuestion=<DIV>Are you sure you want to move <B> {0} </B> to <B> {1} </B> ?</DIV>
moveToGroup=&Move to group
moveContactError=&Contact cannot be moved
msgDeliveryFailure=The above message could not be delivered

@ -835,7 +835,6 @@ private void setDefaultThemePack()
// popup menu stays light weight it will appear behind the heavy weight
// component.
ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false);
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
// we need to set the UIDefaults class loader so that it may access
// resources packed inside OSGI bundles

@ -823,6 +823,7 @@ public void mouseReleased(MouseEvent e)
ContactListModel listModel = (ContactListModel) this.getModel();
Object dest = listModel.getElementAt(selectedIndex);
if (draggedElement != null)
{
if (dest instanceof MetaContact)
@ -832,9 +833,9 @@ public void mouseReleased(MouseEvent e)
{
if (draggedElement.getContact() != null)
{
// we move the specified contact
mainFrame.getContactList().moveContact(
draggedElement.getContact(), contactDest);
new MoveContactToMetaContactThread(
draggedElement.getContact(),
contactDest).start();
}
else
{
@ -845,8 +846,9 @@ public void mouseReleased(MouseEvent e)
while(i.hasNext())
{
Contact contact = (Contact) i.next();
mainFrame.getContactList().
moveContact(contact, contactDest);
new MoveContactToMetaContactThread(
contact,
contactDest).start();
}
}
@ -863,22 +865,25 @@ else if (dest instanceof MetaContactGroup)
// as this contact is the only one inside it.
if (draggedElement.getMetaContact().getContactCount() > 1)
{
mainFrame.getContactList().moveContact(
draggedElement.getContact(), contactDest);
new MoveContactToGroupThread(
draggedElement.getContact(),
contactDest).start();
}
else if (!contactDest.contains(
draggedElement.getMetaContact()))
{
mainFrame.getContactList().moveMetaContact(
draggedElement.getMetaContact(), contactDest);
new MoveMetaContactThread(
draggedElement.getMetaContact(),
contactDest).start();
}
}
else if (!contactDest.contains(draggedElement.getMetaContact()))
{
try
{
mainFrame.getContactList().moveMetaContact(
draggedElement.getMetaContact(), contactDest);
new MoveMetaContactThread(
draggedElement.getMetaContact(),
contactDest).start();
}
catch (Exception ex)
{
@ -1357,4 +1362,175 @@ public MainFrame getMainFrame()
{
return mainFrame;
}
/**
* Moves the given <tt>Contact</tt> to the given <tt>MetaContact</tt> and
* asks user for confirmation.
*/
private class MoveContactToMetaContactThread extends Thread
{
private Contact srcContact;
private MetaContact destMetaContact;
public MoveContactToMetaContactThread( Contact srcContact,
MetaContact destMetaContact)
{
this.srcContact = srcContact;
this.destMetaContact = destMetaContact;
}
public void run()
{
if (!ConfigurationManager.isMoveContactConfirmationRequested())
{
// we move the specified contact
mainFrame.getContactList().moveContact(
srcContact, destMetaContact);
return;
}
String message = Messages.getI18NString(
"moveSubcontactQuestion",
new String[]{ srcContact.getDisplayName(),
destMetaContact.getDisplayName()})
.getText();
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("moveContact").getText(),
message,
Messages.getI18NString("move").getText());
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE)
{
// we move the specified contact
mainFrame.getContactList().moveContact(
srcContact, destMetaContact);
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE)
{
ConfigurationManager.setMoveContactConfirmationRequested(false);
// we move the specified contact
mainFrame.getContactList().moveContact(
srcContact, destMetaContact);
}
}
}
/**
* Moves the given <tt>Contact</tt> to the given <tt>MetaContactGroup</tt>
* and asks user for confirmation.
*/
private class MoveContactToGroupThread extends Thread
{
private Contact srcContact;
private MetaContactGroup destGroup;
public MoveContactToGroupThread(Contact srcContact,
MetaContactGroup destGroup)
{
this.srcContact = srcContact;
this.destGroup = destGroup;
}
public void run()
{
if (!ConfigurationManager.isMoveContactConfirmationRequested())
{
// we move the specified contact
mainFrame.getContactList().moveContact(
srcContact, destGroup);
return;
}
String message = Messages.getI18NString(
"moveSubcontactQuestion",
new String[]{ srcContact.getDisplayName(),
destGroup.getGroupName()})
.getText();
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("moveContact").getText(),
message,
Messages.getI18NString("move").getText());
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE)
{
// we move the specified contact
mainFrame.getContactList().moveContact(
srcContact, destGroup);
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE)
{
ConfigurationManager.setMoveContactConfirmationRequested(false);
// we move the specified contact
mainFrame.getContactList().moveContact(
srcContact, destGroup);
}
}
}
/**
* Moves the given <tt>MetaContact</tt> to the given <tt>MetaContactGroup</tt>
* and asks user for confirmation.
*/
private class MoveMetaContactThread extends Thread
{
private MetaContact srcContact;
private MetaContactGroup destGroup;
public MoveMetaContactThread( MetaContact srcContact,
MetaContactGroup destGroup)
{
this.srcContact = srcContact;
this.destGroup = destGroup;
}
public void run()
{
if (!ConfigurationManager.isMoveContactConfirmationRequested())
{
// we move the specified contact
mainFrame.getContactList().moveMetaContact(
srcContact, destGroup);
return;
}
String message = Messages.getI18NString(
"moveSubcontactQuestion",
new String[]{ srcContact.getDisplayName(),
destGroup.getGroupName()})
.getText();
MessageDialog dialog = new MessageDialog(
mainFrame,
Messages.getI18NString("moveContact").getText(),
message,
Messages.getI18NString("move").getText());
int returnCode = dialog.showDialog();
if (returnCode == MessageDialog.OK_RETURN_CODE)
{
// we move the specified contact
mainFrame.getContactList().moveMetaContact(
srcContact, destGroup);
}
else if (returnCode == MessageDialog.OK_DONT_ASK_CODE)
{
ConfigurationManager.setMoveContactConfirmationRequested(false);
// we move the specified contact
mainFrame.getContactList().moveMetaContact(
srcContact, destGroup);
}
}
}
}

@ -35,6 +35,8 @@ public class ConfigurationManager
private static boolean isSendTypingNotifications = true;
private static boolean isMoveContactConfirmationRequested = true;
private static ConfigurationService configService
= GuiActivator.getConfigurationService();
@ -103,6 +105,19 @@ public static void loadGuiConfigurations()
isSendTypingNotifications
= new Boolean(isSendTypingNotif).booleanValue();
}
// Load the "isMoveContactConfirmationRequested" property.
String isMoveContactConfirmationRequestedString
= configService.getString(
"net.java.sip.communicator.impl.gui.isMoveContactConfirmationRequested");
if(isMoveContactConfirmationRequestedString != null
&& isMoveContactConfirmationRequestedString != "")
{
isMoveContactConfirmationRequested
= new Boolean(isMoveContactConfirmationRequestedString)
.booleanValue();
}
}
/**
@ -178,6 +193,18 @@ public static boolean isSendTypingNotifications()
return isSendTypingNotifications;
}
/**
* Returns TRUE if the "isMoveContactConfirmationRequested" property is true,
* otherwise - returns FALSE. Indicates to the user interface whether the
* confirmation window during the move contact process is enabled or not.
* @return TRUE if the "isMoveContactConfirmationRequested" property is true,
* otherwise - returns FALSE
*/
public static boolean isMoveContactConfirmationRequested()
{
return isMoveContactConfirmationRequested;
}
/**
* Return the "sendMessageCommand" property that was saved previously
* through the <tt>ConfigurationService</tt>. Indicates to the user
@ -306,6 +333,22 @@ public static void setSendMessageCommand(String newMessageCommand)
newMessageCommand);
}
/**
* Updates the "isMoveContactQuestionEnabled" property through the
* <tt>ConfigurationService</tt>.
*
* @param isRequested indicates if a confirmation would be requested
* from user during the move contact process.
*/
public static void setMoveContactConfirmationRequested(boolean isRequested)
{
isMoveContactConfirmationRequested = isRequested;
configService.setProperty(
"net.java.sip.communicator.impl.gui.isMoveContactConfirmationRequested",
new Boolean(isMoveContactConfirmationRequested));
}
/**
* Saves a chat room through the <tt>ConfigurationService</tt>.
*

@ -211,6 +211,12 @@ public class ImageLoader {
public static final ImageID MAIN_WINDOW_BACKGROUND
= new ImageID("MAIN_WINDOW_BACKGROUND");
/**
* The background of the about window.
*/
public static final ImageID ABOUT_WINDOW_BG
= new ImageID("ABOUT_WINDOW_BG");
/**
* The icon on the "Add contact" button in the <tt>QuickMenu</tt>.
*/

@ -185,4 +185,5 @@ MAIN_WINDOW_BACKGROUND=resources/images/impl/gui/common/mainWindowBackground.png
TOOL_BAR_BACKGROUND=resources/images/impl/gui/common/toolbarBackground.png
MENU_BACKGROUND=resources/images/impl/gui/common/menuBackground.png
WINDOW_TITLE_BAR=resources/images/impl/gui/common/windowTitleBarBackground.png
WINDOW_TITLE_BAR=resources/images/impl/gui/common/windowTitleBarBackground.png
ABOUT_WINDOW_BG=resources/images/plugin/branding/aboutWindowBackground.png
Loading…
Cancel
Save