mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-19 16:38:28 +00:00
148 lines
No EOL
3.7 KiB
QML
148 lines
No EOL
3.7 KiB
QML
import QtQuick 2.7
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Common 1.0
|
|
import Linphone 1.0
|
|
//import LinphoneUtils 1.0
|
|
import LinphoneEnums 1.0
|
|
|
|
import App.Styles 1.0
|
|
import Common.Styles 1.0
|
|
import Units 1.0
|
|
|
|
|
|
// =============================================================================
|
|
|
|
DialogPlus {
|
|
id:dialog
|
|
buttons: [
|
|
TextButtonA {
|
|
//: 'cancel' : button text for cancelling operation
|
|
text: qsTr('cancelButton')
|
|
capitalization: Font.AllUppercase
|
|
onClicked:{
|
|
exit(0)
|
|
}
|
|
},
|
|
TextButtonB {
|
|
//: 'start' : button text to start ephemeral mode
|
|
text: qsTr('startButton')
|
|
visible: chatRoomModel.canBeEphemeral
|
|
|
|
onClicked: {
|
|
if(dialog.timer=== 0)
|
|
chatRoomModel.ephemeralEnabled = false
|
|
else {
|
|
chatRoomModel.ephemeralLifetime = dialog.timer
|
|
chatRoomModel.ephemeralEnabled = true
|
|
}
|
|
exit(1)
|
|
}
|
|
}
|
|
]
|
|
flat : true
|
|
//: "Ephemeral messages" : Popup title for ephemerals
|
|
title: qsTr('ephemeralTitle')
|
|
showCloseCross:false
|
|
|
|
property ChatRoomModel chatRoomModel
|
|
property int timer : 0
|
|
buttonsAlignment: Qt.AlignCenter
|
|
|
|
height: 320
|
|
width: ManageAccountsStyle.width
|
|
|
|
// ---------------------------------------------------------------------------
|
|
ColumnLayout {
|
|
anchors.fill: parent
|
|
anchors.topMargin: 15
|
|
anchors.leftMargin: 10
|
|
anchors.rightMargin: 10
|
|
spacing: 0
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
Icon{
|
|
icon:'timer'
|
|
iconSize:40
|
|
Layout.preferredHeight: 50
|
|
Layout.preferredWidth: 50
|
|
Layout.alignment: Qt.AlignCenter
|
|
}
|
|
Text{
|
|
Layout.fillWidth: true
|
|
Layout.alignment: Qt.AlignCenter
|
|
Layout.leftMargin: 10
|
|
Layout.rightMargin: 10
|
|
|
|
maximumLineCount: 4
|
|
wrapMode: Text.Wrap
|
|
//: 'New messages will be deleted on both ends once it has been read by your contact. Select a timeout.'
|
|
//~ Context Explanation for ephemerals
|
|
text: qsTr('ephemeralText')
|
|
//: '\nEphemeral message is only supported in conference based chat room!'
|
|
//~ Context Warning about not being in conference based chat room.
|
|
+(!chatRoomModel.canBeEphemeral?'\n'+qsTr('ephemeralNotInConference!'):'')
|
|
verticalAlignment: Text.AlignVCenter
|
|
horizontalAlignment: Text.AlignHCenter
|
|
font.pointSize: Units.dp * 11
|
|
color: Colors.d.color
|
|
}
|
|
ComboBox{
|
|
Layout.alignment: Qt.AlignCenter
|
|
Layout.preferredWidth: 150
|
|
Layout.topMargin:10
|
|
Layout.bottomMargin:10
|
|
id:timerPicker
|
|
textRole: "text"
|
|
currentIndex: if( chatRoomModel.ephemeralLifetime == 0 || !chatRoomModel.ephemeralEnabled)
|
|
return 0;
|
|
else if( chatRoomModel.ephemeralLifetime <= 60 )
|
|
return 1;
|
|
else if( chatRoomModel.ephemeralLifetime <= 3600 )
|
|
return 2;
|
|
else if( chatRoomModel.ephemeralLifetime <= 86400 )
|
|
return 3;
|
|
else if( chatRoomModel.ephemeralLifetime <= 259200 )
|
|
return 4;
|
|
else if( chatRoomModel.ephemeralLifetime <= 604800 )
|
|
return 5;
|
|
else
|
|
return 5;
|
|
/*
|
|
property var fields : [
|
|
//: 'Disabled'
|
|
qsTr('disabled'),
|
|
//: '%1 minute'
|
|
qsTr('nMinute', '', 1).arg(1),
|
|
//: '%1 hour'
|
|
qsTr('nHour', '', 1).arg(1),
|
|
//: '%1 day'
|
|
qsTr('nDay', '', 1).arg(1),
|
|
//: '%1 days'
|
|
qsTr('nDay', '', 3).arg(3),
|
|
//: '%1 week'
|
|
qsTr('nWeek', '', 1).arg(1)
|
|
]
|
|
*/
|
|
model:[
|
|
//: 'Disabled'
|
|
{text:qsTr('disabled'), value:0},
|
|
//: '%1 minute'
|
|
{ text:qsTr('nMinute', '', 1).arg(1), value:60},
|
|
//: '%1 hour'
|
|
{ text:qsTr('nHour', '', 1).arg(1), value:3600},
|
|
//: '%1 day'
|
|
{ text:qsTr('nDay', '', 1).arg(1), value:86400},
|
|
//: '%1 days'
|
|
{ text:qsTr('nDay', '', 3).arg(3), value:259200},
|
|
//: '%1 week'
|
|
{ text:qsTr('nWeek', '', 1).arg(1), value:604800}
|
|
]
|
|
|
|
onActivated: dialog.timer = model[index].value
|
|
visible: chatRoomModel.canBeEphemeral
|
|
}
|
|
|
|
}
|
|
|
|
} |