qml: move (un)freeze buttons next to can send/receive info
This commit is contained in:
@@ -102,15 +102,30 @@ Pane {
|
|||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
FormattedAmount {
|
RowLayout {
|
||||||
visible: !channeldetails.frozenForSending && channeldetails.isOpen
|
visible: channeldetails.isOpen
|
||||||
amount: channeldetails.canSend
|
FormattedAmount {
|
||||||
|
visible: !channeldetails.frozenForSending
|
||||||
|
amount: channeldetails.canSend
|
||||||
|
singleLine: false
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
visible: channeldetails.frozenForSending
|
||||||
|
text: qsTr('n/a (frozen)')
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 1
|
||||||
|
}
|
||||||
|
FlatButton {
|
||||||
|
Layout.minimumWidth: implicitWidth
|
||||||
|
// icon.source: '../../icons/warning.png'
|
||||||
|
// icon.color: 'transparent'
|
||||||
|
text: channeldetails.frozenForSending ? qsTr('Unfreeze') : qsTr('Freeze')
|
||||||
|
onClicked: channeldetails.freezeForSending()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: channeldetails.frozenForSending && channeldetails.isOpen
|
|
||||||
text: qsTr('n/a (frozen)')
|
|
||||||
}
|
|
||||||
Label {
|
Label {
|
||||||
visible: !channeldetails.isOpen
|
visible: !channeldetails.isOpen
|
||||||
text: qsTr('n/a (channel not open)')
|
text: qsTr('n/a (channel not open)')
|
||||||
@@ -121,15 +136,31 @@ Pane {
|
|||||||
color: Material.accentColor
|
color: Material.accentColor
|
||||||
}
|
}
|
||||||
|
|
||||||
FormattedAmount {
|
RowLayout {
|
||||||
visible: !channeldetails.frozenForReceiving && channeldetails.isOpen
|
visible: channeldetails.isOpen
|
||||||
amount: channeldetails.canReceive
|
FormattedAmount {
|
||||||
|
visible: !channeldetails.frozenForReceiving
|
||||||
|
amount: channeldetails.canReceive
|
||||||
|
singleLine: false
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
visible: channeldetails.frozenForReceiving
|
||||||
|
text: qsTr('n/a (frozen)')
|
||||||
|
}
|
||||||
|
Item {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 1
|
||||||
|
}
|
||||||
|
FlatButton {
|
||||||
|
Layout.minimumWidth: implicitWidth
|
||||||
|
// icon.source: '../../icons/warning.png'
|
||||||
|
// icon.color: 'transparent'
|
||||||
|
text: channeldetails.frozenForReceiving ? qsTr('Unfreeze') : qsTr('Freeze')
|
||||||
|
onClicked: channeldetails.freezeForReceiving()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
|
||||||
visible: channeldetails.frozenForReceiving && channeldetails.isOpen
|
|
||||||
text: qsTr('n/a (frozen)')
|
|
||||||
}
|
|
||||||
Label {
|
Label {
|
||||||
visible: !channeldetails.isOpen
|
visible: !channeldetails.isOpen
|
||||||
text: qsTr('n/a (channel not open)')
|
text: qsTr('n/a (channel not open)')
|
||||||
@@ -198,66 +229,40 @@ Pane {
|
|||||||
icon.source: '../../icons/file.png'
|
icon.source: '../../icons/file.png'
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
FlatButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
FlatButton {
|
Layout.preferredWidth: 1
|
||||||
Layout.fillWidth: true
|
text: qsTr('Close channel');
|
||||||
Layout.preferredWidth: 1
|
visible: channeldetails.canClose
|
||||||
text: qsTr('Close channel');
|
onClicked: {
|
||||||
enabled: channeldetails.canClose
|
var dialog = closechannel.createObject(root, { 'channelid': channelid })
|
||||||
onClicked: {
|
dialog.open()
|
||||||
var dialog = closechannel.createObject(root, { 'channelid': channelid })
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
icon.source: '../../icons/closebutton.png'
|
|
||||||
}
|
|
||||||
|
|
||||||
FlatButton {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: 1
|
|
||||||
text: qsTr('Delete channel');
|
|
||||||
enabled: channeldetails.canDelete
|
|
||||||
onClicked: {
|
|
||||||
var dialog = app.messageDialog.createObject(root,
|
|
||||||
{
|
|
||||||
'text': qsTr('Are you sure you want to delete this channel? This will purge associated transactions from your wallet history.'),
|
|
||||||
'yesno': true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
dialog.yesClicked.connect(function() {
|
|
||||||
channeldetails.deleteChannel()
|
|
||||||
app.stack.pop()
|
|
||||||
Daemon.currentWallet.historyModel.init_model() // needed here?
|
|
||||||
Daemon.currentWallet.channelModel.remove_channel(channelid)
|
|
||||||
})
|
|
||||||
dialog.open()
|
|
||||||
}
|
|
||||||
icon.source: '../../icons/delete.png'
|
|
||||||
}
|
}
|
||||||
|
icon.source: '../../icons/closebutton.png'
|
||||||
}
|
}
|
||||||
|
|
||||||
RowLayout {
|
FlatButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: channeldetails.isOpen
|
Layout.preferredWidth: 1
|
||||||
|
text: qsTr('Delete channel');
|
||||||
FlatButton {
|
visible: channeldetails.canDelete
|
||||||
Layout.fillWidth: true
|
onClicked: {
|
||||||
Layout.preferredWidth: 1
|
var dialog = app.messageDialog.createObject(root,
|
||||||
enabled: channeldetails.isOpen
|
{
|
||||||
text: channeldetails.frozenForSending ? qsTr('Unfreeze (for sending)') : qsTr('Freeze (for sending)')
|
'text': qsTr('Are you sure you want to delete this channel? This will purge associated transactions from your wallet history.'),
|
||||||
icon.source: '../../icons/seal.png'
|
'yesno': true
|
||||||
onClicked: channeldetails.freezeForSending()
|
}
|
||||||
}
|
)
|
||||||
FlatButton {
|
dialog.yesClicked.connect(function() {
|
||||||
Layout.fillWidth: true
|
channeldetails.deleteChannel()
|
||||||
Layout.preferredWidth: 1
|
app.stack.pop()
|
||||||
enabled: channeldetails.isOpen
|
Daemon.currentWallet.historyModel.init_model() // needed here?
|
||||||
text: channeldetails.frozenForReceiving ? qsTr('Unfreeze (for receiving)') : qsTr('Freeze (for receiving)')
|
Daemon.currentWallet.channelModel.remove_channel(channelid)
|
||||||
icon.source: '../../icons/seal.png'
|
})
|
||||||
onClicked: channeldetails.freezeForReceiving()
|
dialog.open()
|
||||||
}
|
}
|
||||||
|
icon.source: '../../icons/delete.png'
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ChannelDetails {
|
ChannelDetails {
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Item {
|
|||||||
property color colorAddressInternal: Qt.rgba(1,0.93,0,0.75)
|
property color colorAddressInternal: Qt.rgba(1,0.93,0,0.75)
|
||||||
property color colorAddressUsed: Qt.rgba(0.5,0.5,0.5,1)
|
property color colorAddressUsed: Qt.rgba(0.5,0.5,0.5,1)
|
||||||
property color colorAddressUsedWithBalance: Qt.rgba(0.75,0.75,0.75,1)
|
property color colorAddressUsedWithBalance: Qt.rgba(0.75,0.75,0.75,1)
|
||||||
property color colorAddressFrozen: Qt.rgba(0.5,0.5,1,0.75)
|
property color colorAddressFrozen: Qt.rgba(0.5,0.5,1,1)
|
||||||
|
|
||||||
function colorAlpha(baseColor, alpha) {
|
function colorAlpha(baseColor, alpha) {
|
||||||
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, alpha)
|
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, alpha)
|
||||||
|
|||||||
Reference in New Issue
Block a user