error dialog fixes - merged with alpha2

cusax-fix
Yana Stamcheva 19 years ago
parent 7d2b71f571
commit 14df57e4c0

@ -239,12 +239,12 @@ else if (selectedPanel != null
{
new ErrorDialog(
this.mainFrame,
Messages.getI18NString("warning").getText(),
Messages.getI18NString(
"contactNotSupportingTelephony",
new String[]
{ ((MetaContact) o).getDisplayName() })
.getText(),
Messages.getI18NString("warning").getText())
.getText())
.showDialog();
}
}

@ -161,9 +161,9 @@ public void actionPerformed(ActionEvent e)
if(chatRoom == null)
{
new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomNotJoined")
.getText(),
Messages.getI18NString("error").getText())
.getText())
.setVisible(true);
return;
@ -248,36 +248,30 @@ public void run()
{
ErrorDialog errorDialog
= new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString(
Messages.getI18NString("kickFailed").getText(),
Messages.getI18NString(
"kickFailedNotEnoughPermissions",
new String[]{chatContact.getName()})
.getText(),
e,
Messages.getI18NString("kickFailed")
.getText());
new String[]{chatContact.getName()}).getText(),
e);
errorDialog.showDialog();
}
else if (e.getErrorCode()
else if (e.getErrorCode()
== OperationFailedException.FORBIDDEN)
{
new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString("kickFailed").getText(),
Messages.getI18NString("kickFailedNotAllowed",
new String[]{chatContact.getName()})
.getText(),
e,
Messages.getI18NString("kickFailed").getText())
.showDialog();
new String[]{chatContact.getName()}).getText(),
e).showDialog();
}
else
{
new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString("kickFailed").getText(),
Messages.getI18NString("kickFailedGeneralError",
new String[]{chatContact.getName()})
.getText(),
e,
Messages.getI18NString("kickFailed").getText())
.showDialog();
new String[]{chatContact.getName()}).getText(),
e).showDialog();
}
}
}
@ -311,37 +305,33 @@ public void run()
{
logger.error("Failed to ban participant.", e);
if (e.getErrorCode()
if (e.getErrorCode()
== OperationFailedException.NOT_ENOUGH_PRIVILEGES)
{
new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString("banFailed").getText(),
Messages.getI18NString("banFailedNotEnoughPermissions",
new String[]{chatContact.getName()})
.getText(),
e,
Messages.getI18NString("banFailed").getText())
.showDialog();
e).showDialog();
}
else if (e.getErrorCode()
else if (e.getErrorCode()
== OperationFailedException.FORBIDDEN)
{
new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString("banFailed").getText(),
Messages.getI18NString("banFailedNotAllowed",
new String[]{chatContact.getName()})
.getText(),
e,
Messages.getI18NString("banFailed").getText())
.showDialog();
new String[]{chatContact.getName()}).getText(),
e).showDialog();
}
else
{
new ErrorDialog(chatPanel.getChatWindow(),
Messages.getI18NString("banFailed").getText(),
Messages.getI18NString("banFailedGeneralError",
new String[]{chatContact.getName()})
.getText(),
e,
Messages.getI18NString("banFailed").getText())
.showDialog();
e).showDialog();
}
}
}

@ -390,12 +390,10 @@ public void run()
{
new ErrorDialog(
ChatRoomConfigurationWindow.this,
Messages.getI18NString("error").getText(),
Messages.getI18NString(
"chatRoomConfigFormSubmitFailed").getText(),
e,
Messages.getI18NString(
"error").getText())
.showDialog();
e).showDialog();
}
}
}.start();

@ -123,14 +123,14 @@ public void actionPerformed(ActionEvent evt)
if(e.getErrorCode()
== OperationFailedException.NOT_ENOUGH_PRIVILEGES)
{
{
new ErrorDialog(
chatWindow,
Messages.getI18NString("warning").getText(),
Messages.getI18NString(
"chatRoomOpenConfigForbidden",
new String[]{chatRoomWrapper.getChatRoomName()})
.getText(),
Messages.getI18NString("warning").getText(),
.getText(),
ErrorDialog.WARNING)
.showDialog();
}
@ -138,14 +138,13 @@ public void actionPerformed(ActionEvent evt)
{
new ErrorDialog(
chatWindow,
Messages.getI18NString("error").getText(),
Messages.getI18NString(
"chatRoomOpenConfigFailed",
new String[]{
chatRoomWrapper.getChatRoomName()})
.getText(),
e,
Messages.getI18NString("error").getText())
.showDialog();
e).showDialog();
}
}
}

@ -313,10 +313,10 @@ else if (evt.getEventType().equals(
LocalUserChatRoomPresenceChangeEvent.LOCAL_USER_JOIN_FAILED))
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("failedToJoinChatRoom",
new String[]{sourceChatRoom.getName()})
.getText() + evt.getReason(),
Messages.getI18NString("error").getText())
.getText() + evt.getReason())
.showDialog();
}
else if (evt.getEventType().equals(
@ -383,9 +383,9 @@ public void acceptInvitation(ChatRoomInvitation invitation)
catch (OperationFailedException e)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("failedToJoinChatRoom",
new String[] {chatRoom.getName()}).getText(),
Messages.getI18NString("error").getText())
new String[] {chatRoom.getName()}).getText())
.showDialog();
logger.error("Failed to join chat room: "
@ -463,20 +463,20 @@ else if(e.getErrorCode()
.REGISTRATION_REQUIRED)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomRegistrationRequired",
new String[]{chatRoom.getName()})
.getText(),
Messages.getI18NString("error").getText())
.getText())
.showDialog();
}
else if(e.getErrorCode()
== OperationFailedException.PROVIDER_NOT_REGISTERED)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomNotConnected",
new String[]{chatRoom.getName()})
.getText(),
Messages.getI18NString("error").getText())
.getText())
.showDialog();
}
else if(e.getErrorCode()
@ -484,19 +484,19 @@ else if(e.getErrorCode()
.SUBSCRIPTION_ALREADY_EXISTS)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomAlreadyJoined",
new String[]{chatRoom.getName()})
.getText(),
Messages.getI18NString("error").getText())
.getText())
.showDialog();
}
else
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("failedToJoinChatRoom",
new String[]{chatRoom.getName()})
.getText(),
Messages.getI18NString("error").getText())
.getText())
.showDialog();
}
@ -554,45 +554,41 @@ else if(e.getErrorCode()
.REGISTRATION_REQUIRED)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomRegistrationRequired",
new String[]{chatRoom.getName()})
.getText(),
e,
Messages.getI18NString("error").getText())
.showDialog();
e).showDialog();
}
else if(e.getErrorCode()
== OperationFailedException.PROVIDER_NOT_REGISTERED)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomNotConnected",
new String[]{chatRoom.getName()})
.getText(),
e,
Messages.getI18NString("error").getText())
.showDialog();
e).showDialog();
}
else if(e.getErrorCode()
== OperationFailedException
.SUBSCRIPTION_ALREADY_EXISTS)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomAlreadyJoined",
new String[]{chatRoom.getName()})
.getText(),
e,
Messages.getI18NString("error").getText())
.showDialog();
}
e).showDialog();
}
else
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("failedToJoinChatRoom",
new String[]{chatRoom.getName()})
.getText(),
e,
Messages.getI18NString("error").getText())
.showDialog();
e).showDialog();
}
logger.error("Failed to join chat room: "

@ -170,9 +170,9 @@ else if (itemName.equals("leaveChatRoom"))
if(chatRoom == null)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("warning").getText(),
Messages.getI18NString("haveToBeConnectedToLeave")
.getText(),
Messages.getI18NString("warning").getText())
.getText())
.showDialog();
return;
@ -191,9 +191,9 @@ else if (itemName.equals("joinChatRoom"))
if(chatRoom == null)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("warning").getText(),
Messages.getI18NString("haveToBeConnectedToJoin")
.getText(),
Messages.getI18NString("warning").getText())
.getText())
.showDialog();
return;
@ -212,9 +212,9 @@ else if(itemName.equals("joinAsChatRoom"))
if(chatRoom == null)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("warning").getText(),
Messages.getI18NString("haveToBeConnectedToJoin")
.getText(),
Messages.getI18NString("warning").getText())
.getText())
.showDialog();
return;

@ -140,26 +140,24 @@ public void run()
logger.error("Failed to create chat room.", ex);
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString(
"createChatRoomError",
new String[]{chatRoomName}).getText(),
ex,
Messages.getI18NString(
"error").getText())
.showDialog();
ex)
.showDialog();
}
catch (OperationNotSupportedException ex)
{
logger.error("Failed to create chat room.", ex);
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString(
"createChatRoomError",
new String[]{chatRoomName}).getText(),
ex,
Messages.getI18NString(
"error").getText())
.showDialog();
ex)
.showDialog();
}
if(chatRoom != null)

@ -130,9 +130,9 @@ public void run()
catch (OperationFailedException e)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("failedToCreateChatRoom",
new String[]{chatRoomName}).getText(),
Messages.getI18NString("error").getText())
new String[]{chatRoomName}).getText())
.showDialog();
logger.error("Failed to create chat room with name: "
@ -141,11 +141,11 @@ public void run()
catch (OperationNotSupportedException e)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("createChatRoomNotSupported",
new String[]{chatRoomName,
protocolProvider.getAccountID().getService()})
.getText(),
Messages.getI18NString("error").getText())
.getText())
.showDialog();
logger.error("Failed to create chat room with name: "
@ -154,22 +154,22 @@ public void run()
catch (Exception e)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("failedToCreateChatRoom",
new String[]{chatRoomName}).getText(),
Messages.getI18NString("error").getText())
new String[]{chatRoomName}).getText())
.showDialog();
logger.error("Failed to create chat room with name: "
+ namePanel.getChatRoomName(), e);
}
}
}
}.start();
}.start();
}
this.dispose();
}
protected void close(boolean isEscaped)
{
this.cancelButton.doClick();
}
this.cancelButton.doClick();
}
}

@ -88,28 +88,26 @@ public void run()
logger.error("Failed to create chat room.", ex);
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString(
"createChatRoomError",
new String[]{newChatRoom.getChatRoomName()}).getText(),
ex,
Messages.getI18NString(
"error").getText())
.showDialog();
ex)
.showDialog();
}
catch (OperationNotSupportedException ex)
{
logger.error("Failed to create chat room.", ex);
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString(
"createChatRoomError",
new String[]{newChatRoom.getChatRoomName()}).getText(),
ex,
Messages.getI18NString(
"error").getText())
.showDialog();
ex)
.showDialog();
}
if(chatRoom != null)
mainFrame.getChatRoomsListPanel().getChatRoomsList()
.addChatRoom(new ChatRoomWrapper(chatRoom));

@ -134,11 +134,11 @@ public void run()
if(chatRoom == null)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomNotExist",
new String[]{chatRoomName,
protocolProvider.getAccountID().getService()})
.getText(),
Messages.getI18NString("error").getText())
.getText())
.showDialog();
}
else

@ -102,11 +102,11 @@ public void run()
if(chatRoom == null)
{
new ErrorDialog(mainFrame,
Messages.getI18NString("error").getText(),
Messages.getI18NString("chatRoomNotExist",
new String[]{chatRoomName,
newChatRoom.getProtocolProvider().getAccountID()
.getService()}).getText(),
Messages.getI18NString("error").getText())
.getService()}).getText())
.showDialog();
}
else

Loading…
Cancel
Save