really fix empty lists ui + display contacts on init when necessary + fix ensureVisible contact form
This commit is contained in:
parent
d11b3bce3d
commit
48ccfe95c7
18 changed files with 71 additions and 63 deletions
|
|
@ -69,7 +69,7 @@ ConferenceInfoCore::ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo>
|
||||||
mUri = address && address->isValid() && !address->getDomain().empty()
|
mUri = address && address->isValid() && !address->getDomain().empty()
|
||||||
? Utils::coreStringToAppString(address->asStringUriOnly())
|
? Utils::coreStringToAppString(address->asStringUriOnly())
|
||||||
: "";
|
: "";
|
||||||
mDateTime = QDateTime::fromMSecsSinceEpoch(conferenceInfo->getDateTime() * 1000, Qt::LocalTime);
|
mDateTime = QDateTime::fromMSecsSinceEpoch(conferenceInfo->getDateTime() * 1000);
|
||||||
mDuration = conferenceInfo->getDuration();
|
mDuration = conferenceInfo->getDuration();
|
||||||
mEndDateTime = mDateTime.addSecs(mDuration * 60);
|
mEndDateTime = mDateTime.addSecs(mDuration * 60);
|
||||||
mIsScheduled = mDateTime.isValid();
|
mIsScheduled = mDateTime.isValid();
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@ FriendCore::FriendCore(const std::shared_ptr<linphone::Friend> &contact) : QObje
|
||||||
mJob = Utils::coreStringToAppString(vcard->getJobTitle());
|
mJob = Utils::coreStringToAppString(vcard->getJobTitle());
|
||||||
mGivenName = Utils::coreStringToAppString(vcard->getGivenName());
|
mGivenName = Utils::coreStringToAppString(vcard->getGivenName());
|
||||||
mFamilyName = Utils::coreStringToAppString(vcard->getFamilyName());
|
mFamilyName = Utils::coreStringToAppString(vcard->getFamilyName());
|
||||||
mFullName = Utils::coreStringToAppString(vcard->getFullName());
|
|
||||||
mVCardString = Utils::coreStringToAppString(vcard->asVcard4String());
|
mVCardString = Utils::coreStringToAppString(vcard->asVcard4String());
|
||||||
}
|
}
|
||||||
auto addresses = contact->getAddresses();
|
auto addresses = contact->getAddresses();
|
||||||
|
|
@ -102,6 +101,8 @@ FriendCore::FriendCore(const std::shared_ptr<linphone::Friend> &contact) : QObje
|
||||||
mIsLdap = ToolModel::friendIsInFriendList(ToolModel::getLdapFriendList(), contact);
|
mIsLdap = ToolModel::friendIsInFriendList(ToolModel::getLdapFriendList(), contact);
|
||||||
connect(this, &FriendCore::addressChanged, &FriendCore::allAddressesChanged);
|
connect(this, &FriendCore::addressChanged, &FriendCore::allAddressesChanged);
|
||||||
connect(this, &FriendCore::phoneNumberChanged, &FriendCore::allAddressesChanged);
|
connect(this, &FriendCore::phoneNumberChanged, &FriendCore::allAddressesChanged);
|
||||||
|
connect(this, &FriendCore::givenNameChanged, &FriendCore::displayNameChanged);
|
||||||
|
connect(this, &FriendCore::familyNameChanged, &FriendCore::displayNameChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
FriendCore::FriendCore(const FriendCore &friendCore) {
|
FriendCore::FriendCore(const FriendCore &friendCore) {
|
||||||
|
|
@ -111,7 +112,6 @@ FriendCore::FriendCore(const FriendCore &friendCore) {
|
||||||
mDefaultAddress = friendCore.mDefaultAddress;
|
mDefaultAddress = friendCore.mDefaultAddress;
|
||||||
mGivenName = friendCore.mGivenName;
|
mGivenName = friendCore.mGivenName;
|
||||||
mFamilyName = friendCore.mFamilyName;
|
mFamilyName = friendCore.mFamilyName;
|
||||||
mFullName = friendCore.mFullName;
|
|
||||||
mOrganization = friendCore.mOrganization;
|
mOrganization = friendCore.mOrganization;
|
||||||
mJob = friendCore.mJob;
|
mJob = friendCore.mJob;
|
||||||
mPictureUri = friendCore.mPictureUri;
|
mPictureUri = friendCore.mPictureUri;
|
||||||
|
|
@ -232,7 +232,6 @@ void FriendCore::reset(const FriendCore &contact) {
|
||||||
resetAddresses(contact.getAddresses());
|
resetAddresses(contact.getAddresses());
|
||||||
resetPhoneNumbers(contact.getPhoneNumbers());
|
resetPhoneNumbers(contact.getPhoneNumbers());
|
||||||
setDefaultAddress(contact.getDefaultAddress());
|
setDefaultAddress(contact.getDefaultAddress());
|
||||||
setDisplayName(contact.getDisplayName());
|
|
||||||
setGivenName(contact.getGivenName());
|
setGivenName(contact.getGivenName());
|
||||||
setFamilyName(contact.getFamilyName());
|
setFamilyName(contact.getFamilyName());
|
||||||
setOrganization(contact.getOrganization());
|
setOrganization(contact.getOrganization());
|
||||||
|
|
@ -242,15 +241,7 @@ void FriendCore::reset(const FriendCore &contact) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FriendCore::getDisplayName() const {
|
QString FriendCore::getDisplayName() const {
|
||||||
return !mFullName.isEmpty() ? mFullName : mGivenName + " " + mFamilyName;
|
return mGivenName + " " + mFamilyName;
|
||||||
}
|
|
||||||
|
|
||||||
void FriendCore::setDisplayName(const QString &name) {
|
|
||||||
if (mFullName != name) {
|
|
||||||
mFullName = name;
|
|
||||||
emit displayNameChanged();
|
|
||||||
setIsSaved(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FriendCore::getGivenName() const {
|
QString FriendCore::getGivenName() const {
|
||||||
|
|
@ -261,7 +252,6 @@ void FriendCore::setGivenName(const QString &name) {
|
||||||
if (mGivenName != name) {
|
if (mGivenName != name) {
|
||||||
mGivenName = name;
|
mGivenName = name;
|
||||||
emit givenNameChanged(name);
|
emit givenNameChanged(name);
|
||||||
emit displayNameChanged();
|
|
||||||
setIsSaved(false);
|
setIsSaved(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -298,7 +288,6 @@ void FriendCore::setFamilyName(const QString &name) {
|
||||||
if (mFamilyName != name) {
|
if (mFamilyName != name) {
|
||||||
mFamilyName = name;
|
mFamilyName = name;
|
||||||
emit familyNameChanged(name);
|
emit familyNameChanged(name);
|
||||||
emit displayNameChanged();
|
|
||||||
setIsSaved(false);
|
setIsSaved(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -518,9 +507,7 @@ void FriendCore::writeIntoModel(std::shared_ptr<FriendModel> model) const {
|
||||||
mustBeInLinphoneThread(QString("[") + gClassName + "] " + Q_FUNC_INFO);
|
mustBeInLinphoneThread(QString("[") + gClassName + "] " + Q_FUNC_INFO);
|
||||||
model->getFriend()->edit();
|
model->getFriend()->edit();
|
||||||
// needed to create the vcard if not created yet
|
// needed to create the vcard if not created yet
|
||||||
model->setName(!mFullName.isEmpty()
|
model->setName(mGivenName + (mFamilyName.isEmpty() || mGivenName.isEmpty() ? "" : " ") + mFamilyName);
|
||||||
? mFullName
|
|
||||||
: mGivenName + (mFamilyName.isEmpty() || mGivenName.isEmpty() ? "" : " ") + mFamilyName);
|
|
||||||
auto core = CoreModel::getInstance()->getCore();
|
auto core = CoreModel::getInstance()->getCore();
|
||||||
|
|
||||||
std::list<std::shared_ptr<linphone::Address>> addresses;
|
std::list<std::shared_ptr<linphone::Address>> addresses;
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ class FriendCore : public QObject, public AbstractObject {
|
||||||
Q_PROPERTY(int verifiedDeviceCount MEMBER mVerifiedDeviceCount NOTIFY verifiedDevicesChanged)
|
Q_PROPERTY(int verifiedDeviceCount MEMBER mVerifiedDeviceCount NOTIFY verifiedDevicesChanged)
|
||||||
Q_PROPERTY(QString givenName READ getGivenName WRITE setGivenName NOTIFY givenNameChanged)
|
Q_PROPERTY(QString givenName READ getGivenName WRITE setGivenName NOTIFY givenNameChanged)
|
||||||
Q_PROPERTY(QString familyName READ getFamilyName WRITE setFamilyName NOTIFY familyNameChanged)
|
Q_PROPERTY(QString familyName READ getFamilyName WRITE setFamilyName NOTIFY familyNameChanged)
|
||||||
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName NOTIFY displayNameChanged)
|
Q_PROPERTY(QString displayName READ getDisplayName NOTIFY displayNameChanged)
|
||||||
Q_PROPERTY(QString organization READ getOrganization WRITE setOrganization NOTIFY organizationChanged)
|
Q_PROPERTY(QString organization READ getOrganization WRITE setOrganization NOTIFY organizationChanged)
|
||||||
Q_PROPERTY(QString job READ getJob WRITE setJob NOTIFY jobChanged)
|
Q_PROPERTY(QString job READ getJob WRITE setJob NOTIFY jobChanged)
|
||||||
Q_PROPERTY(QString defaultAddress READ getDefaultAddress WRITE setDefaultAddress NOTIFY defaultAddressChanged)
|
Q_PROPERTY(QString defaultAddress READ getDefaultAddress WRITE setDefaultAddress NOTIFY defaultAddressChanged)
|
||||||
|
|
@ -178,7 +178,6 @@ protected:
|
||||||
QDateTime mPresenceTimestamp;
|
QDateTime mPresenceTimestamp;
|
||||||
QString mGivenName;
|
QString mGivenName;
|
||||||
QString mFamilyName;
|
QString mFamilyName;
|
||||||
QString mFullName;
|
|
||||||
QString mOrganization;
|
QString mOrganization;
|
||||||
QString mJob;
|
QString mJob;
|
||||||
bool mStarred;
|
bool mStarred;
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,15 @@ void MagicSearchList::setSelf(QSharedPointer<MagicSearchList> me) {
|
||||||
} else if (auto address = it->getAddress()) {
|
} else if (auto address = it->getAddress()) {
|
||||||
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
|
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
|
||||||
contact = FriendCore::create(linphoneFriend);
|
contact = FriendCore::create(linphoneFriend);
|
||||||
contact->setDisplayName(Utils::coreStringToAppString(address->getDisplayName()));
|
auto displayname = Utils::coreStringToAppString(address->getDisplayName());
|
||||||
|
auto splitted = displayname.split(" ");
|
||||||
|
if (splitted.size() > 0) {
|
||||||
|
contact->setGivenName(splitted[0]);
|
||||||
|
splitted.removeFirst();
|
||||||
|
contact->setFamilyName(splitted.join(" "));
|
||||||
|
} else {
|
||||||
contact->setGivenName(Utils::coreStringToAppString(address->getUsername()));
|
contact->setGivenName(Utils::coreStringToAppString(address->getUsername()));
|
||||||
|
}
|
||||||
contact->appendAddress(Utils::coreStringToAppString(address->asStringUriOnly()));
|
contact->appendAddress(Utils::coreStringToAppString(address->asStringUriOnly()));
|
||||||
contacts->append(contact);
|
contacts->append(contact);
|
||||||
} else if (!it->getPhoneNumber().empty()) {
|
} else if (!it->getPhoneNumber().empty()) {
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<Conferenc
|
||||||
|
|
||||||
QDateTime ConferenceInfoModel::getDateTime() const {
|
QDateTime ConferenceInfoModel::getDateTime() const {
|
||||||
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
|
||||||
return QDateTime::fromMSecsSinceEpoch(mConferenceInfo->getDateTime() * 1000, Qt::LocalTime);
|
return QDateTime::fromMSecsSinceEpoch(mConferenceInfo->getDateTime() * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ConferenceInfoModel::getDuration() const {
|
int ConferenceInfoModel::getDuration() const {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ FocusScope{
|
||||||
property alias errorTextItem: errorText
|
property alias errorTextItem: errorText
|
||||||
property alias errorMessage: errorText.text
|
property alias errorMessage: errorText.text
|
||||||
property bool enableErrorText: false
|
property bool enableErrorText: false
|
||||||
property bool errorTextVisible: errorText.text.length > 0
|
property bool errorTextVisible: errorText.isVisible
|
||||||
implicitHeight: layout.implicitHeight
|
implicitHeight: layout.implicitHeight
|
||||||
|
|
||||||
function clearErrorText() {
|
function clearErrorText() {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ ListView {
|
||||||
property bool initialHeadersVisible: true
|
property bool initialHeadersVisible: true
|
||||||
property bool displayNameCapitalization: true
|
property bool displayNameCapitalization: true
|
||||||
property bool showFavoritesOnly: false
|
property bool showFavoritesOnly: false
|
||||||
property bool showDefaultAddress: true
|
property bool showDefaultAddress: false
|
||||||
property bool showLdapContacts: false
|
property bool showLdapContacts: false
|
||||||
property bool searchOnInitialization: false
|
property bool searchOnInitialization: false
|
||||||
|
|
||||||
|
|
@ -203,10 +203,11 @@ ListView {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
Layout.topMargin: 2 * DefaultStyle.dp
|
maximumLineCount: 1
|
||||||
visible: mainItem.showDefaultAddress
|
visible: mainItem.showDefaultAddress
|
||||||
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(modelData.core.defaultAddress) : modelData.core.defaultAddress
|
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(modelData.core.defaultAddress) : modelData.core.defaultAddress
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.topMargin: 2 * DefaultStyle.dp
|
||||||
font {
|
font {
|
||||||
weight: 300 * DefaultStyle.dp
|
weight: 300 * DefaultStyle.dp
|
||||||
pixelSize: 12 * DefaultStyle.dp
|
pixelSize: 12 * DefaultStyle.dp
|
||||||
|
|
@ -244,8 +245,8 @@ ListView {
|
||||||
icon.width: 24 * DefaultStyle.dp
|
icon.width: 24 * DefaultStyle.dp
|
||||||
icon.height: 24 * DefaultStyle.dp
|
icon.height: 24 * DefaultStyle.dp
|
||||||
icon.source: AppIcons.phone
|
icon.source: AppIcons.phone
|
||||||
|
contentImageColor: DefaultStyle.main2_600
|
||||||
focus: visible
|
focus: visible
|
||||||
contentImageColor: DefaultStyle.main2_500main
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
radius: 40 * DefaultStyle.dp
|
radius: 40 * DefaultStyle.dp
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import Linphone
|
||||||
Text {
|
Text {
|
||||||
id: mainItem
|
id: mainItem
|
||||||
color: DefaultStyle.danger_500main
|
color: DefaultStyle.danger_500main
|
||||||
visible: text.length > 0
|
property bool isVisible: text.length > 0
|
||||||
function clear() {
|
function clear() {
|
||||||
autoHideErrorMessage.stop()
|
autoHideErrorMessage.stop()
|
||||||
text = ""
|
text = ""
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ ColumnLayout {
|
||||||
id: usernameEdit
|
id: usernameEdit
|
||||||
Layout.preferredWidth: 360 * DefaultStyle.dp
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 49 * DefaultStyle.dp
|
Layout.preferredHeight: 49 * DefaultStyle.dp
|
||||||
isError: username.errorTextVisible || errorText.visible
|
isError: username.errorTextVisible || (errorText.isVisible && text.length > 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -34,7 +34,7 @@ ColumnLayout {
|
||||||
id: passwordEdit
|
id: passwordEdit
|
||||||
Layout.preferredWidth: 360 * DefaultStyle.dp
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 49 * DefaultStyle.dp
|
Layout.preferredHeight: 49 * DefaultStyle.dp
|
||||||
isError: password.errorTextVisible || errorText.visible
|
isError: password.errorTextVisible || (errorText.isVisible && text.length > 0)
|
||||||
hidden: true
|
hidden: true
|
||||||
}
|
}
|
||||||
TemporaryText {
|
TemporaryText {
|
||||||
|
|
@ -43,6 +43,7 @@ ColumnLayout {
|
||||||
Connections {
|
Connections {
|
||||||
target: LoginPageCpp
|
target: LoginPageCpp
|
||||||
function onErrorMessageChanged() {
|
function onErrorMessageChanged() {
|
||||||
|
if (passwordEdit.text.length > 0 || usernameEdit.text.length > 0)
|
||||||
errorText.setText(LoginPageCpp.errorMessage)
|
errorText.setText(LoginPageCpp.errorMessage)
|
||||||
}
|
}
|
||||||
function onRegistrationStateChanged() {
|
function onRegistrationStateChanged() {
|
||||||
|
|
|
||||||
|
|
@ -163,6 +163,7 @@ FocusScope {
|
||||||
Layout.preferredHeight: contentHeight
|
Layout.preferredHeight: contentHeight
|
||||||
Control.ScrollBar.vertical.visible: false
|
Control.ScrollBar.vertical.visible: false
|
||||||
contactMenuVisible: false
|
contactMenuVisible: false
|
||||||
|
searchOnInitialization: true
|
||||||
searchBarText: searchBar.text
|
searchBarText: searchBar.text
|
||||||
onContactClicked: (contact) => {
|
onContactClicked: (contact) => {
|
||||||
mainItem.contactClicked(contact)
|
mainItem.contactClicked(contact)
|
||||||
|
|
|
||||||
|
|
@ -72,9 +72,11 @@ MainRightPanel {
|
||||||
button.text: mainItem.saveButtonText
|
button.text: mainItem.saveButtonText
|
||||||
|
|
||||||
button.onClicked: {
|
button.onClicked: {
|
||||||
if (contact.core.givenName.length === 0 || (addressesList.count === 0 && phoneNumberList.count === 0)) {
|
if (contact.core.givenName.length === 0) {
|
||||||
if (contact.core.givenName.length === 0) givenName.errorMessage = qsTr("Veuillez saisir un prénom")
|
givenName.errorMessage = qsTr("Veuillez saisir un prénom")
|
||||||
if (addressesList.count === 0 && phoneNumberList.count === 0) addressesErrorText.text = qsTr("Veuillez saisir une adresse ou un numéro de téléphone")
|
return
|
||||||
|
} else if (addressesList.count === 0 && phoneNumberList.count === 0) {
|
||||||
|
addressesErrorText.setText(qsTr("Veuillez saisir une adresse ou un numéro de téléphone"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mainItem.contact.core.save()
|
mainItem.contact.core.save()
|
||||||
|
|
@ -135,11 +137,12 @@ MainRightPanel {
|
||||||
content: Flickable {
|
content: Flickable {
|
||||||
id: editionLayout
|
id: editionLayout
|
||||||
contentWidth: 421 * DefaultStyle.dp
|
contentWidth: 421 * DefaultStyle.dp
|
||||||
|
contentY: 0
|
||||||
|
|
||||||
function ensureVisible(r) {
|
function ensureVisible(r) {
|
||||||
if (contentY >= r.y)
|
if (contentY >= r.y)
|
||||||
contentY = r.y;
|
contentY = r.y;
|
||||||
else if (contentY+height <= r.y+r.height+content.spacing)
|
else if (contentY+height <= r.y+r.height)
|
||||||
contentY = r.y+r.height-height;
|
contentY = r.y+r.height-height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -162,7 +165,9 @@ MainRightPanel {
|
||||||
id: givenNameEdit
|
id: givenNameEdit
|
||||||
Layout.preferredHeight: 49 * DefaultStyle.dp
|
Layout.preferredHeight: 49 * DefaultStyle.dp
|
||||||
initialText: contact.core.givenName
|
initialText: contact.core.givenName
|
||||||
onTextEdited: contact.core.givenName = text
|
onTextChanged: {
|
||||||
|
contact.core.givenName = givenNameEdit.text
|
||||||
|
}
|
||||||
backgroundColor: DefaultStyle.grey_0
|
backgroundColor: DefaultStyle.grey_0
|
||||||
backgroundBorderColor: givenName.errorTextVisible ? DefaultStyle.danger_500main : DefaultStyle.grey_200
|
backgroundBorderColor: givenName.errorTextVisible ? DefaultStyle.danger_500main : DefaultStyle.grey_200
|
||||||
KeyNavigation.up: editButton.visible ? editButton : addPictureButton
|
KeyNavigation.up: editButton.visible ? editButton : addPictureButton
|
||||||
|
|
@ -175,7 +180,7 @@ MainRightPanel {
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: nameTextField
|
id: nameTextField
|
||||||
initialText: contact.core.familyName
|
initialText: contact.core.familyName
|
||||||
onTextEdited: contact.core.familyName = text
|
onEditingFinished: contact.core.familyName = text
|
||||||
backgroundColor: DefaultStyle.grey_0
|
backgroundColor: DefaultStyle.grey_0
|
||||||
KeyNavigation.up: givenNameEdit
|
KeyNavigation.up: givenNameEdit
|
||||||
KeyNavigation.down: companyTextField
|
KeyNavigation.down: companyTextField
|
||||||
|
|
@ -187,7 +192,7 @@ MainRightPanel {
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: companyTextField
|
id: companyTextField
|
||||||
initialText: contact.core.organization
|
initialText: contact.core.organization
|
||||||
onTextEdited: contact.core.organization = text
|
onEditingFinished: contact.core.organization = text
|
||||||
backgroundColor: DefaultStyle.grey_0
|
backgroundColor: DefaultStyle.grey_0
|
||||||
KeyNavigation.up: nameTextField
|
KeyNavigation.up: nameTextField
|
||||||
KeyNavigation.down: jobTextField
|
KeyNavigation.down: jobTextField
|
||||||
|
|
@ -199,7 +204,7 @@ MainRightPanel {
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: jobTextField
|
id: jobTextField
|
||||||
initialText: contact.core.job
|
initialText: contact.core.job
|
||||||
onTextEdited: contact.core.job = text
|
onEditingFinished: contact.core.job = text
|
||||||
backgroundColor: DefaultStyle.grey_0
|
backgroundColor: DefaultStyle.grey_0
|
||||||
KeyNavigation.up: companyTextField
|
KeyNavigation.up: companyTextField
|
||||||
Keys.onPressed: (event) => {
|
Keys.onPressed: (event) => {
|
||||||
|
|
@ -274,7 +279,7 @@ MainRightPanel {
|
||||||
FormItemLayout {
|
FormItemLayout {
|
||||||
label: qsTr("Adresse SIP")
|
label: qsTr("Adresse SIP")
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onYChanged: editionLayout.ensureVisible(this)
|
// onYChanged: editionLayout.ensureVisible(this)
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: newAddressTextField
|
id: newAddressTextField
|
||||||
backgroundColor: DefaultStyle.grey_0
|
backgroundColor: DefaultStyle.grey_0
|
||||||
|
|
@ -294,8 +299,9 @@ MainRightPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
mainItem.contact.core.appendAddress(text)
|
if (text.length > 0) mainItem.contact.core.appendAddress(text)
|
||||||
newAddressTextField.clear()
|
newAddressTextField.clear()
|
||||||
|
editionLayout.ensureVisible(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -359,7 +365,7 @@ MainRightPanel {
|
||||||
id: phoneNumberInput
|
id: phoneNumberInput
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
label: qsTr("Phone")
|
label: qsTr("Phone")
|
||||||
onYChanged: editionLayout.ensureVisible(this)
|
// onYChanged: editionLayout.ensureVisible(this)
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: phoneNumberInputTextField
|
id: phoneNumberInputTextField
|
||||||
backgroundColor: DefaultStyle.grey_0
|
backgroundColor: DefaultStyle.grey_0
|
||||||
|
|
@ -380,7 +386,8 @@ MainRightPanel {
|
||||||
}
|
}
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
if (text.length != 0) mainItem.contact.core.appendPhoneNumber(phoneNumberInput.label, text)
|
if (text.length != 0) mainItem.contact.core.appendPhoneNumber(phoneNumberInput.label, text)
|
||||||
text = ""
|
phoneNumberInputTextField.clear()
|
||||||
|
editionLayout.ensureVisible(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -389,7 +396,7 @@ MainRightPanel {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
onTextChanged: editionLayout.ensureVisible(this)
|
onTextChanged: if(text.length > 0) editionLayout.ensureVisible(this)
|
||||||
}
|
}
|
||||||
Item{Layout.fillHeight: true}
|
Item{Layout.fillHeight: true}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ LoginLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: usernameEdit
|
id: usernameEdit
|
||||||
isError: username.errorTextVisible
|
isError: username.errorTextVisible || errorText.isVisible
|
||||||
Layout.preferredWidth: 360 * DefaultStyle.dp
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
KeyNavigation.down: passwordEdit
|
KeyNavigation.down: passwordEdit
|
||||||
}
|
}
|
||||||
|
|
@ -221,7 +221,7 @@ LoginLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
contentItem: TextField {
|
contentItem: TextField {
|
||||||
id: passwordEdit
|
id: passwordEdit
|
||||||
isError: password.errorTextVisible
|
isError: password.errorTextVisible || errorText.isVisible
|
||||||
hidden: true
|
hidden: true
|
||||||
Layout.preferredWidth: 360 * DefaultStyle.dp
|
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||||
KeyNavigation.up: usernameEdit
|
KeyNavigation.up: usernameEdit
|
||||||
|
|
@ -287,7 +287,7 @@ LoginLayout {
|
||||||
Connections {
|
Connections {
|
||||||
target: LoginPageCpp
|
target: LoginPageCpp
|
||||||
function onErrorMessageChanged(error) {
|
function onErrorMessageChanged(error) {
|
||||||
errorText.text = error
|
errorText.setText(error)
|
||||||
}
|
}
|
||||||
function onRegistrationStateChanged() {
|
function onRegistrationStateChanged() {
|
||||||
if (LoginPageCpp.registrationState === LinphoneEnums.RegistrationState.Ok) {
|
if (LoginPageCpp.registrationState === LinphoneEnums.RegistrationState.Ok) {
|
||||||
|
|
@ -345,7 +345,7 @@ LoginLayout {
|
||||||
username.errorMessage = ""
|
username.errorMessage = ""
|
||||||
password.errorMessage = ""
|
password.errorMessage = ""
|
||||||
domain.errorMessage = ""
|
domain.errorMessage = ""
|
||||||
errorText.text = ""
|
errorText.clear()
|
||||||
|
|
||||||
if (usernameEdit.text.length == 0 || passwordEdit.text.length == 0 || domainEdit.text.length == 0) {
|
if (usernameEdit.text.length == 0 || passwordEdit.text.length == 0 || domainEdit.text.length == 0) {
|
||||||
if (usernameEdit.text.length == 0)
|
if (usernameEdit.text.length == 0)
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ FocusScope{
|
||||||
contactMenuVisible: false
|
contactMenuVisible: false
|
||||||
confInfoGui: mainItem.conferenceInfoGui
|
confInfoGui: mainItem.conferenceInfoGui
|
||||||
searchBarText: searchbar.text
|
searchBarText: searchbar.text
|
||||||
|
searchOnInitialization: true
|
||||||
onContactAddedToSelection: (address) => {
|
onContactAddedToSelection: (address) => {
|
||||||
suggestionList.addContactToSelection(address)
|
suggestionList.addContactToSelection(address)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ FocusScope {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: formLayout
|
id: formLayout
|
||||||
spacing: 16 * DefaultStyle.dp
|
spacing: 16 * DefaultStyle.dp
|
||||||
|
anchors.fill: parent
|
||||||
Connections {
|
Connections {
|
||||||
target: mainItem.conferenceInfoGui.core
|
target: mainItem.conferenceInfoGui.core
|
||||||
function onSchedulerStateChanged() {
|
function onSchedulerStateChanged() {
|
||||||
|
|
@ -153,7 +154,6 @@ FocusScope {
|
||||||
TimeComboBox {
|
TimeComboBox {
|
||||||
id: startHour
|
id: startHour
|
||||||
indicator.visible: mainItem.isCreation
|
indicator.visible: mainItem.isCreation
|
||||||
// Layout.fillWidth: true
|
|
||||||
Layout.preferredWidth: 94 * DefaultStyle.dp
|
Layout.preferredWidth: 94 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
background.visible: mainItem.isCreation
|
background.visible: mainItem.isCreation
|
||||||
|
|
@ -196,7 +196,7 @@ FocusScope {
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: timeZoneCbox
|
id: timeZoneCbox
|
||||||
Layout.preferredWidth: 307 * DefaultStyle.dp
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: 30 * DefaultStyle.dp
|
Layout.preferredHeight: 30 * DefaultStyle.dp
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
oneLine: true
|
oneLine: true
|
||||||
|
|
|
||||||
|
|
@ -21,11 +21,11 @@ LoginLayout {
|
||||||
else if (field == "password") pwdItem.errorMessage = errorMessage
|
else if (field == "password") pwdItem.errorMessage = errorMessage
|
||||||
else if (field == "phone") phoneNumberInput.errorMessage = errorMessage
|
else if (field == "phone") phoneNumberInput.errorMessage = errorMessage
|
||||||
else if (field == "email") emailItem.errorMessage = errorMessage
|
else if (field == "email") emailItem.errorMessage = errorMessage
|
||||||
else otherErrorText.text = errorMessage
|
else otherErrorText.setText(errorMessage)
|
||||||
}
|
}
|
||||||
function onRegisterNewAccountFailed(errorMessage) {
|
function onRegisterNewAccountFailed(errorMessage) {
|
||||||
console.log("register failed", errorMessage)
|
console.log("register failed", errorMessage)
|
||||||
otherErrorText.text = errorMessage
|
otherErrorText.setText(errorMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ AbstractMainPage {
|
||||||
|
|
||||||
onNoItemButtonPressed: goToNewCall()
|
onNoItemButtonPressed: goToNewCall()
|
||||||
|
|
||||||
showDefaultItem: listStackView.currentItem && listStackView.currentItem.listView && listStackView.currentItem.listView.count === 0
|
showDefaultItem: listStackView.currentItem && listStackView.currentItem.objectName == "historyListItem" && listStackView.currentItem.listView.count === 0
|
||||||
|
|
||||||
function goToNewCall() {
|
function goToNewCall() {
|
||||||
if (listStackView.currentItem && listStackView.currentItem.objectName != "newCallItem") listStackView.push(newCallItem)
|
if (listStackView.currentItem && listStackView.currentItem.objectName != "newCallItem") listStackView.push(newCallItem)
|
||||||
|
|
@ -185,6 +185,7 @@ AbstractMainPage {
|
||||||
Layout.rightMargin: 39 * DefaultStyle.dp
|
Layout.rightMargin: 39 * DefaultStyle.dp
|
||||||
icon.width: 28 * DefaultStyle.dp
|
icon.width: 28 * DefaultStyle.dp
|
||||||
icon.height: 28 * DefaultStyle.dp
|
icon.height: 28 * DefaultStyle.dp
|
||||||
|
contentImageColor: DefaultStyle.main2_600
|
||||||
KeyNavigation.left: removeHistory
|
KeyNavigation.left: removeHistory
|
||||||
KeyNavigation.down: listStackView
|
KeyNavigation.down: listStackView
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
@ -199,7 +200,7 @@ AbstractMainPage {
|
||||||
id: historyListItem
|
id: historyListItem
|
||||||
FocusScope{
|
FocusScope{
|
||||||
objectName: "historyListItem"
|
objectName: "historyListItem"
|
||||||
property var listView: historyListView
|
property alias listView: historyListView
|
||||||
Control.StackView.onActivated: titleLoader.sourceComponent = historyListTitle
|
Control.StackView.onActivated: titleLoader.sourceComponent = historyListTitle
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -231,7 +232,7 @@ AbstractMainPage {
|
||||||
background: Item{}
|
background: Item{}
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
Text {
|
Text {
|
||||||
visible: historyListView.count === 0 || searchBar.text.length != 0
|
visible: historyListView.count === 0
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: qsTr("Aucun appel%1").arg(searchBar.text.length != 0 ? " correspondant" : "")
|
text: qsTr("Aucun appel%1").arg(searchBar.text.length != 0 ? " correspondant" : "")
|
||||||
font {
|
font {
|
||||||
|
|
@ -362,6 +363,7 @@ AbstractMainPage {
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
icon.width: 24 * DefaultStyle.dp
|
icon.width: 24 * DefaultStyle.dp
|
||||||
icon.height: 24 * DefaultStyle.dp
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
contentImageColor: DefaultStyle.main2_600
|
||||||
focus: true
|
focus: true
|
||||||
activeFocusOnTab: false
|
activeFocusOnTab: false
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ AbstractMainPage {
|
||||||
|
|
||||||
// rightPanelStackView.initialItem: contactDetail
|
// rightPanelStackView.initialItem: contactDetail
|
||||||
|
|
||||||
showDefaultItem: rightPanelStackView.depth == 0 && contactList.count === 0 && searchBar.text.length === 0
|
showDefaultItem: rightPanelStackView.depth == 0 && leftPanelNoItemText.visible && searchBar.text.length === 0
|
||||||
|
|
||||||
MagicSearchProxy {
|
MagicSearchProxy {
|
||||||
id: allFriends
|
id: allFriends
|
||||||
|
|
@ -236,7 +236,8 @@ AbstractMainPage {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: 15 * DefaultStyle.dp
|
spacing: 15 * DefaultStyle.dp
|
||||||
Text {
|
Text {
|
||||||
visible: contactList.count === 0 || searchBar.text.length != 0
|
id: leftPanelNoItemText
|
||||||
|
visible: contactList.count === 0
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: 137 * DefaultStyle.dp
|
Layout.topMargin: 137 * DefaultStyle.dp
|
||||||
text: qsTr("Aucun contact%1").arg(searchBar.text.length !== 0 ? " correspondant" : "")
|
text: qsTr("Aucun contact%1").arg(searchBar.text.length !== 0 ? " correspondant" : "")
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Text {
|
Text {
|
||||||
visible: conferenceList.count === 0 || searchBar.text.length != 0
|
visible: conferenceList.count === 0
|
||||||
Layout.topMargin: 137 * DefaultStyle.dp
|
Layout.topMargin: 137 * DefaultStyle.dp
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
@ -191,7 +191,6 @@ AbstractMainPage {
|
||||||
Layout.topMargin: 38 * DefaultStyle.dp - 24 * DefaultStyle.dp
|
Layout.topMargin: 38 * DefaultStyle.dp - 24 * DefaultStyle.dp
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
implicitHeight: contentHeight
|
|
||||||
hoverEnabled: mainItem.leftPanelEnabled
|
hoverEnabled: mainItem.leftPanelEnabled
|
||||||
highlightFollowsCurrentItem: true
|
highlightFollowsCurrentItem: true
|
||||||
preferredHighlightBegin: height/2 - 10
|
preferredHighlightBegin: height/2 - 10
|
||||||
|
|
@ -343,14 +342,14 @@ AbstractMainPage {
|
||||||
id: editFocusScope
|
id: editFocusScope
|
||||||
property bool isCreation
|
property bool isCreation
|
||||||
property ConferenceInfoGui conferenceInfoGui
|
property ConferenceInfoGui conferenceInfoGui
|
||||||
width: parent?.width
|
width: overridenRightPanelStackView.width
|
||||||
height: editLayout.implicitHeight
|
height: editLayout.implicitHeight
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: editLayout
|
id: editLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 58 * DefaultStyle.dp
|
||||||
spacing: 0
|
spacing: 0
|
||||||
Section {
|
Section {
|
||||||
Layout.topMargin: 58 * DefaultStyle.dp
|
|
||||||
content: RowLayout {
|
content: RowLayout {
|
||||||
spacing: 10 * DefaultStyle.dp
|
spacing: 10 * DefaultStyle.dp
|
||||||
Button {
|
Button {
|
||||||
|
|
@ -420,6 +419,7 @@ AbstractMainPage {
|
||||||
property bool isCreation
|
property bool isCreation
|
||||||
isCreation: editFocusScope.isCreation
|
isCreation: editFocusScope.isCreation
|
||||||
conferenceInfoGui: editFocusScope.conferenceInfoGui
|
conferenceInfoGui: editFocusScope.conferenceInfoGui
|
||||||
|
Layout.fillWidth: true
|
||||||
Connections {
|
Connections {
|
||||||
target: conferenceEdit.conferenceInfoGui ? conferenceEdit.conferenceInfoGui.core : null
|
target: conferenceEdit.conferenceInfoGui ? conferenceEdit.conferenceInfoGui.core : null
|
||||||
function onConferenceSchedulerStateChanged() {
|
function onConferenceSchedulerStateChanged() {
|
||||||
|
|
@ -464,6 +464,7 @@ AbstractMainPage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Item { Layout.fillHeight: true}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -551,10 +552,10 @@ AbstractMainPage {
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: meetingDetailsLayout
|
id: meetingDetailsLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: 58 * DefaultStyle.dp
|
||||||
visible: mainItem.selectedConference
|
visible: mainItem.selectedConference
|
||||||
spacing: 25 * DefaultStyle.dp
|
spacing: 25 * DefaultStyle.dp
|
||||||
Section {
|
Section {
|
||||||
Layout.topMargin: 58 * DefaultStyle.dp
|
|
||||||
visible: mainItem.selectedConference
|
visible: mainItem.selectedConference
|
||||||
content: RowLayout {
|
content: RowLayout {
|
||||||
spacing: 8 * DefaultStyle.dp
|
spacing: 8 * DefaultStyle.dp
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue