mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 14:25:37 +02:00
make sure createHost() works from non-main thread - event firing needs to be done on main thread
This commit is contained in:
parent
c799f0763e
commit
e55afd6fa4
1 changed files with 24 additions and 7 deletions
|
@ -2200,7 +2200,29 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
|
|||
}
|
||||
|
||||
|
||||
//int eventType = ISystemResourceChangeEvent.EVENT_ADD;
|
||||
FireNewHostEvents fire = new FireNewHostEvents(conn, subSystems);
|
||||
Display.getDefault().asyncExec(fire);
|
||||
|
||||
}
|
||||
SystemPreferencesManager.getPreferencesManager().setConnectionNamesOrder(); // update preferences order list
|
||||
|
||||
RSEUIPlugin.getThePersistenceManager().commit(conn);
|
||||
return conn;
|
||||
}
|
||||
|
||||
|
||||
class FireNewHostEvents implements Runnable
|
||||
{
|
||||
private ISubSystem[] subSystems;
|
||||
private IHost conn;
|
||||
public FireNewHostEvents(IHost host, ISubSystem[] subSystems)
|
||||
{
|
||||
this.subSystems= subSystems;
|
||||
this.conn = host;
|
||||
}
|
||||
|
||||
public void run()
|
||||
{
|
||||
int eventType = ISystemResourceChangeEvents.EVENT_ADD_RELATIVE;
|
||||
SystemResourceChangeEvent event = new SystemResourceChangeEvent(conn, eventType, this);
|
||||
//event.setPosition(pool.getConnectionPosition(conn));
|
||||
|
@ -2214,14 +2236,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
|
|||
ISubSystem ss = subSystems[s];
|
||||
fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, ss, null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
SystemPreferencesManager.getPreferencesManager().setConnectionNamesOrder(); // update preferences order list
|
||||
|
||||
RSEUIPlugin.getThePersistenceManager().commit(conn);
|
||||
return conn;
|
||||
}
|
||||
|
||||
private ISystemNewConnectionWizardPage[] getApplicableWizardPages(ISubSystemConfiguration ssf, ISystemNewConnectionWizardPage[] allPages)
|
||||
{
|
||||
if ((allPages == null) || (allPages.length == 0))
|
||||
|
|
Loading…
Add table
Reference in a new issue