ubuntu: port to oxide

This commit is contained in:
Maxim Ermilov 2014-10-17 01:45:03 +04:00
parent a40a10f1ea
commit 88b71b3a57
3 changed files with 9 additions and 14 deletions

View File

@ -21,9 +21,9 @@
* *
*/ */
import QtQuick 2.0 import QtQuick 2.0
import QtWebKit 3.0
import Ubuntu.Components.Popups 0.1 import Ubuntu.Components.Popups 0.1
import Ubuntu.Components 0.1 import Ubuntu.Components 0.1
import com.canonical.Oxide 1.0
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
@ -60,10 +60,9 @@ Rectangle {
y: urlEntry.height y: urlEntry.height
height: parent.height - y height: parent.height - y
url: url1 url: url1
onLoadingChanged: { id: _view
if (loadRequest.status) { onLoadingStateChanged: {
root.exec("InAppBrowser", "loadFinished", [loadRequest.status]) root.exec("InAppBrowser", "loadFinished", [_view.loading])
}
} }
} }
} }

View File

@ -91,14 +91,10 @@ void Inappbrowser::injectScriptCode(int, int, const QString&, bool) {
qCritical() << "unimplemented " << __PRETTY_FUNCTION__; qCritical() << "unimplemented " << __PRETTY_FUNCTION__;
} }
void Inappbrowser::loadFinished(int status) { void Inappbrowser::loadFinished(bool status) {
if (status == 2) { if (status) {
this->callbackWithoutRemove(_eventCb, LOADERROR_EVENT); this->callbackWithoutRemove(_eventCb, LOADSTOP_EVENT);
} } else {
if (status == 0) {
this->callbackWithoutRemove(_eventCb, LOADSTART_EVENT); this->callbackWithoutRemove(_eventCb, LOADSTART_EVENT);
} }
if (status == 3) {
this->callbackWithoutRemove(_eventCb, LOADSTOP_EVENT);
}
} }

View File

@ -52,7 +52,7 @@ public slots:
void injectScriptFile(int cb, int, const QString&, bool); void injectScriptFile(int cb, int, const QString&, bool);
void injectScriptCode(int cb, int, const QString&, bool); void injectScriptCode(int cb, int, const QString&, bool);
void loadFinished(int status); void loadFinished(bool status);
private: private:
int _eventCb; int _eventCb;