mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Show leave confirmation when starting an RTMP stream.
This commit is contained in:
@@ -1328,8 +1328,7 @@ void Panel::chooseJoinAs() {
|
||||
_joinAsProcess.start(
|
||||
_peer,
|
||||
context,
|
||||
showBoxCallback,
|
||||
showToastCallback,
|
||||
std::make_shared<Show>(this),
|
||||
callback,
|
||||
_call->joinAs());
|
||||
}
|
||||
@@ -1470,6 +1469,10 @@ void Panel::showBox(
|
||||
_layerBg->showBox(std::move(box), options, animated);
|
||||
}
|
||||
|
||||
void Panel::hideLayer(anim::type animated) {
|
||||
_layerBg->hideAll(animated);
|
||||
}
|
||||
|
||||
void Panel::kickParticipantSure(not_null<PeerData*> participantPeer) {
|
||||
if (const auto chat = _peer->asChat()) {
|
||||
chat->session().api().chatParticipants().kick(chat, participantPeer);
|
||||
@@ -2555,4 +2558,38 @@ not_null<Ui::RpWidget*> Panel::widget() const {
|
||||
return _window.widget();
|
||||
}
|
||||
|
||||
Show::Show(not_null<Panel*> panel)
|
||||
: _panel(base::make_weak(panel.get())) {
|
||||
}
|
||||
|
||||
Show::~Show() = default;
|
||||
|
||||
void Show::showBox(
|
||||
object_ptr<Ui::BoxContent> content,
|
||||
Ui::LayerOptions options) const {
|
||||
if (const auto panel = _panel.get()) {
|
||||
panel->showBox(std::move(content), options);
|
||||
}
|
||||
}
|
||||
|
||||
void Show::hideLayer() const {
|
||||
if (const auto panel = _panel.get()) {
|
||||
panel->hideLayer();
|
||||
}
|
||||
}
|
||||
|
||||
not_null<QWidget*> Show::toastParent() const {
|
||||
const auto panel = _panel.get();
|
||||
Assert(panel != nullptr);
|
||||
return panel->widget();
|
||||
}
|
||||
|
||||
bool Show::valid() const {
|
||||
return !_panel.empty();
|
||||
}
|
||||
|
||||
Show::operator bool() const {
|
||||
return valid();
|
||||
}
|
||||
|
||||
} // namespace Calls::Group
|
||||
|
Reference in New Issue
Block a user