Exemplo n.º 1
0
SessionsBox::Inner::Inner(QWidget *parent, SessionsBox::List *list, SessionsBox::Data *current) : TWidget(parent)
, _list(list)
, _current(current)
, _terminateAll(this, lang(lng_sessions_terminate_all), st::sessionTerminateAllButton) {
	connect(_terminateAll, SIGNAL(clicked()), this, SLOT(onTerminateAll()));
	_terminateAll->hide();
	setAttribute(Qt::WA_OpaquePaintEvent);
}
Exemplo n.º 2
0
SessionsInner::SessionsInner(SessionsList *list, SessionData *current) : TWidget()
    , _list(list)
    , _current(current)
    , _terminating(0)
    , _terminateAll(this, lang(lng_sessions_terminate_all), st::redBoxLinkButton)
    , _terminateBox(0) {
    connect(&_terminateAll, SIGNAL(clicked()), this, SLOT(onTerminateAll()));
    _terminateAll.hide();
    setAttribute(Qt::WA_OpaquePaintEvent);
}
Exemplo n.º 3
0
void SessionsBox::prepare() {
	setTitle(langFactory(lng_sessions_other_header));

	addButton(langFactory(lng_close), [this] { closeBox(); });

	setDimensions(st::boxWideWidth, st::sessionsHeight);

	connect(_inner, SIGNAL(oneTerminated()), this, SLOT(onOneTerminated()));
	connect(_inner, SIGNAL(allTerminated()), this, SLOT(onAllTerminated()));
	connect(_inner, SIGNAL(terminateAll()), this, SLOT(onTerminateAll()));
	connect(App::wnd(), SIGNAL(checkNewAuthorization()), this, SLOT(onCheckNewAuthorization()));
	connect(_shortPollTimer, SIGNAL(timeout()), this, SLOT(onShortPollAuthorizations()));

	_inner = setInnerWidget(object_ptr<Inner>(this, &_list, &_current), st::sessionsScroll);
	_inner->resize(width(), st::noContactsHeight);

	setLoading(true);

	MTP::send(MTPaccount_GetAuthorizations(), rpcDone(&SessionsBox::gotAuthorizations));
}