diff options
author | sminto | 2005-08-17 21:29:18 +0000 |
---|---|---|
committer | sminto | 2005-08-17 21:29:18 +0000 |
commit | 2feffe761a7ca361c7fcd3cde0e42ee2645b70c8 (patch) | |
tree | 5e873a8a9e3f0c68ba605864e72e978fe29c1769 /org.eclipse.mylyn.bugzilla.ui | |
parent | b7859ff52aeb19c38322f26aadc5cbe2969112e9 (diff) | |
download | org.eclipse.mylyn.tasks-2feffe761a7ca361c7fcd3cde0e42ee2645b70c8.tar.gz org.eclipse.mylyn.tasks-2feffe761a7ca361c7fcd3cde0e42ee2645b70c8.tar.xz org.eclipse.mylyn.tasks-2feffe761a7ca361c7fcd3cde0e42ee2645b70c8.zip |
fixed Bug #106926: too many "download failed" messages in log
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r-- | org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java index c4942765d..c154a88d6 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java @@ -26,6 +26,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.ISchedulingRule; import org.eclipse.core.runtime.jobs.Job; import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.mylar.bugzilla.core.BugReport; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; import org.eclipse.mylar.bugzilla.core.BugzillaRepository; @@ -42,6 +43,7 @@ import org.eclipse.mylar.tasklist.Task; import org.eclipse.mylar.tasklist.TaskListImages; import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Display; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PlatformUI; @@ -216,14 +218,26 @@ public class BugzillaTask extends Task { try { // XXX make sure to send in the server name if there are multiple repositories if(BugzillaPlugin.getDefault() == null){ - MylarPlugin.log("Bugreport download failed for: " + getBugId(getHandle()) + " due to bugzilla core not existing", this); + MylarPlugin.log("Bug Beport download failed for: " + getBugId(getHandle()) + " due to bugzilla core not existing", this); return null; } return BugzillaRepository.getInstance().getBug(getBugId(getHandle())); } catch (LoginException e) { - MylarPlugin.log(e, "download failed"); + Workbench.getInstance().getDisplay().asyncExec(new Runnable() { + + public void run() { + MessageDialog.openError(Display.getDefault().getActiveShell(), "Report Download Failed", "The bugzilla report failed to be downloaded since your username or password is incorrect."); + } + }); } catch (IOException e) { - MylarPlugin.log(e, "download failed"); + Workbench.getInstance().getDisplay().asyncExec(new Runnable() { + public void run() { + ((ApplicationWindow)BugzillaPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow()).setStatus("Download of bug " + + getBugId(getHandle()) + + " failed due to I/O exception"); + } + }); +// MylarPlugin.log(e, "download failed due to I/O exception"); } return null; } @@ -300,6 +314,7 @@ public class BugzillaTask extends Task { if (mode == MylarTasklistPlugin.ReportOpenMode.EDITOR) { try{ + // if we can reach the server, get the latest for the bug if(!isBugDownloaded()){ input.getBugTask().downloadReport(); input.setOfflineBug(input.getBugTask().getBugReport()); @@ -539,7 +554,7 @@ public class BugzillaTask extends Task { Font f = super.getFont(); if(f != null) return f; - if (getState() != BugzillaTask.BugTaskState.FREE) { + if (getState() != BugzillaTask.BugTaskState.FREE || bugReport == null) { return ITALIC; } return null; |