feat: add nim-chronicles

This commit is contained in:
Richard Ramos 2020-05-21 15:07:55 -04:00 committed by RichΛrd
parent 6d34c8fa79
commit 1a92cda0d9
8 changed files with 32 additions and 8 deletions

15
.gitmodules vendored
View File

@ -19,3 +19,18 @@
[submodule "vendor/nimqml"]
path = vendor/nimqml
url = https://github.com/status-im/nimqml
[submodule "vendor/nim-chronicles"]
path = vendor/nim-chronicles
url = https://github.com/status-im/nim-chronicles
[submodule "vendor/nim-faststreams"]
path = vendor/nim-faststreams
url = https://github.com/status-im/nim-faststreams/
[submodule "vendor/nim-chronos"]
path = vendor/nim-chronos
url = https://github.com/status-im/nim-chronos
[submodule "vendor/nim-json-serialization"]
path = vendor/nim-json-serialization
url = https://github.com/status-im/nim-json-serialization
[submodule "vendor/nim-serialization"]
path = vendor/nim-serialization
url = https://github.com/status-im/nim-serialization/

View File

@ -1,8 +1,12 @@
import NimQml
import chronicles
import "../../status/core" as status
import ../signals/types
import nodeView
logScope:
topics = "node"
type NodeController* = ref object of SignalSubscriber
view*: NodeView
variant*: QVariant
@ -24,6 +28,6 @@ proc init*(self: NodeController) =
discard
method onSignal(self: NodeController, data: Signal) =
echo "new signal received"
debug "New signal received"
var msg = cast[WalletSignal](data)
self.view.setLastMessage(msg.content)

View File

@ -1,4 +1,5 @@
import NimQml
import chronicles
import app/chat/core as chat
import app/wallet/core as wallet
import app/node/core as node
@ -18,6 +19,9 @@ import state
var signalsQObjPointer: pointer
logScope:
topics = "main"
proc mainProc() =
let app = newQApplication()
let engine = newQQmlApplicationEngine()
@ -33,13 +37,10 @@ proc mainProc() =
signalsQObjPointer = cast[pointer](signalController.vptr)
var appState = state.newAppState()
echo appState.title
debug "Application State", title=appState.title
var accounts = status_test.setupNewAccount()
echo "---------"
echo parseJSON(accounts)[0]
echo parseJSON(accounts)[1]
echo "---------"
debug "Accounts", accounts0 = parseJSON(accounts)[0], accounts1 = parseJSON(accounts)[1]
status_chat.startMessenger()
@ -69,8 +70,6 @@ proc mainProc() =
appState.subscribe(proc () =
# chatsModel.names = @[]
for channel in appState.channels:
echo channel.name
# chatsModel.addNameTolist(channel.name)
chat.join(channel.name)
)
@ -91,6 +90,7 @@ proc mainProc() =
# Qt main event loop is entered here
# The termination of the loop will be performed when exit() or quit() is called
info "Starting application..."
app.exec()
when isMainModule:

1
vendor/nim-chronicles vendored Submodule

@ -0,0 +1 @@
Subproject commit fc3f2d3755e035387ebcf20d87a45eb9dcefadbb

1
vendor/nim-chronos vendored Submodule

@ -0,0 +1 @@
Subproject commit bce0f878d16bea14395dc8944ff8dbdeffe33496

1
vendor/nim-faststreams vendored Submodule

@ -0,0 +1 @@
Subproject commit d3ef34b325eafca43405ee2b8390e1b6f218b644

1
vendor/nim-json-serialization vendored Submodule

@ -0,0 +1 @@
Subproject commit aa51f6fed1715a91fd8b58072a1915422a133d4a

1
vendor/nim-serialization vendored Submodule

@ -0,0 +1 @@
Subproject commit 8a013591bda4c5357154207060e62b5cc1eff6c8