improved create group / add members box, displaying info about supergroup when trying to add more than 200 members there

This commit is contained in:
John Preston 2016-03-13 19:01:43 +03:00
parent 86a4a388c3
commit 0249d3fe61
2 changed files with 5 additions and 2 deletions

View File

@ -568,6 +568,7 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
"lng_profile_convert_feature4" = "— Creator can set a public link for the group";
"lng_profile_convert_warning" = "{bold_start}Note:{bold_end} This action can not be undone";
"lng_profile_convert_confirm" = "Convert";
"lng_profile_add_more_after_upgrade" = "You will be able to add up to {count:_not_used_|# member|# members} after you upgrade your group to a supergroup.";
"lng_channel_comments_count" = "{count:_not_used_|# comment|# comments}";
"lng_channel_hide_comments" = "Hide comments";

View File

@ -427,7 +427,7 @@ void ContactsInner::paintDialog(Painter &p, PeerData *peer, ContactData *data, b
sel = false;
}
} else {
if (data->inchat || data->check || selectedCount() >= ((_channel && _channel->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax())) {
if (data->inchat || data->check || selectedCount() >= Global::MegagroupSizeMax()) {
sel = false;
}
}
@ -771,6 +771,8 @@ void ContactsInner::changeCheckState(ContactData *data, PeerData *peer) {
data->check = true;
_checkedContacts.insert(peer, true);
++_selCount;
} else if ((!_channel || !_channel->isMegagroup()) && selectedCount() >= Global::ChatSizeMax() && selectedCount() < Global::MegagroupSizeMax()) {
Ui::showLayer(new InformBox(lng_profile_add_more_after_upgrade(lt_count, Global::MegagroupSizeMax())), KeepOtherLayers);
}
if (cnt != _selCount) emit chosenChanged();
}
@ -1535,7 +1537,7 @@ void ContactsBox::paintEvent(QPaintEvent *e) {
paintTitle(p, lang(lng_channel_admins));
} else if (_inner.chat() || _inner.creating() != CreatingGroupNone) {
QString title(lang(addingAdmin ? lng_channel_add_admin : lng_profile_add_participant));
QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(((_inner.channel() && _inner.channel()->isMegagroup()) ? Global::MegagroupSizeMax() : Global::ChatSizeMax())));
QString additional(addingAdmin ? QString() : QString("%1 / %2").arg(_inner.selectedCount()).arg(Global::MegagroupSizeMax()));
paintTitle(p, title, additional);
} else if (_inner.bot()) {
paintTitle(p, lang(lng_bot_choose_group));