Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2015-10-20 16:34:20 -0400
committerSam Davis2015-10-26 14:43:09 -0400
commit8c5430a89c374befd9f4decba3e6653a52eca743 (patch)
treeb9b469363d3afc7ff5a41dbcefab8554ca5ca227
parentd5f28859e25cd1423e6a0e8067292cfdc40ce9f9 (diff)
downloadorg.eclipse.mylyn.tasks-8c5430a89c374befd9f4decba3e6653a52eca743.tar.gz
org.eclipse.mylyn.tasks-8c5430a89c374befd9f4decba3e6653a52eca743.tar.xz
org.eclipse.mylyn.tasks-8c5430a89c374befd9f4decba3e6653a52eca743.zip
480057: connect mylyn notification appears on every eclipse start
Change-Id: Ifdf476f150e7994d8b79262b22f85e88c6fc24fa Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=480057
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskListViewTest.java21
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/ITasksUiPreferenceConstants.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java10
3 files changed, 29 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskListViewTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskListViewTest.java
index 48ac43870..d89d1307d 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskListViewTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/ui/TaskListViewTest.java
@@ -21,11 +21,15 @@ import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
import org.eclipse.mylyn.internal.tasks.core.TaskCategory;
import org.eclipse.mylyn.internal.tasks.core.TaskList;
import org.eclipse.mylyn.internal.tasks.core.TaskTask;
+import org.eclipse.mylyn.internal.tasks.ui.ITasksUiPreferenceConstants;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.tests.TaskTestUtil;
import org.eclipse.mylyn.tasks.tests.connector.MockRepositoryConnector;
import org.eclipse.mylyn.tasks.ui.ITasksUiConstants;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
/**
* @author Steffen Pingel
@@ -93,6 +97,23 @@ public class TaskListViewTest extends TestCase {
assertEquals(selection, view.getViewer().getSelection());
}
+ public void testWelcomeMessage() throws WorkbenchException {
+ TasksUiPlugin.getDefault()
+ .getPreferenceStore()
+ .setValue(ITasksUiPreferenceConstants.WELCOME_MESSAGE, Boolean.toString(false));
+ // Closing the task list view somehow causes a widget disposed error in testBooleanAttribute,
+ // so instead we need to open a new window to create a new task list view
+ IWorkbenchWindow window = PlatformUI.getWorkbench().openWorkbenchWindow(null);
+ try {
+ window.getActivePage().showView(ITasksUiConstants.ID_VIEW_TASKS);
+ assertTrue(TasksUiPlugin.getDefault()
+ .getPreferenceStore()
+ .getBoolean(ITasksUiPreferenceConstants.WELCOME_MESSAGE));
+ } finally {
+ window.close();
+ }
+ }
+
private String toString(TreeSelection s1) {
StringBuilder sb = new StringBuilder();
for (TreePath path : s1.getPaths()) {
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 3dee8e8a6..ed1ee4a03 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
@@ -112,4 +112,6 @@ public interface ITasksUiPreferenceConstants {
public static final String LAST_SERVICE_MESSAGE_CHECKTIME = "org.eclipse.mylyn.tasks.ui.servicemessage.checktime"; //$NON-NLS-1$
+ public static final String WELCOME_MESSAGE = "org.eclipse.mylyn.tasks.ui.welcome.message"; //$NON-NLS-1$
+
}
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 177c57b50..41a5be8a7 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
@@ -843,16 +843,18 @@ public class TaskListView extends AbstractTaskListView implements IPropertyChang
}
}
- String lastClosedId = TasksUiPlugin.getDefault()
+ boolean showedWelcomeMessage = TasksUiPlugin.getDefault()
.getPreferenceStore()
- .getString(ITasksUiPreferenceConstants.LAST_SERVICE_MESSAGE_ID);
-
- if (showMessage && lastClosedId.equals("")) { //$NON-NLS-1$
+ .getBoolean(ITasksUiPreferenceConstants.WELCOME_MESSAGE);
+ if (showMessage && !showedWelcomeMessage) {
ServiceMessage message = new ServiceMessage("welcome"); //$NON-NLS-1$
message.setDescription(Messages.TaskListView_Welcome_Message);
message.setTitle(Messages.TaskListView_Welcome_Message_Title);
message.setImage(Dialog.DLG_IMG_MESSAGE_INFO);
serviceMessageControl.setMessage(message);
+ TasksUiPlugin.getDefault()
+ .getPreferenceStore()
+ .setValue(ITasksUiPreferenceConstants.WELCOME_MESSAGE, Boolean.toString(true));
}
TasksUiPlugin.getDefault().getServiceMessageManager().addServiceMessageListener(serviceMessageControl);

Back to the top