(!getPreferenceStore().getBoolean(PreferenceConstants.PODCAST_AUTOMATIC_UPDATE))) {
_podcastUpdater.stopCheck();
_podcastUpdater = null;
} else if ((_podcastUpdater == null) &&
(getPreferenceStore().getBoolean(PreferenceConstants.PODCAST_AUTOMATIC_UPDATE))) {
_podcastUpdater = new PodcastAutomaticUpdater();
_podcastUpdater.start();
}
} else if (property.equals(PreferenceConstants.PODCAST_AUTOMATIC_UPDATE_INTERVAL)) {
if (_podcastUpdater != null) {
_podcastUpdater.setNewInterval(getPreferenceStore().getInt(PreferenceConstants.PODCAST_AUTOMATIC_UPDATE_INTERVAL));
}
}
// Change of properties for which application restart is needed.
if ((property.equals(PreferenceConstants.PLAYBACK_ENGINE)) ||
(property.equals(PreferenceConstants.USE_STATISTICS)) ||
(property.equals(PreferenceConstants.PLAYERVIEW_SHOW_IN_TOOLBAR)) ||
(property.equals(PreferenceConstants.PLAYERVIEW_USE_NATIVE_SLIDER)) ||
(property.equals(PreferenceConstants.PLAYERVIEW_TOOLBAR_SIZE))) {
// Prompt the user to restart
boolean confirm = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(),
Messages.getString("Controller.RestartApplicationTitle"), //$NON-NLS-1$
Messages.getString("Controller.RestartApplicationQuestion")); //$NON-NLS-1$
// Restart
if (confirm) {
PlatformUI.getWorkbench().restart();
}
}
}
});
PlatformUI.getWorkbench().getActiveWorkbenchWindow().addPerspectiveListener(new IPerspectiveListener3() {
@Override
public void perspectiveActivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {
if (_perspectiveStatusLine != null) {
_perspectiveStatusLine.setText(perspective.getLabel());
}
}
@Override
public void perspectiveSavedAs(IWorkbenchPage page, IPerspectiveDescriptor oldPerspective, IPerspectiveDescriptor newPerspective) {
if (_perspectiveStatusLine != null) {
_perspectiveStatusLine.setText(newPerspective.getLabel());
}
}
@Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) {}
@Override
public void perspectiveClosed(IWorkbenchPage page, IPerspectiveDescriptor perspective) {}
@Override
public void perspectiveDeactivated(IWorkbenchPage page, IPerspectiveDescriptor perspective) {}
@Override
public void perspectiveOpened(IWorkbenchPage page, IPerspectiveDescriptor perspective) {}
@Override
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, IWorkbenchPartReference partRef, String changeId) {}
});
getEqualizerController().loadPresets();
if (getHSQLController().getLibraryTableReseted()) {
// getLibraryTableReseted() is true either on first run, or after a
// database update. In both case, we need to scan the library.
getEngine().setEnginePath(getPreferenceStore().getString(PreferenceConstants.P_MPLAYER_PATH));
doScanLibrary();
} else {
doScanDirectories();
}
/**
* Check for library modifications.
*/
if (getPreferenceStore().getBoolean(PreferenceConstants.AUTOMATIC_LIBRARY_UPDATE)) {
if (_dirList.countAllFileItems() != getHSQLController().getLibraryRecordCount()) {
Log.getInstance(Controller.class).info("Library is not synchonized, forced update."); //$NON-NLS-1$
doUpdateLibrary();
}
}
/**
* Process command line.
*/
if (getCommandLineParser() != null) {
if (getCommandLineParser().hasFileOnCLI()) {
processCLIFiles(getCommandLineParser().getFileList());
}
}
/**
* Check for new version.
*/
if (getPreferenceStore().getBoolean(PreferenceConstants.VERSION_CHECK_AT_STARTUP)) {
new VersionCheckerJobLauncher().start();
}
/**
* Update podcasts if required.
*/
if (getPreferenceStore().getBoolean(PreferenceConstants.PODCAST_UPDATE_AT_STARTUP)) {
new PodcastUpdaterJob(getPlaylistController().getPodcastListAsList()).schedule();
}
/**
* Launch podcast updater if required.
*/
if (getPreferenceStore().getBoolean(PreferenceConstants.PODCAST_AUTOMATIC_UPDATE)) {
_podcastUpdater = new PodcastAutomaticUpdater();
_podcastUpdater.start();
}
getStatusLineManager().setMessage(String.format(Messages.getString("Controller.WelcomeText"),
Integer.toString(Controller.getInstance().getStatisticsController().getLibraryRecordCount()),