mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Add ' (Test)' to checkout panel titles.
This commit is contained in:
parent
bdffdea358
commit
b1c122a260
3 changed files with 16 additions and 3 deletions
|
@ -126,6 +126,7 @@ void Form::fillInvoiceFromMessage() {
|
||||||
return item->media();
|
return item->media();
|
||||||
}();
|
}();
|
||||||
if (const auto invoice = media ? media->invoice() : nullptr) {
|
if (const auto invoice = media ? media->invoice() : nullptr) {
|
||||||
|
_invoice.isTest = invoice->isTest;
|
||||||
_invoice.cover = Ui::Cover{
|
_invoice.cover = Ui::Cover{
|
||||||
.title = invoice->title,
|
.title = invoice->title,
|
||||||
.description = invoice->description,
|
.description = invoice->description,
|
||||||
|
|
|
@ -56,7 +56,8 @@ void Panel::showForm(
|
||||||
const RequestedInformation ¤t,
|
const RequestedInformation ¤t,
|
||||||
const PaymentMethodDetails &method,
|
const PaymentMethodDetails &method,
|
||||||
const ShippingOptions &options) {
|
const ShippingOptions &options) {
|
||||||
_widget->setTitle(invoice.receipt
|
_testMode = invoice.isTest;
|
||||||
|
setTitle(invoice.receipt
|
||||||
? tr::lng_payments_receipt_title()
|
? tr::lng_payments_receipt_title()
|
||||||
: tr::lng_payments_checkout_title());
|
: tr::lng_payments_checkout_title());
|
||||||
auto form = base::make_unique_q<FormSummary>(
|
auto form = base::make_unique_q<FormSummary>(
|
||||||
|
@ -81,7 +82,7 @@ void Panel::showEditInformation(
|
||||||
const Invoice &invoice,
|
const Invoice &invoice,
|
||||||
const RequestedInformation ¤t,
|
const RequestedInformation ¤t,
|
||||||
InformationField field) {
|
InformationField field) {
|
||||||
_widget->setTitle(tr::lng_payments_shipping_address_title());
|
setTitle(tr::lng_payments_shipping_address_title());
|
||||||
auto edit = base::make_unique_q<EditInformation>(
|
auto edit = base::make_unique_q<EditInformation>(
|
||||||
_widget.get(),
|
_widget.get(),
|
||||||
invoice,
|
invoice,
|
||||||
|
@ -240,7 +241,7 @@ void Panel::showEditPaymentMethod(const PaymentMethodDetails &method) {
|
||||||
: tr::lng_payments_processed_by(
|
: tr::lng_payments_processed_by(
|
||||||
lt_provider,
|
lt_provider,
|
||||||
rpl::single(method.provider));
|
rpl::single(method.provider));
|
||||||
_widget->setTitle(tr::lng_payments_card_title());
|
setTitle(tr::lng_payments_card_title());
|
||||||
if (method.native.supported) {
|
if (method.native.supported) {
|
||||||
showEditCard(method.native, CardField::Number);
|
showEditCard(method.native, CardField::Number);
|
||||||
} else if (!showWebview(method.url, true, std::move(bottomText))) {
|
} else if (!showWebview(method.url, true, std::move(bottomText))) {
|
||||||
|
@ -419,6 +420,15 @@ void Panel::showCardError(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Panel::setTitle(rpl::producer<QString> title) {
|
||||||
|
using namespace rpl::mappers;
|
||||||
|
if (_testMode) {
|
||||||
|
_widget->setTitle(std::move(title) | rpl::map(_1 + " (Test)"));
|
||||||
|
} else {
|
||||||
|
_widget->setTitle(std::move(title));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rpl::producer<> Panel::backRequests() const {
|
rpl::producer<> Panel::backRequests() const {
|
||||||
return _widget->backRequests();
|
return _widget->backRequests();
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool createWebview();
|
bool createWebview();
|
||||||
|
void setTitle(rpl::producer<QString> title);
|
||||||
|
|
||||||
const not_null<PanelDelegate*> _delegate;
|
const not_null<PanelDelegate*> _delegate;
|
||||||
std::unique_ptr<SeparatePanel> _widget;
|
std::unique_ptr<SeparatePanel> _widget;
|
||||||
|
@ -92,6 +93,7 @@ private:
|
||||||
QPointer<FormSummary> _weakFormSummary;
|
QPointer<FormSummary> _weakFormSummary;
|
||||||
QPointer<EditInformation> _weakEditInformation;
|
QPointer<EditInformation> _weakEditInformation;
|
||||||
QPointer<EditCard> _weakEditCard;
|
QPointer<EditCard> _weakEditCard;
|
||||||
|
bool _testMode = false;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue