Ephemeral settings
This commit is contained in:
parent
54a3501ddf
commit
3edc55800a
24 changed files with 589 additions and 176 deletions
|
|
@ -102,6 +102,7 @@ ChatCore::ChatCore(const std::shared_ptr<linphone::ChatRoom> &chatRoom) : QObjec
|
|||
connect(this, &ChatCore::eventsInserted, this, &ChatCore::lUpdateLastMessage);
|
||||
connect(this, &ChatCore::eventRemoved, this, &ChatCore::lUpdateLastMessage);
|
||||
mEphemeralEnabled = chatRoom->ephemeralEnabled();
|
||||
mEphemeralLifetime = chatRoom->ephemeralEnabled() ? chatRoom->getEphemeralLifetime() : 0;
|
||||
mIsMuted = chatRoom->getMuted();
|
||||
mParticipants = buildParticipants(chatRoom);
|
||||
}
|
||||
|
|
@ -285,6 +286,18 @@ void ChatCore::setSelf(QSharedPointer<ChatCore> me) {
|
|||
});
|
||||
});
|
||||
|
||||
mChatModelConnection->makeConnectToCore(&ChatCore::lSetEphemeralLifetime, [this](int time) {
|
||||
mChatModelConnection->invokeToModel([this, time]() { mChatModel->setEphemeralLifetime(time); });
|
||||
});
|
||||
mChatModelConnection->makeConnectToModel(&ChatModel::ephemeralLifetimeChanged, [this](int time) {
|
||||
mChatModelConnection->invokeToCore([this, time]() {
|
||||
if (mEphemeralLifetime != time) {
|
||||
mEphemeralLifetime = time;
|
||||
emit ephemeralLifetimeChanged();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
mChatModelConnection->makeConnectToCore(&ChatCore::lSetSubject, [this](QString subject) {
|
||||
mChatModelConnection->invokeToModel([this, subject]() { mChatModel->setSubject(subject); });
|
||||
});
|
||||
|
|
@ -534,6 +547,10 @@ bool ChatCore::isEphemeralEnabled() const {
|
|||
return mEphemeralEnabled;
|
||||
}
|
||||
|
||||
int ChatCore::getEphemeralLifetime() const {
|
||||
return mEphemeralLifetime;
|
||||
}
|
||||
|
||||
void ChatCore::setMeAdmin(bool admin) {
|
||||
if (mMeAdmin != admin) {
|
||||
mMeAdmin = admin;
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ public:
|
|||
Q_PROPERTY(bool isReadOnly READ getIsReadOnly WRITE setIsReadOnly NOTIFY readOnlyChanged)
|
||||
Q_PROPERTY(QString sendingText READ getSendingText WRITE setSendingText NOTIFY sendingTextChanged)
|
||||
Q_PROPERTY(bool ephemeralEnabled READ isEphemeralEnabled WRITE lEnableEphemeral NOTIFY ephemeralEnabledChanged)
|
||||
Q_PROPERTY(
|
||||
int ephemeralLifetime READ getEphemeralLifetime WRITE lSetEphemeralLifetime NOTIFY ephemeralLifetimeChanged)
|
||||
Q_PROPERTY(bool muted READ isMuted WRITE lSetMuted NOTIFY mutedChanged)
|
||||
Q_PROPERTY(bool meAdmin READ getMeAdmin WRITE setMeAdmin NOTIFY meAdminChanged)
|
||||
Q_PROPERTY(QVariantList participants READ getParticipantsGui NOTIFY participantsChanged)
|
||||
|
|
@ -82,6 +84,7 @@ public:
|
|||
bool isMuted() const;
|
||||
|
||||
bool isEphemeralEnabled() const;
|
||||
int getEphemeralLifetime() const;
|
||||
|
||||
QString getIdentifier() const;
|
||||
|
||||
|
|
@ -150,6 +153,7 @@ signals:
|
|||
void sendingTextChanged(QString text);
|
||||
void mutedChanged();
|
||||
void ephemeralEnabledChanged();
|
||||
void ephemeralLifetimeChanged();
|
||||
void meAdminChanged();
|
||||
void participantsChanged();
|
||||
|
||||
|
|
@ -167,6 +171,7 @@ signals:
|
|||
void lLeave();
|
||||
void lSetMuted(bool muted);
|
||||
void lEnableEphemeral(bool enable);
|
||||
void lSetEphemeralLifetime(int time);
|
||||
void lSetSubject(QString subject);
|
||||
void lRemoveParticipantAtIndex(int index);
|
||||
void lSetParticipantsAddresses(QStringList addresses);
|
||||
|
|
@ -188,6 +193,7 @@ private:
|
|||
bool mIsEncrypted = false;
|
||||
bool mIsReadOnly = false;
|
||||
bool mEphemeralEnabled = false;
|
||||
int mEphemeralLifetime = 0;
|
||||
bool mIsMuted = false;
|
||||
bool mMeAdmin = false;
|
||||
QList<QSharedPointer<ParticipantCore>> mParticipants;
|
||||
|
|
|
|||
|
|
@ -82,6 +82,8 @@ void EventLogCore::computeEvent(const std::shared_ptr<const linphone::EventLog>
|
|||
mustBeInLinphoneThread(getClassName());
|
||||
mHandled = true;
|
||||
mImportant = false;
|
||||
mEphemeralRelated = false;
|
||||
|
||||
auto participantAddress = eventLog->getParticipantAddress() ? eventLog->getParticipantAddress()->clone() : nullptr;
|
||||
|
||||
switch (eventLog->getType()) {
|
||||
|
|
@ -114,14 +116,18 @@ void EventLogCore::computeEvent(const std::shared_ptr<const linphone::EventLog>
|
|||
break;
|
||||
}
|
||||
case linphone::EventLog::Type::ConferenceEphemeralMessageEnabled:
|
||||
mEphemeralRelated = true;
|
||||
mEventDetails = tr("conference_ephemeral_message_enabled_event")
|
||||
.arg(getEphemeralFormatedTime(eventLog->getEphemeralMessageLifetime()));
|
||||
.arg(Utils::getEphemeralFormatedTime(eventLog->getEphemeralMessageLifetime()));
|
||||
break;
|
||||
case linphone::EventLog::Type::ConferenceEphemeralMessageLifetimeChanged:
|
||||
mEphemeralRelated = true;
|
||||
mHandled = eventLog->getEphemeralMessageLifetime() != 0; // Disabled is sent in case of 0.
|
||||
mEventDetails = tr("conference_ephemeral_message_lifetime_changed_event")
|
||||
.arg(getEphemeralFormatedTime(eventLog->getEphemeralMessageLifetime()));
|
||||
.arg(Utils::getEphemeralFormatedTime(eventLog->getEphemeralMessageLifetime()));
|
||||
break;
|
||||
case linphone::EventLog::Type::ConferenceEphemeralMessageDisabled:
|
||||
mEphemeralRelated = true;
|
||||
mEventDetails = tr("conference_ephemeral_message_disabled_event");
|
||||
mImportant = true;
|
||||
break;
|
||||
|
|
@ -140,12 +146,3 @@ void EventLogCore::computeEvent(const std::shared_ptr<const linphone::EventLog>
|
|||
mHandled = false;
|
||||
}
|
||||
}
|
||||
|
||||
QString EventLogCore::getEphemeralFormatedTime(int selectedTime) {
|
||||
if (selectedTime == 60) return tr("nMinute", "", 1).arg(1);
|
||||
else if (selectedTime == 3600) return tr("nHour", "", 1).arg(1);
|
||||
else if (selectedTime == 86400) return tr("nDay", "", 1).arg(1);
|
||||
else if (selectedTime == 259200) return tr("nDay", "", 3).arg(3);
|
||||
else if (selectedTime == 604800) return tr("nWeek", "", 1).arg(1);
|
||||
else return tr("nSeconds", "", selectedTime).arg(selectedTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,6 +59,9 @@ public:
|
|||
bool isHandled() const {
|
||||
return mHandled;
|
||||
}
|
||||
bool isEphemeralRelated() const {
|
||||
return mEphemeralRelated;
|
||||
}
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_OBJECT
|
||||
|
|
@ -69,13 +72,13 @@ private:
|
|||
LinphoneEnums::EventLogType mEventLogType;
|
||||
bool mHandled;
|
||||
bool mImportant;
|
||||
bool mEphemeralRelated;
|
||||
QString mEventDetails;
|
||||
QDateTime mTimestamp;
|
||||
|
||||
ChatMessageCore *getChatMessageCorePointer();
|
||||
CallHistoryCore *getCallHistoryCorePointer();
|
||||
void computeEvent(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||
QString getEphemeralFormatedTime(int selectedTime);
|
||||
};
|
||||
|
||||
#endif // EventLogCore_H_
|
||||
|
|
|
|||
|
|
@ -143,6 +143,13 @@ QVariant EventLogList::data(const QModelIndex &index, int role) const {
|
|||
case Qt::DisplayRole + 1:
|
||||
return "callLog";
|
||||
}
|
||||
} else if (core->isEphemeralRelated()) {
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
return QVariant::fromValue(new EventLogGui(core));
|
||||
case Qt::DisplayRole + 1:
|
||||
return "ephemeralEvent";
|
||||
}
|
||||
} else {
|
||||
switch (role) {
|
||||
case Qt::DisplayRole:
|
||||
|
|
|
|||
16
Linphone/data/image/ephemeral-settings.svg
Normal file
16
Linphone/data/image/ephemeral-settings.svg
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<svg width="131" height="112" viewBox="0 0 131 112" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M76.7875 21.1824V63.548C76.7875 64.9525 76.2295 66.2994 75.2364 67.2926C74.2433 68.2857 72.8963 68.8437 71.4918 68.8437H22.7434L16.688 78.1475C16.6752 78.1614 16.6607 78.1736 16.6449 78.1839C15.694 78.9918 14.4869 79.4352 13.2391 79.435C12.4623 79.4337 11.6951 79.262 10.9918 78.932C10.077 78.5104 9.30297 77.8342 8.76237 76.9842C8.22177 76.1343 7.93746 75.1466 7.94345 74.1394V21.1824C7.94345 19.7779 8.50139 18.4309 9.49452 17.4378C10.4877 16.4447 11.8346 15.8867 13.2391 15.8867H71.4918C72.8963 15.8867 74.2433 16.4447 75.2364 17.4378C76.2295 18.4309 76.7875 19.7779 76.7875 21.1824Z" fill="url(#paint0_linear_11581_2585)"/>
|
||||
<path d="M52.9838 42.6507C52.7862 44.9478 51.9367 47.1407 50.5352 48.9714C49.1336 50.802 47.2384 52.1943 45.0725 52.9845C42.9065 53.7746 40.56 53.9297 38.3089 53.4315C36.0578 52.9333 33.9958 51.8025 32.3655 50.1723C30.7352 48.542 29.6045 46.48 29.1063 44.2289C28.6081 41.9778 28.7632 39.6312 29.5533 37.4653C30.3434 35.2994 31.7357 33.4041 33.5664 32.0026C35.3971 30.6011 37.5899 29.7515 39.887 29.5539C40.0092 29.5439 40.1321 29.5579 40.2488 29.5954C40.3654 29.6328 40.4736 29.6928 40.5671 29.7721C40.6606 29.8513 40.7376 29.9482 40.7936 30.0572C40.8496 30.1661 40.8837 30.2851 40.8938 30.4072C40.9038 30.5294 40.8897 30.6523 40.8523 30.769C40.8149 30.8856 40.7548 30.9938 40.6756 31.0873C40.5964 31.1808 40.4995 31.2578 40.3905 31.3138C40.2816 31.3698 40.1626 31.4039 40.0405 31.414C38.0963 31.581 36.2402 32.2999 34.6907 33.486C33.1412 34.6721 31.9627 36.2761 31.2939 38.1092C30.6251 39.9424 30.4938 41.9284 30.9154 43.8337C31.337 45.7389 32.294 47.4841 33.6738 48.864C35.0536 50.2438 36.7988 51.2008 38.7041 51.6224C40.6094 52.044 42.5954 51.9127 44.4286 51.2438C46.2617 50.575 47.8657 49.3965 49.0518 47.847C50.2379 46.2975 50.9568 44.4415 51.1238 42.4973C51.1442 42.2506 51.2617 42.0222 51.4505 41.8621C51.6393 41.7021 51.8839 41.6237 52.1305 41.644C52.3772 41.6644 52.6057 41.7819 52.7657 41.9707C52.9257 42.1595 53.0042 42.4041 52.9838 42.6507ZM39.9637 35.134V41.644C39.9637 41.8907 40.0617 42.1272 40.2361 42.3016C40.4105 42.476 40.6471 42.574 40.8938 42.574H47.4038C47.6504 42.574 47.887 42.476 48.0614 42.3016C48.2358 42.1272 48.3338 41.8907 48.3338 41.644C48.3338 41.3974 48.2358 41.1608 48.0614 40.9864C47.887 40.812 47.6504 40.714 47.4038 40.714H41.8238V35.134C41.8238 34.8873 41.7258 34.6508 41.5514 34.4764C41.377 34.3019 41.1404 34.204 40.8938 34.204C40.6471 34.204 40.4105 34.3019 40.2361 34.4764C40.0617 34.6508 39.9637 34.8873 39.9637 35.134ZM44.6138 32.344C44.8897 32.344 45.1594 32.2621 45.3888 32.1089C45.6182 31.9556 45.797 31.7377 45.9026 31.4828C46.0082 31.2279 46.0358 30.9474 45.982 30.6768C45.9282 30.4062 45.7953 30.1576 45.6002 29.9625C45.4051 29.7674 45.1565 29.6346 44.8859 29.5807C44.6153 29.5269 44.3348 29.5545 44.0799 29.6601C43.825 29.7657 43.6072 29.9445 43.4539 30.1739C43.3006 30.4033 43.2188 30.673 43.2188 30.9489C43.2188 31.3189 43.3657 31.6738 43.6274 31.9354C43.889 32.197 44.2438 32.344 44.6138 32.344ZM48.7988 35.134C49.0747 35.134 49.3444 35.0522 49.5738 34.8989C49.8032 34.7456 49.982 34.5277 50.0876 34.2728C50.1932 34.0179 50.2208 33.7374 50.167 33.4668C50.1132 33.1962 49.9803 32.9476 49.7852 32.7525C49.5901 32.5574 49.3416 32.4246 49.0709 32.3708C48.8003 32.3169 48.5199 32.3446 48.2649 32.4501C48.01 32.5557 47.7922 32.7345 47.6389 32.9639C47.4856 33.1933 47.4038 33.4631 47.4038 33.739C47.4038 34.1089 47.5508 34.4638 47.8124 34.7254C48.074 34.987 48.4288 35.134 48.7988 35.134ZM51.5888 39.319C51.8647 39.319 52.1344 39.2372 52.3638 39.0839C52.5932 38.9306 52.772 38.7127 52.8776 38.4578C52.9832 38.2029 53.0108 37.9224 52.957 37.6518C52.9032 37.3812 52.7703 37.1327 52.5752 36.9376C52.3801 36.7425 52.1316 36.6096 51.861 36.5558C51.5904 36.502 51.3099 36.5296 51.055 36.6352C50.8001 36.7408 50.5822 36.9196 50.4289 37.149C50.2756 37.3784 50.1938 37.6481 50.1938 37.924C50.1938 38.294 50.3408 38.6488 50.6024 38.9104C50.864 39.172 51.2188 39.319 51.5888 39.319Z" fill="#FAFEFF"/>
|
||||
<path d="M61.3725 54.3001V96.2635C61.3725 97.6547 61.9304 98.9889 62.9236 99.9726C63.9168 100.956 65.2638 101.509 66.6683 101.509H115.418L121.474 110.725C121.487 110.738 121.501 110.75 121.517 110.761C122.468 111.561 123.675 112 124.923 112C125.7 111.999 126.467 111.828 127.17 111.502C128.085 111.084 128.859 110.414 129.4 109.572C129.94 108.73 130.225 107.752 130.219 106.754V54.3001C130.219 52.9089 129.661 51.5747 128.668 50.591C127.674 49.6073 126.327 49.0547 124.923 49.0547H66.6683C65.2638 49.0547 63.9168 49.6073 62.9236 50.591C61.9304 51.5747 61.3725 52.9089 61.3725 54.3001Z" fill="url(#paint1_linear_11581_2585)"/>
|
||||
<defs>
|
||||
<linearGradient id="paint0_linear_11581_2585" x1="121.299" y1="-19.6223" x2="-31.6628" y2="110.15" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF9730"/>
|
||||
<stop offset="1" stop-color="#FFB266" stop-opacity="0.7"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="paint1_linear_11581_2585" x1="16.8595" y1="13.8827" x2="168.599" y2="143.856" gradientUnits="userSpaceOnUse">
|
||||
<stop stop-color="#FF9730"/>
|
||||
<stop offset="1" stop-color="#FFB266" stop-opacity="0.7"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
After Width: | Height: | Size: 5.1 KiB |
11
Linphone/data/image/radio_off.svg
Normal file
11
Linphone/data/image/radio_off.svg
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_11134_54320)">
|
||||
<path d="M0 0H24V24H0V0Z" fill="#F9F9F9"/>
|
||||
<path d="M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z" fill="#FE5E00"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_11134_54320">
|
||||
<rect width="24" height="24" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 509 B |
12
Linphone/data/image/radio_on.svg
Normal file
12
Linphone/data/image/radio_on.svg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<g clip-path="url(#clip0_11134_54326)">
|
||||
<path d="M0 0H24V24H0V0Z" fill="#F9F9F9"/>
|
||||
<path d="M12 7C9.24 7 7 9.24 7 12C7 14.76 9.24 17 12 17C14.76 17 17 14.76 17 12C17 9.24 14.76 7 12 7ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.58 20 4 16.42 4 12C4 7.58 7.58 4 12 4C16.42 4 20 7.58 20 12C20 16.42 16.42 20 12 20Z" fill="#FE5E00"/>
|
||||
</g>
|
||||
<defs>
|
||||
<clipPath id="clip0_11134_54326">
|
||||
<rect width="24" height="24" fill="white"/>
|
||||
</clipPath>
|
||||
</defs>
|
||||
</svg>
|
||||
|
||||
|
After Width: | Height: | Size: 602 B |
|
|
@ -2979,47 +2979,6 @@ Error</extracomment>
|
|||
<source>conference_participant_set_admin_event</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="145"/>
|
||||
<source>nMinute</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="146"/>
|
||||
<source>nHour</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="147"/>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="148"/>
|
||||
<source>nDay</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="149"/>
|
||||
<source>nWeek</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="150"/>
|
||||
<source>nSeconds</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FriendCore</name>
|
||||
|
|
@ -3166,9 +3125,9 @@ Error</extracomment>
|
|||
<translation>Flüchtige Nachrichten aktivieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="292"/>
|
||||
<source>group_infos_disable_ephemerals</source>
|
||||
<translation>Flüchtige Nachrichten deaktivieren</translation>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="203"/>
|
||||
<source>group_infos_ephemerals</source>
|
||||
<translation>Ephemeral messages : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="302"/>
|
||||
|
|
@ -4351,8 +4310,8 @@ Error</extracomment>
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/OneOneConversationInfos.qml" line="145"/>
|
||||
<source>one_one_infos_disable_ephemerals</source>
|
||||
<translation>Flüchtige Nachrichten deaktivieren</translation>
|
||||
<source>one_one_infos_ephemerals</source>
|
||||
<translation>Ephemeral messages : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/OneOneConversationInfos.qml" line="155"/>
|
||||
|
|
@ -5067,6 +5026,41 @@ Pour les activer dans un projet commercial, merci de nous contacter.</source>
|
|||
</context>
|
||||
<context>
|
||||
<name>Utils</name>
|
||||
<message numerus="yes">
|
||||
<source>nMinute</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nHour</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nDay</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nWeek</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nSeconds</source>
|
||||
<translation type="unfinished">
|
||||
<numerusform></numerusform>
|
||||
<numerusform></numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../tool/Utils.cpp" line="171"/>
|
||||
<source>information_popup_call_not_created_message</source>
|
||||
|
|
@ -6629,5 +6623,47 @@ Failed to create 1-1 conversation with %1 !</extracomment>
|
|||
<translation>Participants</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EphemeralSettings</name>
|
||||
<message>
|
||||
<source>title</source>
|
||||
<extracomment>Ephemeral messages</extracomment>
|
||||
<translation>Ephemeral messages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>explanations</source>
|
||||
<extracomment>By enabling ephemeral messages in this chat, messages sent will be automatically deleted after the defined period.</extracomment>
|
||||
<translation>By enabling ephemeral messages in this chat, messages sent will be automatically deleted after the defined period.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_minute</source>
|
||||
<extracomment>1 minute</extracomment>
|
||||
<translation>1 minute</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_hour</source>
|
||||
<extracomment>1 hour</extracomment>
|
||||
<translation>1 hour</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_day</source>
|
||||
<extracomment>1 day</extracomment>
|
||||
<translation>1 day</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_week</source>
|
||||
<extracomment>1 week</extracomment>
|
||||
<translation>1 week</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>disabled</source>
|
||||
<extracomment>Disabled</extracomment>
|
||||
<translation>Disabled</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>custom</source>
|
||||
<extracomment>Custom:</extracomment>
|
||||
<translation>Custom: </translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
|
|
|
|||
|
|
@ -2885,12 +2885,13 @@ Only your correspondent can decrypt them.</translation>
|
|||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="117"/>
|
||||
<source>conference_ephemeral_message_enabled_event</source>
|
||||
<translation>Ephemeral messages have been enabled: %1</translation>
|
||||
<translation>Ephemeral messages enabled
|
||||
Expiration : %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="125"/>
|
||||
<source>conference_ephemeral_message_disabled_event</source>
|
||||
<translation>Ephemeral messages have been disabled</translation>
|
||||
<translation>Ephemeral messages disabled</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="129"/>
|
||||
|
|
@ -2900,48 +2901,8 @@ Only your correspondent can decrypt them.</translation>
|
|||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="121"/>
|
||||
<source>conference_ephemeral_message_lifetime_changed_event</source>
|
||||
<translation>Ephemeral messages have been updated: %1</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="150"/>
|
||||
<source>nSeconds</source>
|
||||
<translation>
|
||||
<numerusform>%1 second</numerusform>
|
||||
<numerusform>%1 seconds</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="145"/>
|
||||
<source>nMinute</source>
|
||||
<translation>
|
||||
<numerusform>%1 minute</numerusform>
|
||||
<numerusform>%1 minutes</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="146"/>
|
||||
<source>nHour</source>
|
||||
<translation>
|
||||
<numerusform>%1 hour</numerusform>
|
||||
<numerusform>%1 hours</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="147"/>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="148"/>
|
||||
<source>nDay</source>
|
||||
<translation>
|
||||
<numerusform>%1 day</numerusform>
|
||||
<numerusform>%1 days</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="149"/>
|
||||
<source>nWeek</source>
|
||||
<translation>
|
||||
<numerusform>%1 week</numerusform>
|
||||
<numerusform>%1 weeks</numerusform>
|
||||
</translation>
|
||||
<translation>Ephemeral messages updated
|
||||
Expiration : %1</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
@ -3084,9 +3045,9 @@ Only your correspondent can decrypt them.</translation>
|
|||
<translation>Enable ephemeral messages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="292"/>
|
||||
<source>group_infos_disable_ephemerals</source>
|
||||
<translation>Disable ephemeral messages</translation>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="203"/>
|
||||
<source>group_infos_ephemerals</source>
|
||||
<translation>Ephemeral messages : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="321"/>
|
||||
|
|
@ -4260,8 +4221,8 @@ Only your correspondent can decrypt them.</translation>
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/OneOneConversationInfos.qml" line="145"/>
|
||||
<source>one_one_infos_disable_ephemerals</source>
|
||||
<translation>Disable ephemeral messages</translation>
|
||||
<source>one_one_infos_ephemerals</source>
|
||||
<translation>Ephemeral messages : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/OneOneConversationInfos.qml" line="155"/>
|
||||
|
|
@ -4964,6 +4925,41 @@ To enable them in a commercial project, please contact us.</translation>
|
|||
</context>
|
||||
<context>
|
||||
<name>Utils</name>
|
||||
<message numerus="yes">
|
||||
<source>nSeconds</source>
|
||||
<translation>
|
||||
<numerusform>%1 second</numerusform>
|
||||
<numerusform>%1 seconds</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nMinute</source>
|
||||
<translation>
|
||||
<numerusform>%1 minute</numerusform>
|
||||
<numerusform>%1 minutes</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nHour</source>
|
||||
<translation>
|
||||
<numerusform>%1 hour</numerusform>
|
||||
<numerusform>%1 hours</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nDay</source>
|
||||
<translation>
|
||||
<numerusform>%1 day</numerusform>
|
||||
<numerusform>%1 days</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nWeek</source>
|
||||
<translation>
|
||||
<numerusform>%1 week</numerusform>
|
||||
<numerusform>%1 weeks</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../tool/Utils.cpp" line="1780"/>
|
||||
<source>contact_presence_status_available</source>
|
||||
|
|
@ -6526,4 +6522,47 @@ Failed to create 1-1 conversation with %1 !</extracomment>
|
|||
<translation>Participants</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>EphemeralSettings</name>
|
||||
<message>
|
||||
<source>title</source>
|
||||
<extracomment>Ephemeral messages</extracomment>
|
||||
<translation>Ephemeral messages</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>explanations</source>
|
||||
<extracomment>By enabling ephemeral messages in this chat, messages sent will be automatically deleted after the defined period.</extracomment>
|
||||
<translation>By enabling ephemeral messages in this chat, messages sent will be automatically deleted after the defined period.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_minute</source>
|
||||
<extracomment>1 minute</extracomment>
|
||||
<translation>1 minute</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_hour</source>
|
||||
<extracomment>1 hour</extracomment>
|
||||
<translation>1 hour</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_day</source>
|
||||
<extracomment>1 day</extracomment>
|
||||
<translation>1 day</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_week</source>
|
||||
<extracomment>1 week</extracomment>
|
||||
<translation>1 week</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>disabled</source>
|
||||
<extracomment>Disabled</extracomment>
|
||||
<translation>Disabled</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>custom</source>
|
||||
<extracomment>Custom:</extracomment>
|
||||
<translation>Custom: </translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
|||
|
|
@ -2875,17 +2875,19 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
|
|||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="117"/>
|
||||
<source>conference_ephemeral_message_enabled_event</source>
|
||||
<translation>Les messages éphémères ont été activés : %1</translation>
|
||||
<translation>Les messages éphémères activés
|
||||
Expiration : %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="121"/>
|
||||
<source>conference_ephemeral_message_lifetime_changed_event</source>
|
||||
<translation>Les messages éphémères ont été mis à jour : %1</translation>
|
||||
<translation>Les messages éphémères mis à jour
|
||||
Expiration : %1</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="125"/>
|
||||
<source>conference_ephemeral_message_disabled_event</source>
|
||||
<translation>Les messages éphémères ont été désactivés : %1</translation>
|
||||
<translation>Les messages éphémères désactivés</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="129"/>
|
||||
|
|
@ -2902,47 +2904,6 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
|
|||
<source>conference_participant_set_admin_event</source>
|
||||
<translation>%1 est maintenant admin</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="145"/>
|
||||
<source>nMinute</source>
|
||||
<translation>
|
||||
<numerusform>%1 minute</numerusform>
|
||||
<numerusform>%1 minutes</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="146"/>
|
||||
<source>nHour</source>
|
||||
<translation>
|
||||
<numerusform>%1 heure</numerusform>
|
||||
<numerusform>%1 heures</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="147"/>
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="148"/>
|
||||
<source>nDay</source>
|
||||
<translation>
|
||||
<numerusform>%1 jour</numerusform>
|
||||
<numerusform>%1 jours</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="149"/>
|
||||
<source>nWeek</source>
|
||||
<translation>
|
||||
<numerusform>%1 semaine</numerusform>
|
||||
<numerusform>%1 semaines</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<location filename="../../core/chat/message/EventLogCore.cpp" line="150"/>
|
||||
<source>nSeconds</source>
|
||||
<translation>
|
||||
<numerusform>%1 seconde</numerusform>
|
||||
<numerusform>%1 secondes</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>FriendCore</name>
|
||||
|
|
@ -3084,9 +3045,9 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
|
|||
<translation>Activer les messages éphémères</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="292"/>
|
||||
<source>group_infos_disable_ephemerals</source>
|
||||
<translation>Désactiver les messages éphémères</translation>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="203"/>
|
||||
<source>group_infos_ephemerals</source>
|
||||
<translation>Messages éphémères : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/GroupConversationInfos.qml" line="321"/>
|
||||
|
|
@ -4255,8 +4216,8 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
|
|||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/OneOneConversationInfos.qml" line="145"/>
|
||||
<source>one_one_infos_disable_ephemerals</source>
|
||||
<translation>Désactiver les messages éphémères</translation>
|
||||
<source>one_one_infos_ephemerals</source>
|
||||
<translation>Messages éphémères : </translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Chat/OneOneConversationInfos.qml" line="155"/>
|
||||
|
|
@ -4959,6 +4920,41 @@ Pour les activer dans un projet commercial, merci de nous contacter.</translatio
|
|||
</context>
|
||||
<context>
|
||||
<name>Utils</name>
|
||||
<message numerus="yes">
|
||||
<source>nMinute</source>
|
||||
<translation>
|
||||
<numerusform>%1 minute</numerusform>
|
||||
<numerusform>%1 minutes</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nHour</source>
|
||||
<translation>
|
||||
<numerusform>%1 heure</numerusform>
|
||||
<numerusform>%1 heures</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nDay</source>
|
||||
<translation>
|
||||
<numerusform>%1 jour</numerusform>
|
||||
<numerusform>%1 jours</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nWeek</source>
|
||||
<translation>
|
||||
<numerusform>%1 semaine</numerusform>
|
||||
<numerusform>%1 semaines</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message numerus="yes">
|
||||
<source>nSeconds</source>
|
||||
<translation>
|
||||
<numerusform>%1 seconde</numerusform>
|
||||
<numerusform>%1 secondes</numerusform>
|
||||
</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../tool/Utils.cpp" line="1780"/>
|
||||
<source>contact_presence_status_available</source>
|
||||
|
|
@ -6521,6 +6517,48 @@ Failed to create 1-1 conversation with %1 !</extracomment>
|
|||
<translation>Participants</translation>
|
||||
</message>
|
||||
</context>
|
||||
|
||||
<context>
|
||||
<name>EphemeralSettings</name>
|
||||
<message>
|
||||
<source>title</source>
|
||||
<extracomment>Ephemeral messages</extracomment>
|
||||
<translation>Messages éphémères</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>explanations</source>
|
||||
<extracomment>By enabling ephemeral messages in this chat, messages sent will be automatically deleted after the defined period.</extracomment>
|
||||
<translation>En activant les messages éphémères dans cette discussion, les messages envoyés seront automatiquement détruits après le délai défini.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_minute</source>
|
||||
<extracomment>1 minute</extracomment>
|
||||
<translation>1 minute</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_hour</source>
|
||||
<extracomment>1 hour</extracomment>
|
||||
<translation>1 heure</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_day</source>
|
||||
<extracomment>1 day</extracomment>
|
||||
<translation>1 jour</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>one_week</source>
|
||||
<extracomment>1 week</extracomment>
|
||||
<translation>1 semaine</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>disabled</source>
|
||||
<extracomment>Disabled</extracomment>
|
||||
<translation>Désactivé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>custom</source>
|
||||
<extracomment>Custom:</extracomment>
|
||||
<translation>Personnalisé: </translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
|
|
|
|||
|
|
@ -114,6 +114,12 @@ void ChatModel::enableEphemeral(bool enable) {
|
|||
emit ephemeralEnableChanged(enable);
|
||||
}
|
||||
|
||||
void ChatModel::setEphemeralLifetime(int time) {
|
||||
mMonitor->setEphemeralLifetime(time);
|
||||
emit ephemeralLifetimeChanged(time);
|
||||
enableEphemeral(time != 0);
|
||||
}
|
||||
|
||||
void ChatModel::deleteHistory() {
|
||||
mMonitor->deleteHistory();
|
||||
emit historyDeleted();
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ public:
|
|||
linphone::ChatRoom::State getState() const;
|
||||
void setMuted(bool muted);
|
||||
void enableEphemeral(bool enable);
|
||||
void setEphemeralLifetime(int time);
|
||||
void setSubject(QString subject) const;
|
||||
void removeParticipantAtIndex(int index) const;
|
||||
void setParticipantAddresses(const QStringList &addresses) const;
|
||||
|
|
@ -73,6 +74,7 @@ signals:
|
|||
void deleted();
|
||||
void mutedChanged(bool muted);
|
||||
void ephemeralEnableChanged(bool enable);
|
||||
void ephemeralLifetimeChanged(int time);
|
||||
|
||||
private:
|
||||
DECLARE_ABSTRACT_OBJECT
|
||||
|
|
|
|||
|
|
@ -2102,3 +2102,12 @@ void Utils::setGlobalCursor(Qt::CursorShape cursor) {
|
|||
void Utils::restoreGlobalCursor() {
|
||||
App::getInstance()->restoreOverrideCursor();
|
||||
}
|
||||
|
||||
QString Utils::getEphemeralFormatedTime(int selectedTime) {
|
||||
if (selectedTime == 60) return tr("nMinute", "", 1).arg(1);
|
||||
else if (selectedTime == 3600) return tr("nHour", "", 1).arg(1);
|
||||
else if (selectedTime == 86400) return tr("nDay", "", 1).arg(1);
|
||||
else if (selectedTime == 259200) return tr("nDay", "", 3).arg(3);
|
||||
else if (selectedTime == 604800) return tr("nWeek", "", 1).arg(1);
|
||||
else return tr("nSeconds", "", selectedTime).arg(selectedTime);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ public:
|
|||
Q_INVOKABLE static void
|
||||
sendReplyMessage(ChatMessageGui *message, ChatGui *chatGui, QString text, QVariantList files);
|
||||
Q_INVOKABLE static void sendVoiceRecordingMessage(RecorderGui *recorderGui, ChatGui *chatGui);
|
||||
Q_INVOKABLE static QString getEphemeralFormatedTime(int selectedTime);
|
||||
|
||||
// QDir findDirectoryByName(QString startPath, QString name);
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
|||
view/Control/Display/Chat/ChatMessageInvitationBubble.qml
|
||||
view/Control/Display/Chat/ChatMessagesListView.qml
|
||||
view/Control/Display/Chat/Event.qml
|
||||
view/Control/Display/Chat/EphemeralEvent.qml
|
||||
view/Control/Display/Chat/FileView.qml
|
||||
view/Control/Display/Contact/Avatar.qml
|
||||
view/Control/Display/Contact/Contact.qml
|
||||
|
|
@ -161,6 +162,8 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
|||
view/Page/Layout/Chat/ChatInfoActionsGroup.qml
|
||||
view/Page/Layout/Chat/GroupChatInfoParticipants.qml
|
||||
view/Page/Layout/Chat/ManageParticipants.qml
|
||||
view/Page/Layout/Chat/EphemeralSettings.qml
|
||||
|
||||
|
||||
view/Page/Main/AbstractMainPage.qml
|
||||
view/Page/Main/Account/AccountListView.qml
|
||||
|
|
|
|||
|
|
@ -157,6 +157,23 @@ ListView {
|
|||
eventLogGui: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DelegateChoice {
|
||||
roleValue: "ephemeralEvent"
|
||||
delegate:
|
||||
Item {
|
||||
property bool showTopMargin: !header.visible && index == 0
|
||||
width: mainItem.width
|
||||
//height: 40 * DefaultStyle.dp
|
||||
height: (showTopMargin ? 30 : 0 * DefaultStyle.dp) + eventItem.height
|
||||
EphemeralEvent {
|
||||
id: eventItem
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: showTopMargin ? 30 : 0 * DefaultStyle.dp
|
||||
eventLogGui: modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
34
Linphone/view/Control/Display/Chat/EphemeralEvent.qml
Normal file
34
Linphone/view/Control/Display/Chat/EphemeralEvent.qml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Linphone
|
||||
import UtilsCpp
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
property EventLogGui eventLogGui
|
||||
property var eventLogCore: eventLogGui.core
|
||||
visible: eventLogCore.handled
|
||||
height: row.height + 15 * DefaultStyle.dp
|
||||
width: row.width + 15 * DefaultStyle.dp
|
||||
radius: 10 * DefaultStyle.dp
|
||||
border.width: 2 * DefaultStyle.dp
|
||||
border.color: DefaultStyle.main2_200
|
||||
color: "transparent"
|
||||
RowLayout {
|
||||
id: row
|
||||
anchors.centerIn: parent
|
||||
EffectImage {
|
||||
Layout.preferredWidth: visible ? 20 * DefaultStyle.dp : 0
|
||||
Layout.preferredHeight: 20 * DefaultStyle.dp
|
||||
colorizationColor: DefaultStyle.main2_400
|
||||
imageSource: AppIcons.clockCountDown
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
Text {
|
||||
id: message
|
||||
text: eventLogCore.eventDetails
|
||||
font: Typography.p3
|
||||
color: DefaultStyle.main2_400
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -387,20 +387,23 @@ RowLayout {
|
|||
property bool showingMessageReactions: false
|
||||
property bool showingImdnStatus: false
|
||||
property bool showingManageParticipants: false
|
||||
property bool showingEphemeralSettings: false
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: Math.round(39 * DefaultStyle.dp)
|
||||
sourceComponent: showingMessageReactions
|
||||
? messageReactionsComponent
|
||||
: showingImdnStatus
|
||||
? messageImdnStatusComponent
|
||||
: showingManageParticipants
|
||||
? manageParticipantsComponents
|
||||
: mainItem.chat.core.isGroupChat
|
||||
? groupInfoComponent
|
||||
: oneToOneInfoComponent
|
||||
sourceComponent: showingEphemeralSettings
|
||||
? ephemeralSettingsComponent
|
||||
: showingMessageReactions
|
||||
? messageReactionsComponent
|
||||
: showingImdnStatus
|
||||
? messageImdnStatusComponent
|
||||
: showingManageParticipants
|
||||
? manageParticipantsComponent
|
||||
: mainItem.chat.core.isGroupChat
|
||||
? groupInfoComponent
|
||||
: oneToOneInfoComponent
|
||||
active: detailsPanel.visible
|
||||
onLoaded: {
|
||||
if (contentLoader.item) {
|
||||
if (contentLoader.item && contentLoader.item.parentView) {
|
||||
contentLoader.item.parentView = mainItem
|
||||
}
|
||||
}
|
||||
|
|
@ -410,6 +413,7 @@ RowLayout {
|
|||
id: oneToOneInfoComponent
|
||||
OneOneConversationInfos {
|
||||
chatGui: mainItem.chat
|
||||
onEphemeralSettingsRequested: contentLoader.showingEphemeralSettings = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -418,6 +422,7 @@ RowLayout {
|
|||
GroupConversationInfos {
|
||||
chatGui: mainItem.chat
|
||||
onManageParticipantsRequested: contentLoader.showingManageParticipants = true
|
||||
onEphemeralSettingsRequested: contentLoader.showingEphemeralSettings = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -443,11 +448,19 @@ RowLayout {
|
|||
}
|
||||
|
||||
Component {
|
||||
id: manageParticipantsComponents
|
||||
id: manageParticipantsComponent
|
||||
ManageParticipants {
|
||||
chatGui: mainItem.chat
|
||||
onDone: contentLoader.showingManageParticipants = false
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: ephemeralSettingsComponent
|
||||
EphemeralSettings {
|
||||
chatGui: mainItem.chat
|
||||
onDone: contentLoader.showingEphemeralSettings = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
142
Linphone/view/Page/Layout/Chat/EphemeralSettings.qml
Normal file
142
Linphone/view/Page/Layout/Chat/EphemeralSettings.qml
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Controls.Basic as Control
|
||||
import QtQuick.Dialogs
|
||||
import QtQuick.Effects
|
||||
import QtQuick.Layouts
|
||||
import Linphone
|
||||
import UtilsCpp
|
||||
import SettingsCpp
|
||||
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
id: mainItem
|
||||
property ChatGui chatGui
|
||||
property var chatCore: chatGui.core
|
||||
property int selectedLifetime: chatCore.ephemeralLifetime
|
||||
spacing: Math.round(5 * DefaultStyle.dp)
|
||||
signal done()
|
||||
|
||||
property var model: [
|
||||
{title: qsTr("one_minute"), lifetime: 60},
|
||||
{title: qsTr("one_hour"), lifetime: 3600},
|
||||
{title: qsTr("one_day"), lifetime: 86400},
|
||||
{title: qsTr("one_week"), lifetime: 7*86400},
|
||||
{title: qsTr("disabled"), lifetime: 0}
|
||||
]
|
||||
|
||||
Component.onCompleted: {
|
||||
var isLifetimeInRange = model.some(function(item) {
|
||||
return item.lifetime === selectedLifetime;
|
||||
});
|
||||
if (!isLifetimeInRange) { // Display life time set elsewhere, not in settable range.
|
||||
model = model.concat({
|
||||
title: qsTr("custom")+UtilsCpp.getEphemeralFormatedTime(selectedLifetime),
|
||||
lifetime: selectedLifetime,
|
||||
disabled: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: manageParticipantsButtons
|
||||
spacing: Math.round(5 * DefaultStyle.dp)
|
||||
|
||||
BigButton {
|
||||
id: manageParticipantsBackButton
|
||||
style: ButtonStyle.noBackground
|
||||
icon.source: AppIcons.leftArrow
|
||||
onClicked: {
|
||||
if (chatCore.ephemeralLifetime != selectedLifetime)
|
||||
chatCore.ephemeralLifetime = selectedLifetime
|
||||
mainItem.done()
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("title")
|
||||
color: DefaultStyle.main2_600
|
||||
maximumLineCount: 1
|
||||
font: Typography.h4
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
Layout.preferredWidth: 130 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 112 * DefaultStyle.dp
|
||||
Layout.topMargin: Math.round(31 * DefaultStyle.dp)
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
source: AppIcons.ephemeralSettings
|
||||
fillMode: Image.PreserveAspectFit
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("explanations")
|
||||
wrapMode: Text.Wrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font: Typography.p1
|
||||
color: DefaultStyle.main2_600
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: Math.round(31 * DefaultStyle.dp)
|
||||
Layout.leftMargin: Math.round(15 * DefaultStyle.dp)
|
||||
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
|
||||
}
|
||||
|
||||
RoundedPane {
|
||||
id: pane
|
||||
Layout.fillWidth: true
|
||||
backgroundColor: DefaultStyle.grey_100
|
||||
Layout.leftMargin: Math.round(15 * DefaultStyle.dp)
|
||||
Layout.rightMargin: Math.round(15 * DefaultStyle.dp)
|
||||
Layout.topMargin: Math.round(31 * DefaultStyle.dp)
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
Repeater {
|
||||
model: mainItem.model
|
||||
delegate: ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: Math.round(8 * DefaultStyle.dp)
|
||||
Control.RadioButton {
|
||||
enabled: modelData.disabled !== true
|
||||
opacity: modelData.disabled !== true ? 1.0 : 0.5
|
||||
checked: modelData.lifetime === mainItem.selectedLifetime
|
||||
onClicked: mainItem.selectedLifetime = modelData.lifetime
|
||||
spacing: Math.round(8 * DefaultStyle.dp)
|
||||
contentItem: Text {
|
||||
id: label
|
||||
text: modelData.title
|
||||
color: DefaultStyle.main2_600
|
||||
font: Typography.p1
|
||||
leftPadding: Math.round(8 * DefaultStyle.dp)
|
||||
wrapMode: Text.NoWrap
|
||||
elide: Text.ElideRight
|
||||
anchors.left: ico.right
|
||||
}
|
||||
indicator: Image {
|
||||
id: ico
|
||||
source: parent.checked ? AppIcons.radioOn : AppIcons.radioOff
|
||||
width: Math.round(24 * DefaultStyle.dp)
|
||||
height: Math.round(24 * DefaultStyle.dp)
|
||||
fillMode: Image.PreserveAspectFit
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
//visible: index < (model.count - 1)
|
||||
color: DefaultStyle.main2_200
|
||||
height: Math.round(1 * DefaultStyle.dp)
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,7 @@ ColumnLayout {
|
|||
property var parentView
|
||||
property bool manageParticipants: false
|
||||
signal manageParticipantsRequested()
|
||||
signal ephemeralSettingsRequested()
|
||||
|
||||
spacing: 0
|
||||
|
||||
|
|
@ -232,11 +233,11 @@ ColumnLayout {
|
|||
{
|
||||
icon: AppIcons.clockCountDown,
|
||||
visible: !mainItem.chatCore.isReadOnly,
|
||||
text: mainItem.chatCore.ephemeralEnabled ? qsTr("group_infos_disable_ephemerals") : qsTr("group_infos_enable_ephemerals"),
|
||||
text: mainItem.chatCore.ephemeralEnabled ? qsTr("group_infos_ephemerals")+UtilsCpp.getEphemeralFormatedTime(mainItem.chatCore.ephemeralLifetime) : qsTr("group_infos_enable_ephemerals"),
|
||||
color: DefaultStyle.main2_600,
|
||||
showRightArrow: false,
|
||||
action: function() {
|
||||
mainItem.chatCore.ephemeralEnabled = !mainItem.chatCore.ephemeralEnabled
|
||||
mainItem.ephemeralSettingsRequested()
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ Rectangle {
|
|||
Layout.leftMargin: Math.round(17 * DefaultStyle.dp)
|
||||
Layout.rightMargin: Math.round(10 * DefaultStyle.dp)
|
||||
color: DefaultStyle.grey_0
|
||||
radius: Math.round(15 * DefaultStyle.dp)
|
||||
height: participantAddColumn.implicitHeight
|
||||
signal done()
|
||||
|
||||
|
|
@ -31,7 +30,6 @@ Rectangle {
|
|||
anchors.topMargin: Math.round(17 * DefaultStyle.dp)
|
||||
spacing: Math.round(5 * DefaultStyle.dp)
|
||||
RowLayout {
|
||||
id: manageParticipantsButtons
|
||||
spacing: Math.round(5 * DefaultStyle.dp)
|
||||
BigButton {
|
||||
id: manageParticipantsBackButton
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@ ColumnLayout {
|
|||
property var contactObj: chatGui ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null
|
||||
property var parentView
|
||||
spacing: 0
|
||||
signal ephemeralSettingsRequested()
|
||||
|
||||
|
||||
Avatar {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
|
@ -155,12 +157,12 @@ ColumnLayout {
|
|||
},
|
||||
{
|
||||
icon: AppIcons.clockCountDown,
|
||||
visible: true,
|
||||
text: mainItem.chatCore.ephemeralEnabled ? qsTr("one_one_infos_disable_ephemerals") : qsTr("one_one_infos_enable_ephemerals"),
|
||||
visible: !mainItem.chatCore.isReadOnly,
|
||||
text: mainItem.chatCore.ephemeralEnabled ? qsTr("one_one_infos_ephemerals")+UtilsCpp.getEphemeralFormatedTime(mainItem.chatCore.ephemeralLifetime) : qsTr("one_one_infos_enable_ephemerals"),
|
||||
color: DefaultStyle.main2_600,
|
||||
showRightArrow: false,
|
||||
action: function() {
|
||||
mainItem.chatCore.ephemeralEnabled = !mainItem.chatCore.ephemeralEnabled
|
||||
mainItem.ephemeralSettingsRequested()
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -154,4 +154,7 @@ QtObject {
|
|||
property string search: "image://internal/search.svg"
|
||||
property string pdf: "image://internal/pdf.svg"
|
||||
property string photo: "image://internal/photo.svg"
|
||||
property string ephemeralSettings: "image://internal/ephemeral-settings.svg"
|
||||
property string radioOn: "image://internal/radio_on.svg"
|
||||
property string radioOff: "image://internal/radio_off.svg"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue