| 957 | } |
| 958 | |
| 959 | SetupChannelBox::SetupChannelBox( |
| 960 | QWidget*, |
| 961 | not_null<Window::SessionNavigation*> navigation, |
| 962 | not_null<ChannelData*> channel, |
| 963 | bool mustBePublic, |
| 964 | Fn<void(not_null<PeerData*>)> done) |
| 965 | : _navigation(navigation) |
| 966 | , _channel(channel) |
| 967 | , _api(&_channel->session().mtp()) |
| 968 | , _mustBePublic(mustBePublic) |
| 969 | , _done(std::move(done)) |
| 970 | , _privacyGroup( |
| 971 | std::make_shared<Ui::RadioenumGroup<Privacy>>(Privacy::Public)) |
| 972 | , _public( |
| 973 | this, |
| 974 | _privacyGroup, |
| 975 | Privacy::Public, |
| 976 | (channel->isMegagroup() |
| 977 | ? tr::lng_create_public_group_title |
| 978 | : tr::lng_create_public_channel_title)(tr::now), |
| 979 | st::defaultBoxCheckbox) |
| 980 | , _private( |
| 981 | this, |
| 982 | _privacyGroup, |
| 983 | Privacy::Private, |
| 984 | (channel->isMegagroup() |
| 985 | ? tr::lng_create_private_group_title |
| 986 | : tr::lng_create_private_channel_title)(tr::now), |
| 987 | st::defaultBoxCheckbox) |
| 988 | , _aboutPublicWidth(st::boxWideWidth |
| 989 | - st::boxPadding.left() |
| 990 | - st::defaultBox.buttonPadding.right() |
| 991 | - st::newGroupPadding.left() |
| 992 | - st::defaultRadio.diameter |
| 993 | - st::defaultBoxCheckbox.textPosition.x()) |
| 994 | , _aboutPublic( |
| 995 | st::defaultTextStyle, |
| 996 | (channel->isMegagroup() |
| 997 | ? tr::lng_create_public_group_about |
| 998 | : tr::lng_create_public_channel_about)(tr::now), |
| 999 | kDefaultTextOptions, |
| 1000 | _aboutPublicWidth) |
| 1001 | , _aboutPrivate( |
| 1002 | st::defaultTextStyle, |
| 1003 | (channel->isMegagroup() |
| 1004 | ? tr::lng_create_private_group_about |
| 1005 | : tr::lng_create_private_channel_about)(tr::now), |
| 1006 | kDefaultTextOptions, |
| 1007 | _aboutPublicWidth) |
| 1008 | , _link( |
| 1009 | this, |
| 1010 | st::setupChannelLink, |
| 1011 | nullptr, |
| 1012 | channel->username(), |
| 1013 | channel->session().createInternalLink(QString())) |
| 1014 | , _checkTimer([=] { check(); }) { |
| 1015 | if (_mustBePublic) { |
| 1016 | _public.destroy(); |
nothing calls this directly
no test coverage detected