From 214a6c780c638fb0b2ecba2345316526b4a1d23e Mon Sep 17 00:00:00 2001 From: John Gibbon Date: Mon, 19 Oct 2020 21:06:28 +0200 Subject: [PATCH] Fix crash with no groups in common --- .../ChatInformationTabItemMembersGroups.qml | 7 +++++-- .../chatInformationPage/ChatInformationTabView.qml | 9 +++------ translations/harbour-fernschreiber-de.ts | 8 ++++++++ translations/harbour-fernschreiber-es.ts | 8 ++++++++ translations/harbour-fernschreiber-fi.ts | 8 ++++++++ translations/harbour-fernschreiber-hu.ts | 8 ++++++++ translations/harbour-fernschreiber-it.ts | 8 ++++++++ translations/harbour-fernschreiber-pl.ts | 8 ++++++++ translations/harbour-fernschreiber-ru.ts | 8 ++++++++ translations/harbour-fernschreiber-zh_CN.ts | 8 ++++++++ translations/harbour-fernschreiber.ts | 8 ++++++++ 11 files changed, 80 insertions(+), 8 deletions(-) diff --git a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml index 7be0b30..7077a61 100644 --- a/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml +++ b/qml/components/chatInformationPage/ChatInformationTabItemMembersGroups.qml @@ -38,7 +38,7 @@ ChatInformationTabItemBase { SilicaListView { id: membersView - model: isPrivateChat ? delegateModel : chatInformationPage.membersList + model: isPrivateChat ? (chatPartnerCommonGroupsIds.length > 0 ? delegateModel : null) : chatInformationPage.membersList clip: true height: tabBase.height width: tabBase.width @@ -68,7 +68,10 @@ ChatInformationTabItemBase { onQuickScrollAnimatingChanged: { handleScrollIntoView(true) } - + ViewPlaceholder { + enabled: membersView.count === 0 + text: chatInformationPage.isPrivateChat ? qsTr("You don't have any groups in common with this user.") : qsTr("This group is empty.") + } delegate: PhotoTextsListItem { pictureThumbnail { photoData: (typeof user.profile_photo !== "undefined") ? user.profile_photo.small : "" diff --git a/qml/components/chatInformationPage/ChatInformationTabView.qml b/qml/components/chatInformationPage/ChatInformationTabView.qml index 2e62006..31b35e5 100644 --- a/qml/components/chatInformationPage/ChatInformationTabView.qml +++ b/qml/components/chatInformationPage/ChatInformationTabView.qml @@ -34,17 +34,14 @@ Item { Item { id: tabViewHeader /* - * Tab view is prepared, but "disabled" for now - * to view shared media/links/…, + * Tab view was prepared for + * shared media/links/…, but for this * we need message search with filters */ - // START: change this to enable height: visible ? headerGrid.height : 0 -// height: 0 clip: true visible: tabView.count > 1 - // END: change this to enable anchors { left: parent.left @@ -80,7 +77,7 @@ Item { } } Label { - text: headerItem.tabItem.title// + headerItem.itemIsActive + text: headerItem.tabItem.title width: parent.width horizontalAlignment: Text.AlignHCenter anchors.top: headerIcon.bottom diff --git a/translations/harbour-fernschreiber-de.ts b/translations/harbour-fernschreiber-de.ts index 105e694..0ce9e2f 100644 --- a/translations/harbour-fernschreiber-de.ts +++ b/translations/harbour-fernschreiber-de.ts @@ -183,6 +183,14 @@ Loading group members… Lade Gruppenmitglieder… + + You don't have any groups in common with this user. + Sie haben mit diesem Benutzer keine gemeinsamen Gruppen. + + + This group is empty. + Diese Gruppe ist leer. + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-es.ts b/translations/harbour-fernschreiber-es.ts index b3d794d..9fca2fc 100644 --- a/translations/harbour-fernschreiber-es.ts +++ b/translations/harbour-fernschreiber-es.ts @@ -183,6 +183,14 @@ You + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-fi.ts b/translations/harbour-fernschreiber-fi.ts index f2f67a6..839f650 100644 --- a/translations/harbour-fernschreiber-fi.ts +++ b/translations/harbour-fernschreiber-fi.ts @@ -183,6 +183,14 @@ You Sinä + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-hu.ts b/translations/harbour-fernschreiber-hu.ts index 4f1a50f..4af68ee 100644 --- a/translations/harbour-fernschreiber-hu.ts +++ b/translations/harbour-fernschreiber-hu.ts @@ -183,6 +183,14 @@ You Te + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-it.ts b/translations/harbour-fernschreiber-it.ts index d11e064..e0e634b 100644 --- a/translations/harbour-fernschreiber-it.ts +++ b/translations/harbour-fernschreiber-it.ts @@ -183,6 +183,14 @@ Unknown Sconosciuto + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-pl.ts b/translations/harbour-fernschreiber-pl.ts index 906f600..78dab8b 100644 --- a/translations/harbour-fernschreiber-pl.ts +++ b/translations/harbour-fernschreiber-pl.ts @@ -183,6 +183,14 @@ You Ty + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 131cc6c..7ce622d 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -183,6 +183,14 @@ You Вы + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber-zh_CN.ts b/translations/harbour-fernschreiber-zh_CN.ts index 64f6c57..ad79fcc 100644 --- a/translations/harbour-fernschreiber-zh_CN.ts +++ b/translations/harbour-fernschreiber-zh_CN.ts @@ -183,6 +183,14 @@ You + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings diff --git a/translations/harbour-fernschreiber.ts b/translations/harbour-fernschreiber.ts index 4d1a4a4..54ea7f6 100644 --- a/translations/harbour-fernschreiber.ts +++ b/translations/harbour-fernschreiber.ts @@ -183,6 +183,14 @@ You + + You don't have any groups in common with this user. + + + + This group is empty. + + ChatInformationTabItemSettings