From 07dc0bfbc419f3523b9e47ddbf833b00007d9083 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Wed, 12 Sep 2012 14:32:38 +0200 Subject: [PATCH] class library: use QWebView for openHTMLFile when available Signed-off-by: Tim Blechmann --- .../Common/GUI/PlusGUI/Collections/StringPlusGUI.sc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc b/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc index 2b4280f11..bc2e578d1 100644 --- a/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc +++ b/SCClassLibrary/Common/GUI/PlusGUI/Collections/StringPlusGUI.sc @@ -4,11 +4,22 @@ } openHTMLFile{ arg selectionStart=0, selectionLength=0; + var webView; + if (Platform.openHTMLFileAction.notNil) { - Platform.openHTMLFileAction.value(this, selectionStart, selectionLength) - } { - this.openDocument(selectionStart, selectionLength) - } + Platform.openHTMLFileAction.value(this, selectionStart, selectionLength); + ^this + }; + + webView = \QWebView.asClass; + if (webView.notNil) { + webView = webView.new; + webView.url_(this); + webView.front; + ^this; + }; + + this.openDocument(selectionStart, selectionLength) } openDocument { arg selectionStart=0, selectionLength=0; -- 2.11.4.GIT