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
bb6c544c
Commit
bb6c544c
authored
Jul 06, 2017
by
kempe
Browse files
Refactoring Separate navigation logic as component
parent
d366cd38
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
103 additions
and
164 deletions
+103
-164
harbour-received.pro
harbour-received.pro
+4
-2
qml/pages/Browse.qml
qml/pages/Browse.qml
+4
-16
qml/pages/BrowseByCategory.qml
qml/pages/BrowseByCategory.qml
+11
-20
qml/pages/Favorites.qml
qml/pages/Favorites.qml
+1
-26
qml/pages/NavigationMenu.qml
qml/pages/NavigationMenu.qml
+15
-0
qml/pages/NavigationMenuForm.ui.qml
qml/pages/NavigationMenuForm.ui.qml
+38
-0
qml/pages/Stations.qml
qml/pages/Stations.qml
+11
-31
translations/harbour-received-sv.ts
translations/harbour-received-sv.ts
+12
-37
translations/harbour-received.ts
translations/harbour-received.ts
+7
-32
No files found.
harbour-received.pro
View file @
bb6c544c
...
...
@@ -35,7 +35,6 @@ OTHER_FILES += qml/harbour-received.qml \
translations/harbour-received-sv.ts \
qml/pages/Stations.qml \
qml/pages/BrowseByCategory.qml \
qml/components/MenuLabelSmal.qml \
qml/components/SleepTimer.qml \
qml/pages/Settings.qml
...
...
@@ -55,4 +54,7 @@ DISTFILES += \
qml/components/js/Rad.js \
qml/components/DockedAudioPlayer.qml \
qml/components/PlayerControlsForm.ui.qml \
qml/components/DockedAudioPlayerForm.ui.qml
qml/components/DockedAudioPlayerForm.ui.qml \
qml/components/MenuLabelSmal.ui.qml \
qml/pages/NavigationMenuForm.ui.qml \
qml/pages/NavigationMenu.qml
qml/pages/Browse.qml
View file @
bb6c544c
...
...
@@ -10,22 +10,10 @@ Page {
VerticalScrollDecorator
{
flickable
:
browseListView
}
anchors.fill
:
parent
PullDownMenu
{
id
:
pulleyMeny
MenuItem
{
visible
:
player
.
isPlaying
()
&&
!
player
.
open
text
:
qsTr
(
"
Show player
"
)
onClicked
:
{
player
.
open
=
true
}
}
MenuItem
{
text
:
qsTr
(
"
Search
"
)
onClicked
:
{
pageStack
.
replace
(
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
}
NavigationMenu
{
id
:
pulleyMeny
hideBrowseAction
:
true
}
header
:
Column
{
PageHeader
{
...
...
qml/pages/BrowseByCategory.qml
View file @
bb6c544c
...
...
@@ -14,26 +14,17 @@ Page {
VerticalScrollDecorator
{
flickable
:
browseByPageListView
}
anchors.fill
:
parent
PullDownMenu
{
id
:
pulleyMeny
MenuItem
{
visible
:
player
.
isPlaying
()
&&
!
player
.
open
text
:
qsTr
(
"
Show player
"
)
onClicked
:
{
player
.
open
=
true
}
}
MenuItem
{
text
:
qsTr
(
"
Search
"
)
onClicked
:
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
}
NavigationMenu
{
id
:
pulleyMeny
hideBrowseAction
:
true
searchAction
:
function
()
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
header
:
Column
{
PageHeader
{
...
...
qml/pages/Favorites.qml
View file @
bb6c544c
...
...
@@ -15,33 +15,8 @@ Page {
VerticalScrollDecorator
{
flickable
:
favoritesListView
}
anchors.fill
:
parent
PullDow
nMenu
{
Navigatio
nMenu
{
id
:
pulleyMeny
MenuItem
{
text
:
qsTr
(
"
Settings
"
)
onClicked
:
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
Settings.qml
"
));
}
}
MenuItem
{
visible
:
player
.
isPlaying
&&
!
player
.
open
text
:
qsTr
(
"
Show player
"
)
onClicked
:
{
player
.
open
=
true
}
}
MenuItem
{
text
:
qsTr
(
"
Browse
"
)
onClicked
:
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
Browse.qml
"
),
{
listType
:
Utils
.
Top100
});
}
}
MenuItem
{
text
:
qsTr
(
"
Search
"
)
onClicked
:
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
}
header
:
Column
{
...
...
qml/pages/NavigationMenu.qml
0 → 100644
View file @
bb6c544c
import
QtQuick
2.4
import
"
../components/js/Utils.js
"
as
Utils
NavigationMenuForm
{
property
var
settingsAction
:
function
()
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
Settings.qml
"
));
}
property
var
showPlayerAction
:
function
()
{
player
.
open
=
true
;
}
property
var
browseAction
:
function
()
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
Browse.qml
"
),
{
listType
:
Utils
.
Top100
});
}
property
var
searchAction
:
function
()
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
actionSettings.onClicked
:
settingsAction
()
actionShowPlayer.onClicked
:
showPlayerAction
()
actionBrowse.onClicked
:
browseAction
()
actionSearch.onClicked
:
searchAction
()
}
qml/pages/NavigationMenuForm.ui.qml
0 → 100644
View file @
bb6c544c
import
QtQuick
2.4
import
Sailfish
.
Silica
1.0
PullDownMenu
{
id
:
pulleyMeny
property
alias
actionSettings
:
actionSettings
property
alias
actionShowPlayer
:
actionShowPlayer
property
alias
actionBrowse
:
actionBrowse
property
alias
actionSearch
:
actionSearch
property
bool
hideSettingsAction
:
false
property
bool
hideShowPlayerAction
:
false
property
bool
hideBrowseAction
:
false
property
bool
hideSearchAction
:
false
MenuItem
{
id
:
actionSettings
visible
:
!
hideSettingsAction
text
:
qsTr
(
"
Settings
"
)
}
MenuItem
{
id
:
actionShowPlayer
visible
:
player
.
isPlaying
&&
!
player
.
open
&&
!
hideShowPlayerAction
text
:
qsTr
(
"
Show player
"
)
}
MenuItem
{
id
:
actionBrowse
visible
:
!
hideBrowseAction
text
:
qsTr
(
"
Browse
"
)
}
MenuItem
{
id
:
actionSearch
visible
:
!
hideSearchAction
text
:
qsTr
(
"
Search
"
)
}
}
qml/pages/Stations.qml
View file @
bb6c544c
...
...
@@ -16,37 +16,17 @@ Page {
VerticalScrollDecorator
{
flickable
:
stationListView
}
anchors.fill
:
parent
PullDownMenu
{
id
:
pulleyMeny
MenuItem
{
visible
:
player
.
isPlaying
()
&&
!
player
.
open
text
:
qsTr
(
"
Show player
"
)
onClicked
:
{
player
.
open
=
true
}
}
MenuItem
{
text
:
qsTr
(
"
Browse
"
)
onClicked
:
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
Browse.qml
"
));
}
}
MenuItem
{
text
:
qsTr
(
"
Search
"
)
visible
:
listType
!==
Utils
.
Search
onClicked
:
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
}
NavigationMenu
{
id
:
pulleyMeny
hideSearchAction
:
listType
===
Utils
.
Search
searchAction
:
function
()
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
Stations.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
header
:
Column
{
PageHeader
{
...
...
translations/harbour-received-sv.ts
View file @
bb6c544c
...
...
@@ -7,10 +7,6 @@
<
source
>
Top
100
<
/source
>
<
translation
>
Topp
100
<
/translation
>
<
/message
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
>
Sök
<
/translation
>
<
/message
>
<
message
>
<
source
>
Browse
<
/source
>
<
translation
>
Bläddra
<
/translation
>
...
...
@@ -43,10 +39,6 @@
<
source
>
Local
<
/source
>
<
translation
>
Lokalt
<
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
>
Visa
spelare
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
BrowseByCategory
<
/name
>
...
...
@@ -54,14 +46,6 @@
<
source
>
Browse
by
<
/source
>
<
translation
>
Bläddra
efter
<
/translation
>
<
/message
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
>
Sök
<
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
>
Visa
spelare
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
DockedAudioPlayerForm
.
ui
<
/name
>
...
...
@@ -80,10 +64,6 @@
<
/context
>
<
context
>
<
name
>
Favorites
<
/name
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
>
Sök
<
/translation
>
<
/message
>
<
message
>
<
source
>
Favorites
<
/source
>
<
translation
>
Favoriter
<
/translation
>
...
...
@@ -92,25 +72,28 @@
<
source
>
Remove
from
favorite
<
/source
>
<
translation
>
Ta
bort
från
favoriter
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
NavigationMenuForm
.
ui
<
/name
>
<
message
>
<
source
>
Browse
<
/source
>
<
translation
>
Bläddra
<
/translation
>
<
source
>
Settings
<
/source
>
<
translation
type
=
"
unfinished
"
>
Inställningar
<
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
>
Visa
spelare
<
/translation
>
<
translation
type
=
"
unfinished
"
>
Visa
spelare
<
/translation
>
<
/message
>
<
message
>
<
source
>
Settings
<
/source
>
<
translation
>
Inställningar
<
/translation
>
<
source
>
Browse
<
/source
>
<
translation
type
=
"
unfinished
"
>
Bläddra
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Stations
<
/name
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
>
Sök
<
/translation
>
<
translation
type
=
"
unfinished
"
>
Sök
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Stations
<
/name
>
<
message
>
<
source
>
Remove
from
favorite
<
/source
>
<
translation
>
Ta
bort
från
favoriter
<
/translation
>
...
...
@@ -119,18 +102,10 @@
<
source
>
Add
to
favorite
<
/source
>
<
translation
>
Lägg
till
i
favoriter
<
/translation
>
<
/message
>
<
message
>
<
source
>
Browse
<
/source
>
<
translation
>
Bläddra
<
/translation
>
<
/message
>
<
message
>
<
source
>
From
<
/source
>
<
translation
>
Från
<
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
>
Visa
spelare
<
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Utils
<
/name
>
...
...
translations/harbour-received.ts
View file @
bb6c544c
...
...
@@ -39,14 +39,6 @@
<
source
>
Local
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
BrowseByCategory
<
/name
>
...
...
@@ -54,14 +46,6 @@
<
source
>
Browse
by
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
DockedAudioPlayerForm
.
ui
<
/name
>
...
...
@@ -88,29 +72,28 @@
<
source
>
Remove
from
favorite
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
NavigationMenuForm
.
ui
<
/name
>
<
message
>
<
source
>
Se
arch
<
/source
>
<
source
>
Se
ttings
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Browse
<
/source
>
<
source
>
Show
player
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
source
>
Browse
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Se
ttings
<
/source
>
<
source
>
Se
arch
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Stations
<
/name
>
<
message
>
<
source
>
Search
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Remove
from
favorite
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
...
...
@@ -119,18 +102,10 @@
<
source
>
Add
to
favorite
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Browse
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
From
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
message
>
<
source
>
Show
player
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
<
/message
>
<
/context
>
<
context
>
<
name
>
Utils
<
/name
>
...
...
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