Commit 5c564b1f authored by Wescoeur's avatar Wescoeur

feat(ui/views/App/Main/InviteFriends): set default subject/message

parent 13bea18e
...@@ -814,11 +814,11 @@ Server url not configured.</translation> ...@@ -814,11 +814,11 @@ Server url not configured.</translation>
<name>InviteFriends</name> <name>InviteFriends</name>
<message> <message>
<source>enterEmailLabel</source> <source>enterEmailLabel</source>
<translation>Enter your friend&apos;s email address</translation> <translation>Friend&apos;s email address</translation>
</message> </message>
<message> <message>
<source>messageLabel</source> <source>messageLabel</source>
<translation>You can modify the invitation that will be sent</translation> <translation>Message</translation>
</message> </message>
<message> <message>
<source>cancel</source> <source>cancel</source>
...@@ -834,11 +834,18 @@ Server url not configured.</translation> ...@@ -834,11 +834,18 @@ Server url not configured.</translation>
</message> </message>
<message> <message>
<source>defaultMessage</source> <source>defaultMessage</source>
<translation type="unfinished"></translation> <translation>%1 wants to invite you on Linphone !</translation>
</message> </message>
<message> <message>
<source>defaultSubject</source> <source>defaultSubject</source>
<translation type="unfinished"></translation> <translation>Linphone invitation</translation>
</message>
<message>
<source>forcedMessage</source>
<translation>Download the application on your computer and start calling and chatting with Linphone users for free.
Click here: &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
</translation>
</message> </message>
</context> </context>
<context> <context>
......
...@@ -834,11 +834,18 @@ Url du serveur non configurée.</translation> ...@@ -834,11 +834,18 @@ Url du serveur non configurée.</translation>
</message> </message>
<message> <message>
<source>defaultMessage</source> <source>defaultMessage</source>
<translation type="unfinished"></translation> <translation>%1 souhaite vous inviter sur Linphone !</translation>
</message> </message>
<message> <message>
<source>defaultSubject</source> <source>defaultSubject</source>
<translation type="unfinished"></translation> <translation>Invitation Linphone</translation>
</message>
<message>
<source>forcedMessage</source>
<translation>Téléchargez lapplication sur votre ordinateur et appelez vos amis ou envoyez-leur un message sur Linphone gratuitement.
Cliquez ici : &lt;a href=&quot;%1&quot;&gt;%1&lt;/a&gt;
</translation>
</message> </message>
</context> </context>
<context> <context>
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#define CBS_CALL_INTERVAL 20 #define CBS_CALL_INTERVAL 20
#define DOWNLOAD_URL "https://www.linphone.org/technical-corner/linphone/downloads"
using namespace std; using namespace std;
// ============================================================================= // =============================================================================
...@@ -164,3 +166,9 @@ void CoreManager::iterate () { ...@@ -164,3 +166,9 @@ void CoreManager::iterate () {
mCore->iterate(); mCore->iterate();
mInstance->unlockVideoRender(); mInstance->unlockVideoRender();
} }
// -----------------------------------------------------------------------------
QString CoreManager::getDownloadUrl () {
return QStringLiteral(DOWNLOAD_URL);
}
...@@ -43,6 +43,7 @@ class CoreManager : public QObject { ...@@ -43,6 +43,7 @@ class CoreManager : public QObject {
Q_OBJECT; Q_OBJECT;
Q_PROPERTY(QString version READ getVersion CONSTANT); Q_PROPERTY(QString version READ getVersion CONSTANT);
Q_PROPERTY(QString downloadUrl READ getDownloadUrl CONSTANT);
public: public:
~CoreManager () = default; ~CoreManager () = default;
...@@ -134,6 +135,8 @@ private: ...@@ -134,6 +135,8 @@ private:
void iterate (); void iterate ();
static QString getDownloadUrl ();
std::shared_ptr<linphone::Core> mCore; std::shared_ptr<linphone::Core> mCore;
std::shared_ptr<CoreHandlers> mHandlers; std::shared_ptr<CoreHandlers> mHandlers;
......
...@@ -2,6 +2,7 @@ import QtQuick 2.7 ...@@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Common 1.0 import Common 1.0
import Linphone 1.0
import App.Styles 1.0 import App.Styles 1.0
...@@ -47,7 +48,7 @@ Rectangle { ...@@ -47,7 +48,7 @@ Rectangle {
id: message id: message
height: InviteFriendsStyle.message.height height: InviteFriendsStyle.message.height
text: qsTr('defaultMessage') text: qsTr('defaultMessage').replace('%1', AccountSettingsModel.username)
} }
} }
} }
...@@ -80,7 +81,9 @@ Rectangle { ...@@ -80,7 +81,9 @@ Rectangle {
Qt.openUrlExternally( Qt.openUrlExternally(
'mailto:' + encodeURIComponent(email.text) + 'mailto:' + encodeURIComponent(email.text) +
'?subject=' + encodeURIComponent(qsTr('defaultSubject')) + '?subject=' + encodeURIComponent(qsTr('defaultSubject')) +
'&body=' + encodeURIComponent(message.text) '&body=' + encodeURIComponent(
message.text + '\n\n' + qsTr('forcedMessage').replace(/%1/g, CoreManager.downloadUrl)
)
) )
window.setView('Home') window.setView('Home')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment