You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2017/12/14 19:27:28 UTC

[GitHub] surajpindoria closed pull request #174: CB-3360 Fix Oxide version & support _system target for ubuntu

surajpindoria closed pull request #174: CB-3360 Fix Oxide version & support _system target for ubuntu
URL: https://github.com/apache/cordova-plugin-inappbrowser/pull/174
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/src/ubuntu/InAppBrowser.qml b/src/ubuntu/InAppBrowser.qml
index 781e8a6e..bb8a4189 100644
--- a/src/ubuntu/InAppBrowser.qml
+++ b/src/ubuntu/InAppBrowser.qml
@@ -23,7 +23,7 @@
 import QtQuick 2.0
 import Ubuntu.Components.Popups 0.1
 import Ubuntu.Components 0.1
-import com.canonical.Oxide 1.0
+import com.canonical.Oxide 1.10
 
 Rectangle {
     anchors.fill: parent
diff --git a/src/ubuntu/inappbrowser.cpp b/src/ubuntu/inappbrowser.cpp
index c5a9e64a..cd9f13a8 100644
--- a/src/ubuntu/inappbrowser.cpp
+++ b/src/ubuntu/inappbrowser.cpp
@@ -50,15 +50,25 @@ const char LOADSTART_EVENT[] = "{type: 'loadstart'}";
 const char LOADSTOP_EVENT[] = "{type: 'loadstop'}";
 const char LOADERROR_EVENT[] = "{type: 'loaderror'}";
 
-void Inappbrowser::open(int cb, int, const QString &url, const QString &, const QString &) {
+void Inappbrowser::open(int cb, int,
+                        const QString &url,
+                        const QString &windowName,
+                        const QString &windowFeatures) {
     assert(_eventCb == 0);
 
     _eventCb = cb;
 
-    QString path = m_cordova->get_app_dir() + "/../qml/InAppBrowser.qml";
-    QString qml = QString(code)
-      .arg(CordovaInternal::format(path)).arg(CordovaInternal::format(url));
-    m_cordova->execQML(qml);
+    if (windowName == "_blank") {
+      QString path = m_cordova->get_app_dir() + "/../qml/InAppBrowser.qml";
+      QString qml = QString(code)
+        .arg(CordovaInternal::format(path)).arg(CordovaInternal::format(url));
+
+      m_cordova->execQML(qml);
+    } else if (windowName == "_system") {
+      // TODO: use ual?
+      m_cordova->execQML(
+          QString("Qt.openUrlExternally(\"%1\")").arg(url));
+    }
 }
 
 void Inappbrowser::show(int, int) {
diff --git a/src/ubuntu/inappbrowser.h b/src/ubuntu/inappbrowser.h
index 1da4e033..a31d5606 100644
--- a/src/ubuntu/inappbrowser.h
+++ b/src/ubuntu/inappbrowser.h
@@ -44,7 +44,9 @@ class Inappbrowser: public CPlugin {
     }
 
 public slots:
-    void open(int cb, int, const QString &url, const QString &windowName, const QString &windowFeatures);
+    void open(int cb, int,
+              const QString &url, const QString &windowName,
+              const QString &windowFeatures);
     void show(int, int);
     void close(int, int);
     void injectStyleFile(int cb, int, const QString&, bool);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org