diff options
author | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-11 18:40:12 +0800 |
---|---|---|
committer | Taylor Gerring <taylor.gerring@gmail.com> | 2015-02-11 18:40:12 +0800 |
commit | cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007 (patch) | |
tree | ab28c518bd1b78f6b8ac8b241951ad161cb268a9 /ui/qt | |
parent | 21fd31dad8bc6e0291ca405314b516670333c707 (diff) | |
parent | c6af5f0a275608ea6c797ef826e6090885f24eac (diff) | |
download | go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.gz go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.bz2 go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.lz go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.xz go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.tar.zst go-tangerine-cfddb7f3cd3b8cecb1e59412ce4db5769f6c8007.zip |
Merge branch 'develop' into jsonrpc
Conflicts:
rpc/ws/server.go
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/filter.go | 19 | ||||
-rw-r--r-- | ui/qt/qwhisper/whisper.go | 5 | ||||
-rw-r--r-- | ui/qt/webengine/all.cpp | 1 | ||||
-rw-r--r-- | ui/qt/webengine/cpp/webengine.cpp | 6 | ||||
-rw-r--r-- | ui/qt/webengine/cpp/webengine.h | 14 | ||||
-rw-r--r-- | ui/qt/webengine/webengine.go | 18 |
6 files changed, 50 insertions, 13 deletions
diff --git a/ui/qt/filter.go b/ui/qt/filter.go index 423d5bd43..bd3ad0303 100644 --- a/ui/qt/filter.go +++ b/ui/qt/filter.go @@ -3,30 +3,27 @@ package qt import ( "github.com/ethereum/go-ethereum/core" "github.com/ethereum/go-ethereum/ui" - "gopkg.in/qml.v1" + "github.com/obscuren/qml" ) func NewFilterFromMap(object map[string]interface{}, eth core.EthManager) *core.Filter { filter := ui.NewFilterFromMap(object, eth) - if object["altered"] != nil { - filter.Altered = makeAltered(object["altered"]) + if object["topics"] != nil { + filter.SetTopics(makeTopics(object["topics"])) } return filter } -func makeAltered(v interface{}) (d []core.AccountChange) { +func makeTopics(v interface{}) (d [][]byte) { if qList, ok := v.(*qml.List); ok { - var s []interface{} + var s []string qList.Convert(&s) - d = makeAltered(s) - } else if qMap, ok := v.(*qml.Map); ok { - var m map[string]interface{} - qMap.Convert(&m) - - d = makeAltered(m) + d = ui.MakeTopics(s) + } else if str, ok := v.(string); ok { + d = ui.MakeTopics(str) } return diff --git a/ui/qt/qwhisper/whisper.go b/ui/qt/qwhisper/whisper.go index 644c147b7..2bc455b0b 100644 --- a/ui/qt/qwhisper/whisper.go +++ b/ui/qt/qwhisper/whisper.go @@ -1,3 +1,4 @@ +// QWhisper package. This package is temporarily on hold until QML DApp dev will reemerge. package qwhisper import ( @@ -7,7 +8,7 @@ import ( "github.com/ethereum/go-ethereum/ethutil" "github.com/ethereum/go-ethereum/logger" "github.com/ethereum/go-ethereum/whisper" - "gopkg.in/qml.v1" + "github.com/obscuren/qml" ) var qlogger = logger.NewLogger("QSHH") @@ -105,7 +106,7 @@ func (self *Whisper) Messages(id int) (messages *ethutil.List) { func filterFromMap(opts map[string]interface{}) (f whisper.Filter) { if to, ok := opts["to"].(string); ok { - f.To = crypto.ToECDSA(fromHex(to)) + f.To = crypto.ToECDSAPub(fromHex(to)) } if from, ok := opts["from"].(string); ok { f.From = crypto.ToECDSAPub(fromHex(from)) diff --git a/ui/qt/webengine/all.cpp b/ui/qt/webengine/all.cpp new file mode 100644 index 000000000..3b7c2f7b8 --- /dev/null +++ b/ui/qt/webengine/all.cpp @@ -0,0 +1 @@ +#include "cpp/webengine.cpp" diff --git a/ui/qt/webengine/cpp/webengine.cpp b/ui/qt/webengine/cpp/webengine.cpp new file mode 100644 index 000000000..118b451ef --- /dev/null +++ b/ui/qt/webengine/cpp/webengine.cpp @@ -0,0 +1,6 @@ +#include <QtWebEngine> +#include "webengine.h" + +void webengineInitialize() { + QtWebEngine::initialize(); +} diff --git a/ui/qt/webengine/cpp/webengine.h b/ui/qt/webengine/cpp/webengine.h new file mode 100644 index 000000000..9c3b13bfa --- /dev/null +++ b/ui/qt/webengine/cpp/webengine.h @@ -0,0 +1,14 @@ +#ifndef WEBENGINE_H +#define WEBENGINE_H + +#ifdef __cplusplus +extern "C" { +#endif + +void webengineInitialize(); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // WEBENGINE_H diff --git a/ui/qt/webengine/webengine.go b/ui/qt/webengine/webengine.go new file mode 100644 index 000000000..600dbb6cb --- /dev/null +++ b/ui/qt/webengine/webengine.go @@ -0,0 +1,18 @@ +package webengine + +// #cgo CPPFLAGS: -I./ +// #cgo CXXFLAGS: -std=c++0x -pedantic-errors -Wall -fno-strict-aliasing +// #cgo LDFLAGS: -lstdc++ +// #cgo pkg-config: Qt5WebEngine +// +// #include "cpp/webengine.h" +import "C" + +import "github.com/obscuren/qml" + +// Initializes the WebEngine extension. +func Initialize() { + qml.RunMain(func() { + C.webengineInitialize() + }) +} |