2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Settings block in the new profile implementation done.

New type of button (LeftOutlineButton) was added. _inviteLink moved
to private section in ChatData and ChannelData (with get-set methods).
This commit is contained in:
John Preston
2016-06-01 16:07:03 +03:00
parent 41c8df029a
commit 66a8aa86e1
26 changed files with 610 additions and 125 deletions

View File

@@ -544,7 +544,8 @@ bool GroupInfoBox::creationFail(const RPCError &error) {
void GroupInfoBox::exportDone(const MTPExportedChatInvite &result) {
_creationRequestId = 0;
if (result.type() == mtpc_chatInviteExported) {
_createdChannel->invitationUrl = qs(result.c_chatInviteExported().vlink);
_createdChannel->setInviteLink(qs(result.c_chatInviteExported().vlink));
Notify::peerUpdatedSendDelayed();
}
Ui::showLayer(new SetupChannelBox(_createdChannel));
}
@@ -716,7 +717,7 @@ void SetupChannelBox::paintEvent(QPaintEvent *e) {
option.setWrapMode(QTextOption::WrapAnywhere);
p.setFont(_linkOver ? st::boxTextFont->underline() : st::boxTextFont);
p.setPen(st::btnDefLink.color);
p.drawText(_invitationLink, _channel->invitationUrl, option);
p.drawText(_invitationLink, _channel->inviteLink(), option);
if (!_goodTextLink.isEmpty() && a_goodOpacity.current() > 0) {
p.setOpacity(a_goodOpacity.current());
p.setPen(st::setGoodColor);
@@ -759,7 +760,7 @@ void SetupChannelBox::mouseMoveEvent(QMouseEvent *e) {
void SetupChannelBox::mousePressEvent(QMouseEvent *e) {
mouseMoveEvent(e);
if (_linkOver) {
Application::clipboard()->setText(_channel->invitationUrl);
Application::clipboard()->setText(_channel->inviteLink());
_goodTextLink = lang(lng_create_channel_link_copied);
a_goodOpacity = anim::fvalue(1, 0);
_a_goodFade.start();

View File

@@ -224,7 +224,7 @@ bool ContactsInner::addAdminFail(const RPCError &error, mtpRequestId req) {
_addAdminRequestId = 0;
if (_addAdminBox) _addAdminBox->onClose();
if (error.type() == "USERS_TOO_MUCH") {
Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers);
Ui::showLayer(new MaxInviteBox(_channel->inviteLink()), KeepOtherLayers);
} else if (error.type() == "ADMINS_TOO_MUCH") {
Ui::showLayer(new InformBox(lang(lng_channel_admins_too_much)), KeepOtherLayers);
} else if (error.type() == qstr("USER_RESTRICTED")) {
@@ -728,7 +728,7 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) {
_checkedContacts.insert(peer, true);
++_selCount;
} else if (_channel && !_channel->isMegagroup()) {
Ui::showLayer(new MaxInviteBox(_channel->invitationUrl), KeepOtherLayers);
Ui::showLayer(new MaxInviteBox(_channel->inviteLink()), KeepOtherLayers);
} else if (!_channel && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) {
Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers);
}
@@ -2291,7 +2291,7 @@ void MembersBox::onScroll() {
void MembersBox::onAdd() {
if (_inner.filter() == MembersFilterRecent && _inner.channel()->count >= (_inner.channel()->isMegagroup() ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) {
Ui::showLayer(new MaxInviteBox(_inner.channel()->invitationUrl), KeepOtherLayers);
Ui::showLayer(new MaxInviteBox(_inner.channel()->inviteLink()), KeepOtherLayers);
return;
}
ContactsBox *box = new ContactsBox(_inner.channel(), _inner.filter(), _inner.already());