Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2010-05-25 17:08:33 -0400
committerrelves2010-05-25 17:08:33 -0400
commit59230af2cab7f285ff5d2e74484f0e48fe4ae64b (patch)
tree59a34d6f98e0147df7f93fa7e6e2c73811e5872d /org.eclipse.mylyn.tasks.ui
parentfb465fd26be2b505c2c2ffda3fe12af4d8f323be (diff)
downloadorg.eclipse.mylyn.tasks-59230af2cab7f285ff5d2e74484f0e48fe4ae64b.tar.gz
org.eclipse.mylyn.tasks-59230af2cab7f285ff5d2e74484f0e48fe4ae64b.tar.xz
org.eclipse.mylyn.tasks-59230af2cab7f285ff5d2e74484f0e48fe4ae64b.zip
NEW - bug 263528: display a repository service message to warn users of problems, updates, and other relevant information
https://bugs.eclipse.org/bugs/show_bug.cgi?id=263528
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java4
4 files changed, 11 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java
index d032ee9b5..cbab31ffe 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java
@@ -91,7 +91,7 @@ public interface ITasksUiPreferenceConstants {
public static final String DEFAULT_ATTACHMENTS_DIRECTORY = "org.eclipse.mylyn.tasks.ui.attachments.defaultDirectory"; //$NON-NLS-1$
public static final String PREFERRED_TASK_ATTACHMENT_VIEWER_ID = "org.eclipse.mylyn.tasks.ui.attachments.preferredViewerID"; //$NON-NLS-1$
-
+
public static final String SERVICE_MESSAGE_URL = "org.eclipse.mylyn.tasks.ui.servicemessage.url"; //$NON-NLS-1$;
public static final String LAST_SERVICE_MESSAGE_ID = "org.eclipse.mylyn.tasks.ui.servicemessage.id"; //$NON-NLS-1$
@@ -99,4 +99,6 @@ public interface ITasksUiPreferenceConstants {
public static final String LAST_SERVICE_MESSAGE_ETAG = "org.eclipse.mylyn.tasks.ui.servicemessage.etag"; //$NON-NLS-1$
public static final String LAST_SERVICE_MESSAGE_LAST_MODIFIED = "org.eclipse.mylyn.tasks.ui.servicemessage.lastmodified"; //$NON-NLS-1$
+
+ public static final String LAST_SERVICE_MESSAGE_CHECKTIME = "org.eclipse.mylyn.tasks.ui.servicemessage.checktime"; //$NON-NLS-1$
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
index 272ad3031..46fc71d61 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiPlugin.java
@@ -619,9 +619,11 @@ public class TasksUiPlugin extends AbstractUIPlugin {
String lastMod = getPreferenceStore().getString(
ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_LAST_MODIFIED);
String etag = getPreferenceStore().getString(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_ETAG);
+ String serviceMessageUrl = getPreferenceStore().getString(ITasksUiPreferenceConstants.SERVICE_MESSAGE_URL);
- serviceMessageManager = new ServiceMessageManager(getPreferenceStore().getString(
- ITasksUiPreferenceConstants.SERVICE_MESSAGE_URL), lastMod, etag);
+ Long checktime = getPreferenceStore().getLong(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_CHECKTIME);
+
+ serviceMessageManager = new ServiceMessageManager(serviceMessageUrl, lastMod, etag, checktime);
if (getPreferenceStore().getBoolean(ITasksUiPreferenceConstants.SERVICE_MESSAGES_ENABLED)) {
serviceMessageManager.start();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java
index 39ed42680..9c6fc95ba 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/notifications/TaskListServiceMessageControl.java
@@ -11,6 +11,8 @@
package org.eclipse.mylyn.internal.tasks.ui.notifications;
+import java.util.Date;
+
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
@@ -214,7 +216,9 @@ public class TaskListServiceMessageControl implements IServiceMessageListener {
switch (event.getEventKind()) {
case MESSAGE_UPDATE:
IPreferenceStore preferenceStore = TasksUiPlugin.getDefault().getPreferenceStore();
+ preferenceStore.setValue(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_CHECKTIME, new Date().getTime());
String lastMessageId = preferenceStore.getString(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_ID);
+
for (final ServiceMessage message : event.getMessages()) {
if (!message.isValid() || message.getId().equals("-1")) { //$NON-NLS-1$
continue;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index 5cd041a55..9d526f6c7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -64,9 +64,7 @@ import org.eclipse.mylyn.internal.tasks.core.AbstractTaskContainer;
import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener;
import org.eclipse.mylyn.internal.tasks.core.ITasksCoreConstants;
import org.eclipse.mylyn.internal.tasks.core.TaskContainerDelta;
-import org.eclipse.mylyn.internal.tasks.core.notifications.ServiceMessageEvent;
import org.eclipse.mylyn.internal.tasks.core.notifications.ServiceMessageManager;
-import org.eclipse.mylyn.internal.tasks.core.notifications.ServiceMessageEvent.EVENT_KIND;
import org.eclipse.mylyn.internal.tasks.ui.AbstractTaskListFilter;
import org.eclipse.mylyn.internal.tasks.ui.CategorizedPresentation;
import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
@@ -942,8 +940,6 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener, I
serviceMessageControl = new TaskListServiceMessageControl(body);
ServiceMessageManager manager = TasksUiPlugin.getDefault().getServiceMessageManager();
- serviceMessageControl.handleEvent(new ServiceMessageEvent(manager, EVENT_KIND.MESSAGE_UPDATE,
- manager.getServiceMessages()));
TasksUiPlugin.getDefault().getServiceMessageManager().addServiceMessageListener(serviceMessageControl);
// Need to do this because the page, which holds the active working set is not around on creation, see bug 203179

Back to the top