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
7500f9a1
Commit
7500f9a1
authored
Jul 20, 2020
by
Kempe
Browse files
[FEATURE] Check if station favorite when needed
parent
8451508b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
qml/components/contextmenus/StationsListContextMenu.qml
qml/components/contextmenus/StationsListContextMenu.qml
+8
-6
No files found.
qml/components/contextmenus/StationsListContextMenu.qml
View file @
7500f9a1
...
...
@@ -11,25 +11,27 @@ ContextMenu {
signal
removeFavorite
(
var
station
)
signal
addFavorite
(
int
id
)
property
bool
isFavorite
:
FavoritesUtils
.
isRadIoFavorite
(
id
);
MenuItem
{
id
:
removeFavoritMenuItem
text
:
qsTr
(
"
Remove from favorite
"
)
visible
:
isFavorite
onClicked
:
{
remorseAction
(
qsTr
(
"
Deleting
"
),
function
()
{
removeFavorite
(
FavoritesUtils
.
getFavoriteByRadioId
(
id
))
isFavorite
=
false
});
}
}
MenuItem
{
id
:
addFavoritMenuItem
text
:
qsTr
(
"
Add to favorite
"
)
visible
:
!
isFavorite
onClicked
:
{
addFavorite
(
id
)
isFavorite
=
true
}
}
onActiveChanged
:
{
var
isFavorit
=
FavoritesUtils
.
isRadIoFavorite
(
id
)
removeFavoritMenuItem
.
visible
=
isFavorit
addFavoritMenuItem
.
visible
=
!
isFavorit
}
}
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