mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-27 00:48:08 +00:00
Merge branch 'fix/6.1' into 'release/6.1'
Fixes See merge request BC/public/linphone-desktop!1639
This commit is contained in:
commit
307119ffb7
19 changed files with 839 additions and 789 deletions
|
|
@ -972,6 +972,7 @@ void App::restart() {
|
|||
mIsRestarting = true;
|
||||
if (mAccountList) mAccountList->resetData();
|
||||
if (mCallList) mCallList->resetData();
|
||||
if (mCallHistoryList) mCallHistoryList->resetData();
|
||||
if (mChatList) mChatList->resetData();
|
||||
if (mConferenceInfoList) mConferenceInfoList->resetData();
|
||||
closeCallsWindow();
|
||||
|
|
@ -1234,6 +1235,16 @@ void App::setConferenceInfoList(QSharedPointer<ConferenceInfoList> data) {
|
|||
}
|
||||
}
|
||||
|
||||
QSharedPointer<CallHistoryList> App::getCallHistoryList() const {
|
||||
return mCallHistoryList;
|
||||
}
|
||||
void App::setCallHistoryList(QSharedPointer<CallHistoryList> data) {
|
||||
if (mCallHistoryList != data) {
|
||||
mCallHistoryList = data;
|
||||
emit callHistoryChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QSharedPointer<ChatList> App::getChatList() const {
|
||||
return mChatList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <QSharedPointer>
|
||||
|
||||
#include "core/account/AccountProxy.hpp"
|
||||
#include "core/call-history/CallHistoryList.hpp"
|
||||
#include "core/call/CallProxy.hpp"
|
||||
#include "core/chat/ChatGui.hpp"
|
||||
#include "core/chat/ChatList.hpp"
|
||||
|
|
@ -163,6 +164,9 @@ public:
|
|||
QSharedPointer<ConferenceInfoList> getConferenceInfoList() const;
|
||||
void setConferenceInfoList(QSharedPointer<ConferenceInfoList> data);
|
||||
|
||||
QSharedPointer<CallHistoryList> getCallHistoryList() const;
|
||||
void setCallHistoryList(QSharedPointer<CallHistoryList> data);
|
||||
|
||||
QSharedPointer<ChatList> getChatList() const;
|
||||
ChatList *getChats() const;
|
||||
void setChatList(QSharedPointer<ChatList> data);
|
||||
|
|
@ -213,6 +217,7 @@ signals:
|
|||
void currentChatChanged();
|
||||
void conferenceInfosChanged();
|
||||
void chatsChanged();
|
||||
void callHistoryChanged();
|
||||
void localeChanged();
|
||||
// void executeCommand(QString command);
|
||||
|
||||
|
|
@ -239,6 +244,7 @@ private:
|
|||
QSharedPointer<ConferenceInfoList> mConferenceInfoList;
|
||||
QSharedPointer<ChatList> mChatList;
|
||||
QSharedPointer<CallList> mCallList;
|
||||
QSharedPointer<CallHistoryList> mCallHistoryList;
|
||||
QSharedPointer<SafeConnection<App, CoreModel>> mCoreModelConnection;
|
||||
QSharedPointer<SafeConnection<App, CliModel>> mCliModelConnection;
|
||||
bool mAutoStart = false;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,11 @@ DEFINE_ABSTRACT_OBJECT(CallHistoryProxy)
|
|||
|
||||
CallHistoryProxy::CallHistoryProxy(QObject *parent) : LimitProxy(parent) {
|
||||
mHistoryList = CallHistoryList::create();
|
||||
if (!App::getInstance()->getCallHistoryList()) {
|
||||
mHistoryList = CallHistoryList::create();
|
||||
App::getInstance()->setCallHistoryList(mHistoryList);
|
||||
}
|
||||
mHistoryList = App::getInstance()->getCallHistoryList();
|
||||
connect(mHistoryList.get(), &CallHistoryList::listAboutToBeReset, this, &CallHistoryProxy::listAboutToBeReset);
|
||||
setSourceModels(new SortFilterList(mHistoryList.get(), Qt::DescendingOrder));
|
||||
connect(App::getInstance(), &App::currentDateChanged, this, [this] { emit mHistoryList->lUpdate(); });
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -357,10 +357,11 @@ void AccountManager::linkNewAccountUsingCode(const QString &code,
|
|||
const std::string &errorMessage, const std::shared_ptr<const linphone::Dictionary> ¶meterErrors) {
|
||||
if (request->getType() == linphone::AccountManagerServicesRequest::Type::LinkEmailUsingCode) {
|
||||
lInfo() << "[AccountManager] error linking email to account" << errorMessage;
|
||||
emit linkingNewAccountWithCodeFailed(Utils::coreStringToAppString(errorMessage));
|
||||
} else if (request->getType() == linphone::AccountManagerServicesRequest::Type::LinkPhoneNumberUsingCode) {
|
||||
lInfo() << "[AccountManager] error linking phone number to account" << errorMessage;
|
||||
emit linkingNewAccountWithCodeFailed(Utils::coreStringToAppString(errorMessage));
|
||||
}
|
||||
emit linkingNewAccountWithCodeFailed(Utils::coreStringToAppString(errorMessage));
|
||||
});
|
||||
if (registerType == RegisterType::Email)
|
||||
mAccountManagerServicesModel->linkEmailToAccountUsingCode(sipIdentityAddress,
|
||||
|
|
|
|||
|
|
@ -3,12 +3,18 @@ import QtQuick.Controls.Basic as Control
|
|||
import QtQuick.Layouts
|
||||
import QtQuick.Effects
|
||||
import Linphone
|
||||
import CustomControls 1.0
|
||||
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
|
||||
|
||||
Control.ComboBox {
|
||||
id: mainItem
|
||||
property string defaultCallingCode: ""
|
||||
property bool enableBackgroundColors: false
|
||||
onKeyboardFocusChanged: console.log("keyboard focus combobox", keyboardFocus)
|
||||
property bool keyboardFocus: FocusHelper.keyboardFocus
|
||||
property color keyboardFocusedBorderColor: DefaultStyle.main2_900
|
||||
property real borderWidth: Utils.getSizeWithScreenRatio(1)
|
||||
property real keyboardFocusedBorderWidth: Utils.getSizeWithScreenRatio(3)
|
||||
property string text: combobox.model.getAt(combobox.currentIndex) ? combobox.model.getAt(combobox.currentIndex).countryCallingCode : ""
|
||||
currentIndex: phoneNumberModel.count > 0 ? Math.max(0, phoneNumberModel.findIndexByCountryCallingCode(defaultCallingCode)) : -1
|
||||
Accessible.name: mainItem.Accessible.name
|
||||
|
|
@ -19,13 +25,16 @@ Control.ComboBox {
|
|||
anchors.fill: parent
|
||||
radius: Utils.getSizeWithScreenRatio(63)
|
||||
color: mainItem.enableBackgroundColor ? DefaultStyle.grey_100 : "transparent"
|
||||
border.color: mainItem.enableBackgroundColors
|
||||
? (mainItem.errorMessage.length > 0
|
||||
? DefaultStyle.danger_500_main
|
||||
: textField.activeFocus
|
||||
? DefaultStyle.main1_500_main
|
||||
: DefaultStyle.grey_200)
|
||||
: "transparent"
|
||||
border.color: mainItem.keyboardFocus
|
||||
? mainItem.keyboardFocusedBorderColor
|
||||
: mainItem.enableBackgroundColors
|
||||
? (mainItem.errorMessage.length > 0
|
||||
? DefaultStyle.danger_500_main
|
||||
: mainItem.activeFocus || textField.activeFocus
|
||||
? DefaultStyle.main1_500_main
|
||||
: DefaultStyle.grey_200)
|
||||
: "transparent"
|
||||
border.width: mainItem.keyboardFocus ? mainItem.keyboardFocusedBorderWidth : mainItem.borderWidth
|
||||
}
|
||||
contentItem: RowLayout {
|
||||
readonly property var currentItem: combobox.model.getAt(combobox.currentIndex)
|
||||
|
|
@ -95,8 +104,6 @@ Control.ComboBox {
|
|||
maximumFlickVelocity: 1500
|
||||
spacing: Utils.getSizeWithScreenRatio(10)
|
||||
highlight: Rectangle {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
width: listView.width
|
||||
height: listView.height
|
||||
color: DefaultStyle.main2_300
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ FocusScope{
|
|||
property string labelIndication
|
||||
property string tooltip: ""
|
||||
property bool mandatory: false
|
||||
property int errorTextTopMargin: 0//
|
||||
|
||||
property alias errorTextItem: errorText
|
||||
property alias errorMessage: errorText.text
|
||||
|
|
@ -85,7 +86,7 @@ FocusScope{
|
|||
Item {
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.fillWidth: true
|
||||
StackLayout {
|
||||
FocusScope {
|
||||
id: contentItem
|
||||
height: childrenRect.height
|
||||
anchors.left: parent.left
|
||||
|
|
@ -94,6 +95,7 @@ FocusScope{
|
|||
TemporaryText {
|
||||
id: errorText
|
||||
anchors.top: contentItem.bottom
|
||||
anchors.topMargin: mainItem.errorTextTopMargin
|
||||
color: DefaultStyle.danger_500_main
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,14 +26,12 @@ ListView {
|
|||
|
||||
model: CallHistoryProxy {
|
||||
id: callHistoryProxy
|
||||
Component.onCompleted: {
|
||||
loading = true
|
||||
}
|
||||
onListAboutToBeReset: loading = true
|
||||
filterText: mainItem.searchText
|
||||
onFilterTextChanged: maxDisplayItems = initialDisplayItems
|
||||
initialDisplayItems: Math.max(20, Math.round(2 * mainItem.height / Utils.getSizeWithScreenRatio(56)))
|
||||
displayItemsStep: 3 * initialDisplayItems / 2
|
||||
onModelAboutToBeReset: loading = true
|
||||
onModelReset: {
|
||||
mainItem.resultsReceived()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ ListView {
|
|||
spacing: Utils.getSizeWithScreenRatio(8)
|
||||
highlightFollowsCurrentItem: false
|
||||
|
||||
onCurrentIndexChanged: if(currentIndex === -1) {
|
||||
resetSelections()
|
||||
}
|
||||
|
||||
signal meetingDeletionRequested(ConferenceInfoGui confInfo, bool canCancel)
|
||||
|
||||
function selectIndex(index){
|
||||
|
|
@ -53,7 +57,6 @@ ListView {
|
|||
moveToCurrentItem()
|
||||
if(currentItem) {
|
||||
mainItem.selectedConference = currentItem.itemGui
|
||||
currentItem.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
// Update position only if we are moving to current item and its position is changing.
|
||||
|
|
@ -243,7 +246,7 @@ ListView {
|
|||
anchors.fill: parent
|
||||
anchors.rightMargin: 5 // margin to avoid clipping shadows at right
|
||||
radius: Utils.getSizeWithScreenRatio(10)
|
||||
visible: itemDelegate.haveModel || itemDelegate.activeFocus
|
||||
visible: itemDelegate.haveModel || mainItem.currentIndex === itemDelegate.index
|
||||
color: itemDelegate.isSelected ? DefaultStyle.main2_200 : DefaultStyle.grey_0 // mainItem.currentIndex === index
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
|
|||
Control.TextField {
|
||||
id: mainItem
|
||||
property real inputSize: Utils.getSizeWithScreenRatio(100)
|
||||
property bool isError: false
|
||||
color: activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_500_main
|
||||
validator: IntValidator{bottom: 0; top: 9}
|
||||
|
||||
|
|
@ -34,7 +35,11 @@ Control.TextField {
|
|||
Rectangle {
|
||||
id: background
|
||||
border.width: Utils.getSizeWithScreenRatio(1)
|
||||
border.color: mainItem.activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_500_main
|
||||
border.color: mainItem.isError
|
||||
? DefaultStyle.danger_500_main
|
||||
: mainItem.activeFocus
|
||||
? DefaultStyle.main1_500_main
|
||||
: DefaultStyle.main2_500_main
|
||||
radius: mainItem.inputSize * 0.15
|
||||
width: mainItem.inputSize * 0.9
|
||||
height: mainItem.inputSize
|
||||
|
|
|
|||
|
|
@ -41,61 +41,65 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
|
||||
function handleKeyPadEvent(event) {
|
||||
if (event.key === Qt.Key_0) {
|
||||
keypadKeyPressedAtIndex(10)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_1) {
|
||||
keypadKeyPressedAtIndex(0)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_2) {
|
||||
keypadKeyPressedAtIndex(1)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_3) {
|
||||
keypadKeyPressedAtIndex(2)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_4) {
|
||||
keypadKeyPressedAtIndex(3)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_5) {
|
||||
keypadKeyPressedAtIndex(4)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_6) {
|
||||
keypadKeyPressedAtIndex(5)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_7) {
|
||||
keypadKeyPressedAtIndex(6)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_8) {
|
||||
keypadKeyPressedAtIndex(7)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_9) {
|
||||
keypadKeyPressedAtIndex(8)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Asterisk) {
|
||||
keypadKeyPressedAtIndex(9)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Plus) {
|
||||
mainItem.buttonPressed("+")
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Enter) {
|
||||
mainItem.launchCall()
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: (event) => {
|
||||
event.accepted = false
|
||||
if (event.modifiers & Qt.KeypadModifier) {
|
||||
if (event.key === Qt.Key_0) {
|
||||
keypadKeyPressedAtIndex(10)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_1) {
|
||||
keypadKeyPressedAtIndex(0)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_2) {
|
||||
keypadKeyPressedAtIndex(1)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_3) {
|
||||
keypadKeyPressedAtIndex(2)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_4) {
|
||||
keypadKeyPressedAtIndex(3)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_5) {
|
||||
keypadKeyPressedAtIndex(4)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_6) {
|
||||
keypadKeyPressedAtIndex(5)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_7) {
|
||||
keypadKeyPressedAtIndex(6)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_8) {
|
||||
keypadKeyPressedAtIndex(7)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_9) {
|
||||
keypadKeyPressedAtIndex(8)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Asterisk) {
|
||||
keypadKeyPressedAtIndex(9)
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Plus) {
|
||||
mainItem.buttonPressed("+")
|
||||
event.accepted = true
|
||||
}
|
||||
if (event.key === Qt.Key_Enter) {
|
||||
mainItem.launchCall()
|
||||
event.accepted = true
|
||||
}
|
||||
handleKeyPadEvent(event)
|
||||
}
|
||||
if (event.key === Qt.Key_Backspace) {
|
||||
mainItem.wipe()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,10 @@ ColumnLayout {
|
|||
readonly property string phoneNumber: textField.text
|
||||
readonly property string countryCode: combobox.text
|
||||
property string defaultCallingCode
|
||||
property bool keyboardFocus: FocusHelper.keyboardFocus
|
||||
property bool keyboardFocus: combobox.keyboardFocus || textField.keyboardFocus
|
||||
property color keyboardFocusedBorderColor: DefaultStyle.main2_900
|
||||
property real borderWidth: Utils.getSizeWithScreenRatio(1)
|
||||
property real keyboardFocusedBorderWidth: Utils.getSizeWithScreenRatio(3)
|
||||
|
||||
spacing: Utils.getSizeWithScreenRatio(5)
|
||||
|
||||
|
|
@ -26,7 +29,7 @@ ColumnLayout {
|
|||
visible: label.length > 0
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: mainItem.label + (mainItem.mandatory ? "*" : "")
|
||||
color: (combobox.hasActiveFocus || textField.hasActiveFocus) ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
|
||||
color: (combobox.activeFocus || textField.activeFocus) ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
|
||||
font {
|
||||
pixelSize: Typography.p2.pixelSize
|
||||
weight: Typography.p2.weight
|
||||
|
|
@ -36,25 +39,25 @@ ColumnLayout {
|
|||
Control.Control {
|
||||
Layout.preferredWidth: mainItem.width
|
||||
Layout.preferredHeight: Utils.getSizeWithScreenRatio(49)
|
||||
leftPadding: Utils.getSizeWithScreenRatio(16)
|
||||
background: Rectangle {
|
||||
id: contentBackground
|
||||
anchors.fill: parent
|
||||
radius: Utils.getSizeWithScreenRatio(63)
|
||||
color: DefaultStyle.grey_100
|
||||
border.color: mainItem.errorMessage.length > 0
|
||||
? DefaultStyle.danger_500_main
|
||||
: (textField.hasActiveFocus || combobox.hasActiveFocus)
|
||||
? DefaultStyle.main1_500_main
|
||||
: DefaultStyle.grey_200
|
||||
? DefaultStyle.danger_500_main
|
||||
: (textField.activeFocus || combobox.activeFocus)
|
||||
? DefaultStyle.main1_500_main
|
||||
: DefaultStyle.grey_200
|
||||
border.width: mainItem.borderWidth
|
||||
}
|
||||
contentItem: RowLayout {
|
||||
CountryIndicatorCombobox {
|
||||
id: combobox
|
||||
implicitWidth: Utils.getSizeWithScreenRatio(110)
|
||||
leftPadding: Utils.getSizeWithScreenRatio(16)
|
||||
Layout.fillHeight: true
|
||||
defaultCallingCode: mainItem.defaultCallingCode
|
||||
property bool keyboardFocus: FocusHelper.keyboardFocus
|
||||
//: %1 prefix
|
||||
Accessible.name: qsTr("prefix_phone_number_accessible_name").arg(mainItem.Accessible.name)
|
||||
}
|
||||
|
|
@ -69,10 +72,15 @@ ColumnLayout {
|
|||
id: textField
|
||||
Layout.fillWidth: true
|
||||
placeholderText: mainItem.placeholderText
|
||||
background: Item{}
|
||||
background: Rectangle {
|
||||
visible: textField.keyboardFocus
|
||||
radius: Utils.getSizeWithScreenRatio(63)
|
||||
color: "transparent"
|
||||
border.color: mainItem.keyboardFocusedBorderColor
|
||||
border.width: mainItem.keyboardFocusedBorderWidth
|
||||
}
|
||||
initialText: initialPhoneNumber
|
||||
validator: RegularExpressionValidator{ regularExpression: /[0-9]+/}
|
||||
property bool keyboardFocus: FocusHelper.keyboardFocus
|
||||
//: %1 number
|
||||
Accessible.name: qsTr("number_phone_number_accessible_name").arg(mainItem.Accessible.name)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,13 @@ FocusScope {
|
|||
repeat: false
|
||||
onTriggered: textField.searchText = textField.text
|
||||
}
|
||||
Keys.onPressed: (event) => {
|
||||
event.accepted = false
|
||||
if (mainItem.numericPadPopup && mainItem.numericPadPopup.opened && (event.modifiers & Qt.KeypadModifier)) {
|
||||
mainItem.numericPadPopup.keyPadKeyPressed(event)
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
}
|
||||
Button {
|
||||
id: dialerButton
|
||||
|
|
|
|||
|
|
@ -20,6 +20,10 @@ Control.Popup {
|
|||
property var currentCall
|
||||
onOpened: numPad.forceActiveFocus()
|
||||
signal buttonPressed(string text)
|
||||
signal keyPadKeyPressed(KeyEvent event)
|
||||
onKeyPadKeyPressed: (event) => {
|
||||
numPad.handleKeyPadEvent(event)
|
||||
}
|
||||
signal launchCall()
|
||||
signal wipe()
|
||||
|
||||
|
|
@ -72,7 +76,6 @@ Control.Popup {
|
|||
lastRowVisible: mainItem.lastRowVisible
|
||||
currentCall: mainItem.currentCall
|
||||
onButtonPressed: (text) => {
|
||||
console.log("BUTTON PRESSED NUMPAD")
|
||||
mainItem.buttonPressed(text)
|
||||
}
|
||||
onLaunchCall: mainItem.launchCall()
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ LoginLayout {
|
|||
property string address
|
||||
property string sipIdentityAddress
|
||||
property string code
|
||||
property alias errorMessage: codeItemLayout.errorMessage
|
||||
property bool ctrlIsPressed
|
||||
onCtrlIsPressedChanged: console.log("ctrl is pressed", ctrlIsPressed)
|
||||
titleContent: [
|
||||
|
|
@ -78,66 +79,71 @@ LoginLayout {
|
|||
text = qsTr("assistant_account_creation_confirmation_explanation").arg(completeString).arg(address)
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
spacing: Utils.getSizeWithScreenRatio(45)
|
||||
Repeater {
|
||||
model: 4
|
||||
id: repeater
|
||||
signal pasteRequested(string text)
|
||||
DigitInput {
|
||||
id: digitInput
|
||||
required property int index
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
Connections {
|
||||
target: repeater
|
||||
function onPasteRequested(text) {
|
||||
console.log("paste requested", text[digitInput.index])
|
||||
var test= text;
|
||||
if (UtilsCpp.isInteger(text))
|
||||
{
|
||||
digitInput.text = text[digitInput.index]
|
||||
FormItemLayout {
|
||||
id: codeItemLayout
|
||||
errorTextTopMargin: Utils.getSizeWithScreenRatio(5)
|
||||
contentItem: RowLayout {
|
||||
spacing: Utils.getSizeWithScreenRatio(45)
|
||||
Repeater {
|
||||
model: 4
|
||||
id: repeater
|
||||
signal pasteRequested(string text)
|
||||
DigitInput {
|
||||
id: digitInput
|
||||
required property int index
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
isError: codeItemLayout.errorMessage !== ""
|
||||
Connections {
|
||||
target: repeater
|
||||
function onPasteRequested(text) {
|
||||
console.log("paste requested", text[digitInput.index])
|
||||
var test= text;
|
||||
if (UtilsCpp.isInteger(text))
|
||||
{
|
||||
digitInput.text = text[digitInput.index]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
onTextChanged: {
|
||||
console.log("text edited", text)
|
||||
if (text.length > 0 ) {
|
||||
mainItem.code = mainItem.code.slice(0, index) + text + mainItem.code.slice(index)
|
||||
if (index < 3)
|
||||
nextItemInFocusChain(true).forceActiveFocus()
|
||||
else {
|
||||
mainItem.sendCode(mainItem.code)
|
||||
mainItem.code = ""
|
||||
}
|
||||
} else {
|
||||
if (index > 0)
|
||||
nextItemInFocusChain(false).forceActiveFocus()
|
||||
}
|
||||
}
|
||||
Keys.onPressed: (event) => {
|
||||
if (event.key == Qt.Key_Backspace) {
|
||||
if (text.length === 0) {
|
||||
nextItemInFocusChain(false).forceActiveFocus()
|
||||
event.accepted = true
|
||||
onTextChanged: {
|
||||
console.log("text edited", text)
|
||||
if (text.length > 0 ) {
|
||||
mainItem.code = mainItem.code.slice(0, index) + text + mainItem.code.slice(index)
|
||||
if (index < 3)
|
||||
nextItemInFocusChain(true).forceActiveFocus()
|
||||
else {
|
||||
mainItem.sendCode(mainItem.code)
|
||||
mainItem.code = ""
|
||||
}
|
||||
} else {
|
||||
event.accepted = false
|
||||
if (index > 0)
|
||||
nextItemInFocusChain(false).forceActiveFocus()
|
||||
}
|
||||
} else if (event.key == Qt.Key_Control) {
|
||||
mainItem.ctrlIsPressed = true
|
||||
event.accepted = false
|
||||
} else if (mainItem.ctrlIsPressed && event.key == Qt.Key_V) {
|
||||
var clipboard = UtilsCpp.getClipboardText()
|
||||
console.log("paste", clipboard)
|
||||
repeater.pasteRequested(clipboard)
|
||||
} else {
|
||||
event.accepted = false
|
||||
}
|
||||
}
|
||||
Keys.onReleased: (event) => {
|
||||
if (event.key == Qt.Key_Control) {
|
||||
mainItem.ctrlIsPressed = false
|
||||
event.accepted = true
|
||||
Keys.onPressed: (event) => {
|
||||
if (event.key == Qt.Key_Backspace) {
|
||||
if (text.length === 0) {
|
||||
nextItemInFocusChain(false).forceActiveFocus()
|
||||
event.accepted = true
|
||||
} else {
|
||||
event.accepted = false
|
||||
}
|
||||
} else if (event.key == Qt.Key_Control) {
|
||||
mainItem.ctrlIsPressed = true
|
||||
event.accepted = false
|
||||
} else if (mainItem.ctrlIsPressed && event.key == Qt.Key_V) {
|
||||
var clipboard = UtilsCpp.getClipboardText()
|
||||
console.log("paste", clipboard)
|
||||
repeater.pasteRequested(clipboard)
|
||||
} else {
|
||||
event.accepted = false
|
||||
}
|
||||
}
|
||||
Keys.onReleased: (event) => {
|
||||
if (event.key == Qt.Key_Control) {
|
||||
mainItem.ctrlIsPressed = false
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -128,15 +128,11 @@ LoginLayout {
|
|||
|
||||
ColumnLayout {
|
||||
id: contentLayout
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
spacing: Utils.getSizeWithScreenRatio(8)
|
||||
ColumnLayout {
|
||||
id: formLayout
|
||||
spacing: Utils.getSizeWithScreenRatio(24)
|
||||
RowLayout {
|
||||
Layout.preferredHeight: usernameItem.height
|
||||
spacing: Utils.getSizeWithScreenRatio(16)
|
||||
FormItemLayout {
|
||||
id: usernameItem
|
||||
label: qsTr("username")
|
||||
|
|
@ -152,6 +148,7 @@ LoginLayout {
|
|||
}
|
||||
RowLayout {
|
||||
spacing: Utils.getSizeWithScreenRatio(10)
|
||||
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
|
||||
ComboBox {
|
||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(210)
|
||||
Layout.preferredHeight: Utils.getSizeWithScreenRatio(49)
|
||||
|
|
@ -171,7 +168,8 @@ LoginLayout {
|
|||
currentIndex: bar.currentIndex
|
||||
PhoneNumberInput {
|
||||
id: phoneNumberInput
|
||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(346)
|
||||
Layout.fillWidth: false
|
||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(390)
|
||||
property string completePhoneNumber: countryCode + phoneNumber
|
||||
//: "Numéro de téléphone"
|
||||
label: qsTr("phone_number")
|
||||
|
|
@ -221,6 +219,7 @@ LoginLayout {
|
|||
}
|
||||
FormItemLayout {
|
||||
Layout.preferredWidth: Utils.getSizeWithScreenRatio(346)
|
||||
Layout.leftMargin: Utils.getSizeWithScreenRatio(16)
|
||||
//: "Confirmation mot de passe"
|
||||
label: qsTr("assistant_account_register_password_confirmation")
|
||||
mandatory: true
|
||||
|
|
@ -235,13 +234,14 @@ LoginLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
TemporaryText {
|
||||
id: otherErrorText
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Utils.getSizeWithScreenRatio(5)
|
||||
}
|
||||
}
|
||||
}
|
||||
TemporaryText {
|
||||
id: otherErrorText
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: implicitHeight
|
||||
// Layout.topMargin: Utils.getSizeWithScreenRatio(5)
|
||||
}
|
||||
// ColumnLayout {
|
||||
// spacing: Utils.getSizeWithScreenRatio(18)
|
||||
// RowLayout {
|
||||
|
|
@ -276,6 +276,7 @@ LoginLayout {
|
|||
Accessible.name: acceptCguAndPrivacyPolicyItem.associatedText
|
||||
}
|
||||
Text {
|
||||
id: privacyLinkText
|
||||
text: acceptCguAndPrivacyPolicyItem.associatedText
|
||||
onLinkActivated: (link) => Qt.openUrlExternally(link)
|
||||
font {
|
||||
|
|
@ -284,9 +285,17 @@ LoginLayout {
|
|||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.NoButton
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
onClicked: termsCheckBox.toggle()
|
||||
onClicked: (mouse) => {
|
||||
mouse.accepted = false
|
||||
if (parent.hoveredLink) {
|
||||
privacyLinkText.linkActivated(privacyLinkText.linkAt(mouse.x, mouse.y))
|
||||
}
|
||||
else {
|
||||
termsCheckBox.toggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,6 +230,7 @@ AbstractWindow {
|
|||
Component {
|
||||
id: checkingPage
|
||||
RegisterCheckingPage {
|
||||
id: registerCheckingPage
|
||||
onReturnToRegister: mainWindowStackView.pop()
|
||||
onSendCode: (code) => {
|
||||
RegisterPageCpp.linkNewAccountUsingCode(code, registerWithEmail, sipIdentityAddress)
|
||||
|
|
@ -238,15 +239,16 @@ AbstractWindow {
|
|||
target: RegisterPageCpp
|
||||
function onLinkingNewAccountWithCodeSucceed() {
|
||||
goToLogin()
|
||||
//: "Compte créé"
|
||||
mainWindow.showInformationPopup(qsTr("assistant_register_success_title"),
|
||||
//: "Le compte a été créé. Vous pouvez maintenant vous connecter"
|
||||
qsTr("assistant_register_success_message"), true)
|
||||
//: "Compte créé"
|
||||
mainWindow.showInformationPopup(qsTr("assistant_register_success_title"),
|
||||
//: "Le compte a été créé. Vous pouvez maintenant vous connecter"
|
||||
qsTr("assistant_register_success_message"), true)
|
||||
}
|
||||
function onLinkingNewAccountWithCodeFailed(errorMessage) {
|
||||
//: "Erreur dans le code de validation"
|
||||
if (errorMessage.length === 0) errorMessage = qsTr("assistant_register_error_code")
|
||||
mainWindow.showInformationPopup(qsTr("information_popup_error_title"), errorMessage, false)
|
||||
registerCheckingPage.errorMessage = ""
|
||||
//: "Erreur dans le code de validation"
|
||||
if (errorMessage.length === 0) errorMessage = qsTr("assistant_register_error_code")
|
||||
registerCheckingPage.errorMessage = errorMessage
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue