Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
sailfish-apps
Received
Commits
eab30459
Commit
eab30459
authored
Nov 17, 2017
by
kempe
Browse files
Set default settings
parent
18a71f62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
4 deletions
+15
-4
qml/components/audioplayer/DockedAudioPlayerLoader.qml
qml/components/audioplayer/DockedAudioPlayerLoader.qml
+2
-3
qml/harbour-received.qml
qml/harbour-received.qml
+1
-1
src/harbour-received.cpp
src/harbour-received.cpp
+12
-0
No files found.
qml/components/audioplayer/DockedAudioPlayerLoader.qml
View file @
eab30459
...
...
@@ -29,11 +29,10 @@ DockedPanel {
}
Component.onCompleted
:
{
var
sourceBaseName
=
settings
.
value
(
"
playerLayout
"
)
?
settings
.
value
(
"
playerLayout
"
)
:
"
DockedAudioPlayer
"
dockedAudioPlayer
.
source
=
Qt
.
resolvedUrl
(
sourceBaseName
+
"
.qml
"
)
updateDockedAudioPlayerSource
()
}
function
playerLayoutUpdated
()
{
function
updateDockedAudioPlayerSource
()
{
dockedAudioPlayer
.
source
=
Qt
.
resolvedUrl
(
settings
.
value
(
"
playerLayout
"
)
+
"
.qml
"
)
}
...
...
qml/harbour-received.qml
View file @
eab30459
...
...
@@ -44,7 +44,7 @@ ApplicationWindow
}
function
playerLayoutUpdated
()
{
player
.
playerLayoutUpdated
()
player
.
updateDockedAudioPlayerSource
()
;
}
}
...
...
src/harbour-received.cpp
View file @
eab30459
...
...
@@ -43,6 +43,17 @@
#include "src/settings.h"
#include "src/audioplayer.h"
void
setupSettings
(
Settings
&
settings
)
{
if
(
settings
.
value
(
"playerLayout"
).
toString
().
isEmpty
())
{
settings
.
setValue
(
"playerLayout"
,
"DockedAudioPlayerSmall"
);
}
if
(
settings
.
value
(
"apiUrl"
).
toString
().
isEmpty
())
{
settings
.
setValue
(
"apiUrl"
,
"http://www.rad.io"
);
}
}
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -53,6 +64,7 @@ int main(int argc, char *argv[])
qmlRegisterSingletonType
<
AudioPlayer
>
(
"it.kempe.AudioPlayer"
,
1
,
0
,
"AudioPlayer"
,
audioPlayerProvider
);
Settings
settings
;
setupSettings
(
settings
);
view
->
rootContext
()
->
setContextProperty
(
"settings"
,
&
settings
);
view
->
setSource
(
SailfishApp
::
pathTo
(
"qml/harbour-received.qml"
));
view
->
showFullScreen
();
...
...
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