"escape on a non - empty message window should trigger a warning" - Done.

cusax-fix
Yana Stamcheva 20 years ago
parent 835c938567
commit 4ee9cc6fc9

@ -52,6 +52,7 @@ multipleLogins=You have logged in more than once with the same account. ? accoun
networkFailure=Network failure
next=Next
no=No
nonEmptyChatWindowClose=You're trying to close a non empty chat. Are you sure you want to close this chat?
nonExistingUserId=The ? server does not recognize specified user id.
notifications=Notifications
passwd=Password:

@ -20,11 +20,13 @@
import javax.swing.InputMap;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import net.java.sip.communicator.impl.gui.main.MainFrame;
import net.java.sip.communicator.impl.gui.main.customcontrols.SIPCommTabbedPane;
import net.java.sip.communicator.impl.gui.main.customcontrols.events.CloseListener;
import net.java.sip.communicator.impl.gui.main.i18n.Messages;
import net.java.sip.communicator.impl.gui.utils.Constants;
import net.java.sip.communicator.impl.gui.utils.ImageLoader;
import net.java.sip.communicator.service.contactlist.MetaContact;
@ -135,13 +137,21 @@ private void enableKeyActions(){
{
public void actionPerformed(ActionEvent e)
{
if(chatTabbedPane.getTabCount() > 1){
removeContactTab(chatTabbedPane.getSelectedIndex());
}
else{
ChatWindow.this.dispose();
mainFrame.getTabbedPane().getContactListPanel()
.setTabbedChatWindow(null);
int answer = JOptionPane.showConfirmDialog(ChatWindow.this,
Messages.getString("nonEmptyChatWindowClose"),
Messages.getString("warning"),
JOptionPane.OK_CANCEL_OPTION,
JOptionPane.WARNING_MESSAGE);
if(answer == JOptionPane.YES_OPTION){
if(chatTabbedPane.getTabCount() > 1){
removeContactTab(chatTabbedPane.getSelectedIndex());
}
else{
ChatWindow.this.dispose();
mainFrame.getTabbedPane().getContactListPanel()
.setTabbedChatWindow(null);
}
}
}
};

Loading…
Cancel
Save