linkbrowser: prefer xdg-open over Desktop.open and browse
Desktop.open/Desktop.browse doesn't work on Linux with gtk3 See JDK-8275494
This commit is contained in:
@@ -60,17 +60,17 @@ public class LinkBrowser
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attemptDesktopBrowse(url))
|
|
||||||
{
|
|
||||||
log.debug("Opened url through Desktop#browse to {}", url);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (shouldAttemptXdg && attemptXdgOpen(url))
|
if (shouldAttemptXdg && attemptXdgOpen(url))
|
||||||
{
|
{
|
||||||
log.debug("Opened url through xdg-open to {}", url);
|
log.debug("Opened url through xdg-open to {}", url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (attemptDesktopBrowse(url))
|
||||||
|
{
|
||||||
|
log.debug("Opened url through Desktop#browse to {}", url);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
log.warn("LinkBrowser.browse() could not open {}", url);
|
log.warn("LinkBrowser.browse() could not open {}", url);
|
||||||
showMessageBox("Unable to open link. Press 'OK' and the link will be copied to your clipboard.", url);
|
showMessageBox("Unable to open link. Press 'OK' and the link will be copied to your clipboard.", url);
|
||||||
@@ -91,18 +91,18 @@ public class LinkBrowser
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (shouldAttemptXdg && attemptXdgOpen(directory))
|
||||||
|
{
|
||||||
|
log.debug("Opened directory through xdg-open to {}", directory);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (attemptDesktopOpen(directory))
|
if (attemptDesktopOpen(directory))
|
||||||
{
|
{
|
||||||
log.debug("Opened directory through Desktop#open to {}", directory);
|
log.debug("Opened directory through Desktop#open to {}", directory);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldAttemptXdg && attemptXdgOpen(directory))
|
|
||||||
{
|
|
||||||
log.debug("Opened directory through xdg-open to {}", directory);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
log.warn("LinkBrowser.open() could not open {}", directory);
|
log.warn("LinkBrowser.open() could not open {}", directory);
|
||||||
showMessageBox("Unable to open folder. Press 'OK' and the folder directory will be copied to your clipboard.", directory);
|
showMessageBox("Unable to open folder. Press 'OK' and the folder directory will be copied to your clipboard.", directory);
|
||||||
}).start();
|
}).start();
|
||||||
|
|||||||
Reference in New Issue
Block a user