From e2b6d25aa854f774cae5a331e0279b79b821604b Mon Sep 17 00:00:00 2001 From: Sebastian Wolf Date: Tue, 26 Jan 2021 23:54:37 +0100 Subject: [PATCH] Show picture placeholder in settings, handle first upload properly --- qml/components/ProfilePictureList.qml | 1 + qml/pages/SettingsPage.qml | 15 ++++ src/tdlibwrapper.cpp | 1 + translations/harbour-fernschreiber-ru.ts | 4 +- translations/harbour-fernschreiber-sk.ts | 107 +++++++++++++++++++++++ 5 files changed, 126 insertions(+), 2 deletions(-) diff --git a/qml/components/ProfilePictureList.qml b/qml/components/ProfilePictureList.qml index 8e1f2fd..d88ea09 100644 --- a/qml/components/ProfilePictureList.qml +++ b/qml/components/ProfilePictureList.qml @@ -71,4 +71,5 @@ Item { style: Text.Raised styleColor: Theme.highlightDimmerColor } + } diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index 47df8d3..bbcf1ab 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -64,6 +64,11 @@ Page { if (request === "deleteProfilePhoto") { tdLibWrapper.getUserProfilePhotos(userInformation.id, 100, 0); } + if (request === "setProfilePhoto") { + tdLibWrapper.getUserProfilePhotos(userInformation.id, 100, 0); + profilePictureButtonColumn.visible = true; + uploadInProgress = false; + } } } @@ -196,6 +201,16 @@ Page { anchors.horizontalCenter: parent.horizontalCenter source: "../components/ProfilePictureList.qml" } + + ProfileThumbnail { + id: chatPictureReplacement + visible: !profilePictureLoader.active + replacementStringHint: Functions.getUserName(settingsPage.userInformation) + radius: imageContainer.thumbnailRadius + anchors.horizontalCenter: parent.horizontalCenter + width: Theme.itemSizeExtraLarge + height: Theme.itemSizeExtraLarge + } } Column { diff --git a/src/tdlibwrapper.cpp b/src/tdlibwrapper.cpp index 9b0f942..6b5b339 100644 --- a/src/tdlibwrapper.cpp +++ b/src/tdlibwrapper.cpp @@ -1301,6 +1301,7 @@ void TDLibWrapper::setProfilePhoto(const QString &filePath) QVariantMap requestObject; requestObject.insert(_TYPE, "setProfilePhoto"); + requestObject.insert(_EXTRA, "setProfilePhoto"); QVariantMap inputChatPhoto; inputChatPhoto.insert(_TYPE, "inputChatPhotoStatic"); QVariantMap inputFile; diff --git a/translations/harbour-fernschreiber-ru.ts b/translations/harbour-fernschreiber-ru.ts index 391b880..3a1a6ca 100644 --- a/translations/harbour-fernschreiber-ru.ts +++ b/translations/harbour-fernschreiber-ru.ts @@ -2140,11 +2140,11 @@ sent a game myself - + отправлена игра sent a game - + отправлена игра diff --git a/translations/harbour-fernschreiber-sk.ts b/translations/harbour-fernschreiber-sk.ts index 8b9059b..02d7726 100644 --- a/translations/harbour-fernschreiber-sk.ts +++ b/translations/harbour-fernschreiber-sk.ts @@ -1554,6 +1554,113 @@ Some inline bots request location data when using them Niektorí inline roboti požadujú údaje o polohe ak ich používajú + + User Profile + + + + First Name + first name of the logged-in profile - header + + + + Enter 1-64 characters + Zadať 1-128 znakov {1-64 ?} + + + Last Name + last name of the logged-in profile - header + + + + Enter 0-64 characters + Zadať 1-128 znakov {0-64 ?} + + + Username + user name of the logged-in profile - header + + + + Profile Pictures + + + + Add Picture + + + + Delete Picture + + + + Deleting profile picture + + + + Uploading... + Zapisovanie... + + + Allow chat invites + + + + Privacy setting for managing whether you can be invited to chats. + + + + Yes + + + + Your contacts only + + + + No + + + + Allow finding by phone number + + + + Privacy setting for managing whether you can be found by your phone number. + + + + Show link in forwarded messages + + + + Privacy setting for managing whether a link to your account is included in forwarded messages. + + + + Show phone number + + + + Privacy setting for managing whether your phone number is visible. + + + + Show profile photo + + + + Privacy setting for managing whether your profile photo is visible. + + + + Show status + + + + Privacy setting for managing whether your online status is visible. + + StickerPicker