From f3e78c8f3cd2196ef70a41f298b6df556543d581 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 28 Jan 2015 10:23:18 +0100 Subject: reworking messages => log --- ui/filter.go | 26 +++++++++----------------- ui/qt/filter.go | 17 +++++++---------- 2 files changed, 16 insertions(+), 27 deletions(-) (limited to 'ui') diff --git a/ui/filter.go b/ui/filter.go index e0797dad2..8f298a40c 100644 --- a/ui/filter.go +++ b/ui/filter.go @@ -28,14 +28,9 @@ func NewFilterFromMap(object map[string]interface{}, eth core.EthManager) *core. filter.SetLatestBlock(val.Int()) } - if object["to"] != nil { - val := ethutil.NewValue(object["to"]) - filter.AddTo(fromHex(val.Str())) - } - - if object["from"] != nil { - val := ethutil.NewValue(object["from"]) - filter.AddFrom(fromHex(val.Str())) + if object["address"] != nil { + val := ethutil.NewValue(object["address"]) + filter.SetAddress(fromHex(val.Str())) } if object["max"] != nil { @@ -48,8 +43,8 @@ func NewFilterFromMap(object map[string]interface{}, eth core.EthManager) *core. filter.SetSkip(int(val.Uint())) } - if object["altered"] != nil { - filter.Altered = makeAltered(object["altered"]) + if object["topics"] != nil { + filter.SetTopics(MakeTopics(object["topics"])) } return filter @@ -70,16 +65,13 @@ func mapToAccountChange(m map[string]interface{}) (d core.AccountChange) { // data can come in in the following formats: // ["aabbccdd", {id: "ccddee", at: "11223344"}], "aabbcc", {id: "ccddee", at: "1122"} -func makeAltered(v interface{}) (d []core.AccountChange) { +func MakeTopics(v interface{}) (d [][]byte) { if str, ok := v.(string); ok { - d = append(d, core.AccountChange{fromHex(str), nil}) - } else if obj, ok := v.(map[string]interface{}); ok { - d = append(d, mapToAccountChange(obj)) - } else if slice, ok := v.([]interface{}); ok { + d = append(d, fromHex(str)) + } else if slice, ok := v.([]string); ok { for _, item := range slice { - d = append(d, makeAltered(item)...) + d = append(d, fromHex(item)) } } - return } diff --git a/ui/qt/filter.go b/ui/qt/filter.go index 423d5bd43..cb4d0311b 100644 --- a/ui/qt/filter.go +++ b/ui/qt/filter.go @@ -9,24 +9,21 @@ import ( 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 -- cgit v1.2.3 From fb7c03ff4dc759f7dd2fc5cee65b46111cbb7375 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 28 Jan 2015 14:51:54 +0100 Subject: switched to obscuren/qml --- ui/qt/filter.go | 2 +- ui/qt/qwhisper/whisper.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/qt/filter.go b/ui/qt/filter.go index cb4d0311b..bd3ad0303 100644 --- a/ui/qt/filter.go +++ b/ui/qt/filter.go @@ -3,7 +3,7 @@ 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 { diff --git a/ui/qt/qwhisper/whisper.go b/ui/qt/qwhisper/whisper.go index 644c147b7..22671f1b5 100644 --- a/ui/qt/qwhisper/whisper.go +++ b/ui/qt/qwhisper/whisper.go @@ -7,7 +7,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") -- cgit v1.2.3 From adda54ac5537b9f5e93a9b66ea6907a71da45aaf Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 28 Jan 2015 20:50:20 +0100 Subject: Added webengine initializer --- ui/qt/webengine/all.cpp | 1 + ui/qt/webengine/cpp/webengine.cpp | 6 ++++++ ui/qt/webengine/cpp/webengine.h | 14 ++++++++++++++ ui/qt/webengine/webengine.go | 18 ++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 ui/qt/webengine/all.cpp create mode 100644 ui/qt/webengine/cpp/webengine.cpp create mode 100644 ui/qt/webengine/cpp/webengine.h create mode 100644 ui/qt/webengine/webengine.go (limited to 'ui') 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 +#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() + }) +} -- cgit v1.2.3 From c03d403437c20584bcbf3cf3fa9d79ac7a0a8ca7 Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 30 Jan 2015 13:25:12 +0100 Subject: Added whisper interface for xeth, added examples, updated RPC * Added RPC methods for whisper * Added whisper example --- ui/qt/qwhisper/whisper.go | 1 + 1 file changed, 1 insertion(+) (limited to 'ui') diff --git a/ui/qt/qwhisper/whisper.go b/ui/qt/qwhisper/whisper.go index 22671f1b5..98bfc69b0 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 ( -- cgit v1.2.3 From e40c1c62ce0c2d9567066d84ea74fd24b424a81a Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 5 Feb 2015 15:00:59 -0800 Subject: API changed to use Pubkey only. Reflected that change in the rest of the api --- ui/qt/qwhisper/whisper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ui') diff --git a/ui/qt/qwhisper/whisper.go b/ui/qt/qwhisper/whisper.go index 98bfc69b0..2bc455b0b 100644 --- a/ui/qt/qwhisper/whisper.go +++ b/ui/qt/qwhisper/whisper.go @@ -106,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)) -- cgit v1.2.3