Improve phrases in share voice chat link box.

This commit is contained in:
John Preston 2021-03-12 22:22:19 +04:00
parent ed4dea2b0e
commit ce84d9c84d
5 changed files with 19 additions and 6 deletions

View file

@ -1961,7 +1961,9 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_group_call_ptt_delay_s" = "{amount}s";
"lng_group_call_ptt_delay" = "Push to Talk release delay: {delay}";
"lng_group_call_share" = "Share Invite Link";
"lng_group_call_share_listener" = "Mute joined by this link";
"lng_group_call_share_speaker" = "Users with this link can speak";
"lng_group_call_copy_speaker_link" = "Copy Speaker Link";
"lng_group_call_copy_listener_link" = "Copy Listener Link";
"lng_group_call_end" = "End Voice Chat";
"lng_group_call_join" = "Join";
"lng_group_call_invite_done_user" = "You invited {user} to the voice chat.";

View file

@ -173,6 +173,9 @@ ShareBox::ShareBox(QWidget*, Descriptor &&descriptor)
tr::lng_photos_comment()),
st::shareCommentPadding)
, _bottomWidget(std::move(_descriptor.bottomWidget))
, _copyLinkText(_descriptor.copyLinkText
? std::move(_descriptor.copyLinkText)
: tr::lng_share_copy_link())
, _searchTimer([=] { searchByUsername(); }) {
if (_bottomWidget) {
_bottomWidget->setParent(this);
@ -452,7 +455,7 @@ void ShareBox::createButtons() {
[=] { submitSilent(); },
[=] { submitScheduled(); });
} else if (_descriptor.copyCallback) {
addButton(tr::lng_share_copy_link(), [=] { copyLink(); });
addButton(_copyLinkText.value(), [=] { copyLink(); });
}
addButton(tr::lng_cancel(), [=] { closeBox(); });
}

View file

@ -75,6 +75,7 @@ public:
Fn<void(not_null<Ui::InputField*>)> initSpellchecker;
Fn<void(not_null<Ui::InputField*>)> initEditLink;
object_ptr<Ui::RpWidget> bottomWidget = { nullptr };
rpl::producer<QString> copyLinkText;
const style::MultiSelect *stMultiSelect = nullptr;
const style::InputField *stComment = nullptr;
const style::PeerList *st = nullptr;
@ -129,6 +130,7 @@ private:
QPointer<Inner> _inner;
bool _hasSelected = false;
rpl::variable<QString> _copyLinkText;
base::Timer _searchTimer;
QString _peopleQuery;

View file

@ -106,13 +106,13 @@ object_ptr<ShareBox> ShareInviteLinkBox(
nullptr,
object_ptr<Ui::Checkbox>(
nullptr,
tr::lng_group_call_share_listener(tr::now),
tr::lng_group_call_share_speaker(tr::now),
true,
st::groupCallCheckbox),
st::groupCallShareMutedMargin);
const auto listenerCheckbox = bottom ? bottom->entity() : nullptr;
const auto speakerCheckbox = bottom ? bottom->entity() : nullptr;
const auto currentLink = [=] {
return (!listenerCheckbox || listenerCheckbox->checked())
return (!speakerCheckbox || !speakerCheckbox->checked())
? linkListener
: linkSpeaker;
};
@ -192,6 +192,12 @@ object_ptr<ShareBox> ShareInviteLinkBox(
.submitCallback = std::move(submitCallback),
.filterCallback = std::move(filterCallback),
.bottomWidget = std::move(bottom),
.copyLinkText = rpl::conditional(
(speakerCheckbox
? speakerCheckbox->checkedValue()
: rpl::single(false)),
tr::lng_group_call_copy_speaker_link(),
tr::lng_group_call_copy_listener_link()),
.stMultiSelect = &st::groupCallMultiSelect,
.stComment = &st::groupCallShareBoxComment,
.st = &st::groupCallShareBoxList });

@ -1 +1 @@
Subproject commit 001d9c36b029094b18049198b830acc9969bae3c
Subproject commit 7fccdee1bb669225bbdbb3db127163e71bf7fad0