history warning, overlay model fixes, new zoom system beginnings #445
80
go/ui/gcd.go
80
go/ui/gcd.go
|
@ -9,6 +9,7 @@ import (
|
||||||
"cwtch.im/ui/go/constants"
|
"cwtch.im/ui/go/constants"
|
||||||
"cwtch.im/ui/go/features/groups"
|
"cwtch.im/ui/go/features/groups"
|
||||||
"cwtch.im/ui/go/ui/android"
|
"cwtch.im/ui/go/ui/android"
|
||||||
|
"encoding/json"
|
||||||
"github.com/therecipe/qt/qml"
|
"github.com/therecipe/qt/qml"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -143,7 +144,7 @@ type GrandCentralDispatcher struct {
|
||||||
_ func() `constructor:"init"`
|
_ func() `constructor:"init"`
|
||||||
|
|
||||||
// legacy overlay model support
|
// legacy overlay model support
|
||||||
_ func(onion string, overlay int) `signal:"legacyLoadOverlay,auto"`
|
_ func(onion string) `signal:"legacyLoadOverlay,auto"`
|
||||||
_ func(handle, from, displayName, message, image string, mID string, fromMe bool, ts int64, ackd bool, error bool) `signal:"AppendMessage"`
|
_ func(handle, from, displayName, message, image string, mID string, fromMe bool, ts int64, ackd bool, error bool) `signal:"AppendMessage"`
|
||||||
_ func(handle, from, displayName, message, image string, mID string, fromMe bool, ts int64, ackd bool, error bool) `signal:"PrependMessage"`
|
_ func(handle, from, displayName, message, image string, mID string, fromMe bool, ts int64, ackd bool, error bool) `signal:"PrependMessage"`
|
||||||
}
|
}
|
||||||
|
@ -334,20 +335,31 @@ func (this *GrandCentralDispatcher) loadMessagesPaneHelper(handle string) {
|
||||||
updateLastReadTime(contact.Onion)
|
updateLastReadTime(contact.Onion)
|
||||||
this.SetToolbarTitle(nick)
|
this.SetToolbarTitle(nick)
|
||||||
|
|
||||||
this.legacyLoadOverlay(handle, 4)
|
this.legacyLoadOverlay(handle)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *GrandCentralDispatcher) legacyLoadOverlay(handle string, overlay int) {
|
func (this *GrandCentralDispatcher) legacyLoadOverlay(handle string) {
|
||||||
go this.legacyLoadOverlay_helper(handle, overlay)
|
// only do this for overlays 2 (bulletin) and 4 (lists)
|
||||||
|
go this.legacyLoadOverlay_helper(handle, []int{2,4})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *GrandCentralDispatcher) legacyLoadOverlay_helper(handle string, overlay int) {
|
func contains(arr []int, x int) bool {
|
||||||
|
for _, v := range arr {
|
||||||
|
if v == x {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *GrandCentralDispatcher) legacyLoadOverlay_helper(handle string, overlays []int) {
|
||||||
if isGroup(handle) {
|
if isGroup(handle) {
|
||||||
group := the.CwtchApp.GetPeer(this.selectedProfile()).GetGroup(handle)
|
group := the.CwtchApp.GetPeer(this.selectedProfile()).GetGroup(handle)
|
||||||
tl := group.GetTimeline()
|
tl := group.GetTimeline()
|
||||||
|
|
||||||
for i := len(tl) - 1; i >= 0; i-- {
|
for i := len(tl) - 1; i >= 0; i-- {
|
||||||
if tl[i].PeerID == the.Peer.GetOnion() {
|
if tl[i].PeerID == this.selectedProfile() {
|
||||||
handle = "me"
|
handle = "me"
|
||||||
} else {
|
} else {
|
||||||
handle = tl[i].PeerID
|
handle = tl[i].PeerID
|
||||||
|
@ -356,18 +368,22 @@ func (this *GrandCentralDispatcher) legacyLoadOverlay_helper(handle string, over
|
||||||
name := GetNick(tl[i].PeerID)
|
name := GetNick(tl[i].PeerID)
|
||||||
image := GetProfilePic(tl[i].PeerID)
|
image := GetProfilePic(tl[i].PeerID)
|
||||||
|
|
||||||
this.PrependMessage(
|
obj := &OverlayJSONObject{}
|
||||||
handle,
|
err := json.Unmarshal([]byte(tl[i].Message), obj)
|
||||||
tl[i].PeerID,
|
if err == nil && contains(overlays, obj.Overlay) {
|
||||||
name,
|
this.PrependMessage(
|
||||||
tl[i].Message,
|
handle,
|
||||||
image,
|
tl[i].PeerID,
|
||||||
string(tl[i].Signature),
|
name,
|
||||||
tl[i].PeerID == the.Peer.GetOnion(),
|
tl[i].Message,
|
||||||
tl[i].Timestamp.Unix(),
|
image,
|
||||||
tl[i].Received.Equal(time.Unix(0, 0)) == false, // If the received timestamp is epoch, we have not yet received this message through an active server
|
string(tl[i].Signature),
|
||||||
false,
|
tl[i].PeerID == this.selectedProfile(),
|
||||||
)
|
tl[i].Timestamp.Unix(),
|
||||||
|
tl[i].Received.Equal(time.Unix(0, 0)) == false, // If the received timestamp is epoch, we have not yet received this message through an active server
|
||||||
|
false,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {// !isGroup
|
} else {// !isGroup
|
||||||
|
@ -382,18 +398,22 @@ func (this *GrandCentralDispatcher) legacyLoadOverlay_helper(handle string, over
|
||||||
displayname := GetNick(messages[i].PeerID)
|
displayname := GetNick(messages[i].PeerID)
|
||||||
image := GetProfilePic(messages[i].PeerID)
|
image := GetProfilePic(messages[i].PeerID)
|
||||||
|
|
||||||
this.PrependMessage(
|
obj := &OverlayJSONObject{}
|
||||||
from,
|
err := json.Unmarshal([]byte(messages[i].Message), obj)
|
||||||
messages[i].PeerID,
|
if err == nil && contains(overlays, obj.Overlay) {
|
||||||
displayname,
|
this.PrependMessage(
|
||||||
messages[i].Message,
|
from,
|
||||||
image,
|
messages[i].PeerID,
|
||||||
string(messages[i].Signature),
|
displayname,
|
||||||
fromMe,
|
messages[i].Message,
|
||||||
messages[i].Timestamp.Unix(),
|
image,
|
||||||
messages[i].Acknowledged,
|
string(messages[i].Signature),
|
||||||
messages[i].Error != "",
|
fromMe,
|
||||||
)
|
messages[i].Timestamp.Unix(),
|
||||||
|
messages[i].Acknowledged,
|
||||||
|
messages[i].Error != "",
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@ import (
|
||||||
"cwtch.im/cwtch/model"
|
"cwtch.im/cwtch/model"
|
||||||
"cwtch.im/ui/go/the"
|
"cwtch.im/ui/go/the"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
|
||||||
|
//"encoding/hex"
|
||||||
"git.openprivacy.ca/openprivacy/log"
|
"git.openprivacy.ca/openprivacy/log"
|
||||||
"github.com/therecipe/qt/core"
|
"github.com/therecipe/qt/core"
|
||||||
"reflect"
|
"reflect"
|
||||||
|
@ -20,6 +22,7 @@ type MessageModel struct {
|
||||||
_ map[int]*core.QByteArray `property:"roles"`
|
_ map[int]*core.QByteArray `property:"roles"`
|
||||||
_ func() `constructor:"init"`
|
_ func() `constructor:"init"`
|
||||||
|
|
||||||
|
_ func(int) *MessageWrapper `slot:"getMessage,auto"`
|
||||||
_ func(int) `signal:"addMessage,auto"`
|
_ func(int) `signal:"addMessage,auto"`
|
||||||
_ func(int) `signal:"editMessage,auto"`
|
_ func(int) `signal:"editMessage,auto"`
|
||||||
_ func() `signal:"requestEIR,auto"`
|
_ func() `signal:"requestEIR,auto"`
|
||||||
|
@ -29,17 +32,22 @@ type MessageModel struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type MessageWrapper struct {
|
type MessageWrapper struct {
|
||||||
model.Message
|
|
||||||
core.QObject
|
core.QObject
|
||||||
|
model.Message
|
||||||
|
|
||||||
Timestamp int64
|
_ int64 `property:"timestamp"`
|
||||||
PeerID string
|
_ string `property:"peerID"`
|
||||||
Acknowledged bool
|
_ bool `property:"acknowledged"`
|
||||||
RawMessage string
|
_ string `property:"rawMessage"`
|
||||||
Error string
|
_ string `property:"error"`
|
||||||
Day string
|
_ string `property:"day"`
|
||||||
Signature string
|
_ string `property:"signature"`
|
||||||
_ bool `property:"ackd"`
|
_ bool `property:"ackd"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type OverlayJSONObject struct {
|
||||||
|
Overlay int `json:"o"`
|
||||||
|
Data string `json:"d"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *MessageModel) Handle() string {
|
func (this *MessageModel) Handle() string {
|
||||||
|
@ -51,13 +59,19 @@ func (this *MessageModel) setHandle(handle string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *MessageModel) init() {
|
func (this *MessageModel) init() {
|
||||||
mdt := reflect.TypeOf([]MessageWrapper{}).Elem()
|
sacrificialObject := NewMessageWrapper(nil)
|
||||||
|
mdt := reflect.TypeOf(*sacrificialObject)
|
||||||
roles := make(map[int]*core.QByteArray)
|
roles := make(map[int]*core.QByteArray)
|
||||||
for i := 0; i < mdt.NumField(); i++ {
|
for i := 0; i < mdt.NumField(); i++ {
|
||||||
if mdt.Field(i).Name == "Acknowledged" {
|
fieldName := mdt.Field(i).Name
|
||||||
|
if fieldName == "_" {
|
||||||
|
fieldName = mdt.Field(i).Tag.Get("property")
|
||||||
|
}
|
||||||
|
|
||||||
|
if fieldName == "acknowledged" {
|
||||||
this.ackIdx = int(core.Qt__UserRole) + 1 + i
|
this.ackIdx = int(core.Qt__UserRole) + 1 + i
|
||||||
}
|
}
|
||||||
roles[int(core.Qt__UserRole)+1+i] = core.NewQByteArray2(mdt.Field(i).Name, -1)
|
roles[int(core.Qt__UserRole)+1+i] = core.NewQByteArray2(fieldName, -1)
|
||||||
}
|
}
|
||||||
roles[int(core.Qt__DisplayRole)] = core.NewQByteArray2("display", -1)
|
roles[int(core.Qt__DisplayRole)] = core.NewQByteArray2("display", -1)
|
||||||
this.SetRoles(roles)
|
this.SetRoles(roles)
|
||||||
|
@ -133,16 +147,17 @@ func (this *MessageModel) getMessage(idx int) *MessageWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &MessageWrapper{
|
mw := NewMessageWrapper(nil)
|
||||||
Message: modelmsg,
|
mw.Message = modelmsg
|
||||||
Timestamp: modelmsg.Timestamp.Unix(),
|
mw.SetTimestamp(modelmsg.Timestamp.Unix())
|
||||||
RawMessage: modelmsg.Message,
|
mw.SetPeerID(modelmsg.PeerID)
|
||||||
PeerID: modelmsg.PeerID,
|
mw.SetError(modelmsg.Error)
|
||||||
Error: modelmsg.Error,
|
mw.SetAcknowledged(ackd)
|
||||||
Acknowledged: ackd,
|
mw.SetAckd(ackd)//??why both??
|
||||||
|
|||||||
Day: modelmsg.Timestamp.Format("January 2, 2006"),
|
mw.SetDay(modelmsg.Timestamp.Format("January 2, 2006"))
|
||||||
Signature: hex.EncodeToString(modelmsg.Signature),
|
mw.SetSignature(hex.EncodeToString(modelmsg.Signature))
|
||||||
}
|
mw.SetRawMessage(modelmsg.Message)
|
||||||
|
return mw
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *MessageModel) data(index *core.QModelIndex, role int) *core.QVariant {
|
func (this *MessageModel) data(index *core.QModelIndex, role int) *core.QVariant {
|
||||||
|
|
1
main.go
1
main.go
|
@ -40,6 +40,7 @@ var (
|
||||||
func init() {
|
func init() {
|
||||||
// make go-defined types available in qml
|
// make go-defined types available in qml
|
||||||
ui.GrandCentralDispatcher_QmlRegisterType2("CustomQmlTypes", 1, 0, "GrandCentralDispatcher")
|
ui.GrandCentralDispatcher_QmlRegisterType2("CustomQmlTypes", 1, 0, "GrandCentralDispatcher")
|
||||||
|
ui.MessageWrapper_QmlRegisterType2("CustomQmlTypes", 1, 0, "MessageWrapper")
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 365eedbd90eb936043e42f632355862d2a34c77a
|
Subproject commit dd8dde1fb38e296530570d31e95780ff707e2895
|
|
@ -8,6 +8,7 @@ import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
import "../opaque" as Opaque
|
import "../opaque" as Opaque
|
||||||
import "../opaque/styles"
|
import "../opaque/styles"
|
||||||
|
import "../opaque/theme"
|
||||||
import "../utils.js" as Utils
|
import "../utils.js" as Utils
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
@ -50,7 +51,18 @@ ColumnLayout {
|
||||||
maximumFlickVelocity: 800
|
maximumFlickVelocity: 800
|
||||||
|
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
id: cnxns1
|
||||||
|
target: mm
|
||||||
|
onRowsInserted: {
|
||||||
|
var msg = mm.getMessage(first);
|
||||||
|
var name = msg.peerID == gcd.selectedProfile ? "me" : mm.getNick(msg.peerID);
|
||||||
|
cnxns2.handler(msg.peerID, msg.peerID, name, msg.rawMessage, mm.getImage(msg.peerID), msg.signature, msg.peerID == gcd.selectedProfile, msg.timestamp, msg.ack, msg.error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
id: cnxns2
|
||||||
target: gcd
|
target: gcd
|
||||||
|
|
||||||
onClearMessages: function() {
|
onClearMessages: function() {
|
||||||
|
@ -139,11 +151,11 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
id: texttitle
|
id: texttitle
|
||||||
text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + from + "<br/>" + Qt.formatDateTime(new Date(timestamp*1000), "MMMM d, h:mm ap")
|
text: '<b>' + Utils.htmlEscaped(title) + '</b> by ' + displayName + "<br/>" + Qt.formatDateTime(new Date(timestamp*1000), "MMMM d, h:mm ap")
|
||||||
leftPadding: 10
|
leftPadding: 10
|
||||||
topPadding: 5
|
topPadding: 5
|
||||||
bottomPadding:5
|
bottomPadding:5
|
||||||
color: windowItem.cwtch_dark_color
|
color: Theme.mainTextColor
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -172,6 +184,7 @@ ColumnLayout {
|
||||||
leftPadding: 10
|
leftPadding: 10
|
||||||
topPadding: 10
|
topPadding: 10
|
||||||
width: parent.width - 50
|
width: parent.width - 50
|
||||||
|
color: Theme.mainTextColor
|
||||||
}
|
}
|
||||||
|
|
||||||
Opaque.Button {
|
Opaque.Button {
|
||||||
|
@ -212,6 +225,7 @@ ColumnLayout {
|
||||||
Text {
|
Text {
|
||||||
//: Post a new Bulletin Post
|
//: Post a new Bulletin Post
|
||||||
text: qsTr("post-new-bulletin-label")
|
text: qsTr("post-new-bulletin-label")
|
||||||
|
color: Theme.mainTextColor
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import QtQuick 2.7
|
||||||
import QtQuick.Controls 2.4
|
import QtQuick.Controls 2.4
|
||||||
import QtQuick.Controls.Material 2.0
|
import QtQuick.Controls.Material 2.0
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
import CustomQmlTypes 1.0
|
||||||
|
|
||||||
import "../opaque" as Opaque
|
import "../opaque" as Opaque
|
||||||
import "../opaque/controls" as Awesome
|
import "../opaque/controls" as Awesome
|
||||||
|
@ -11,7 +12,9 @@ import "../widgets" as W
|
||||||
import "../opaque/theme"
|
import "../opaque/theme"
|
||||||
|
|
||||||
W.Overlay {
|
W.Overlay {
|
||||||
|
id: overlayRoot
|
||||||
property bool loading
|
property bool loading
|
||||||
|
property string historyState: "DefaultDeleteHistory"
|
||||||
|
|
||||||
//horizontalPadding: 15 * gcd.themeScale
|
//horizontalPadding: 15 * gcd.themeScale
|
||||||
|
|
||||||
|
@ -59,8 +62,17 @@ W.Overlay {
|
||||||
header: Component {
|
header: Component {
|
||||||
Column {
|
Column {
|
||||||
width: messagesListView.width
|
width: messagesListView.width
|
||||||
|
Label {
|
||||||
|
width: messagesListView.width
|
||||||
|
font.pointSize: Theme.textSmallPt
|
||||||
|
font.weight: Font.Bold
|
||||||
|
color: Theme.chatOverlayWarningTextColor
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
text: overlayRoot.historyState
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
id: historyWarning
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
width: messagesListView.width
|
width: messagesListView.width
|
||||||
font.pointSize: Theme.textSmallPt
|
font.pointSize: Theme.textSmallPt
|
||||||
|
@ -68,9 +80,12 @@ W.Overlay {
|
||||||
color: Theme.chatOverlayWarningTextColor
|
color: Theme.chatOverlayWarningTextColor
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
//: This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
|
//: This conversation will be deleted when Cwtch is closed! Message history can be enabled per-conversation via the Settings menu in the upper right.
|
||||||
text: true ? qsTr("chat-history-disabled") :
|
text: overlayRoot.historyState == "DefaultDeleteHistory" ? qsTr("chat-history-default") : (
|
||||||
//: Message history is enabled.
|
//: Message history is disabled.
|
||||||
qsTr("chat-history-enabled")
|
overlayRoot.historyState == "DeleteHistoryConfirmed" ? qsTr("chat-history-disabled") :
|
||||||
|
//: Message history is enabled.
|
||||||
|
qsTr("chat-history-enabled")
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Opaque.Icon {
|
Opaque.Icon {
|
||||||
|
@ -89,20 +104,26 @@ W.Overlay {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
delegate: W.Message {
|
delegate: W.Message {
|
||||||
handle: PeerID
|
// unusual msg... syntax is due to qt stack weirdnesses
|
||||||
from: PeerID
|
// model injection doesn't work properly because MessageWrapper uses tagged QML properties
|
||||||
displayName: mm.getNick(PeerID)
|
// but reverting to struct properties prevents us from using mm.getMessage() in onRowsInserted sooooo
|
||||||
message: JSON.parse(RawMessage).d
|
property variant msg: mm.getMessage(index)
|
||||||
rawMessage: RawMessage
|
property variant obj: JSON.parse(msg.rawMessage)
|
||||||
image: mm.getImage(PeerID)
|
visible: obj.o == 1
|
||||||
messageID: Signature
|
height: visible ? implicitHeight : -messagesListView.spacing
|
||||||
fromMe: PeerID == gcd.selectedProfile
|
handle: msg.peerID
|
||||||
timestamp: parseInt(Timestamp)
|
from: msg.peerID
|
||||||
ackd: Acknowledged
|
displayName: mm.getNick(msg.peerID)
|
||||||
error: Error
|
message: obj.o == 1 ? obj.d : ""
|
||||||
calendarEvent: PeerID == "calendar"
|
//rawMessage: msg.rawMessage
|
||||||
|
image: mm.getImage(msg.peerID)
|
||||||
|
messageID: msg.signature
|
||||||
|
fromMe: msg.peerID == gcd.selectedProfile
|
||||||
|
timestamp: parseInt(msg.timestamp)
|
||||||
|
//ackd: acknowledged
|
||||||
|
//error: msg.error
|
||||||
|
calendarEvent: msg.peerID == "calendar"
|
||||||
// listview doesnt do anchors right
|
// listview doesnt do anchors right
|
||||||
// https://stackoverflow.com/questions/31381997/why-does-anchors-fill-does-not-work-in-a-qml-listviews-delegates-subviews-and/31382307
|
// https://stackoverflow.com/questions/31381997/why-does-anchors-fill-does-not-work-in-a-qml-listviews-delegates-subviews-and/31382307
|
||||||
width: messagesListView.width - scrollbar.width
|
width: messagesListView.width - scrollbar.width
|
||||||
|
@ -159,6 +180,10 @@ W.Overlay {
|
||||||
messagesListView.positionViewAtEnd()
|
messagesListView.positionViewAtEnd()
|
||||||
thymer.running = true
|
thymer.running = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onSupplyPeerSettings: function(onion, nick, authorization, saveHistory) {
|
||||||
|
overlayRoot.historyState = saveHistory
|
||||||
erinn marked this conversation as resolved
sarah
commented
I'd like to see a qml check on onion == handle here even if the logic is also being handled by the gcd I'd like to see a qml check on onion == handle here even if the logic is also being handled by the gcd
|
|||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import QtQuick.Controls 2.4
|
||||||
import QtQuick.Controls.Material 2.0
|
import QtQuick.Controls.Material 2.0
|
||||||
import QtQuick.Controls 1.4
|
import QtQuick.Controls 1.4
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Layouts 1.3
|
||||||
|
import CustomQmlTypes 1.0
|
||||||
|
|
||||||
import "../opaque" as Opaque
|
import "../opaque" as Opaque
|
||||||
import "../opaque/controls" as Awesome
|
import "../opaque/controls" as Awesome
|
||||||
|
@ -28,7 +29,7 @@ ColumnLayout {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
|
|
||||||
//: ex: "... paste an address here to add a contact ..."
|
//: ex: "Find..."
|
||||||
placeholderText: qsTr("search-list")
|
placeholderText: qsTr("search-list")
|
||||||
horizontalAlignment: TextInput.AlignHCenter
|
horizontalAlignment: TextInput.AlignHCenter
|
||||||
icon: gcd.assetPath + "core/search-24px.webp"
|
icon: gcd.assetPath + "core/search-24px.webp"
|
||||||
|
@ -78,7 +79,18 @@ ColumnLayout {
|
||||||
maximumFlickVelocity: 800
|
maximumFlickVelocity: 800
|
||||||
|
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
id: cnxns1
|
||||||
|
target: mm
|
||||||
|
onRowsInserted: {
|
||||||
|
var msg = mm.getMessage(first);
|
||||||
|
var name = msg.peerID == gcd.selectedProfile ? "me" : mm.getNick(msg.peerID);
|
||||||
|
cnxns2.handler(msg.peerID, msg.peerID, name, msg.rawMessage, mm.getImage(msg.peerID), msg.signature, msg.peerID == gcd.selectedProfile, msg.timestamp, msg.ack, msg.error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
id: cnxns2
|
||||||
target: gcd
|
target: gcd
|
||||||
|
|
||||||
onClearMessages: function() {
|
onClearMessages: function() {
|
||||||
|
|
|
@ -82,14 +82,11 @@ Opaque.SettingsList { // settingsPane
|
||||||
|
|
||||||
isToggled: root.authorization == Const.auth_blocked
|
isToggled: root.authorization == Const.auth_blocked
|
||||||
onToggled: function() {
|
onToggled: function() {
|
||||||
console.log("peer block toddle for " + txtOnion.text + " currently: " + root.authorization)
|
|
||||||
if (root.authorization == Const.auth_blocked) {
|
if (root.authorization == Const.auth_blocked) {
|
||||||
root.authorization = Const.auth_unknown
|
root.authorization = Const.auth_unknown
|
||||||
console.log("setPeerAuthorization to " + Const.auth_unknown + " for " + txtOnion.text)
|
|
||||||
gcd.setPeerAuthorization(txtOnion.text, Const.auth_unknown)
|
gcd.setPeerAuthorization(txtOnion.text, Const.auth_unknown)
|
||||||
} else {
|
} else {
|
||||||
root.authorization = Const.auth_blocked
|
root.authorization = Const.auth_blocked
|
||||||
console.log("setPeerAuthorization to " + Const.auth_blocked + " for " + txtOnion.text)
|
|
||||||
gcd.setPeerAuthorization(txtOnion.text, Const.auth_blocked)
|
gcd.setPeerAuthorization(txtOnion.text, Const.auth_blocked)
|
||||||
}
|
}
|
||||||
isToggled = root.authorization == Const.auth_blocked
|
isToggled = root.authorization == Const.auth_blocked
|
||||||
|
|
|
@ -12,7 +12,8 @@ import "../opaque/fonts"
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
height: Math.max(imgProfile.height, rectMessageBubble.height)
|
implicitHeight: Math.max(imgProfile.height, rectMessageBubble.height)
|
||||||
|
height: implicitHeight
|
||||||
color: Theme.backgroundMainColor
|
color: Theme.backgroundMainColor
|
||||||
|
|
||||||
property string message
|
property string message
|
||||||
|
|
|
@ -79,6 +79,10 @@ ColumnLayout {
|
||||||
id: statusText
|
id: statusText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
width: parent.width - 2 * Theme.paddingMinimal
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
elide: Text.ElideRight
|
||||||
|
wrapMode: Text.NoWrap
|
||||||
text: ""
|
text: ""
|
||||||
visible: text != ""
|
visible: text != ""
|
||||||
size: Theme.chatMetaTextSize
|
size: Theme.chatMetaTextSize
|
||||||
|
|
|
@ -28,12 +28,12 @@ Item {
|
||||||
id: control
|
id: control
|
||||||
width: parent.width
|
width: parent.width
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 10 * gcd.themeScale
|
anchors.topMargin: 10
|
||||||
|
|
||||||
anchors.bottom: msgEd.top
|
anchors.bottom: msgEd.top
|
||||||
anchors.bottomMargin: 10 * gcd.themeScale
|
anchors.bottomMargin: 10
|
||||||
|
|
||||||
horizontalPadding: 15 * gcd.themeScale
|
horizontalPadding: 15
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ Item {
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.rightMargin: 15 * gcd.themeScale
|
anchors.rightMargin: 15
|
||||||
anchors.leftMargin: 15 * gcd.themeScale
|
anchors.leftMargin: 15
|
||||||
|
|
||||||
onSendClicked: function(messageText) {
|
onSendClicked: function(messageText) {
|
||||||
root.sendClicked(messageText)
|
root.sendClicked(messageText)
|
||||||
|
|
Reference in New Issue
I beleive this disinguishes outbound messages that have been acked with inbound messages that we have acked.