2017-03-20 15:41:17 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2017-03-20 15:41:17 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2017-03-20 15:41:17 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2017-04-06 14:38:10 +00:00
|
|
|
#include "boxes/abstract_box.h"
|
2017-03-23 12:15:21 +00:00
|
|
|
#include "mtproto/sender.h"
|
2017-03-20 15:41:17 +00:00
|
|
|
|
|
|
|
namespace Ui {
|
|
|
|
class RadiobuttonGroup;
|
|
|
|
class Radiobutton;
|
|
|
|
class FlatLabel;
|
|
|
|
} // namespace Ui
|
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
namespace Main {
|
|
|
|
class Session;
|
|
|
|
} // namespace Main
|
|
|
|
|
2019-11-27 08:02:56 +00:00
|
|
|
class SelfDestructionBox : public Ui::BoxContent {
|
2017-03-20 15:41:17 +00:00
|
|
|
public:
|
2019-07-25 18:55:11 +00:00
|
|
|
SelfDestructionBox(
|
|
|
|
QWidget*,
|
|
|
|
not_null<Main::Session*> session,
|
|
|
|
rpl::producer<int> preloaded);
|
2018-09-17 17:31:01 +00:00
|
|
|
|
|
|
|
static QString DaysLabel(int days);
|
2017-03-20 15:41:17 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void prepare() override;
|
|
|
|
|
|
|
|
private:
|
2018-09-17 17:31:01 +00:00
|
|
|
void gotCurrent(int days);
|
|
|
|
void showContent();
|
|
|
|
|
2019-07-25 18:55:11 +00:00
|
|
|
const not_null<Main::Session*> _session;
|
2018-09-17 17:31:01 +00:00
|
|
|
bool _prepared = false;
|
2017-03-20 15:41:17 +00:00
|
|
|
std::vector<int> _ttlValues;
|
|
|
|
object_ptr<Ui::FlatLabel> _description = { nullptr };
|
2018-09-17 17:31:01 +00:00
|
|
|
object_ptr<Ui::FlatLabel> _loading;
|
2017-03-20 15:41:17 +00:00
|
|
|
std::shared_ptr<Ui::RadiobuttonGroup> _ttlGroup;
|
|
|
|
|
|
|
|
};
|