warning_window.getCoreComponents();
warning_window.initUIComponents();
}
// show log messages
new JMThread(new JMRunnable() {
public void JMRun() {
logger.fine(Localizer._("mainwindow.logtab.message_jmule_started", JMConstants.JMULE_FULL_NAME));
logger.fine(Localizer._("mainwindow.logtab.message_servers_loaded", _core.getServerManager().getServersCount() + ""));
logger.fine(Localizer._("mainwindow.logtab.message_shared_loaded", _core.getSharingManager().getFileCount() + ""));
logger.fine(Localizer._("mainwindow.logtab.message_partial_loaded", _core.getDownloadManager().getDownloadCount() + ""));
}}).start();
_core.addEventListener(new JMuleCoreEventListener() {
public void eventOccured(JMuleCoreEvent event, final EventDescriptor eventDescriptor) {
if( event == JMuleCoreEvent.NOT_ENOUGH_SPACE ) {
display.syncExec(new JMRunnable() {
NotEnoughSpaceDownloadingFile nes = (NotEnoughSpaceDownloadingFile)eventDescriptor;
public void JMRun() {
Utils.showErrorMessage(shell,
_._("mainwindow.not_enough_space_dialog.title"),
_._("mainwindow.not_enough_space_dialog.message",
nes.getFileName(),
FileFormatter.formatFileSize( nes.getTotalSpace() ),
FileFormatter.formatFileSize( nes.getFreeSpace() )));
}
});
}
}
});
// Update checker
if (SWTPreferences.getInstance().updateCheckAtStartup()) {
new JMThread(new JMRunnable() {
public void JMRun() {
try {
JMUpdater.getInstance().checkForUpdates();
if (JMUpdater.getInstance().isNewVersionAvailable())
SWTThread.getDisplay().asyncExec(new JMRunnable() {
public void JMRun() {
if (JMUpdater.getInstance().isNewVersionAvailable()) {
if (Utils.showConfirmMessage(shell, _._("mainwindow.new_version_available.title"), _._("mainwindow.new_version_available"))) {
UpdaterWindow window = new UpdaterWindow();
window.getCoreComponents();
window.initUIComponents();
} }
}});
} catch (JMUpdaterException e) {}
}
}).start();
}
shell.addListener(SWT.Close, new Listener() {
public void handleEvent(Event arg0) {
boolean exit = SWTPreferences.getInstance().promptOnExit() ?
Utils.showConfirmMessage(shell, _._("mainwindow.exit_prompt_title"), _._("mainwindow.exit_prompt")) : true;
arg0.doit = exit;
}
});
shell.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent arg0) {
new JMThread(new JMRunnable() {
public void JMRun() {
try {
JMuleUIManager.getSingleton().shutdown();
} catch (JMuleUIManagerException e) {
e.printStackTrace();