From 87b6d9b184168b8558a574799cfa34efc04d5f06 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Thu, 27 Apr 2023 15:38:26 +0200 Subject: Copy url to clipboard on failed browse (#66) --- src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt index 050937022..5aa6915bd 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/OSUtils.kt @@ -19,10 +19,11 @@ object OSUtils { Desktop.getDesktop().browse(URI(url)) } catch (e: IOException) { e.printStackTrace() - LorenzUtils.error("[SkyHanni] Error opening website!") + LorenzUtils.error("[SkyHanni] Error opening website: $url!") } } else { - LorenzUtils.warning("[SkyHanni] Web browser is not supported!") + copyToClipboard(url) + LorenzUtils.warning("[SkyHanni] Web browser is not supported! Copied url to clipboard.") } } @@ -52,4 +53,4 @@ object OSUtils { if (this.isKeyDown || this.isPressed) return true return false } -} \ No newline at end of file +} -- cgit