add popup before calling device
This commit is contained in:
parent
3d0fe1a732
commit
16757d0a85
4 changed files with 111 additions and 4 deletions
|
|
@ -319,9 +319,23 @@ void Settings::setFirstLaunch(bool first) {
|
||||||
if (firstLaunch != first) {
|
if (firstLaunch != first) {
|
||||||
mAppSettings.setValue("firstLaunch", (int)first);
|
mAppSettings.setValue("firstLaunch", (int)first);
|
||||||
mAppSettings.sync();
|
mAppSettings.sync();
|
||||||
|
emit firstLaunchChanged(first);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Settings::setDisplayDeviceCheckConfirmation(bool display) {
|
||||||
|
if (getDisplayDeviceCheckConfirmation() != display) {
|
||||||
|
mAppSettings.setValue("displayDeviceCheckConfirmation", display);
|
||||||
|
mAppSettings.sync();
|
||||||
|
emit showVerifyDeviceConfirmationChanged(display);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Settings::getDisplayDeviceCheckConfirmation() const {
|
||||||
|
auto val = mAppSettings.value("displayDeviceCheckConfirmation", 1).toInt();
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
|
||||||
void Settings::startEchoCancellerCalibration() {
|
void Settings::startEchoCancellerCalibration() {
|
||||||
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->startEchoCancellerCalibration(); });
|
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->startEchoCancellerCalibration(); });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,9 @@ public:
|
||||||
Q_INVOKABLE void setFirstLaunch(bool first);
|
Q_INVOKABLE void setFirstLaunch(bool first);
|
||||||
Q_INVOKABLE bool getFirstLaunch() const;
|
Q_INVOKABLE bool getFirstLaunch() const;
|
||||||
|
|
||||||
|
Q_INVOKABLE void setDisplayDeviceCheckConfirmation(bool display);
|
||||||
|
Q_INVOKABLE bool getDisplayDeviceCheckConfirmation() const;
|
||||||
|
|
||||||
// Security. --------------------------------------------------------------------
|
// Security. --------------------------------------------------------------------
|
||||||
bool getVfsEnabled() {
|
bool getVfsEnabled() {
|
||||||
return mVfsEnabled;
|
return mVfsEnabled;
|
||||||
|
|
@ -184,6 +187,9 @@ signals:
|
||||||
void logsEmailChanged(const QString &email);
|
void logsEmailChanged(const QString &email);
|
||||||
void logsFolderChanged(const QString &folder);
|
void logsFolderChanged(const QString &folder);
|
||||||
|
|
||||||
|
void firstLaunchChanged(bool firstLaunch);
|
||||||
|
void showVerifyDeviceConfirmationChanged(bool showVerifyDeviceConfirmation);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<SettingsModel> mSettingsModel;
|
std::shared_ptr<SettingsModel> mSettingsModel;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import Linphone
|
||||||
Control.Popup{
|
Control.Popup{
|
||||||
id: mainItem
|
id: mainItem
|
||||||
padding: 0
|
padding: 0
|
||||||
property color underlineColor
|
property color underlineColor : DefaultStyle.main1_500_main
|
||||||
property int radius: 16 * DefaultStyle.dp
|
property int radius: 16 * DefaultStyle.dp
|
||||||
property bool hovered: mouseArea.containsMouse
|
property bool hovered: mouseArea.containsMouse
|
||||||
background: Item{
|
background: Item{
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,84 @@ AbstractMainPage {
|
||||||
onAccepted: contact.core.remove()
|
onAccepted: contact.core.remove()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Popup {
|
||||||
|
id: verifyDevicePopup
|
||||||
|
property string deviceName
|
||||||
|
property string deviceAddress
|
||||||
|
padding: 30 * DefaultStyle.dp
|
||||||
|
anchors.centerIn: parent
|
||||||
|
closePolicy: Control.Popup.CloseOnEscape
|
||||||
|
modal: true
|
||||||
|
onAboutToHide: neverDisplayAgainCheckbox.checked = false
|
||||||
|
contentItem: ColumnLayout {
|
||||||
|
spacing: 45 * DefaultStyle.dp
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
Text {
|
||||||
|
text: qsTr("Augmenter la confiance")
|
||||||
|
font {
|
||||||
|
pixelSize: 22 * DefaultStyle.dp
|
||||||
|
weight: 800 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 24 * DefaultStyle.dp
|
||||||
|
Text {
|
||||||
|
Layout.preferredWidth: 529 * DefaultStyle.dp
|
||||||
|
text: qsTr("Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.")
|
||||||
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
Layout.preferredWidth: 529 * DefaultStyle.dp
|
||||||
|
text: qsTr("Vous êtes sur le point d’appeler “%1” voulez vous continuer ?").arg(verifyDevicePopup.deviceName)
|
||||||
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
RowLayout {
|
||||||
|
spacing: 7 * DefaultStyle.dp
|
||||||
|
CheckBox{
|
||||||
|
id: neverDisplayAgainCheckbox
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: qsTr("Ne plus afficher")
|
||||||
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: neverDisplayAgainCheckbox.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item{Layout.fillWidth: true}
|
||||||
|
RowLayout {
|
||||||
|
spacing: 15 * DefaultStyle.dp
|
||||||
|
Button {
|
||||||
|
inversedColors: true
|
||||||
|
text: qsTr("Annuler")
|
||||||
|
leftPadding: 20 * DefaultStyle.dp
|
||||||
|
rightPadding: 20 * DefaultStyle.dp
|
||||||
|
topPadding: 11 * DefaultStyle.dp
|
||||||
|
bottomPadding: 11 * DefaultStyle.dp
|
||||||
|
onClicked: verifyDevicePopup.close()
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
text: qsTr("Appeler")
|
||||||
|
leftPadding: 20 * DefaultStyle.dp
|
||||||
|
rightPadding: 20 * DefaultStyle.dp
|
||||||
|
topPadding: 11 * DefaultStyle.dp
|
||||||
|
bottomPadding: 11 * DefaultStyle.dp
|
||||||
|
onClicked: {
|
||||||
|
SettingsCpp.setDisplayDeviceCheckConfirmation(!neverDisplayAgainCheckbox.checked)
|
||||||
|
UtilsCpp.createCall(verifyDevicePopup.deviceAddress, {}, LinphoneEnums.MediaEncryption.Zrtp)
|
||||||
|
onClicked: verifyDevicePopup.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
leftPanelContent: Item {
|
leftPanelContent: Item {
|
||||||
id: leftPanel
|
id: leftPanel
|
||||||
property int leftMargin: 45 * DefaultStyle.dp
|
property int leftMargin: 45 * DefaultStyle.dp
|
||||||
|
|
@ -518,8 +596,9 @@ AbstractMainPage {
|
||||||
height: 30 * DefaultStyle.dp
|
height: 30 * DefaultStyle.dp
|
||||||
property var callObj
|
property var callObj
|
||||||
property CallGui deviceCall: callObj ? callObj.value : null
|
property CallGui deviceCall: callObj ? callObj.value : null
|
||||||
|
property string deviceName: modelData.name.length != 0 ? modelData.name : qsTr("Appareil sans nom")
|
||||||
Text {
|
Text {
|
||||||
text: modelData.name.length != 0 ? modelData.name : qsTr("Appareil sans nom")
|
text: deviceDelegate.deviceName
|
||||||
font.pixelSize: 14 * DefaultStyle.dp
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
Item{Layout.fillWidth: true}
|
Item{Layout.fillWidth: true}
|
||||||
|
|
@ -529,6 +608,7 @@ AbstractMainPage {
|
||||||
width: 22 * DefaultStyle.dp
|
width: 22 * DefaultStyle.dp
|
||||||
height: 22 * DefaultStyle.dp
|
height: 22 * DefaultStyle.dp
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
visible: modelData.securityLevel != LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
visible: modelData.securityLevel != LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||||
color: DefaultStyle.main1_100
|
color: DefaultStyle.main1_100
|
||||||
|
|
@ -542,6 +622,12 @@ AbstractMainPage {
|
||||||
topPadding: 6 * DefaultStyle.dp
|
topPadding: 6 * DefaultStyle.dp
|
||||||
bottomPadding: 6 * DefaultStyle.dp
|
bottomPadding: 6 * DefaultStyle.dp
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
if (SettingsCpp.getDisplayDeviceCheckConfirmation()) {
|
||||||
|
verifyDevicePopup.deviceName = deviceDelegate.deviceName
|
||||||
|
verifyDevicePopup.deviceAddress = modelData.address
|
||||||
|
verifyDevicePopup.open()
|
||||||
|
}
|
||||||
|
else {
|
||||||
UtilsCpp.createCall(modelData.address, {}, LinphoneEnums.MediaEncryption.Zrtp)
|
UtilsCpp.createCall(modelData.address, {}, LinphoneEnums.MediaEncryption.Zrtp)
|
||||||
parent.callObj = UtilsCpp.getCallByAddress(modelData.address)
|
parent.callObj = UtilsCpp.getCallByAddress(modelData.address)
|
||||||
}
|
}
|
||||||
|
|
@ -551,6 +637,7 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 9 * DefaultStyle.dp
|
spacing: 9 * DefaultStyle.dp
|
||||||
Text {
|
Text {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue