Commit 3c205c70 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Notifications): deal with recording

parent 63ea842f
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="40px"
height="40px"
viewBox="0 0 40 40"
version="1.1"
id="svg12"
sodipodi:docname="recording_sign.svg"
inkscape:version="0.92.1 r">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="985"
id="namedview14"
showgrid="false"
inkscape:zoom="5.9"
inkscape:cx="-27.881356"
inkscape:cy="20"
inkscape:window-x="0"
inkscape:window-y="35"
inkscape:window-maximized="1"
inkscape:current-layer="download_ended" />
<defs
id="defs6" />
<g
id="Symbols"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1">
<g
id="download_ended">
<polygon
id="call_pausing_sign"
points="40,0 0,40 0,0 "
style="fill:#4b5964" />
<g
id="attachment_default"
translate=""
transform="translate(-7.2881356,-2.8813559)">
<circle
cx="19.5"
cy="15.5"
r="5"
id="circle10"
style="stroke:#ffffff" />
<circle
cx="19.5"
cy="15.5"
r="3"
id="circle12"
style="fill:#ffffff" />
</g>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="23px" height="14px" viewBox="0 0 23 14" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch -->
<title>settings_video_default</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round">
<g id="settings_video_default" stroke-width="1.5" stroke="#FFFFFF">
<polygon id="videocall_icon" points="22.25 6.89355494 22.25 1.08716608 16.4942742 5.63134348 16.4942742 0.75 0.75 0.75 0.75 13.25 16.4942742 13.25 16.4942742 8.36865652 22.25 12.9128339"></polygon>
</g>
</g>
</svg>
<?xml version="1.0" encoding="UTF-8"?>
<svg width="40px" height="40px" viewBox="0 0 40 40" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Generator: Sketch 42 (36781) - http://www.bohemiancoding.com/sketch -->
<title>download_ended</title>
<desc>Created with Sketch.</desc>
<defs></defs>
<g id="Symbols" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="download_ended">
<polygon id="call_pausing_sign" fill="#4B5964" points="0 0 40 0 0 40"></polygon>
<path d="M15.8862711,16.7118816 C15.8848622,18.47124 14.366077,19.9160243 12.4971822,19.9365977 C10.627583,19.9538529 9.11372887,18.5402605 9.1158422,16.7815657 L9.1158422,7.21360248 C9.1158422,6.03892711 10.1302442,5.0752951 11.3771133,5.06334925 C12.6225736,5.05007608 13.6292267,5.9911437 13.6292267,7.16648273 L13.6292267,16.7351096 C13.6292267,17.3224473 13.1206168,17.8022723 12.4978867,17.8095726 C11.8751565,17.8162091 11.3735911,17.3456753 11.3721822,16.7570103 L11.3721822,8.2535552 L10.24366,8.26417373 L10.24366,16.7682925 C10.24366,17.9429679 11.2524264,18.8846992 12.5,18.8727533 C13.7447558,18.8594801 14.75634,17.8978391 14.7577489,16.7244911 L14.7577489,7.15520054 C14.7598622,5.39584211 13.2460081,3.98224971 11.3757044,4.00016849 C9.50751409,4.02007824 8.00281778,5.46287161 8,7.2228937 L8,17.3231109 C8.27402943,19.4169532 10.1957577,21.0216792 12.4950689,20.9997785 C14.7971979,20.9752231 16.7217439,19.3333322 17,17.2321897 L17,6.07741929 L15.8862711,6.07741929 L15.8862711,16.7118816 Z" id="attachment_default" fill="#FFFFFF" transform="translate(12.500000, 12.500000) rotate(-315.000000) translate(-12.500000, -12.500000) "></path>
</g>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="40px"
height="40px"
viewBox="0 0 40 40"
version="1.1"
id="svg12"
sodipodi:docname="snapshot_sign.svg"
inkscape:version="0.92.1 r">
<metadata
id="metadata16">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="985"
id="namedview14"
showgrid="false"
inkscape:zoom="5.9"
inkscape:cx="-32.457627"
inkscape:cy="19.322034"
inkscape:window-x="0"
inkscape:window-y="35"
inkscape:window-maximized="1"
inkscape:current-layer="download_ended" />
<defs
id="defs6">
<mask
id="mask-2"
maskContentUnits="userSpaceOnUse"
maskUnits="objectBoundingBox"
x="0"
y="0"
width="23"
height="16"
fill="white">
<rect
rx="1"
height="16"
width="23"
y="12"
x="8.5"
id="use7" />
</mask>
</defs>
<g
id="Symbols"
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1">
<g
id="download_ended">
<polygon
id="call_pausing_sign"
points="0,40 0,0 40,0 "
style="fill:#4b5964" />
<g
style="fill:none;fill-rule:evenodd;stroke:none;stroke-width:1"
id="screenshot_default"
transform="matrix(0.70847458,0,0,0.70847458,-2.2203389,-3.7423729)">
<path
d="M 9.5,14.5 H 30.523796"
id="path14"
inkscape:connector-curvature="0"
style="stroke:#ffffff;stroke-linecap:square" />
<rect
rx="1"
height="16"
width="23"
y="12"
x="8.5"
id="use16"
style="stroke:#ffffff;stroke-width:2" />
<path
d="m 20,16.333333 v 2"
id="path18"
inkscape:connector-curvature="0"
style="stroke:#ffffff;stroke-linecap:square" />
<path
d="m 20,23.666667 v 2"
id="path20"
inkscape:connector-curvature="0"
style="stroke:#ffffff;stroke-linecap:square" />
<path
d="m 23.666667,20 v 2"
transform="rotate(90,23.666667,21)"
id="path22"
inkscape:connector-curvature="0"
style="stroke:#ffffff;stroke-linecap:square" />
<path
d="m 16.333333,20 v 2"
transform="rotate(90,16.333333,21)"
id="path24"
inkscape:connector-curvature="0"
style="stroke:#ffffff;stroke-linecap:square" />
<circle
cx="20"
cy="21"
r="3.6666667"
id="circle26"
style="stroke:#ffffff" />
</g>
</g>
</svg>
\ No newline at end of file
</g>
</svg>
......@@ -152,6 +152,7 @@
<file>assets/images/pause_on_normal.svg</file>
<file>assets/images/pause_on_pressed.svg</file>
<file>assets/images/pause_on_updating.svg</file>
<file>assets/images/recording_sign.svg</file>
<file>assets/images/record_off.svg</file>
<file>assets/images/record_on.svg</file>
<file>assets/images/screenshot_hovered.svg</file>
......@@ -168,7 +169,6 @@
<file>assets/images/settings_network_selected.svg</file>
<file>assets/images/settings_sip_accounts_normal.svg</file>
<file>assets/images/settings_sip_accounts_selected.svg</file>
<file>assets/images/settings_video_normal.svg</file>
<file>assets/images/settings_video_selected.svg</file>
<file>assets/images/snapshot_sign.svg</file>
<file>assets/images/speaker_off_hovered.svg</file>
......@@ -333,6 +333,7 @@
<file>ui/modules/Linphone/Notifications/NotificationReceivedCall.qml</file>
<file>ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml</file>
<file>ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml</file>
<file>ui/modules/Linphone/Notifications/NotificationRecordingCompleted.qml</file>
<file>ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml</file>
<file>ui/modules/Linphone/Presence/PresenceLevel.qml</file>
<file>ui/modules/Linphone/qmldir</file>
......
......@@ -89,14 +89,16 @@ void CallModel::setRecordFile (shared_ptr<linphone::CallParams> &callParams) {
void CallModel::updateStats (const shared_ptr<const linphone::CallStats> &callStats) {
switch (callStats->getType()) {
case linphone::StreamTypeText:
case linphone::StreamTypeUnknown:
break;
case linphone::StreamTypeAudio:
updateStats(callStats, mAudioStats);
break;
case linphone::StreamTypeVideo:
updateStats(callStats, mVideoStats);
break;
default:
break;
}
emit statsUpdated();
......@@ -211,6 +213,10 @@ void CallModel::stopRecording () {
mRecording = false;
mCall->stopRecording();
App::getInstance()->getNotifier()->notifyRecordingCompleted(
::Utils::coreStringToAppString(mCall->getParams()->getRecordFile())
);
emit recordingChanged(false);
}
......
......@@ -79,7 +79,8 @@ const QHash<int, Notifier::Notification> Notifier::mNotifications = {
{ Notifier::ReceivedFileMessage, { "NotificationReceivedFileMessage.qml", 10 } },
{ Notifier::ReceivedCall, { "NotificationReceivedCall.qml", 30 } },
{ Notifier::NewVersionAvailable, { "NotificationNewVersionAvailable.qml", 30 } },
{ Notifier::SnapshotWasTaken, { "NotificationSnapshotWasTaken.qml", 10 } }
{ Notifier::SnapshotWasTaken, { "NotificationSnapshotWasTaken.qml", 10 } },
{ Notifier::RecordingCompleted, { "NotificationRecordingCompleted.qml", 10 } }
};
// -----------------------------------------------------------------------------
......@@ -283,5 +284,14 @@ void Notifier::notifySnapshotWasTaken (const QString &filePath) {
SHOW_NOTIFICATION(map);
}
void Notifier::notifyRecordingCompleted (const QString &filePath) {
CREATE_NOTIFICATION(Notifier::RecordingCompleted);
QVariantMap map;
map["filePath"] = filePath;
SHOW_NOTIFICATION(map);
}
#undef SHOW_NOTIFICATION
#undef CREATE_NOTIFICATION
......@@ -43,7 +43,8 @@ public:
ReceivedFileMessage,
ReceivedCall,
NewVersionAvailable,
SnapshotWasTaken
SnapshotWasTaken,
RecordingCompleted
};
void notifyReceivedMessage (const std::shared_ptr<linphone::ChatMessage> &message);
......@@ -51,6 +52,7 @@ public:
void notifyReceivedCall (const std::shared_ptr<linphone::Call> &call);
void notifyNewVersionAvailable (const QString &version, const QString &url);
void notifySnapshotWasTaken (const QString &filePath);
void notifyRecordingCompleted (const QString &filePath);
public slots:
void deleteNotification (QVariant notification);
......
import Utils 1.0
// =============================================================================
NotificationBasic {
icon: 'recording_sign'
message: Utils.basename(notificationData.filePath)
handler: (function () {
Qt.openUrlExternally(Utils.dirname(
Utils.getUriFromSystemPath(notificationData.filePath)
))
})
}
......@@ -4,7 +4,7 @@ import Utils 1.0
NotificationBasic {
icon: 'snapshot_sign'
message: notificationData.filePath
message: Utils.basename(notificationData.filePath)
handler: (function () {
Qt.openUrlExternally(Utils.dirname(
Utils.getUriFromSystemPath(notificationData.filePath)
......
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