diff --git a/assets/images/snapshot_sign.svg b/assets/images/snapshot_sign.svg new file mode 100644 index 000000000..66c70f42f --- /dev/null +++ b/assets/images/snapshot_sign.svg @@ -0,0 +1,13 @@ + + + + download_ended + Created with Sketch. + + + + + + + + \ No newline at end of file diff --git a/resources.qrc b/resources.qrc index 3c5fd65f3..668e6374e 100644 --- a/resources.qrc +++ b/resources.qrc @@ -170,6 +170,7 @@ assets/images/settings_sip_accounts_selected.svg assets/images/settings_video_normal.svg assets/images/settings_video_selected.svg + assets/images/snapshot_sign.svg assets/images/speaker_off_hovered.svg assets/images/speaker_off_normal.svg assets/images/speaker_off_pressed.svg @@ -326,11 +327,13 @@ ui/modules/Linphone/Contact/Contact.qml ui/modules/Linphone/Contact/MessagesCounter.qml ui/modules/Linphone/Menus/SipAddressesMenu.qml + ui/modules/Linphone/Notifications/NotificationBasic.qml ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml ui/modules/Linphone/Notifications/Notification.qml ui/modules/Linphone/Notifications/NotificationReceivedCall.qml ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml + ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml ui/modules/Linphone/Presence/PresenceLevel.qml ui/modules/Linphone/qmldir ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml @@ -348,10 +351,11 @@ ui/modules/Linphone/Styles/Contact/ContactStyle.qml ui/modules/Linphone/Styles/Contact/MessagesCounterStyle.qml ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml - ui/modules/Linphone/Styles/Notifications/NotificationNewVersionAvailableStyle.qml + ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml + ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml ui/modules/Linphone/Styles/qmldir ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml diff --git a/src/components/call/CallModel.cpp b/src/components/call/CallModel.cpp index 67678fd42..d489dc88e 100644 --- a/src/components/call/CallModel.cpp +++ b/src/components/call/CallModel.cpp @@ -185,11 +185,9 @@ void CallModel::takeSnapshot () { qInfo() << QStringLiteral("Take snapshot of call:") << this; - mCall->takeVideoSnapshot( - ::Utils::appStringToCoreString( - CoreManager::getInstance()->getSettingsModel()->getSavedScreenshotsFolder() + newName - ) - ); + const QString filePath = CoreManager::getInstance()->getSettingsModel()->getSavedScreenshotsFolder() + newName; + mCall->takeVideoSnapshot(::Utils::appStringToCoreString(filePath)); + App::getInstance()->getNotifier()->notifySnapshotWasTaken(filePath); } void CallModel::startRecording () { diff --git a/src/components/notifier/Notifier.cpp b/src/components/notifier/Notifier.cpp index 91e57ac02..67c76ef18 100644 --- a/src/components/notifier/Notifier.cpp +++ b/src/components/notifier/Notifier.cpp @@ -75,30 +75,27 @@ void setProperty (QObject &object, const char *property, const T &value) { // ============================================================================= const QHash Notifier::mNotifications = { - { Notifier::ReceivedMessage, { "NotificationReceivedMessage.qml", 10000 } }, - { Notifier::ReceivedFileMessage, { "NotificationReceivedFileMessage.qml", 10000 } }, - { Notifier::ReceivedCall, { "NotificationReceivedCall.qml", 30000 } }, - { Notifier::NewVersionAvailable, { "NotificationNewVersionAvailable.qml", 30000 } } + { Notifier::ReceivedMessage, { "NotificationReceivedMessage.qml", 10 } }, + { Notifier::ReceivedFileMessage, { "NotificationReceivedFileMessage.qml", 10 } }, + { Notifier::ReceivedCall, { "NotificationReceivedCall.qml", 30 } }, + { Notifier::NewVersionAvailable, { "NotificationNewVersionAvailable.qml", 30 } }, + { Notifier::SnapshotWasTaken, { "NotificationSnapshotWasTaken.qml", 10 } } }; // ----------------------------------------------------------------------------- Notifier::Notifier (QObject *parent) : QObject(parent) { - // Build components. const int nComponents = mNotifications.size(); mComponents = new QQmlComponent *[nComponents]; QQmlEngine *engine = App::getInstance()->getEngine(); - for (const auto &key : mNotifications.keys()) - mComponents[key] = new QQmlComponent(engine, QUrl(NOTIFICATIONS_PATH + Notifier::mNotifications[key].filename)); - - // Check errors. - for (int i = 0; i < nComponents; ++i) { - QQmlComponent *component = mComponents[i]; - if (component->isError()) { - qWarning() << QStringLiteral("Errors found in `Notification` component %1:").arg(i) << component->errors(); + for (const auto &key : mNotifications.keys()) { + QQmlComponent *component = new QQmlComponent(engine, QUrl(NOTIFICATIONS_PATH + Notifier::mNotifications[key].filename)); + if (Q_UNLIKELY(component->isError())) { + qWarning() << QStringLiteral("Errors found in `Notification` component %1:").arg(key) << component->errors(); abort(); } + mComponents[key] = component; } mMutex = new QMutex(); @@ -217,7 +214,7 @@ void Notifier::deleteNotification (QVariant notification) { QObject * notification = createNotification(TYPE); \ if (!notification) \ return; \ - const int timeout = mNotifications[TYPE].timeout; + const int timeout = mNotifications[TYPE].timeout * 1000; #define SHOW_NOTIFICATION(DATA) \ ::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, DATA); \ @@ -277,5 +274,14 @@ void Notifier::notifyNewVersionAvailable (const QString &version, const QString SHOW_NOTIFICATION(map); } +void Notifier::notifySnapshotWasTaken (const QString &filePath) { + CREATE_NOTIFICATION(Notifier::SnapshotWasTaken); + + QVariantMap map; + map["filePath"] = filePath; + + SHOW_NOTIFICATION(map); +} + #undef SHOW_NOTIFICATION #undef CREATE_NOTIFICATION diff --git a/src/components/notifier/Notifier.hpp b/src/components/notifier/Notifier.hpp index 8a11d8509..855882749 100644 --- a/src/components/notifier/Notifier.hpp +++ b/src/components/notifier/Notifier.hpp @@ -42,13 +42,15 @@ public: ReceivedMessage, ReceivedFileMessage, ReceivedCall, - NewVersionAvailable + NewVersionAvailable, + SnapshotWasTaken }; void notifyReceivedMessage (const std::shared_ptr &message); void notifyReceivedFileMessage (const std::shared_ptr &message); void notifyReceivedCall (const std::shared_ptr &call); void notifyNewVersionAvailable (const QString &version, const QString &url); + void notifySnapshotWasTaken (const QString &filePath); public slots: void deleteNotification (QVariant notification); diff --git a/ui/modules/Linphone/Notifications/Notification.qml b/ui/modules/Linphone/Notifications/Notification.qml index 5c209402a..8594788e1 100644 --- a/ui/modules/Linphone/Notifications/Notification.qml +++ b/ui/modules/Linphone/Notifications/Notification.qml @@ -1,13 +1,17 @@ import QtQuick 2.7 import Common 1.0 +import Linphone.Styles 1.0 // ============================================================================= DesktopPopup { id: notification + property alias icon: iconSign.icon property var notificationData: ({}) + property int overrodeHeight + default property alias _content: content.data signal deleteNotification (var notification) @@ -23,4 +27,32 @@ DesktopPopup { return (Qt.FramelessWindowHint | Qt.WindowStaysOnTopHint) | (Qt.platform.os === 'osx' ? Qt.Window : Qt.Popup) } + + Rectangle { + color: NotificationStyle.color + height: overrodeHeight || NotificationStyle.height + width: NotificationStyle.width + + border { + color: NotificationStyle.border.color + width: NotificationStyle.border.width + } + + Item { + id: content + + anchors.fill: parent + } + Icon { + id: iconSign + + anchors { + left: parent.left + top: parent.top + } + + iconSize: NotificationStyle.iconSize + } + + } } diff --git a/ui/modules/Linphone/Notifications/NotificationBasic.qml b/ui/modules/Linphone/Notifications/NotificationBasic.qml new file mode 100644 index 000000000..c2ec8cd5f --- /dev/null +++ b/ui/modules/Linphone/Notifications/NotificationBasic.qml @@ -0,0 +1,45 @@ +import QtQuick 2.7 + +import Common 1.0 +import Linphone.Styles 1.0 + +// ============================================================================= + +Notification { + id: notification + + property string message + property var handler: (function () {}) + + overrodeHeight: NotificationBasicStyle.overrodeHeight + + // --------------------------------------------------------------------------- + + Loader { + active: Boolean(notification.message) + anchors { + fill: parent + + leftMargin: NotificationBasicStyle.leftMargin + rightMargin: NotificationBasicStyle.rightMargin + } + + sourceComponent: Text { + anchors.fill: parent + + color: NotificationBasicStyle.message.color + font.pointSize: NotificationBasicStyle.message.pointSize + text: notification.message + verticalAlignment: Text.AlignVCenter + wrapMode: Text.Wrap + + MouseArea { + anchors.fill: parent + cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true + + onClicked: notification._close(notification.handler) + } + } + } +} diff --git a/ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml b/ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml index d4abaafd5..834b6e28c 100644 --- a/ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml +++ b/ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml @@ -1,61 +1,7 @@ -import QtQuick 2.7 -import QtQuick.Layouts 1.3 - -import Common 1.0 -import Linphone 1.0 -import Linphone.Styles 1.0 -import Utils 1.0 - -// ============================================================================= - -Notification { - id: notification - - // --------------------------------------------------------------------------- - - Rectangle { - color: NotificationNewVersionAvailableStyle.color - height: NotificationNewVersionAvailableStyle.height - width: NotificationNewVersionAvailableStyle.width - - Icon { - anchors { - left: parent.left - top: parent.top - } - - icon: 'update_sign' - iconSize: NotificationNewVersionAvailableStyle.iconSize - } - - Loader { - active: notificationData.url.length > 0 - anchors { - fill: parent - - leftMargin: NotificationNewVersionAvailableStyle.leftMargin - rightMargin: NotificationNewVersionAvailableStyle.rightMargin - } - - sourceComponent: Text { - anchors.fill: parent - - color: NotificationNewVersionAvailableStyle.message.color - font.pointSize: NotificationNewVersionAvailableStyle.message.pointSize - text: notificationData.message - verticalAlignment: Text.AlignVCenter - wrapMode: Text.Wrap - - MouseArea { - anchors.fill: parent - cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true - - onClicked: notification._close(function () { - Qt.openUrlExternally(notificationData.url) - }) - } - } - } - } +NotificationBasic { + icon: 'update_sign' + message: notificationData.url + handler: (function () { + Qt.openUrlExternally(notificationData.url) + }) } diff --git a/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml b/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml index c1b3c0501..2b66fcad8 100644 --- a/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml +++ b/ui/modules/Linphone/Notifications/NotificationReceivedCall.qml @@ -10,87 +10,73 @@ import Linphone.Styles 1.0 Notification { id: notification - // --------------------------------------------------------------------------- - - property var _call: notificationData && notificationData.call + icon: 'call_sign_incoming' // --------------------------------------------------------------------------- - Rectangle { - color: NotificationReceivedCallStyle.color - height: NotificationReceivedCallStyle.height - width: NotificationReceivedCallStyle.width + readonly property var call: notificationData && notificationData.call - Icon { - anchors { - left: parent.left - top: parent.top - } + // --------------------------------------------------------------------------- - icon: 'call_sign_incoming' - iconSize: NotificationReceivedCallStyle.iconSize + Loader { + active: Boolean(notification.call) + anchors { + fill: parent + + leftMargin: NotificationReceivedCallStyle.leftMargin + rightMargin: NotificationReceivedCallStyle.rightMargin + bottomMargin: NotificationReceivedCallStyle.bottomMargin } - Loader { - active: Boolean(notification._call) - anchors { - fill: parent + sourceComponent: ColumnLayout { + spacing: NotificationReceivedCallStyle.spacing - leftMargin: NotificationReceivedCallStyle.leftMargin - rightMargin: NotificationReceivedCallStyle.rightMargin - bottomMargin: NotificationReceivedCallStyle.bottomMargin + Contact { + Layout.fillWidth: true + + entry: { + var call = notification.call + return SipAddressesModel.getSipAddressObserver(call ? call.sipAddress : '') + } } - sourceComponent: ColumnLayout { - spacing: NotificationReceivedCallStyle.spacing + // --------------------------------------------------------------------- + // Action buttons. + // --------------------------------------------------------------------- - Contact { - Layout.fillWidth: true + Item { + Layout.fillHeight: true + Layout.fillWidth: true - entry: { - var call = notification._call - return SipAddressesModel.getSipAddressObserver(call ? call.sipAddress : '') + ActionBar { + anchors.centerIn: parent + iconSize: NotificationReceivedCallStyle.actionArea.iconSize + + ActionButton { + icon: 'video_call_accept' + + onClicked: notification._close(notification.call.acceptWithVideo) + } + + ActionButton { + icon: 'call_accept' + + onClicked: notification._close(notification.call.accept) } } - // --------------------------------------------------------------------- - // Action buttons. - // --------------------------------------------------------------------- - - Item { - Layout.fillHeight: true - Layout.fillWidth: true - - ActionBar { - anchors.centerIn: parent - iconSize: NotificationReceivedCallStyle.actionArea.iconSize - - ActionButton { - icon: 'video_call_accept' - - onClicked: notification._close(notification._call.acceptWithVideo) - } - - ActionButton { - icon: 'call_accept' - - onClicked: notification._close(notification._call.accept) - } + ActionBar { + anchors { + right: parent.right + rightMargin: NotificationReceivedCallStyle.actionArea.rightButtonsGroupMargin + verticalCenter: parent.verticalCenter } + iconSize: NotificationReceivedCallStyle.actionArea.iconSize - ActionBar { - anchors { - right: parent.right - rightMargin: NotificationReceivedCallStyle.actionArea.rightButtonsGroupMargin - verticalCenter: parent.verticalCenter - } - iconSize: NotificationReceivedCallStyle.actionArea.iconSize + ActionButton { + icon: 'hangup' - ActionButton { - icon: 'hangup' - - onClicked: notification._close(notification._call.terminate) - } + onClicked: notification._close(notification.call.terminate) } } } diff --git a/ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml b/ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml index 26740bf99..2ca3cfdfd 100644 --- a/ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml +++ b/ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml @@ -2,7 +2,6 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 import Common 1.0 -import Linphone 1.0 import Linphone.Styles 1.0 import Utils 1.0 @@ -11,72 +10,59 @@ import Utils 1.0 Notification { id: notification - // --------------------------------------------------------------------------- - - property string _fileUri: notificationData && notificationData.fileUri || '' + icon: 'file_sign' + overrodeHeight: NotificationReceivedFileMessageStyle.overrodeHeight // --------------------------------------------------------------------------- - Rectangle { - color: NotificationReceivedFileMessageStyle.color - height: NotificationReceivedFileMessageStyle.height - width: NotificationReceivedFileMessageStyle.width + readonly property string fileUri: notificationData && notificationData.fileUri || '' - Icon { - anchors { - left: parent.left - top: parent.top - } + // --------------------------------------------------------------------------- - icon: 'file_sign' - iconSize: NotificationReceivedFileMessageStyle.iconSize + Loader { + active: Boolean(notification.fileUri) + anchors { + fill: parent + + leftMargin: NotificationReceivedFileMessageStyle.leftMargin + rightMargin: NotificationReceivedFileMessageStyle.rightMargin } - Loader { - active: notification._fileUri.length > 0 - anchors { - fill: parent + sourceComponent: RowLayout { + anchors.fill: parent + spacing: NotificationReceivedFileMessageStyle.spacing - leftMargin: NotificationReceivedFileMessageStyle.leftMargin - rightMargin: NotificationReceivedFileMessageStyle.rightMargin + Text { + Layout.fillWidth: true + + color: NotificationReceivedFileMessageStyle.fileName.color + elide: Text.ElideRight + font.pointSize: NotificationReceivedFileMessageStyle.fileName.pointSize + text: Utils.basename(notification.fileUri) } - sourceComponent: RowLayout { - anchors.fill: parent - spacing: NotificationReceivedFileMessageStyle.spacing + Text { + Layout.preferredWidth: NotificationReceivedFileMessageStyle.fileSize.width - Text { - Layout.fillWidth: true + color: NotificationReceivedFileMessageStyle.fileSize.color + elide: Text.ElideRight + font.pointSize: NotificationReceivedFileMessageStyle.fileSize.pointSize + horizontalAlignment: Text.AlignRight + text: Utils.formatSize(notification.notificationData.fileSize) + } + } - color: NotificationReceivedFileMessageStyle.fileName.color - elide: Text.ElideRight - font.pointSize: NotificationReceivedFileMessageStyle.fileName.pointSize - text: Utils.basename(notification._fileUri) + MouseArea { + anchors.fill: parent + cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true + + onClicked: notification._close(function () { + var uri = Utils.getUriFromSystemPath(notification.fileUri) + if (!Qt.openUrlExternally(uri)) { + Qt.openUrlExternally(Utils.dirname(uri)) } - - Text { - Layout.preferredWidth: NotificationReceivedFileMessageStyle.fileSize.width - - color: NotificationReceivedFileMessageStyle.fileSize.color - elide: Text.ElideRight - font.pointSize: NotificationReceivedFileMessageStyle.fileSize.pointSize - horizontalAlignment: Text.AlignRight - text: Utils.formatSize(notification.notificationData.fileSize) - } - } - - MouseArea { - anchors.fill: parent - cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true - - onClicked: notification._close(function () { - var uri = Utils.getUriFromSystemPath(notification._fileUri) - if (!Qt.openUrlExternally(uri)) { - Qt.openUrlExternally(Utils.dirname(uri)) - } - }) - } + }) } } } diff --git a/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml b/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml index 0e063562b..f167f0db2 100644 --- a/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml +++ b/ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml @@ -10,85 +10,71 @@ import Linphone.Styles 1.0 Notification { id: notification - // --------------------------------------------------------------------------- - - property string _sipAddress: notificationData && notificationData.sipAddress || '' + icon: 'message_sign' // --------------------------------------------------------------------------- - Rectangle { - color: NotificationReceivedMessageStyle.color - height: NotificationReceivedMessageStyle.height - width: NotificationReceivedMessageStyle.width + readonly property string sipAddress: notificationData && notificationData.sipAddress || '' - Icon { - anchors { - left: parent.left - top: parent.top - } + // --------------------------------------------------------------------------- - icon: 'message_sign' - iconSize: NotificationReceivedMessageStyle.iconSize + Loader { + active: Boolean(notification.sipAddress) + anchors { + fill: parent + + leftMargin: NotificationReceivedMessageStyle.leftMargin + rightMargin: NotificationReceivedMessageStyle.rightMargin + bottomMargin: NotificationReceivedMessageStyle.bottomMargin } - Loader { - active: notification._sipAddress.length > 0 - anchors { - fill: parent + sourceComponent: ColumnLayout { + spacing: NotificationReceivedMessageStyle.spacing - leftMargin: NotificationReceivedMessageStyle.leftMargin - rightMargin: NotificationReceivedMessageStyle.rightMargin - bottomMargin: NotificationReceivedMessageStyle.bottomMargin + Contact { + Layout.fillWidth: true + + entry: SipAddressesModel.getSipAddressObserver(notification.sipAddress) } - sourceComponent: ColumnLayout { - spacing: NotificationReceivedMessageStyle.spacing + Rectangle { + Layout.fillHeight: true + Layout.fillWidth: true - Contact { - Layout.fillWidth: true + color: NotificationReceivedMessageStyle.messageContainer.color + radius: NotificationReceivedMessageStyle.messageContainer.radius - entry: SipAddressesModel.getSipAddressObserver(notification._sipAddress) - } - - Rectangle { - Layout.fillHeight: true - Layout.fillWidth: true - - color: NotificationReceivedMessageStyle.messageContainer.color - radius: NotificationReceivedMessageStyle.messageContainer.radius - - Text { - anchors { - fill: parent - margins: NotificationReceivedMessageStyle.messageContainer.margins - } - - color: NotificationReceivedMessageStyle.messageContainer.text.color - elide: Text.ElideRight - - font { - italic: true - pointSize: NotificationReceivedMessageStyle.messageContainer.text.pointSize - } - - verticalAlignment: Text.AlignVCenter - text: notification.notificationData.message - wrapMode: Text.Wrap + Text { + anchors { + fill: parent + margins: NotificationReceivedMessageStyle.messageContainer.margins } + + color: NotificationReceivedMessageStyle.messageContainer.text.color + elide: Text.ElideRight + + font { + italic: true + pointSize: NotificationReceivedMessageStyle.messageContainer.text.pointSize + } + + verticalAlignment: Text.AlignVCenter + text: notification.notificationData.message + wrapMode: Text.Wrap } } } - - MouseArea { - anchors.fill: parent - cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true - - onClicked: notification._close(function () { - notification.notificationData.window.setView('Conversation', { - sipAddress: notification._sipAddress - }) - }) - } + } + + MouseArea { + anchors.fill: parent + cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true + + onClicked: notification._close(function () { + notification.notificationData.window.setView('Conversation', { + sipAddress: notification.sipAddress + }) + }) } } diff --git a/ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml b/ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml new file mode 100644 index 000000000..38d135ece --- /dev/null +++ b/ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml @@ -0,0 +1,13 @@ +import Utils 1.0 + +// ============================================================================= + +NotificationBasic { + icon: 'snapshot_sign' + message: notificationData.filePath + handler: (function () { + Qt.openUrlExternally(Utils.dirname( + Utils.getUriFromSystemPath(notificationData.filePath) + )) + }) +} diff --git a/ui/modules/Linphone/Styles/Notifications/NotificationNewVersionAvailableStyle.qml b/ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml similarity index 75% rename from ui/modules/Linphone/Styles/Notifications/NotificationNewVersionAvailableStyle.qml rename to ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml index 24b59d394..fcc16bdff 100644 --- a/ui/modules/Linphone/Styles/Notifications/NotificationNewVersionAvailableStyle.qml +++ b/ui/modules/Linphone/Styles/Notifications/NotificationBasicStyle.qml @@ -7,12 +7,9 @@ import Units 1.0 // ============================================================================= QtObject { - property color color: Colors.k - property int height: 55 - property int iconSize: 40 property int leftMargin: 30 property int rightMargin: 15 - property int width: 300 + property int overrodeHeight: 55 property QtObject message: QtObject { property color color: Colors.h diff --git a/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml b/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml index b47faf7d5..03a3b6e43 100644 --- a/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml +++ b/ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml @@ -1,16 +1,10 @@ pragma Singleton import QtQml 2.2 -import Colors 1.0 - // ============================================================================= QtObject { - property color color: Colors.k - property int height: 120 - property int iconSize: 40 property int spacing: 0 - property int width: 300 property int bottomMargin: 15 property int leftMargin: 15 property int rightMargin: 15 diff --git a/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml b/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml index 2eab8686d..b7782a5eb 100644 --- a/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml +++ b/ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml @@ -8,12 +8,10 @@ import Units 1.0 QtObject { property color color: Colors.k - property int height: 55 - property int iconSize: 40 property int leftMargin: 25 + property int overrodeHeight: 55 property int rightMargin: 15 property int spacing: 10 - property int width: 300 property QtObject fileName: QtObject { property color color: Colors.h diff --git a/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml b/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml index c72a0c7fe..6854b9ab2 100644 --- a/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml +++ b/ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml @@ -9,12 +9,10 @@ import Units 1.0 QtObject { property color color: Colors.k property int bottomMargin: 15 - property int iconSize: 40 property int leftMargin: 15 + property int overrodeHeight: 55 property int rightMargin: 15 property int spacing: 0 - property int width: 300 - property int height: 120 property QtObject messageContainer: QtObject { property color color: Colors.m diff --git a/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml b/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml new file mode 100644 index 000000000..17c4fd55a --- /dev/null +++ b/ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml @@ -0,0 +1,18 @@ +pragma Singleton +import QtQml 2.2 + +import Colors 1.0 + +// ============================================================================= + +QtObject { + property color color: Colors.k + property int height: 120 + property int iconSize: 40 + property int width: 300 + + property QtObject border: QtObject { + property color color: Colors.w + property int width: 1 + } +} diff --git a/ui/modules/Linphone/Styles/qmldir b/ui/modules/Linphone/Styles/qmldir index 0c5a7ec68..8b2c423b6 100644 --- a/ui/modules/Linphone/Styles/qmldir +++ b/ui/modules/Linphone/Styles/qmldir @@ -25,10 +25,11 @@ singleton MessagesCounterStyle 1.0 Contact/MessagesCounterStyle. singleton SipAddressesMenuStyle 1.0 Menus/SipAddressesMenuStyle.qml -singleton NotificationNewVersionAvailableStyle 1.0 Notifications/NotificationNewVersionAvailableStyle.qml +singleton NotificationBasicStyle 1.0 Notifications/NotificationBasicStyle.qml singleton NotificationReceivedCallStyle 1.0 Notifications/NotificationReceivedCallStyle.qml -singleton NotificationReceivedMessageStyle 1.0 Notifications/NotificationReceivedMessageStyle.qml singleton NotificationReceivedFileMessageStyle 1.0 Notifications/NotificationReceivedFileMessageStyle.qml +singleton NotificationReceivedMessageStyle 1.0 Notifications/NotificationReceivedMessageStyle.qml +singleton NotificationStyle 1.0 Notifications/NotificationStyle.qml singleton TelKeypadStyle 1.0 TelKeypad/TelKeypadStyle.qml diff --git a/ui/scripts/Utils/utils.js b/ui/scripts/Utils/utils.js index 081b599d5..5fa3a2335 100644 --- a/ui/scripts/Utils/utils.js +++ b/ui/scripts/Utils/utils.js @@ -287,6 +287,10 @@ function assert (condition, message) { // ----------------------------------------------------------------------------- function basename (str) { + if (!str) { + return '' + } + if (runOnWindows()) { str = str.replace(/\\/g, '/') } @@ -310,6 +314,10 @@ function capitalizeFirstLetter (str) { // ----------------------------------------------------------------------------- function dirname (str) { + if (!str) { + return '' + } + if (runOnWindows()) { str = str.replace(/\\/g, '/') }