1
0

qml: fixes for CloseChannelDialog;

- split RequestForceClose and LocalForceClose options, as request force close is only available if connected.
- disable no close policy on dialog, as it locks the user in the dialog if no succesful close is initiated.
  what this intended to do is keep the backing object QEChannelDetails alive until a result is obtained, to avoid
  exceptions when emitting the result signal. this is now handled more robustly, the user can leave the dialog
  without triggering exceptions later.
This commit is contained in:
Sander van Grieken
2023-11-08 18:23:23 +01:00
parent fb4eb86e7c
commit 0fb47c87d2
2 changed files with 26 additions and 13 deletions

View File

@@ -20,8 +20,6 @@ ElDialog {
property string _closing_method
closePolicy: Popup.NoAutoClose
padding: 0
ColumnLayout {
@@ -120,14 +118,14 @@ ElDialog {
id: closetypeRemoteForce
ButtonGroup.group: closetypegroup
property string closetype: 'remote_force'
enabled: !channeldetails.isClosing && channeldetails.canForceClose
enabled: !channeldetails.isClosing && channeldetails.canRequestForceClose
text: qsTr('Request Force-close')
}
ElRadioButton {
id: closetypeLocalForce
ButtonGroup.group: closetypegroup
property string closetype: 'local_force'
enabled: !channeldetails.isClosing && channeldetails.canForceClose && !channeldetails.isBackup
enabled: !channeldetails.isClosing && channeldetails.canLocalForceClose && !channeldetails.isBackup
text: qsTr('Local Force-close')
}
}
@@ -213,8 +211,10 @@ ElDialog {
// init default choice
if (channeldetails.canCoopClose)
closetypeCoop.checked = true
else
else if (channeldetails.canRequestForceClose)
closetypeRemoteForce.checked = true
else
closetypeLocalForce.checked = true
}
onChannelCloseSuccess: {