/* 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 "settings/settings_power_saving.h" #include "boxes/peers/edit_peer_permissions_box.h" #include "core/application.h" #include "lang/lang_keys.h" #include "ui/layers/generic_box.h" #include "ui/power_saving.h" namespace Settings { void PowerSavingBox(not_null box) { box->setTitle(tr::lng_settings_power_title()); auto [checkboxes, getResult, changes] = CreateEditPowerSaving( box, PowerSaving::kAll & ~PowerSaving::Current()); box->addRow(std::move(checkboxes), {}); box->addButton(tr::lng_settings_save(), [=, collect = getResult] { Set(PowerSaving::kAll & ~collect()); Core::App().saveSettingsDelayed(); box->closeBox(); }); box->addButton(tr::lng_cancel(), [=] { box->closeBox(); }); } std::vector PowerSavingLabelsList() { using namespace PowerSaving; using Label = PowerSavingLabel; auto stickers = std::vector