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
91ef7469
Commit
91ef7469
authored
Nov 16, 2016
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): add `Notification` component, restore `DesktopPopup` component without notification deps
parent
80e643e8
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
69 additions
and
59 deletions
+69
-59
resources.qrc
tests/resources.qrc
+2
-0
Notifier.cpp
tests/src/components/notifier/Notifier.cpp
+6
-9
Notifier.hpp
tests/src/components/notifier/Notifier.hpp
+0
-2
DesktopPopup.qml
tests/ui/modules/Common/Popup/DesktopPopup.qml
+3
-37
SearchBox.qml
tests/ui/modules/Common/SearchBox.qml
+0
-1
PopupStyle.qml
tests/ui/modules/Common/Styles/PopupStyle.qml
+0
-4
CallNotification.qml
tests/ui/modules/Linphone/Notifications/CallNotification.qml
+1
-3
Notification.qml
tests/ui/modules/Linphone/Notifications/Notification.qml
+43
-0
NotificationStyle.qml
tests/ui/modules/Linphone/Styles/NotificationStyle.qml
+8
-0
qmldir
tests/ui/modules/Linphone/Styles/qmldir
+2
-0
qmldir
tests/ui/modules/Linphone/qmldir
+0
-3
utils.spec.qml
tests/ui/scripts/Utils/utils.spec.qml
+4
-0
No files found.
tests/resources.qrc
View file @
91ef7469
...
...
@@ -118,6 +118,7 @@
<file>
ui/modules/Linphone/Contact/ContactDescription.qml
</file>
<file>
ui/modules/Linphone/Contact/Contact.qml
</file>
<file>
ui/modules/Linphone/Notifications/CallNotification.qml
</file>
<file>
ui/modules/Linphone/Notifications/Notification.qml
</file>
<file>
ui/modules/Linphone/Presence/PresenceLevel.qml
</file>
<file>
ui/modules/Linphone/Presence/PresenceString.qml
</file>
<file>
ui/modules/Linphone/qmldir
</file>
...
...
@@ -127,6 +128,7 @@
<file>
ui/modules/Linphone/Styles/Contact/AvatarStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Contact/ContactStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/NotificationStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/Presence/PresenceStringStyle.qml
</file>
<file>
ui/modules/Linphone/Styles/qmldir
</file>
<file>
ui/modules/Linphone/Styles/TimelineStyle.qml
</file>
...
...
tests/src/components/notifier/Notifier.cpp
View file @
91ef7469
...
...
@@ -7,14 +7,12 @@
// Notifications QML properties/methods.
#define NOTIFICATION_SHOW_METHOD_NAME "show"
#define NOTIFICATION_EDGE_PROPERTY_NAME "edge"
#define NOTIFICATION_HEIGHT_PROPERTY "popupHeight"
#define NOTIFICATION_OFFSET_PROPERTY_NAME "edgeOffset"
#define NOTIFICATION_HEIGHT_PROPERTY "notificationHeight"
#define NOTIFICATION_OFFSET_PROPERTY_NAME "notificationOffset"
// Arbitrary hardcoded values.
#define NOTIFICATION_SPACING 10
#define NOTIFICATION_START_OFFSET 30
#define N_MAX_NOTIFICATIONS 3
#define N_MAX_NOTIFICATIONS 15
// ===================================================================
...
...
@@ -47,7 +45,7 @@ bool setProperty (QObject &object, const char *property, const T &value) {
// -------------------------------------------------------------------
Notifier
::
Notifier
(
QObject
*
parent
)
:
QObject
(
parent
)
,
m_offset
(
NOTIFICATION_START_OFFSET
)
{
QObject
(
parent
)
{
QQmlEngine
*
engine
=
App
::
getInstance
()
->
getEngine
();
// Build components.
...
...
@@ -95,7 +93,6 @@ void Notifier::showCallMessage (
if
(
offset
==
-
1
||
!::
setProperty
(
*
object
,
NOTIFICATION_EDGE_PROPERTY_NAME
,
Qt
::
TopEdge
|
Qt
::
RightEdge
)
||
!::
setProperty
(
*
object
,
NOTIFICATION_OFFSET_PROPERTY_NAME
,
m_offset
)
)
{
delete
object
;
...
...
@@ -108,7 +105,7 @@ void Notifier::showCallMessage (
m_mutex
.
unlock
();
// Display
popup
.
// Display
notification
.
QMetaObject
::
invokeMethod
(
object
,
"show"
,
Qt
::
DirectConnection
);
// Destroy it after timeout.
...
...
@@ -119,7 +116,7 @@ void Notifier::showCallMessage (
m_n_instances
--
;
if
(
m_n_instances
==
0
)
m_offset
=
NOTIFICATION_START_OFFSET
;
m_offset
=
0
;
m_mutex
.
unlock
();
});
...
...
tests/src/components/notifier/Notifier.hpp
View file @
91ef7469
...
...
@@ -24,8 +24,6 @@ public slots:
void
showCallMessage
(
int
timeout
,
const
QString
&
sip_address
);
private:
void
computePositions
();
QQmlComponent
*
m_components
[
MaxNbTypes
];
int
m_offset
=
0
;
...
...
tests/ui/modules/Common/Popup/DesktopPopup.qml
View file @
91ef7469
...
...
@@ -8,13 +8,10 @@ import Common.Styles 1.0
Item
{
id
:
wrapper
property
int
popupX
:
0
property
int
popupY
:
0
property
alias
popupX
:
popup
.
x
property
alias
popupY
:
popup
.
y
property
int
edge
:
0
property
int
edgeOffset
:
0
property
int
flags
:
Qt
.
Popup
property
int
flags
:
Qt
.
SplashScreen
readonly
property
alias
popupWidth
:
popup
.
width
readonly
property
alias
popupHeight
:
popup
.
height
...
...
@@ -30,34 +27,6 @@ Item {
_isOpen
=
false
}
function
_applyXEdge
()
{
var
screen
=
popup
.
Screen
if
(
screen
==
null
)
{
return
popupX
}
if
(
edge
&
Qt
.
LeftEdge
)
{
return
PopupStyle
.
desktop
.
edgeMargin
}
return
screen
.
width
-
popup
.
width
-
PopupStyle
.
desktop
.
edgeMargin
}
function
_applyYEdge
()
{
var
screen
=
popup
.
Screen
if
(
screen
==
null
)
{
return
popupY
}
if
(
edge
&
Qt
.
TopEdge
)
{
return
edgeOffset
+
PopupStyle
.
desktop
.
edgeMargin
}
return
screen
.
height
-
popup
.
height
-
edgeOffset
-
PopupStyle
.
desktop
.
edgeMargin
}
// -----------------------------------------------------------------
// DO NOT TOUCH THIS PROPERTIES.
...
...
@@ -79,9 +48,6 @@ Item {
height
:
_content
[
0
]
!=
null
?
_content
[
0
].
height
:
0
width
:
_content
[
0
]
!=
null
?
_content
[
0
].
width
:
0
x
:
edge
?
_applyXEdge
()
:
popupX
y
:
edge
?
_applyYEdge
()
:
popupY
Item
{
id
:
content
...
...
tests/ui/modules/Common/SearchBox.qml
View file @
91ef7469
...
...
@@ -90,7 +90,6 @@ Item {
return
point
}
flags
:
Qt
.
SplashScreen
popupX
:
coords
.
x
popupY
:
coords
.
y
...
...
tests/ui/modules/Common/Styles/PopupStyle.qml
View file @
91ef7469
...
...
@@ -13,10 +13,6 @@ QtObject {
property
int
closingDuration
:
250
}
property
QtObject
desktop
:
QtObject
{
property
int
edgeMargin
:
10
}
property
QtObject
shadow
:
QtObject
{
property
color
color
:
Colors
.
l
property
int
horizontalOffset
:
4
...
...
tests/ui/modules/Linphone/Notifications/CallNotification.qml
View file @
91ef7469
import
QtQuick
2.7
import
Common
1.0
DesktopPopup
{
Notification
{
Rectangle
{
color
:
'
red
'
...
...
tests/ui/modules/Linphone/Notifications/Notification.qml
0 → 100644
View file @
91ef7469
import
QtQuick
2.7
// Warning: This import is necessary to use the attached property `Screen`.
// See: https://doc-snapshots.qt.io/qt5-5.7/qml-qtquick-window-screen.html
import
QtQuick
.
Window
2.2
import
Common
1.0
import
Linphone
.
Styles
1.0
import
Utils
1.0
// ===================================================================
DesktopPopup
{
id
:
notification
property
int
notificationOffset
:
0
property
alias
notificationHeight
:
notification
.
popupHeight
flags
:
Qt
.
Popup
Component.onCompleted
:
{
var
window
=
data
[
0
]
Utils
.
assert
(
Utils
.
qmlTypeof
(
window
,
'
QQuickWindowQmlImpl
'
),
true
,
'
Unable to found `Window` object in `DesktopPopup`.
'
)
window
.
x
=
Qt
.
binding
(
function
()
{
var
screen
=
window
.
Screen
return
screen
!=
null
?
screen
.
width
-
window
.
width
-
NotificationStyle
.
margin
:
0
})
window
.
y
=
Qt
.
binding
(
function
()
{
var
screen
=
window
.
Screen
return
screen
!=
null
?
screen
.
desktopAvailableHeight
-
window
.
height
-
notificationOffset
:
0
})
}
}
tests/ui/modules/Linphone/Styles/NotificationStyle.qml
0 → 100644
View file @
91ef7469
pragma
Singleton
import
QtQuick
2.7
// ===================================================================
QtObject
{
property
int
margin
:
10
}
tests/ui/modules/Linphone/Styles/qmldir
View file @
91ef7469
...
...
@@ -12,6 +12,8 @@ singleton AvatarStyle 1.0 Contact/AvatarStyle.qml
singleton ContactDescriptionStyle 1.0 Contact/ContactDescriptionStyle.qml
singleton ContactStyle 1.0 Contact/ContactStyle.qml
singleton NotificationStyle 1.0 NotificationStyle.qml
singleton PresenceStringStyle 1.0 Presence/PresenceStringStyle.qml
singleton TimelineStyle 1.0 TimelineStyle.qml
tests/ui/modules/Linphone/qmldir
View file @
91ef7469
...
...
@@ -20,9 +20,6 @@ Avatar 1.0 Contact/Avatar.qml
Contact 1.0 Contact/Contact.qml
ContactDescription 1.0 Contact/ContactDescription.qml
# Notifications
CallNotification 1.0 Notifications/CallNotification.qml
# Presence
PresenceLevel 1.0 Presence/PresenceLevel.qml
PresenceString 1.0 Presence/PresenceString.qml
...
...
tests/ui/scripts/Utils/utils.spec.qml
View file @
91ef7469
...
...
@@ -78,6 +78,10 @@ TestCase {
component
:
'
import QtQuick 2.7; MouseArea {}
'
,
result
:
true
,
type
:
'
QQuickMouseArea
'
},
{
component
:
'
import QtQuick 2.7; import QtQuick.Window 2.2; Window {}
'
,
result
:
true
,
type
:
'
QQuickWindowQmlImpl
'
}
]
}
...
...
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