Fixes problem with starting smack 3.2.0 b2 debugger.

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12089 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Holger Bergunde
2011-03-10 11:55:04 +00:00
committed by holger.bergunde
parent 6aedeb214e
commit 5bc85051a3

View File

@ -871,7 +871,29 @@ public final class LoginDialog {
}
}
connection.connect();
//If we want to use the debug version of smack, we have to check if
//we are on the dispatch thread because smack will create an UI
if (localPref.isDebuggerEnabled()) {
if (EventQueue.isDispatchThread()) {
connection.connect();
} else {
EventQueue.invokeAndWait(new Runnable() {
@Override
public void run() {
try {
connection.connect();
} catch (XMPPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
});
}
} else {
connection.connect();
}
String resource = localPref.getResource();
if (!ModelUtil.hasLength(resource)) {