Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfbecker2011-06-29 13:14:21 -0400
committerfbecker2011-06-29 13:14:21 -0400
commitd7bdddd0158c9523d5bfc965c1accc8c0cc6bb73 (patch)
treeece09277e5c9aaa09b04f4a3708a3467dd000726
parent0c1d6c747e7be4b4913a39172b542e291a674a5e (diff)
downloadorg.eclipse.mylyn.tasks-d7bdddd0158c9523d5bfc965c1accc8c0cc6bb73.tar.gz
org.eclipse.mylyn.tasks-d7bdddd0158c9523d5bfc965c1accc8c0cc6bb73.tar.xz
org.eclipse.mylyn.tasks-d7bdddd0158c9523d5bfc965c1accc8c0cc6bb73.zip
ASSIGNED - bug 345056: disable the submit button if we know that we get an error
https://bugs.eclipse.org/bugs/show_bug.cgi?id=345056
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java15
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java60
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties2
4 files changed, 37 insertions, 42 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
index 3518964b2..e9470dcce 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/BugzillaTaskDataHandler.java
@@ -221,7 +221,20 @@ public class BugzillaTaskDataHandler extends AbstractTaskDataHandler {
}
}
},
- VERSION_CURRENT(4.7f) {
+ VERSION_4_7(4.7f) {
+ @Override
+ void migrate(TaskRepository repository, TaskData data, BugzillaRepositoryConnector connector) {
+ TaskAttribute exporter = data.getRoot().getAttribute(BugzillaAttribute.EXPORTER_NAME.getKey());
+ if (exporter == null) {
+ String exporterName = repository.getUserName();
+ if (exporterName != null && !exporterName.equals("")) { //$NON-NLS-1$
+ exporter = data.getRoot().createAttribute(BugzillaAttribute.EXPORTER_NAME.getKey());
+ exporter.setValue(exporterName);
+ }
+ }
+ }
+ },
+ VERSION_CURRENT(4.8f) {
@Override
void migrate(TaskRepository repository, TaskData data, BugzillaRepositoryConnector connector) {
data.setVersion(TaskDataVersion.VERSION_CURRENT.toString());
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
index 4c54c9633..b8ca27809 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/SaxMultiBugReportContentHandler.java
@@ -322,6 +322,8 @@ public class SaxMultiBugReportContentHandler extends DefaultHandler {
if (exporter != null) {
createAttrribute(exporter, BugzillaAttribute.EXPORTER_NAME);
+ } else {
+ createAttrribute("", BugzillaAttribute.EXPORTER_NAME); //$NON-NLS-1$
}
break;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
index 42acc3194..5ac2e55e2 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditorPage.java
@@ -545,46 +545,26 @@ public class BugzillaTaskEditorPage extends AbstractTaskEditorPage {
});
return false;
}
-// if (!getModel().getTaskData().isNew()) {
-// TaskAttribute exporter = getModel().getTaskData()
-// .getRoot()
-// .getAttribute(BugzillaAttribute.EXPORTER_NAME.getKey());
-// if (exporter == null) {
-// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_submit_disabled_please_refresh,
-// type, new HyperlinkAdapter() {
-// @Override
-// public void linkActivated(HyperlinkEvent e) {
-// ITask task = getModel().getTask();
-// AbstractRepositoryConnector connector = TasksUi.getRepositoryManager()
-// .getRepositoryConnector(task.getConnectorKind());
-// if (connector == null) {
-// return;
-// }
-// TasksUiInternal.synchronizeTask(connector, task, true, new JobChangeAdapter() {
-// @Override
-// public void done(IJobChangeEvent event) {
-// PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
-// public void run() {
-// try {
-// getTaskEditor().refreshPages();
-// } finally {
-// if (getTaskEditor() != null) {
-// getTaskEditor().showBusy(false);
-// }
-// }
-// }
-// });
-// }
-// });
-// }
-// });
-// }
-// });
-// return false;
-// }
-// }
+ if (!getModel().getTaskData().isNew()) {
+ TaskAttribute exporter = getModel().getTaskData()
+ .getRoot()
+ .getAttribute(BugzillaAttribute.EXPORTER_NAME.getKey());
+ if (exporter == null || exporter.getValue().equals("")) { //$NON-NLS-1$
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ getTaskEditor().setMessage(Messages.BugzillaTaskEditorPage_submit_disabled_please_refresh,
+ type, new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ TasksUiUtil.openEditRepositoryWizard(taskRepository);
+ refresh();
+ }
+ });
+ }
+ });
+ return false;
+ }
+ }
return true;
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
index bc3ad6911..ec01b9b96 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/messages.properties
@@ -37,7 +37,7 @@ BugzillaTaskEditorPage_Please_enter_a_description_before_submitting=Please enter
BugzillaTaskEditorPage_Please_enter_a_short_summary_before_submitting=Please enter a short summary before submitting
BugzillaTaskEditorPage_Please_select_a_component_before_submitting=Please select a component before submitting
BugzillaTaskEditorPage_Please_enter_a_bugid_for_duplicate_of_before_submitting=Please enter a bugid for \"duplicate of\" before submitting
-BugzillaTaskEditorPage_submit_disabled_please_refresh=submit disabled, please refresh
+BugzillaTaskEditorPage_submit_disabled_please_refresh=submit disabled, please check Credentials and refresh
BugzillaVotesEditor_Show_votes=Show votes
BugzillaVotesEditor_Vote=Vote

Back to the top