|
|
@ -84,6 +84,12 @@ static QString fromRaw(dev::h256 _n, unsigned* _inc = nullptr) |
|
|
|
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"); |
|
|
|
|
|
|
|
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_qwebConnector = new QWebThreeConnector(); |
|
|
|
m_server = unique_ptr<WebThreeStubServer>(new WebThreeStubServer(m_qwebConnector, *web3(), keysAsVector(owned()))); |
|
|
|
m_server->StartListening(); |
|
|
|
|
|
|
|
|
|
|
|
connect(ui->webView, &QWebView::loadStarted, [this]() |
|
|
|
{ |
|
|
|
// NOTE: no need to delete as QETH_INSTALL_JS_NAMESPACE adopts it.
|
|
|
|
m_qweb = new QWebThree(this); |
|
|
|
auto qweb = m_qweb; |
|
|
|
m_qwebConnector->setQWeb(qweb); |
|
|
|
|
|
|
|
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); |
|
|
|
QWebFrame* f = ui->webView->page()->mainFrame(); |
|
|
|
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)); |
|
|
|
}); |
|
|
|
|
|
|
@ -1126,10 +1133,7 @@ void Main::ourAccountsRowsMoved() |
|
|
|
m_myKeys = myKeys; |
|
|
|
|
|
|
|
if (m_server.get()) |
|
|
|
{ |
|
|
|
auto list = owned().toStdList(); |
|
|
|
m_server->setAccounts({std::begin(list), std::end(list)}); |
|
|
|
} |
|
|
|
m_server->setAccounts(keysAsVector(owned())); |
|
|
|
} |
|
|
|
|
|
|
|
void Main::on_inject_triggered() |
|
|
|