mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-23 02:00:20 +07:00
chore: minor fixes (#2459)
* fix: fixed links on page with service description * fix: fixed subscription text color * chore: update ru translations * chore: add save button * fix: ru translation fixes
This commit is contained in:
@@ -32,8 +32,9 @@ QVariant ApiAccountInfoModel::data(const QModelIndex &index, int role) const
|
||||
return tr("Active");
|
||||
}
|
||||
|
||||
return apiUtils::isSubscriptionExpired(m_accountInfoData.subscriptionEndDate) ? tr("<p><a style=\"color: #EB5757;\">Inactive</a>")
|
||||
: tr("<p><a style=\"color: #28c840;\">Active</a>");
|
||||
return apiUtils::isSubscriptionExpired(m_accountInfoData.subscriptionEndDate)
|
||||
? QStringLiteral("<p><a style=\"color: #EB5757;\">%1</a>").arg(tr("Inactive"))
|
||||
: QStringLiteral("<p><a style=\"color: #28c840;\">%1</a>").arg(tr("Active"));
|
||||
}
|
||||
case EndDateRole: {
|
||||
if (m_accountInfoData.configType == apiDefs::ConfigType::AmneziaFreeV3) {
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace configKey
|
||||
constexpr char title[] = "title";
|
||||
constexpr char body[] = "body";
|
||||
constexpr char icon[] = "icon";
|
||||
constexpr char accent[] = "accent";
|
||||
constexpr char link[] = "link";
|
||||
}
|
||||
|
||||
QString gatewayIconKeyToUrl(const QString &iconKey)
|
||||
@@ -62,8 +62,8 @@ QVariant ApiBenefitsModel::data(const QModelIndex &index, int role) const
|
||||
return item.title;
|
||||
case BodyRole:
|
||||
return item.body;
|
||||
case AccentRole:
|
||||
return item.accent;
|
||||
case LinkRole:
|
||||
return item.link;
|
||||
default:
|
||||
return {};
|
||||
}
|
||||
@@ -75,7 +75,7 @@ QHash<int, QByteArray> ApiBenefitsModel::roleNames() const
|
||||
{ IconRole, "icon" },
|
||||
{ TitleRole, "title" },
|
||||
{ BodyRole, "body" },
|
||||
{ AccentRole, "accent" },
|
||||
{ LinkRole, "link" },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -90,7 +90,11 @@ void ApiBenefitsModel::updateModel(const QJsonArray &benefits)
|
||||
const QJsonObject benefitObject = benefitValue.toObject();
|
||||
QString title = benefitObject.value(configKey::title).toString();
|
||||
QString body = benefitObject.value(configKey::body).toString();
|
||||
const bool isLink = benefitObject.value(configKey::link).toBool();
|
||||
const QString iconKey = benefitObject.value(configKey::icon).toString();
|
||||
if (isLink) {
|
||||
body = body.trimmed();
|
||||
}
|
||||
if (title.isEmpty() && body.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
@@ -98,7 +102,7 @@ void ApiBenefitsModel::updateModel(const QJsonArray &benefits)
|
||||
item.icon = gatewayIconKeyToUrl(iconKey);
|
||||
item.title = std::move(title);
|
||||
item.body = std::move(body);
|
||||
item.accent = benefitObject.value(configKey::accent).toBool();
|
||||
item.link = isLink;
|
||||
m_serviceBenefits.append(std::move(item));
|
||||
}
|
||||
endResetModel();
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
IconRole = Qt::UserRole + 1,
|
||||
TitleRole,
|
||||
BodyRole,
|
||||
AccentRole
|
||||
LinkRole
|
||||
};
|
||||
Q_ENUM(Roles)
|
||||
|
||||
@@ -34,7 +34,7 @@ private:
|
||||
QString icon;
|
||||
QString title;
|
||||
QString body;
|
||||
bool accent = false;
|
||||
bool link = false;
|
||||
};
|
||||
|
||||
QVector<ServiceBenefitItem> m_serviceBenefits;
|
||||
|
||||
Reference in New Issue
Block a user