summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2011-11-22 16:22:48 (EST)
committer Steffen Pingel2011-11-22 16:22:48 (EST)
commitf86f0941bcf02484938212277431ae2811902ca4 (patch)
treea369e8c7e1744e0015b463e7d978f65fb847a80b
parent7fc3057e5d0c28088d654371343adc609fbbb76e (diff)
downloadorg.eclipse.mylyn.tasks-f86f0941bcf02484938212277431ae2811902ca4.zip
org.eclipse.mylyn.tasks-f86f0941bcf02484938212277431ae2811902ca4.tar.gz
org.eclipse.mylyn.tasks-f86f0941bcf02484938212277431ae2811902ca4.tar.bz2
NEW - bug 364240: don't reset content type when switching to preview
page https://bugs.eclipse.org/bugs/show_bug.cgi?id=364240
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java11
1 files changed, 7 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java
index dd1b193..48830e9 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/TaskAttachmentPage.java
@@ -8,6 +8,7 @@
* Contributors:
* Jeff Pound - initial API and implementation
* Tasktop Technologies - improvements
+ * Tomasz Zarna (IBM) - fixes for bug 364240
*******************************************************************************/
package org.eclipse.mylyn.tasks.ui.wizards;
@@ -339,10 +340,12 @@ public class TaskAttachmentPage extends WizardPage {
@Override
public void setVisible(boolean visible) {
if (visible) {
- fileNameText.setText(taskAttachment.getFileName() == null ? "" : taskAttachment.getFileName()); //$NON-NLS-1$
- if (fileNameText.getText().length() == 0) {
- setFilePath(getModel().getSource().getName());
- setContentType(getModel().getSource().getContentType());
+ if (!fileNameText.getText().equals(taskAttachment.getFileName())) {
+ fileNameText.setText(taskAttachment.getFileName() == null ? "" : taskAttachment.getFileName()); //$NON-NLS-1$
+ if (fileNameText.getText().length() == 0) {
+ setFilePath(getModel().getSource().getName());
+ setContentType(getModel().getSource().getContentType());
+ }
}
}
super.setVisible(visible);