|
@ -84,6 +84,12 @@ static QString fromRaw(dev::h256 _n, unsigned* _inc = nullptr) |
|
|
return QString(); |
|
|
return QString(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static std::vector<dev::KeyPair> keysAsVector(QList<dev::KeyPair> const& keys) |
|
|
|
|
|
{ |
|
|
|
|
|
auto list = keys.toStdList(); |
|
|
|
|
|
return {std::begin(list), std::end(list)}; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Address c_config = Address("661005d2720d855f1d9976f88bb10c1a3398c77f"); |
|
|
Address c_config = Address("661005d2720d855f1d9976f88bb10c1a3398c77f"); |
|
|
|
|
|
|
|
|
Main::Main(QWidget *parent) : |
|
|
Main::Main(QWidget *parent) : |
|
@ -133,20 +139,21 @@ Main::Main(QWidget *parent) : |
|
|
|
|
|
|
|
|
m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir() + "/AlethZero", false, {"eth", "shh"})); |
|
|
m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir() + "/AlethZero", false, {"eth", "shh"})); |
|
|
|
|
|
|
|
|
|
|
|
m_qwebConnector = new QWebThreeConnector(); |
|
|
|
|
|
m_server = unique_ptr<WebThreeStubServer>(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(owned()))); |
|
|
|
|
|
m_server->StartListening(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
connect(ui->webView, &QWebView::loadStarted, [this]() |
|
|
connect(ui->webView, &QWebView::loadStarted, [this]() |
|
|
{ |
|
|
{ |
|
|
// NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it.
|
|
|
// NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it.
|
|
|
m_qweb = new QWebThree(this); |
|
|
m_qweb = new QWebThree(this); |
|
|
auto qweb = m_qweb; |
|
|
auto qweb = m_qweb; |
|
|
|
|
|
m_qwebConnector->setQWeb(qweb); |
|
|
|
|
|
|
|
|
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); |
|
|
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); |
|
|
QWebFrame* f = ui->webView->page()->mainFrame(); |
|
|
QWebFrame* f = ui->webView->page()->mainFrame(); |
|
|
f->disconnect(SIGNAL(javaScriptWindowObjectCleared())); |
|
|
f->disconnect(SIGNAL(javaScriptWindowObjectCleared())); |
|
|
|
|
|
|
|
|
auto list = owned().toStdList(); |
|
|
|
|
|
m_server = unique_ptr<WebThreeStubServer>(new WebThreeStubServer(new QWebThreeConnector(qweb), *web3(), {std::begin(list), std::end(list)})); |
|
|
|
|
|
m_server->StartListening(); |
|
|
|
|
|
|
|
|
|
|
|
connect(f, &QWebFrame::javaScriptWindowObjectCleared, QETH_INSTALL_JS_NAMESPACE(f, this, qweb)); |
|
|
connect(f, &QWebFrame::javaScriptWindowObjectCleared, QETH_INSTALL_JS_NAMESPACE(f, this, qweb)); |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -1126,10 +1133,7 @@ void Main::ourAccountsRowsMoved() |
|
|
m_myKeys = myKeys; |
|
|
m_myKeys = myKeys; |
|
|
|
|
|
|
|
|
if (m_server.get()) |
|
|
if (m_server.get()) |
|
|
{ |
|
|
m_server->setAccounts(keysAsVector(owned())); |
|
|
auto list = owned().toStdList(); |
|
|
|
|
|
m_server->setAccounts({std::begin(list), std::end(list)}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void Main::on_inject_triggered() |
|
|
void Main::on_inject_triggered() |
|
|