Translate call policies and verify desktop phone button colors

This commit is contained in:
evgeny committed 2026-10-19 15:20:25 +02:00
1 parent 94e79e5630
commit 39ed42da2e
3 files changed
+60

No files matched your search

@@ -541,4 +541,22 @@
<string name="local_invites_enabled">Разрешить получать приглашения из локальной сети</string> <string name="local_invites_enabled">Разрешить получать приглашения из локальной сети</string>
<string name="local_broadcasts_enabled">Разрешить отправлять широковещательные объявления</string> <string name="local_broadcasts_enabled">Разрешить отправлять широковещательные объявления</string>
<string name="local_invite_forbidden">Приём приглашений запрещён. Разрешите его в настройках устройства получателя.</string> <string name="local_invite_forbidden">Приём приглашений запрещён. Разрешите его в настройках устройства получателя.</string>
<string name="phone_status_setting">Показывать, что я разговариваю</string>
<string name="phone_status_description">Публиковать статус звонка для других участников</string>
<string name="phone_notify_setting">Предупреждать при входящем вызове</string>
<string name="phone_notify_description">Сообщать, что я разговариваю, и предлагать всё равно позвонить или завершить</string>
<string name="phone_status_permission_missing">Нужно разрешение на состояние телефона; статус неизвестен</string>
<string name="phone_busy_warning">Абонент разговаривает по телефону</string>
<string name="phone_status_busy">Занят звонком</string>
<string name="phone_status_free">Телефон свободен</string>
<string name="phone_status_unknown">Статус телефона неизвестен</string>
<string name="call_anyway">Всё равно позвонить</string>
<string name="finish_call">Завершить</string>
<string name="radio_call_already_active">Рация абонента уже включена в этом канале</string>
<string name="phone_reject_setting">Отклонять вызовы, когда я разговариваю</string>
<string name="phone_reject_description">Отклонять телефонные вызовы и приглашения в рацию вместо предложения позвонить</string>
<string name="block_incoming_calls">Отклонять все телефонные вызовы</string>
<string name="block_incoming_calls_description">Отклонять входящие звонки vibechat без рингтона</string>
<string name="block_incoming_radio">Отклонять все вызовы по рации</string>
<string name="block_incoming_radio_description">Отклонять приглашения; включённая рация продолжит работать</string>
</resources> </resources>
@@ -540,4 +540,22 @@
<string name="local_invites_enabled">Receive invitations from the local network</string> <string name="local_invites_enabled">Receive invitations from the local network</string>
<string name="local_broadcasts_enabled">Broadcast presence on the local network</string> <string name="local_broadcasts_enabled">Broadcast presence on the local network</string>
<string name="local_invite_forbidden">Receiving invitations is forbidden. Enable it in the recipient device\'s settings.</string> <string name="local_invite_forbidden">Receiving invitations is forbidden. Enable it in the recipient device\'s settings.</string>
<string name="phone_status_setting">Show when I am on a call</string>
<string name="phone_status_description">Share my call status with other members</string>
<string name="phone_notify_setting">Warn callers when I am on a call</string>
<string name="phone_notify_description">Let callers choose whether to call anyway before my phone rings</string>
<string name="phone_status_permission_missing">Phone permission is required; status is unknown</string>
<string name="phone_busy_warning">The subscriber is on a phone call</string>
<string name="phone_status_busy">Busy on a call</string>
<string name="phone_status_free">Phone is free</string>
<string name="phone_status_unknown">Phone status unknown</string>
<string name="call_anyway">Call anyway</string>
<string name="finish_call">End</string>
<string name="radio_call_already_active">The subscriber’s radio is already on in this channel</string>
<string name="phone_reject_setting">Reject calls when I am on a phone call</string>
<string name="phone_reject_description">Reject telephone and radio invitations instead of offering to call anyway</string>
<string name="block_incoming_calls">Reject all telephone calls</string>
<string name="block_incoming_calls_description">Reject incoming vibechat calls without ringing</string>
<string name="block_incoming_radio">Reject all radio calls</string>
<string name="block_incoming_radio_description">Reject radio invitations; the channel radio keeps working</string>
</resources> </resources>
+24
View File
@@ -459,6 +459,30 @@ private slots:
if (!preview.isEmpty()) QVERIFY(view.grab().save(preview)); if (!preview.isEmpty()) QVERIFY(view.grab().save(preview));
} }
void phoneButtonReflectsBusyFreeUnknownAndOffline() {
QStandardItemModel model;
auto* peer = new QStandardItem("peer"); model.appendRow(peer);
peer->setData(false, Qt::UserRole + 2); peer->setData(true, MemberListModel::OnlineRole);
AccountDelegate delegate;
QStyleOptionViewItem option; option.rect = QRect(0, 0, 280, 52);
auto pixels = [&](int flags, bool online, const QColor& color) {
peer->setData(flags, Qt::UserRole + 3); peer->setData(online, MemberListModel::OnlineRole);
QImage image(option.rect.size(), QImage::Format_RGB32); image.fill(Qt::white);
QPainter painter(&image); delegate.paint(&painter, option, model.index(0, 0)); painter.end();
int count = 0;
for (int y = 0; y < image.height(); ++y)
for (int x = image.width() - 31; x < image.width(); ++x) count += image.pixelColor(x, y) == color;
return count;
};
const int known = CHAT_MEMBER_FLAG_PHONE_KNOWN, busy = CHAT_MEMBER_FLAG_PHONE_BUSY;
QVERIFY(pixels(known | busy, true, QColor("#E53935")) > 0);
QVERIFY(pixels(known, true, QColor("#4CAF50")) > 0);
QCOMPARE(pixels(0, true, QColor("#4CAF50")), 0);
QCOMPARE(pixels(busy, true, QColor("#E53935")), 0);
QCOMPARE(pixels(known | busy, false, QColor("#E53935")), 0);
QCOMPARE(pixels(known | busy, true, QColor("#4CAF50")), 0);
}
void radioMuteButtonTargetsMemberAndChangesColor() { void radioMuteButtonTargetsMemberAndChangesColor() {
QStandardItemModel model; QStandardItemModel model;
auto* other = new QStandardItem("other"); other->setData(false, Qt::UserRole + 2); model.appendRow(other); auto* other = new QStandardItem("other"); other->setData(false, Qt::UserRole + 2); model.appendRow(other);