Skip to content

Commit

Permalink
cross platform support
Browse files Browse the repository at this point in the history
fixes #27
  • Loading branch information
gdelmas committed Jul 26, 2014
1 parent b147941 commit 06bfdde
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/de/dreamlab/dash/DashLauncher.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@

package de.dreamlab.dash;

import com.intellij.execution.ExecutionException;
import com.intellij.execution.configurations.GeneralCommandLine;
import com.intellij.execution.util.ExecUtil;
import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;

import java.awt.Desktop;
import java.io.UnsupportedEncodingException;
import java.net.URI;
import java.net.URLEncoder;
import java.util.Collection;

Expand Down Expand Up @@ -54,17 +53,15 @@ public void search(Collection<String> keywords, String query)
}
}

private void openUri(String uri)
private void openUri(String uriStr)
{
try {
final GeneralCommandLine commandLine = new GeneralCommandLine(ExecUtil.getOpenCommandPath());
commandLine.addParameter(uri);
commandLine.createProcess();

Desktop desktop = Desktop.getDesktop();
URI uri = new URI(uriStr);
desktop.browse(uri);
}
catch ( ExecutionException e ) {
catch (Throwable e) {
Notifications.Bus.notify(new Notification("Dash Plugin Error", "Dash Plugin Error", e.getMessage(), NotificationType.ERROR));
return;
}
}

Expand Down

0 comments on commit 06bfdde

Please sign in to comment.