Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2010-03-15 15:10:39 -0400
committersminto2010-03-15 15:10:39 -0400
commitcc6f98af9b97db61c188f1d92ca851fad396c99d (patch)
tree5e5fa3a6f3675e2319a94d1b31e2fd00fd74003d /org.eclipse.mylyn.tasks.core
parent3818292daeda96e5ab3a6240795b68ec70219022 (diff)
downloadorg.eclipse.mylyn.tasks-cc6f98af9b97db61c188f1d92ca851fad396c99d.tar.gz
org.eclipse.mylyn.tasks-cc6f98af9b97db61c188f1d92ca851fad396c99d.tar.xz
org.eclipse.mylyn.tasks-cc6f98af9b97db61c188f1d92ca851fad396c99d.zip
NEW - bug 305199: show Windows Task Bar progress for manually triggered synchronizations
https://bugs.eclipse.org/bugs/show_bug.cgi?id=305199
Diffstat (limited to 'org.eclipse.mylyn.tasks.core')
-rw-r--r--org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java19
1 files changed, 19 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java
index 163b17f10..a4471e2ee 100644
--- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java
+++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/internal/tasks/core/sync/SynchronizeRepositoriesJob.java
@@ -17,12 +17,15 @@ import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.Map;
import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
@@ -58,6 +61,8 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob {
private final IRepositoryModel tasksModel;
+ private final Map<QualifiedName, Object> properties = new ConcurrentHashMap<QualifiedName, Object>();
+
public SynchronizeRepositoriesJob(TaskList taskList, TaskDataManager taskDataManager, IRepositoryModel tasksModel,
IRepositoryManager repositoryManager) {
super(Messages.SynchronizeRepositoriesJob_Synchronizing_Task_List);
@@ -173,6 +178,8 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob {
job.setUser(isUser());
job.setFullSynchronization(true);
job.setPriority(Job.DECORATE);
+ // propagate all properties from the current job to the newly created job to make sure the job icon, showing progress on the system taskbar, etc. are maintained.
+ copyPropertiesTo(job);
if (isUser()) {
job.schedule();
} else {
@@ -180,6 +187,18 @@ public class SynchronizeRepositoriesJob extends SynchronizationJob {
}
}
+ private void copyPropertiesTo(SynchronizeQueriesJob job) {
+ for (QualifiedName key : properties.keySet()) {
+ job.setProperty(key, properties.get(key));
+ }
+ }
+
+ @Override
+ public void setProperty(QualifiedName key, Object value) {
+ super.setProperty(key, value);
+ properties.put(key, value);
+ }
+
@Override
public boolean belongsTo(Object family) {
return ITasksCoreConstants.JOB_FAMILY_SYNCHRONIZATION == family;

Back to the top