Added dummy box class for statistics.

This commit is contained in:
23rd 2023-04-26 22:06:54 +03:00 committed by John Preston
parent b0a65885c9
commit 10968d0da2
4 changed files with 43 additions and 0 deletions

View File

@ -1278,6 +1278,8 @@ PRIVATE
settings/settings_type.h
settings/settings_websites.cpp
settings/settings_websites.h
statistics/statistics_box.cpp
statistics/statistics_box.h
storage/details/storage_file_utilities.cpp
storage/details/storage_file_utilities.h
storage/details/storage_settings_scheme.cpp

View File

@ -0,0 +1,19 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "statistics/statistics_box.h"
#include "data/data_peer.h"
#include "lang/lang_keys.h"
#include "ui/layers/generic_box.h"
namespace {
} // namespace
void StatisticsBox(not_null<Ui::GenericBox*> box, not_null<PeerData*> peer) {
box->setTitle(tr::lng_stats_title());
}

View File

@ -0,0 +1,16 @@
/*
This file is part of Telegram Desktop,
the official desktop application for the Telegram messaging service.
For license and copyright information please follow this link:
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#pragma once
class PeerData;
namespace Ui {
class GenericBox;
} // namespace Ui
void StatisticsBox(not_null<Ui::GenericBox*> box, not_null<PeerData*> peer);

View File

@ -85,6 +85,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "core/application.h"
#include "export/export_manager.h"
#include "boxes/peers/edit_peer_info_box.h"
#include "statistics/statistics_box.h"
#include "styles/style_chat.h"
#include "styles/style_layers.h"
#include "styles/style_boxes.h"
@ -999,12 +1000,17 @@ void Filler::addManageChat() {
}
void Filler::addViewStatistics() {
#ifdef _DEBUG
if (const auto channel = _peer->asChannel()) {
if (channel->flags() & ChannelDataFlag::CanGetStatistics) {
const auto navigation = _controller;
const auto peer = _peer;
_addAction(tr::lng_stats_title(tr::now), [=] {
navigation->show(Box(StatisticsBox, peer));
}, nullptr);
}
}
#endif
}
void Filler::addCreatePoll() {