Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
63ea842f
Commit
63ea842f
authored
Jun 27, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Notifications): REEEEEEFACTORING. (And supports snapshot notification.)
parent
ed53593e
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
299 additions
and
268 deletions
+299
-268
snapshot_sign.svg
assets/images/snapshot_sign.svg
+13
-0
resources.qrc
resources.qrc
+5
-1
CallModel.cpp
src/components/call/CallModel.cpp
+3
-5
Notifier.cpp
src/components/notifier/Notifier.cpp
+20
-14
Notifier.hpp
src/components/notifier/Notifier.hpp
+3
-1
Notification.qml
ui/modules/Linphone/Notifications/Notification.qml
+32
-0
NotificationBasic.qml
ui/modules/Linphone/Notifications/NotificationBasic.qml
+45
-0
NotificationNewVersionAvailable.qml
...inphone/Notifications/NotificationNewVersionAvailable.qml
+6
-60
NotificationReceivedCall.qml
...dules/Linphone/Notifications/NotificationReceivedCall.qml
+45
-59
NotificationReceivedFileMessage.qml
...inphone/Notifications/NotificationReceivedFileMessage.qml
+38
-52
NotificationReceivedMessage.qml
...es/Linphone/Notifications/NotificationReceivedMessage.qml
+44
-58
NotificationSnapshotWasTaken.qml
...s/Linphone/Notifications/NotificationSnapshotWasTaken.qml
+13
-0
NotificationBasicStyle.qml
.../Linphone/Styles/Notifications/NotificationBasicStyle.qml
+1
-4
NotificationReceivedCallStyle.qml
...ne/Styles/Notifications/NotificationReceivedCallStyle.qml
+0
-6
NotificationReceivedFileMessageStyle.qml
...es/Notifications/NotificationReceivedFileMessageStyle.qml
+1
-3
NotificationReceivedMessageStyle.qml
...Styles/Notifications/NotificationReceivedMessageStyle.qml
+1
-3
NotificationStyle.qml
...dules/Linphone/Styles/Notifications/NotificationStyle.qml
+18
-0
qmldir
ui/modules/Linphone/Styles/qmldir
+3
-2
utils.js
ui/scripts/Utils/utils.js
+8
-0
No files found.
assets/images/snapshot_sign.svg
0 → 100644
View file @
63ea842f
<?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>
</g>
</svg>
\ No newline at end of file
resources.qrc
View file @
63ea842f
...
@@ -170,6 +170,7 @@
...
@@ -170,6 +170,7 @@
<file>
assets/images/settings_sip_accounts_selected.svg
</file>
<file>
assets/images/settings_sip_accounts_selected.svg
</file>
<file>
assets/images/settings_video_normal.svg
</file>
<file>
assets/images/settings_video_normal.svg
</file>
<file>
assets/images/settings_video_selected.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>
<file>
assets/images/speaker_off_hovered.svg
</file>
<file>
assets/images/speaker_off_normal.svg
</file>
<file>
assets/images/speaker_off_normal.svg
</file>
<file>
assets/images/speaker_off_pressed.svg
</file>
<file>
assets/images/speaker_off_pressed.svg
</file>
...
@@ -326,11 +327,13 @@
...
@@ -326,11 +327,13 @@
<file>
ui/modules/Linphone/Contact/Contact.qml
</file>
<file>
ui/modules/Linphone/Contact/Contact.qml
</file>
<file>
ui/modules/Linphone/Contact/MessagesCounter.qml
</file>
<file>
ui/modules/Linphone/Contact/MessagesCounter.qml
</file>
<file>
ui/modules/Linphone/Menus/SipAddressesMenu.qml
</file>
<file>
ui/modules/Linphone/Menus/SipAddressesMenu.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationBasic.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml
</file>
<file>
ui/modules/Linphone/Notifications/Notification.qml
</file>
<file>
ui/modules/Linphone/Notifications/Notification.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationReceivedCall.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationReceivedCall.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml
</file>
<file>
ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml
</file>
<file>
ui/modules/Linphone/Presence/PresenceLevel.qml
</file>
<file>
ui/modules/Linphone/Presence/PresenceLevel.qml
</file>
<file>
ui/modules/Linphone/qmldir
</file>
<file>
ui/modules/Linphone/qmldir
</file>
<file>
ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml
</file>
<file>
ui/modules/Linphone/SmartSearchBar/SmartSearchBar.qml
</file>
...
@@ -348,10 +351,11 @@
...
@@ -348,10 +351,11 @@
<file>
ui/modules/Linphone/Styles/Contact/ContactStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Contact/ContactStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Contact/MessagesCounterStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Contact/MessagesCounterStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/Notification
NewVersionAvailable
Style.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/Notification
Basic
Style.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/qmldir
</file>
<file>
ui/modules/Linphone/Styles/qmldir
</file>
<file>
ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/TelKeypad/TelKeypadStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Timeline/TimelineStyle.qml
</file>
...
...
src/components/call/CallModel.cpp
View file @
63ea842f
...
@@ -185,11 +185,9 @@ void CallModel::takeSnapshot () {
...
@@ -185,11 +185,9 @@ void CallModel::takeSnapshot () {
qInfo
()
<<
QStringLiteral
(
"Take snapshot of call:"
)
<<
this
;
qInfo
()
<<
QStringLiteral
(
"Take snapshot of call:"
)
<<
this
;
mCall
->
takeVideoSnapshot
(
const
QString
filePath
=
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getSavedScreenshotsFolder
()
+
newName
;
::
Utils
::
appStringToCoreString
(
mCall
->
takeVideoSnapshot
(
::
Utils
::
appStringToCoreString
(
filePath
));
CoreManager
::
getInstance
()
->
getSettingsModel
()
->
getSavedScreenshotsFolder
()
+
newName
App
::
getInstance
()
->
getNotifier
()
->
notifySnapshotWasTaken
(
filePath
);
)
);
}
}
void
CallModel
::
startRecording
()
{
void
CallModel
::
startRecording
()
{
...
...
src/components/notifier/Notifier.cpp
View file @
63ea842f
...
@@ -75,30 +75,27 @@ void setProperty (QObject &object, const char *property, const T &value) {
...
@@ -75,30 +75,27 @@ void setProperty (QObject &object, const char *property, const T &value) {
// =============================================================================
// =============================================================================
const
QHash
<
int
,
Notifier
::
Notification
>
Notifier
::
mNotifications
=
{
const
QHash
<
int
,
Notifier
::
Notification
>
Notifier
::
mNotifications
=
{
{
Notifier
::
ReceivedMessage
,
{
"NotificationReceivedMessage.qml"
,
10000
}
},
{
Notifier
::
ReceivedMessage
,
{
"NotificationReceivedMessage.qml"
,
10
}
},
{
Notifier
::
ReceivedFileMessage
,
{
"NotificationReceivedFileMessage.qml"
,
10000
}
},
{
Notifier
::
ReceivedFileMessage
,
{
"NotificationReceivedFileMessage.qml"
,
10
}
},
{
Notifier
::
ReceivedCall
,
{
"NotificationReceivedCall.qml"
,
30000
}
},
{
Notifier
::
ReceivedCall
,
{
"NotificationReceivedCall.qml"
,
30
}
},
{
Notifier
::
NewVersionAvailable
,
{
"NotificationNewVersionAvailable.qml"
,
30000
}
}
{
Notifier
::
NewVersionAvailable
,
{
"NotificationNewVersionAvailable.qml"
,
30
}
},
{
Notifier
::
SnapshotWasTaken
,
{
"NotificationSnapshotWasTaken.qml"
,
10
}
}
};
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
Notifier
::
Notifier
(
QObject
*
parent
)
:
QObject
(
parent
)
{
Notifier
::
Notifier
(
QObject
*
parent
)
:
QObject
(
parent
)
{
// Build components.
const
int
nComponents
=
mNotifications
.
size
();
const
int
nComponents
=
mNotifications
.
size
();
mComponents
=
new
QQmlComponent
*
[
nComponents
];
mComponents
=
new
QQmlComponent
*
[
nComponents
];
QQmlEngine
*
engine
=
App
::
getInstance
()
->
getEngine
();
QQmlEngine
*
engine
=
App
::
getInstance
()
->
getEngine
();
for
(
const
auto
&
key
:
mNotifications
.
keys
())
for
(
const
auto
&
key
:
mNotifications
.
keys
())
{
mComponents
[
key
]
=
new
QQmlComponent
(
engine
,
QUrl
(
NOTIFICATIONS_PATH
+
Notifier
::
mNotifications
[
key
].
filename
));
QQmlComponent
*
component
=
new
QQmlComponent
(
engine
,
QUrl
(
NOTIFICATIONS_PATH
+
Notifier
::
mNotifications
[
key
].
filename
));
if
(
Q_UNLIKELY
(
component
->
isError
()))
{
// Check errors.
qWarning
()
<<
QStringLiteral
(
"Errors found in `Notification` component %1:"
).
arg
(
key
)
<<
component
->
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
();
abort
();
abort
();
}
}
mComponents
[
key
]
=
component
;
}
}
mMutex
=
new
QMutex
();
mMutex
=
new
QMutex
();
...
@@ -217,7 +214,7 @@ void Notifier::deleteNotification (QVariant notification) {
...
@@ -217,7 +214,7 @@ void Notifier::deleteNotification (QVariant notification) {
QObject * notification = createNotification(TYPE); \
QObject * notification = createNotification(TYPE); \
if (!notification) \
if (!notification) \
return; \
return; \
const int timeout = mNotifications[TYPE].timeout;
const int timeout = mNotifications[TYPE].timeout
* 1000
;
#define SHOW_NOTIFICATION(DATA) \
#define SHOW_NOTIFICATION(DATA) \
::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, DATA); \
::setProperty(*notification, NOTIFICATION_PROPERTY_DATA, DATA); \
...
@@ -277,5 +274,14 @@ void Notifier::notifyNewVersionAvailable (const QString &version, const QString
...
@@ -277,5 +274,14 @@ void Notifier::notifyNewVersionAvailable (const QString &version, const QString
SHOW_NOTIFICATION
(
map
);
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 SHOW_NOTIFICATION
#undef CREATE_NOTIFICATION
#undef CREATE_NOTIFICATION
src/components/notifier/Notifier.hpp
View file @
63ea842f
...
@@ -42,13 +42,15 @@ public:
...
@@ -42,13 +42,15 @@ public:
ReceivedMessage
,
ReceivedMessage
,
ReceivedFileMessage
,
ReceivedFileMessage
,
ReceivedCall
,
ReceivedCall
,
NewVersionAvailable
NewVersionAvailable
,
SnapshotWasTaken
};
};
void
notifyReceivedMessage
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
notifyReceivedMessage
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
notifyReceivedFileMessage
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
notifyReceivedFileMessage
(
const
std
::
shared_ptr
<
linphone
::
ChatMessage
>
&
message
);
void
notifyReceivedCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
notifyReceivedCall
(
const
std
::
shared_ptr
<
linphone
::
Call
>
&
call
);
void
notifyNewVersionAvailable
(
const
QString
&
version
,
const
QString
&
url
);
void
notifyNewVersionAvailable
(
const
QString
&
version
,
const
QString
&
url
);
void
notifySnapshotWasTaken
(
const
QString
&
filePath
);
public
slots
:
public
slots
:
void
deleteNotification
(
QVariant
notification
);
void
deleteNotification
(
QVariant
notification
);
...
...
ui/modules/Linphone/Notifications/Notification.qml
View file @
63ea842f
import
QtQuick
2.7
import
QtQuick
2.7
import
Common
1.0
import
Common
1.0
import
Linphone
.
Styles
1.0
// =============================================================================
// =============================================================================
DesktopPopup
{
DesktopPopup
{
id
:
notification
id
:
notification
property
alias
icon
:
iconSign
.
icon
property
var
notificationData
:
({})
property
var
notificationData
:
({})
property
int
overrodeHeight
default
property
alias
_content
:
content
.
data
signal
deleteNotification
(
var
notification
)
signal
deleteNotification
(
var
notification
)
...
@@ -23,4 +27,32 @@ DesktopPopup {
...
@@ -23,4 +27,32 @@ DesktopPopup {
return
(
Qt
.
FramelessWindowHint
|
Qt
.
WindowStaysOnTopHint
)
|
return
(
Qt
.
FramelessWindowHint
|
Qt
.
WindowStaysOnTopHint
)
|
(
Qt
.
platform
.
os
===
'
osx
'
?
Qt
.
Window
:
Qt
.
Popup
)
(
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
}
}
}
}
ui/modules/Linphone/Notifications/NotificationBasic.qml
0 → 100644
View file @
63ea842f
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
)
}
}
}
}
ui/modules/Linphone/Notifications/NotificationNewVersionAvailable.qml
View file @
63ea842f
import
QtQuick
2.7
NotificationBasic
{
import
QtQuick
.
Layouts
1.3
icon
:
'
update_sign
'
message
:
notificationData
.
url
import
Common
1.0
handler
:
(
function
()
{
import
Linphone
1.0
Qt
.
openUrlExternally
(
notificationData
.
url
)
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
)
})
}
}
}
}
}
}
ui/modules/Linphone/Notifications/NotificationReceivedCall.qml
View file @
63ea842f
...
@@ -10,87 +10,73 @@ import Linphone.Styles 1.0
...
@@ -10,87 +10,73 @@ import Linphone.Styles 1.0
Notification
{
Notification
{
id
:
notification
id
:
notification
icon
:
'
call_sign_incoming
'
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
var
_
call
:
notificationData
&&
notificationData
.
call
readonly
property
var
call
:
notificationData
&&
notificationData
.
call
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Rectangle
{
Loader
{
color
:
NotificationReceivedCallStyle
.
color
active
:
Boolean
(
notification
.
call
)
height
:
NotificationReceivedCallStyle
.
height
anchors
{
width
:
NotificationReceivedCallStyle
.
width
fill
:
parent
Icon
{
anchors
{
left
:
parent
.
left
top
:
parent
.
top
}
icon
:
'
call_sign_incoming
'
leftMargin
:
NotificationReceivedCallStyle
.
leftMargin
iconSize
:
NotificationReceivedCallStyle
.
iconSize
rightMargin
:
NotificationReceivedCallStyle
.
rightMargin
bottomMargin
:
NotificationReceivedCallStyle
.
bottomMargin
}
}
Loader
{
sourceComponent
:
ColumnLayout
{
active
:
Boolean
(
notification
.
_call
)
spacing
:
NotificationReceivedCallStyle
.
spacing
anchors
{
fill
:
parent
leftMargin
:
NotificationReceivedCallStyle
.
leftMargin
rightMargin
:
NotificationReceivedCallStyle
.
rightMargin
bottomMargin
:
NotificationReceivedCallStyle
.
bottomMargin
}
sourceComponent
:
ColumnLayout
{
spacing
:
NotificationReceivedCallStyle
.
spacing
Contact
{
Contact
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
entry
:
{
entry
:
{
var
call
=
notification
.
_call
var
call
=
notification
.
call
return
SipAddressesModel
.
getSipAddressObserver
(
call
?
call
.
sipAddress
:
''
)
return
SipAddressesModel
.
getSipAddressObserver
(
call
?
call
.
sipAddress
:
''
)
}
}
}
}
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
// Action buttons.
// Action buttons.
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
Item
{
Item
{
Layout.fillHeight
:
true
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Layout.fillWidth
:
true
ActionBar
{
ActionBar
{
anchors.centerIn
:
parent
anchors.centerIn
:
parent
iconSize
:
NotificationReceivedCallStyle
.
actionArea
.
iconSize
iconSize
:
NotificationReceivedCallStyle
.
actionArea
.
iconSize
ActionButton
{
ActionButton
{
icon
:
'
video_call_accept
'
icon
:
'
video_call_accept
'
onClicked
:
notification
.
_close
(
notification
.
_
call
.
acceptWithVideo
)
onClicked
:
notification
.
_close
(
notification
.
call
.
acceptWithVideo
)
}
}
ActionButton
{
ActionButton
{
icon
:
'
call_accept
'
icon
:
'
call_accept
'
onClicked
:
notification
.
_close
(
notification
.
_call
.
accept
)
onClicked
:
notification
.
_close
(
notification
.
call
.
accept
)
}
}
}
}
ActionBar
{
ActionBar
{
anchors
{
anchors
{
right
:
parent
.
right
right
:
parent
.
right
rightMargin
:
NotificationReceivedCallStyle
.
actionArea
.
rightButtonsGroupMargin
rightMargin
:
NotificationReceivedCallStyle
.
actionArea
.
rightButtonsGroupMargin
verticalCenter
:
parent
.
verticalCenter
verticalCenter
:
parent
.
verticalCenter
}
}
iconSize
:
NotificationReceivedCallStyle
.
actionArea
.
iconSize
iconSize
:
NotificationReceivedCallStyle
.
actionArea
.
iconSize
ActionButton
{
ActionButton
{
icon
:
'
hangup
'
icon
:
'
hangup
'
onClicked
:
notification
.
_close
(
notification
.
_call
.
terminate
)
onClicked
:
notification
.
_close
(
notification
.
call
.
terminate
)
}
}
}
}
}
}
}
...
...
ui/modules/Linphone/Notifications/NotificationReceivedFileMessage.qml
View file @
63ea842f
...
@@ -2,7 +2,6 @@ import QtQuick 2.7
...
@@ -2,7 +2,6 @@ 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
Linphone
.
Styles
1.0
import
Linphone
.
Styles
1.0
import
Utils
1.0
import
Utils
1.0
...
@@ -11,72 +10,59 @@ import Utils 1.0
...
@@ -11,72 +10,59 @@ import Utils 1.0
Notification
{
Notification
{
id
:
notification
id
:
notification
icon
:
'
file_sign
'
overrodeHeight
:
NotificationReceivedFileMessageStyle
.
overrodeHeight
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
string
_
fileUri
:
notificationData
&&
notificationData
.
fileUri
||
''
readonly
property
string
fileUri
:
notificationData
&&
notificationData
.
fileUri
||
''
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Rectangle
{
Loader
{
color
:
NotificationReceivedFileMessageStyle
.
color
active
:
Boolean
(
notification
.
fileUri
)
height
:
NotificationReceivedFileMessageStyle
.
height
anchors
{
width
:
NotificationReceivedFileMessageStyle
.
width
fill
:
parent
Icon
{
anchors
{
left
:
parent
.
left
top
:
parent
.
top
}
icon
:
'
file_sign
'
leftMargin
:
NotificationReceivedFileMessageStyle
.
leftMargin
iconSize
:
NotificationReceivedFileMessageStyle
.
iconSize
rightMargin
:
NotificationReceivedFileMessageStyle
.
rightMargin
}
}
Loader
{
sourceComponent
:
RowLayout
{
active
:
notification
.
_fileUri
.
length
>
0
anchors.fill
:
parent
anchors
{
spacing
:
NotificationReceivedFileMessageStyle
.
spacing
fill
:
parent
leftMargin
:
NotificationReceivedFileMessageStyle
.
leftMargin
Text
{
rightMargin
:
NotificationReceivedFileMessageStyle
.
rightMargin
Layout.fillWidth
:
true
}
sourceComponent
:
RowLayout
{
color
:
NotificationReceivedFileMessageStyle
.
fileName
.
color
anchors.fill
:
parent
elide
:
Text
.
ElideRight
spacing
:
NotificationReceivedFileMessageStyle
.
spacing
font.pointSize
:
NotificationReceivedFileMessageStyle
.
fileName
.
pointSize
text
:
Utils
.
basename
(
notification
.
fileUri
)
}
Text
{
Text
{
Layout.fillWidth
:
true
Layout.preferredWidth
:
NotificationReceivedFileMessageStyle
.
fileSize
.
width
color
:
NotificationReceivedFileMessageStyle
.
fileName
.
color
color
:
NotificationReceivedFileMessageStyle
.
fileSize
.
color
elide
:
Text
.
ElideRight
elide
:
Text
.
ElideRight
font.pointSize
:
NotificationReceivedFileMessageStyle
.
fileName
.
pointSize
font.pointSize
:
NotificationReceivedFileMessageStyle
.
fileSize
.
pointSize
text
:
Utils
.
basename
(
notification
.
_fileUri
)
horizontalAlignment
:
Text
.
AlignRight
}
text
:
Utils
.
formatSize
(
notification
.
notificationData
.
fileSize
)
}
}
Text
{
MouseArea
{
Layout.preferredWidth
:
NotificationReceivedFileMessageStyle
.
fileSize
.
width
anchors.fill
:
parent
cursorShape
:
containsMouse
?
Qt
.
PointingHandCursor
:
Qt
.
ArrowCursor
hoverEnabled
:
true
color
:
NotificationReceivedFileMessageStyle
.
fileSize
.
color
onClicked
:
notification
.
_close
(
function
()
{
elide
:
Text
.
ElideRight
var
uri
=
Utils
.
getUriFromSystemPath
(
notification
.
fileUri
)
font.pointSize
:
NotificationReceivedFileMessageStyle
.
fileSize
.
pointSize
if
(
!
Qt
.
openUrlExternally
(
uri
))
{
horizontalAlignment
:
Text
.
AlignRight
Qt
.
openUrlExternally
(
Utils
.
dirname
(
uri
))
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
))
}
})
}
}
}
}
}
}
}
ui/modules/Linphone/Notifications/NotificationReceivedMessage.qml
View file @
63ea842f
...
@@ -10,85 +10,71 @@ import Linphone.Styles 1.0
...
@@ -10,85 +10,71 @@ import Linphone.Styles 1.0
Notification
{
Notification
{
id
:
notification
id
:
notification
icon
:
'
message_sign
'
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property
string
_
sipAddress
:
notificationData
&&
notificationData
.
sipAddress
||
''
readonly
property
string
sipAddress
:
notificationData
&&
notificationData
.
sipAddress
||
''
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
Rectangle
{
Loader
{
color
:
NotificationReceivedMessageStyle
.
color
active
:
Boolean
(
notification
.
sipAddress
)
height
:
NotificationReceivedMessageStyle
.
height
anchors
{
width
:
NotificationReceivedMessageStyle
.
width
fill
:
parent
Icon
{
anchors
{
left
:
parent
.
left
top
:
parent
.
top
}
icon
:
'
message_sign
'
leftMargin
:
NotificationReceivedMessageStyle
.
leftMargin
iconSize
:
NotificationReceivedMessageStyle
.
iconSize
rightMargin
:
NotificationReceivedMessageStyle
.
rightMargin
bottomMargin
:
NotificationReceivedMessageStyle
.
bottomMargin
}
}
Loader
{
sourceComponent
:
ColumnLayout
{
active
:
notification
.
_sipAddress
.
length
>
0
spacing
:
NotificationReceivedMessageStyle
.
spacing
anchors
{
fill
:
parent
leftMargin
:
NotificationReceivedMessageStyle
.
leftMargin
Contact
{
rightMargin
:
NotificationReceivedMessageStyle
.
rightMargin
Layout.fillWidth
:
true
bottomMargin
:
NotificationReceivedMessageStyle
.
bottomMargin
}
sourceComponent
:
ColumnLayout
{
entry
:
SipAddressesModel
.
getSipAddressObserver
(
notification
.
sipAddress
)
spacing
:
NotificationReceivedMessageStyle
.
spacing
}
Contact
{
Layout.fillWidth
:
true
entry
:
SipAddressesModel
.
getSipAddressObserver
(
notification
.
_sipAddress
)
}
Rectangle
{
Layout.fillHeight
:
true
Layout.fillWidth
:
true
color
:
NotificationReceivedMessageStyle
.
messageContainer
.
color
Rectangle
{
radius
:
NotificationReceivedMessageStyle
.
messageContainer
.
radius
Layout.fillHeight
:
true
Layout.fillWidth
:
true
Text
{
color
:
NotificationReceivedMessageStyle
.
messageContainer
.
color
anchors
{
radius
:
NotificationReceivedMessageStyle
.
messageContainer
.
radius
fill
:
parent
margins
:
NotificationReceivedMessageStyle
.
messageContainer
.
margins
}
color
:
NotificationReceivedMessageStyle
.
messageContainer
.
text
.
color
Text
{
elide
:
Text
.
ElideRight
anchors
{
fill
:
parent
margins
:
NotificationReceivedMessageStyle
.
messageContainer
.
margins
}
font
{
color
:
NotificationReceivedMessageStyle
.
messageContainer
.
text
.
color
italic
:
true
elide
:
Text
.
ElideRight
pointSize
:
NotificationReceivedMessageStyle
.
messageContainer
.
text
.
pointSize
}
verticalAlignment
:
Text
.
AlignVCenter
font
{
text
:
notification
.
notificationData
.
messag
e
italic
:
tru
e
wrapMode
:
Text
.
Wrap
pointSize
:
NotificationReceivedMessageStyle
.
messageContainer
.
text
.
pointSize
}
}
verticalAlignment
:
Text
.
AlignVCenter
text
:
notification
.
notificationData
.
message
wrapMode
:
Text
.
Wrap
}
}
}
}
}
}
}
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
cursorShape
:
containsMouse
?
Qt
.
PointingHandCursor
:
Qt
.
ArrowCursor
cursorShape
:
containsMouse
?
Qt
.
PointingHandCursor
:
Qt
.
ArrowCursor
hoverEnabled
:
true
hoverEnabled
:
true
onClicked
:
notification
.
_close
(
function
()
{
onClicked
:
notification
.
_close
(
function
()
{
notification
.
notificationData
.
window
.
setView
(
'
Conversation
'
,
{
notification
.
notificationData
.
window
.
setView
(
'
Conversation
'
,
{
sipAddress
:
notification
.
_sipAddress
sipAddress
:
notification
.
sipAddress
})
})
})
}
}
)
}
}
}
}
ui/modules/Linphone/Notifications/NotificationSnapshotWasTaken.qml
0 → 100644
View file @
63ea842f
import
Utils
1.0
// =============================================================================
NotificationBasic
{
icon
:
'
snapshot_sign
'
message
:
notificationData
.
filePath
handler
:
(
function
()
{
Qt
.
openUrlExternally
(
Utils
.
dirname
(
Utils
.
getUriFromSystemPath
(
notificationData
.
filePath
)
))
})
}
ui/modules/Linphone/Styles/Notifications/Notification
NewVersionAvailable
Style.qml
→
ui/modules/Linphone/Styles/Notifications/Notification
Basic
Style.qml
View file @
63ea842f
...
@@ -7,12 +7,9 @@ import Units 1.0
...
@@ -7,12 +7,9 @@ import Units 1.0
// =============================================================================
// =============================================================================
QtObject
{
QtObject
{
property
color
color
:
Colors
.
k
property
int
height
:
55
property
int
iconSize
:
40
property
int
leftMargin
:
30
property
int
leftMargin
:
30
property
int
rightMargin
:
15
property
int
rightMargin
:
15
property
int
width
:
300
property
int
overrodeHeight
:
55
property
QtObject
message
:
QtObject
{
property
QtObject
message
:
QtObject
{
property
color
color
:
Colors
.
h
property
color
color
:
Colors
.
h
...
...
ui/modules/Linphone/Styles/Notifications/NotificationReceivedCallStyle.qml
View file @
63ea842f
pragma
Singleton
pragma
Singleton
import
QtQml
2.2
import
QtQml
2.2
import
Colors
1.0
// =============================================================================
// =============================================================================
QtObject
{
QtObject
{
property
color
color
:
Colors
.
k
property
int
height
:
120
property
int
iconSize
:
40
property
int
spacing
:
0
property
int
spacing
:
0
property
int
width
:
300
property
int
bottomMargin
:
15
property
int
bottomMargin
:
15
property
int
leftMargin
:
15
property
int
leftMargin
:
15
property
int
rightMargin
:
15
property
int
rightMargin
:
15
...
...
ui/modules/Linphone/Styles/Notifications/NotificationReceivedFileMessageStyle.qml
View file @
63ea842f
...
@@ -8,12 +8,10 @@ import Units 1.0
...
@@ -8,12 +8,10 @@ import Units 1.0
QtObject
{
QtObject
{
property
color
color
:
Colors
.
k
property
color
color
:
Colors
.
k
property
int
height
:
55
property
int
iconSize
:
40
property
int
leftMargin
:
25
property
int
leftMargin
:
25
property
int
overrodeHeight
:
55
property
int
rightMargin
:
15
property
int
rightMargin
:
15
property
int
spacing
:
10
property
int
spacing
:
10
property
int
width
:
300
property
QtObject
fileName
:
QtObject
{
property
QtObject
fileName
:
QtObject
{
property
color
color
:
Colors
.
h
property
color
color
:
Colors
.
h
...
...
ui/modules/Linphone/Styles/Notifications/NotificationReceivedMessageStyle.qml
View file @
63ea842f
...
@@ -9,12 +9,10 @@ import Units 1.0
...
@@ -9,12 +9,10 @@ import Units 1.0
QtObject
{
QtObject
{
property
color
color
:
Colors
.
k
property
color
color
:
Colors
.
k
property
int
bottomMargin
:
15
property
int
bottomMargin
:
15
property
int
iconSize
:
40
property
int
leftMargin
:
15
property
int
leftMargin
:
15
property
int
overrodeHeight
:
55
property
int
rightMargin
:
15
property
int
rightMargin
:
15
property
int
spacing
:
0
property
int
spacing
:
0
property
int
width
:
300
property
int
height
:
120
property
QtObject
messageContainer
:
QtObject
{
property
QtObject
messageContainer
:
QtObject
{
property
color
color
:
Colors
.
m
property
color
color
:
Colors
.
m
...
...
ui/modules/Linphone/Styles/Notifications/NotificationStyle.qml
0 → 100644
View file @
63ea842f
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
}
}
ui/modules/Linphone/Styles/qmldir
View file @
63ea842f
...
@@ -25,10 +25,11 @@ singleton MessagesCounterStyle 1.0 Contact/MessagesCounterStyle.
...
@@ -25,10 +25,11 @@ singleton MessagesCounterStyle 1.0 Contact/MessagesCounterStyle.
singleton SipAddressesMenuStyle 1.0 Menus/SipAddressesMenuStyle.qml
singleton SipAddressesMenuStyle 1.0 Menus/SipAddressesMenuStyle.qml
singleton Notification
NewVersionAvailableStyle 1.0 Notifications/NotificationNewVersionAvailable
Style.qml
singleton Notification
BasicStyle 1.0 Notifications/NotificationBasic
Style.qml
singleton NotificationReceivedCallStyle 1.0 Notifications/NotificationReceivedCallStyle.qml
singleton NotificationReceivedCallStyle 1.0 Notifications/NotificationReceivedCallStyle.qml
singleton NotificationReceivedMessageStyle 1.0 Notifications/NotificationReceivedMessageStyle.qml
singleton NotificationReceivedFileMessageStyle 1.0 Notifications/NotificationReceivedFileMessageStyle.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
singleton TelKeypadStyle 1.0 TelKeypad/TelKeypadStyle.qml
...
...
ui/scripts/Utils/utils.js
View file @
63ea842f
...
@@ -287,6 +287,10 @@ function assert (condition, message) {
...
@@ -287,6 +287,10 @@ function assert (condition, message) {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
function
basename
(
str
)
{
function
basename
(
str
)
{
if
(
!
str
)
{
return
''
}
if
(
runOnWindows
())
{
if
(
runOnWindows
())
{
str
=
str
.
replace
(
/
\\
/g
,
'
/
'
)
str
=
str
.
replace
(
/
\\
/g
,
'
/
'
)
}
}
...
@@ -310,6 +314,10 @@ function capitalizeFirstLetter (str) {
...
@@ -310,6 +314,10 @@ function capitalizeFirstLetter (str) {
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
function
dirname
(
str
)
{
function
dirname
(
str
)
{
if
(
!
str
)
{
return
''
}
if
(
runOnWindows
())
{
if
(
runOnWindows
())
{
str
=
str
.
replace
(
/
\\
/g
,
'
/
'
)
str
=
str
.
replace
(
/
\\
/g
,
'
/
'
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment