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
81d616e8
Commit
81d616e8
authored
Mar 24, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/app/App): add a splash screen
parent
038445f3
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
123 additions
and
18 deletions
+123
-18
splash_screen.svg
linphone-desktop/assets/images/splash_screen.svg
+28
-0
resources.qrc
linphone-desktop/resources.qrc
+3
-0
App.cpp
linphone-desktop/src/app/App.cpp
+34
-18
SplashScreen.qml
linphone-desktop/ui/views/App/SplashScreen/SplashScreen.qml
+39
-0
SplashScreenStyle.qml
...op/ui/views/App/Styles/SplashScreen/SplashScreenStyle.qml
+17
-0
qmldir
linphone-desktop/ui/views/App/Styles/qmldir
+2
-0
No files found.
linphone-desktop/assets/images/splash_screen.svg
0 → 100644
View file @
81d616e8
This diff is collapsed.
Click to expand it.
linphone-desktop/resources.qrc
View file @
81d616e8
...
...
@@ -148,6 +148,7 @@
<file>
assets/images/speaker_on_hovered.svg
</file>
<file>
assets/images/speaker_on_normal.svg
</file>
<file>
assets/images/speaker_on_pressed.svg
</file>
<file>
assets/images/splash_screen.svg
</file>
<file>
assets/images/tooltip_arrow_bottom.svg
</file>
<file>
assets/images/tooltip_arrow_left.svg
</file>
<file>
assets/images/tooltip_arrow_right.svg
</file>
...
...
@@ -343,6 +344,7 @@
<file>
ui/views/App/Settings/SettingsUi.qml
</file>
<file>
ui/views/App/Settings/SettingsVideo.qml
</file>
<file>
ui/views/App/Settings/SettingsWindow.qml
</file>
<file>
ui/views/App/SplashScreen/SplashScreen.qml
</file>
<file>
ui/views/App/Styles/Calls/CallStyle.qml
</file>
<file>
ui/views/App/Styles/Calls/CallsWindowStyle.qml
</file>
<file>
ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml
</file>
...
...
@@ -360,5 +362,6 @@
<file>
ui/views/App/Styles/Main/ManageAccountsStyle.qml
</file>
<file>
ui/views/App/Styles/qmldir
</file>
<file>
ui/views/App/Styles/Settings/SettingsWindowStyle.qml
</file>
<file>
ui/views/App/Styles/SplashScreen/SplashScreenStyle.qml
</file>
</qresource>
</RCC>
linphone-desktop/src/app/App.cpp
View file @
81d616e8
...
...
@@ -55,6 +55,8 @@
#define QML_VIEW_CALLS_WINDOW "qrc:/ui/views/App/Calls/CallsWindow.qml"
#define QML_VIEW_SETTINGS_WINDOW "qrc:/ui/views/App/Settings/SettingsWindow.qml"
#define QML_VIEW_SPLASH_SCREEN "qrc:/ui/views/App/SplashScreen/SplashScreen.qml"
// =============================================================================
inline
bool
installLocale
(
App
&
app
,
QTranslator
&
translator
,
const
QLocale
&
locale
)
{
...
...
@@ -92,6 +94,35 @@ App::~App () {
// -----------------------------------------------------------------------------
inline
QQuickWindow
*
createSubWindow
(
App
*
app
,
const
char
*
path
)
{
QQmlEngine
*
engine
=
app
->
getEngine
();
QQmlComponent
component
(
engine
,
QUrl
(
path
));
if
(
component
.
isError
())
{
qWarning
()
<<
component
.
errors
();
abort
();
}
QObject
*
object
=
component
.
create
();
QQmlEngine
::
setObjectOwnership
(
object
,
QQmlEngine
::
CppOwnership
);
object
->
setParent
(
app
->
getMainWindow
());
return
qobject_cast
<
QQuickWindow
*>
(
object
);
}
// -----------------------------------------------------------------------------
inline
void
activeSplashScreen
(
App
*
app
)
{
QQuickWindow
*
splash_screen
=
createSubWindow
(
app
,
QML_VIEW_SPLASH_SCREEN
);
QObject
::
connect
(
CoreManager
::
getInstance
(),
&
CoreManager
::
linphoneCoreCreated
,
splash_screen
,
[
splash_screen
]()
{
splash_screen
->
hide
();
splash_screen
->
deleteLater
();
}
);
}
void
App
::
initContentApp
()
{
// Init core.
CoreManager
::
init
(
this
,
m_parser
.
value
(
"config"
));
...
...
@@ -124,6 +155,9 @@ void App::initContentApp () {
if
(
m_engine
.
rootObjects
().
isEmpty
())
qFatal
(
"Unable to open main window."
);
// Load splashscreen.
activeSplashScreen
(
this
);
CoreManager
*
core
=
CoreManager
::
getInstance
();
if
(
m_parser
.
isSet
(
"selftest"
))
...
...
@@ -210,24 +244,6 @@ void App::tryToUsePreferredLocale () {
// -----------------------------------------------------------------------------
inline
QQuickWindow
*
createSubWindow
(
App
*
app
,
const
char
*
path
)
{
QQmlEngine
*
engine
=
app
->
getEngine
();
QQmlComponent
component
(
engine
,
QUrl
(
path
));
if
(
component
.
isError
())
{
qWarning
()
<<
component
.
errors
();
abort
();
}
QObject
*
object
=
component
.
create
();
QQmlEngine
::
setObjectOwnership
(
object
,
QQmlEngine
::
CppOwnership
);
object
->
setParent
(
app
->
getMainWindow
());
return
qobject_cast
<
QQuickWindow
*>
(
object
);
}
// -----------------------------------------------------------------------------
QQuickWindow
*
App
::
getCallsWindow
()
{
if
(
!
m_calls_window
)
m_calls_window
=
createSubWindow
(
this
,
QML_VIEW_CALLS_WINDOW
);
...
...
linphone-desktop/ui/views/App/SplashScreen/SplashScreen.qml
View file @
81d616e8
import
QtQuick
2.7
import
QtQuick
.
Window
2.2
import
Common
1.0
import
App
.
Styles
1.0
// =============================================================================
Window
{
color
:
SplashScreenStyle
.
color
flags
:
Qt
.
SplashScreen
modality
:
Qt
.
ApplicationModal
visible
:
image
.
status
===
Image
.
Ready
x
:
(
Screen
.
width
-
image
.
width
)
/
2
y
:
(
Screen
.
height
-
image
.
height
)
/
2
height
:
image
.
paintedHeight
width
:
image
.
paintedWidth
Image
{
id
:
image
anchors.centerIn
:
parent
height
:
SplashScreenStyle
.
height
width
:
SplashScreenStyle
.
width
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
source
:
SplashScreenStyle
.
image
BusyIndicator
{
height
:
SplashScreenStyle
.
busyIndicator
.
height
width
:
SplashScreenStyle
.
busyIndicator
.
width
anchors
{
bottom
:
parent
.
bottom
bottomMargin
:
SplashScreenStyle
.
busyIndicator
.
bottomMargin
horizontalCenter
:
parent
.
horizontalCenter
}
}
}
}
linphone-desktop/ui/views/App/Styles/SplashScreen/SplashScreenStyle.qml
0 → 100644
View file @
81d616e8
pragma
Singleton
import
QtQuick
2.7
// =============================================================================
QtObject
{
property
color
color
:
'
#444444
'
// Not a `Common.Color`. Specific case.
property
int
height
:
350
property
int
width
:
620
property
url
image
:
'
qrc:/assets/images/splash_screen.svg
'
property
QtObject
busyIndicator
:
QtObject
{
property
int
bottomMargin
:
25
property
int
height
:
24
property
int
width
:
24
}
}
linphone-desktop/ui/views/App/Styles/qmldir
View file @
81d616e8
...
...
@@ -23,3 +23,5 @@ singleton MainWindowStyle 1.0 Main/MainWindowStyle.qml
singleton ManageAccountsStyle 1.0 Main/ManageAccountsStyle.qml
singleton SettingsWindowStyle 1.0 Settings/SettingsWindowStyle.qml
singleton SplashScreenStyle 1.0 SplashScreen/SplashScreenStyle.qml
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