RetroShare/retroshare-qml-app/src/qml/AddTrustedNode.qml
Gio 8d6d3d1894 Retroshare QML App: Implemesh some basic stuff
Implement location creation, selection and login
Implement people listing
Implement firends adding (not working yet)
Depend on androidextra qt module only if compiling for android
LibresapiLocalClient parse one line at time to avoid error if two
requests are sent rapidly one after another
LibresapiLocalClient socket path now is a parameter of openConnection()
to use it as qml type constructor without parameter must be useful
Added JSONListModel for JASON based MVC pattern
2016-09-15 13:07:13 +02:00

40 lines
736 B
QML

import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import org.retroshare.qml_components.LibresapiLocalClient 1.0
Item
{
Component.onCompleted:
{
rsApi.openConnection(apiSocketPath)
rsApi.request("/peers/self/certificate/", "")
}
LibresapiLocalClient
{
id: rsApi
onGoodResponseReceived: myKeyField.text = JSON.parse(msg).data.cert_string
}
ColumnLayout
{
anchors.top: parent.top
anchors.bottom: bottomButton.top
TextField { id: myKeyField }
TextField { id: otherKeyField }
}
Button
{
id: bottomButton
text: "Add trusted node"
anchors.bottom: parent.bottom
onClicked:
{
rsApi.request("/peers/examine_cert/", JSON.stringify({ cert_string: otherKeyField.text }))
}
}
}