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
c29438f1
Commit
c29438f1
authored
Jul 09, 2017
by
kempe
Browse files
Refactored BrowseByCategory page part of
#6
* Divided in .qml and .ui.qml
parent
6f9d3a27
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
22 deletions
+47
-22
harbour-received.pro
harbour-received.pro
+3
-2
qml/pages/BrowseByCategoryPage.qml
qml/pages/BrowseByCategoryPage.qml
+29
-0
qml/pages/BrowseByCategoryPageForm.ui.qml
qml/pages/BrowseByCategoryPageForm.ui.qml
+11
-16
qml/pages/BrowsePage.qml
qml/pages/BrowsePage.qml
+1
-1
translations/harbour-received-sv.ts
translations/harbour-received-sv.ts
+2
-2
translations/harbour-received.ts
translations/harbour-received.ts
+1
-1
No files found.
harbour-received.pro
View file @
c29438f1
...
...
@@ -32,7 +32,6 @@ OTHER_FILES += qml/harbour-received.qml \
qml/components/js/Storage.js \
qml/components/js/Favorites.js \
translations/harbour-received-sv.ts \
qml/pages/BrowseByCategory.qml \
qml/components/SleepTimer.qml \
qml/components/RadioAPI.qml
...
...
@@ -68,5 +67,7 @@ DISTFILES += \
qml/pages/Settings2.qml \
qml/components/RecivedUpgrader.qml \
qml/pages/BrowsePageForm.ui.qml \
qml/pages/BrowsePage.qml
qml/pages/BrowsePage.qml \
qml/pages/BrowseByCategoryPageForm.ui.qml \
qml/pages/BrowseByCategoryPage.qml
qml/pages/BrowseByCategoryPage.qml
0 → 100644
View file @
c29438f1
import
QtQuick
2.6
import
"
../components/js/Utils.js
"
as
Utils
BrowseByCategoryPageForm
{
headerTitle
:
headerTitle
.
toLocaleLowerCase
()
browseByListView.onCurrentIndexChanged
:
{
var
item
=
browseByModel
.
get
(
browseByListView
.
currentIndex
)
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
StationsPage.qml
"
),
{
listType
:
new
Utils
.
ListType
(
title
),
category
:
item
.
category
,
value
:
item
.
title
});
}
// Other
// Set a custom search action in navigation menu
navigationMenu.searchAction
:
function
()
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
StationsPage.qml
"
),
{
listType
:
Utils
.
Search
});
}
Component.onCompleted
:
{
radioAPI
.
getCategories
(
category
.
toLocaleLowerCase
(),
browseByModel
);
}
}
qml/pages/BrowseByCategory.qml
→
qml/pages/BrowseByCategory
PageForm.ui
.qml
View file @
c29438f1
import
QtQuick
2.6
import
Sailfish
.
Silica
1.0
import
"
../components/js/Utils.js
"
as
Utils
Page
{
id
:
page
property
alias
browseByListView
:
browseByListView
property
alias
browseByModel
:
browseByModel
property
alias
navigationMenu
:
navigationMenu
property
string
category
:
""
property
string
headerTitle
:
""
...
...
@@ -14,24 +18,18 @@ Page {
anchors.fill
:
parent
NavigationMenu
{
id
:
pulley
Men
y
id
:
navigation
Men
u
hideBrowseAction
:
true
searchAction
:
function
()
{
pageStack
.
replaceAbove
(
pageStack
.
find
(
function
(
page
)
{
return
page
.
firstPage
===
true
}),
Qt
.
resolvedUrl
(
"
StationsPage.qml
"
),
{
listType
:
Utils
.
Search
});
}
}
header
:
Column
{
PageHeader
{
title
:
qsTr
(
"
Browse by
"
)
+
"
"
+
headerTitle
.
toLocaleLowerCase
()
title
:
qsTr
(
"
Browse by
"
)
+
"
"
+
headerTitle
width
:
page
.
width
}
}
currentIndex
:
-
1
model
:
ListModel
{
id
:
browseByModel
}
...
...
@@ -50,13 +48,10 @@ Page {
anchors.topMargin
:
7
}
onClicked
:
{
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
StationsPage.qml
"
),
{
listType
:
new
Utils
.
ListType
(
title
),
category
:
category
,
value
:
title
});
Connections
{
target
:
listItem
onClicked
:
browseByListView
.
currentIndex
=
index
}
}
}
Component.onCompleted
:
{
radioAPI
.
getCategories
(
category
.
toLocaleLowerCase
(),
browseByModel
);
}
}
qml/pages/BrowsePage.qml
View file @
c29438f1
...
...
@@ -17,7 +17,7 @@ BrowsePageForm {
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
StationsPage.qml
"
),
{
listType
:
Utils
.
Local
});
break
;
default
:
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
BrowseByCategory.qml
"
),
{
category
:
item
.
originalTitle
,
headerTitle
:
item
.
title
});
pageStack
.
push
(
Qt
.
resolvedUrl
(
"
BrowseByCategory
Page
.qml
"
),
{
category
:
item
.
originalTitle
,
headerTitle
:
item
.
title
});
break
;
}
}
...
...
translations/harbour-received-sv.ts
View file @
c29438f1
...
...
@@ -2,10 +2,10 @@
<!
DOCTYPE
TS
>
<
TS
version
=
"
2.1
"
>
<
context
>
<
name
>
BrowseByCategory
<
/name
>
<
name
>
BrowseByCategory
PageForm
.
ui
<
/name
>
<
message
>
<
source
>
Browse
by
<
/source
>
<
translation
>
Bläddra
efter
<
/translation
>
<
translation
type
=
"
unfinished
"
>
Bläddra
efter
<
/translation
>
<
/message
>
<
/context
>
<
context
>
...
...
translations/harbour-received.ts
View file @
c29438f1
...
...
@@ -2,7 +2,7 @@
<!
DOCTYPE
TS
>
<
TS
version
=
"
2.1
"
>
<
context
>
<
name
>
BrowseByCategory
<
/name
>
<
name
>
BrowseByCategory
PageForm
.
ui
<
/name
>
<
message
>
<
source
>
Browse
by
<
/source
>
<
translation
type
=
"
unfinished
"
><
/translation
>
...
...
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