From c50fc0ba65dcb7cd2e0cb8394c652bf5be96f181 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 14 Jul 2015 16:25:21 +0200 Subject: [PATCH 1/3] Change the URL when the page changes. Fixes #1215 --- alethzero/MainWin.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index dd3d5bbd3..393e47879 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -232,6 +232,10 @@ Main::Main(QWidget *parent) : { ui->tabWidget->setTabText(0, ui->webView->title()); }); + connect(ui->webView, &QWebEngineView::urlChanged, [=](QUrl const& _url) + { + ui->urlEdit->setText(_url.toString()); + }); m_dappHost.reset(new DappHost(8081)); m_dappLoader = new DappLoader(this, web3(), getNameReg()); From fc5bc756f6c977f5e6bea7fa2c27f0aba255e827 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 14 Jul 2015 18:08:37 +0200 Subject: [PATCH 2/3] Do not change the URLs of Dapps. --- alethzero/DappHost.cpp | 13 +++++++++++-- alethzero/DappHost.h | 6 +++++- alethzero/MainWin.cpp | 3 ++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/alethzero/DappHost.cpp b/alethzero/DappHost.cpp index fd73c1b17..3b0661ad1 100644 --- a/alethzero/DappHost.cpp +++ b/alethzero/DappHost.cpp @@ -28,7 +28,11 @@ using namespace dev; DappHost::DappHost(int _port, int _threads): - m_port(_port), m_threads(_threads), m_running(false), m_daemon(nullptr) + m_port(_port), + m_url(QString("http://localhost:%1/").arg(m_port)), + m_threads(_threads), + m_running(false), + m_daemon(nullptr) { startListening(); } @@ -135,5 +139,10 @@ QUrl DappHost::hostDapp(Dapp&& _dapp) for (ManifestEntry const& entry: m_dapp.manifest.entries) m_entriesByPath[QString::fromStdString(entry.path)] = &entry; - return QUrl(QString("http://localhost:%1/").arg(m_port)); + return m_url; +} + +bool DappHost::servesUrl(QUrl const& _url) const +{ + return m_url == _url || m_url.isParentOf(_url); } diff --git a/alethzero/DappHost.h b/alethzero/DappHost.h index 985bd34d9..50dff741d 100644 --- a/alethzero/DappHost.h +++ b/alethzero/DappHost.h @@ -40,6 +40,9 @@ public: /// Load and host a dapp. Previsous dapp in discarded. Synchronous QUrl hostDapp(Dapp&& _dapp); + /// @returns true if the given url is served from this DappHost. + bool servesUrl(QUrl const& _url) const; + private: void startListening(); void stopListening(); @@ -48,7 +51,8 @@ private: void sendResponse(std::string const& _url, MHD_Connection* _connection); static int callback(void* _cls, MHD_Connection* _connection, char const* _url, char const* _method, char const* _version, char const* _uploadData, size_t* _uploadDataSize, void** _conCls); - int m_port; + int const m_port; + QUrl const m_url; int m_threads; bool m_running; MHD_Daemon* m_daemon; diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 393e47879..e48b58283 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -234,7 +234,8 @@ Main::Main(QWidget *parent) : }); connect(ui->webView, &QWebEngineView::urlChanged, [=](QUrl const& _url) { - ui->urlEdit->setText(_url.toString()); + if (!m_dappHost->servesUrl(_url)) + ui->urlEdit->setText(_url.toString()); }); m_dappHost.reset(new DappHost(8081)); From 498d3e477cdd105157523334534f2272e084f120 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 15 Jul 2015 01:38:11 +0200 Subject: [PATCH 3/3] getstuff downloads llvm 3.7svn on windows --- extdep/getstuff.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/extdep/getstuff.bat b/extdep/getstuff.bat index 3c0b42f95..a718650b7 100644 --- a/extdep/getstuff.bat +++ b/extdep/getstuff.bat @@ -11,6 +11,7 @@ call :download curl 7.4.2 call :download jsoncpp 1.6.2 call :download json-rpc-cpp 0.5.0 call :download leveldb 1.2 +call :download llvm 3.7svn call :download microhttpd 0.9.2 call :download qt 5.4.1 call :download miniupnpc 1.9