Commit 1cc6c2d9 authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

use more enums in signals from ViewManager

parent 7d811590
......@@ -169,7 +169,7 @@ void ViewManager::openAllAlbums(const QString &mainTitle, const QUrl &imageUrl)
if (mCurrentView != mTargetView) {
Q_EMIT openGridView(mTargetView, ElisaUtils::NoFilter, 1, mainTitle, {}, imageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, {}, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, {}, ViewShowRating, DelegateWithSecondaryText);
}
}
......@@ -204,7 +204,7 @@ void ViewManager::openOneAlbum(const QString &albumTitle, const QString &albumAu
} else {
mTargetView = ViewsType::OneAlbum;
Q_EMIT openGridView(ViewsType::AllAlbums, ElisaUtils::NoFilter, 1, {}, {}, {}, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, {}, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, {}, ViewShowRating, DelegateWithSecondaryText);
}
}
......@@ -214,7 +214,7 @@ void ViewManager::openAllArtists(const QString &mainTitle, const QUrl &imageUrl)
if (mCurrentView != mTargetView) {
Q_EMIT openGridView(ViewsType::AllArtists, ElisaUtils::NoFilter, 1, mainTitle, {}, imageUrl, ElisaUtils::Artist,
QUrl(QStringLiteral("image://icon/view-media-artist")), {}, {}, false, false);
QUrl(QStringLiteral("image://icon/view-media-artist")), {}, {}, ViewHideRating, DelegateWithoutSecondaryText);
}
}
......@@ -232,21 +232,21 @@ void ViewManager::openOneArtist(const QString &artistName, const QUrl &artistIma
if (mCurrentView == ViewsType::AllArtists && mTargetView == ViewsType::OneArtist) {
Q_EMIT openGridView(mTargetView, ElisaUtils::FilterByArtist, 2, mTargetArtistName, {}, mTargetImageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, ViewShowRating, DelegateWithSecondaryText);
} else if (mCurrentView == ViewsType::OneArtist && mCurrentArtistName != mTargetArtistName &&
mTargetView == ViewsType::OneArtist) {
Q_EMIT openGridView(mTargetView, ElisaUtils::FilterByArtist, 2, mTargetArtistName, {}, mTargetImageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, ViewShowRating, DelegateWithSecondaryText);
} else if (mCurrentView == ViewsType::OneAlbumFromArtist && mCurrentArtistName != mTargetArtistName &&
mTargetView == ViewsType::OneArtist) {
Q_EMIT openGridView(mTargetView, ElisaUtils::FilterByArtist, 2, mTargetArtistName, {}, mTargetImageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, ViewShowRating, DelegateWithSecondaryText);
} else if (mCurrentView == ViewsType::AllArtistsFromGenre && mTargetView == ViewsType::OneArtistFromGenre) {
Q_EMIT openGridView(mTargetView, ElisaUtils::FilterByGenreAndArtist, 3, mTargetArtistName, {}, mTargetImageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), mTargetGenreName, mTargetArtistName, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), mTargetGenreName, mTargetArtistName, ViewShowRating, DelegateWithSecondaryText);
} else {
Q_EMIT openGridView(ViewsType::AllArtists, ElisaUtils::NoFilter, 1, {}, {}, {}, ElisaUtils::Artist,
QUrl(QStringLiteral("image://icon/view-media-artist")), {}, {}, false, false);
QUrl(QStringLiteral("image://icon/view-media-artist")), {}, {}, ViewHideRating, DelegateWithoutSecondaryText);
}
}
......@@ -266,7 +266,7 @@ void ViewManager::openAllGenres(const QString &mainTitle, const QUrl &imageUrl)
if (mCurrentView != mTargetView) {
Q_EMIT openGridView(mTargetView, ElisaUtils::NoFilter, 1, mainTitle, {}, imageUrl, ElisaUtils::Genre,
QUrl(QStringLiteral("image://icon/view-media-genre")), {}, {}, false, false);
QUrl(QStringLiteral("image://icon/view-media-genre")), {}, {}, ViewHideRating, DelegateWithoutSecondaryText);
}
}
......@@ -277,10 +277,10 @@ void ViewManager::openAllArtistsFromGenre(const QString &genreName)
if (mCurrentView == ViewsType::AllGenres) {
Q_EMIT openGridView(mTargetView, ElisaUtils::FilterByGenre, 2, mTargetGenreName, {}, QUrl(QStringLiteral("image://icon/view-media-artist")),
ElisaUtils::Artist, QUrl(QStringLiteral("image://icon/view-media-artist")), mTargetGenreName, {}, false, false);
ElisaUtils::Artist, QUrl(QStringLiteral("image://icon/view-media-artist")), mTargetGenreName, {}, ViewHideRating, DelegateWithoutSecondaryText);
} else {
Q_EMIT openGridView(ViewsType::AllGenres, ElisaUtils::NoFilter, 1, {}, {}, {}, ElisaUtils::Genre,
QUrl(QStringLiteral("image://icon/view-media-genre")), {}, {}, false, false);
QUrl(QStringLiteral("image://icon/view-media-genre")), {}, {}, ViewHideRating, DelegateWithoutSecondaryText);
}
}
......@@ -349,10 +349,10 @@ void ViewManager::allArtistsViewIsLoaded()
mCurrentView = ViewsType::AllArtists;
if (mTargetView == ViewsType::OneArtist) {
Q_EMIT openGridView(mTargetView, ElisaUtils::FilterByArtist, 2, mTargetArtistName, {}, mTargetImageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetArtistName, ViewShowRating, DelegateWithSecondaryText);
} else if (mTargetView == ViewsType::OneAlbumFromArtist) {
Q_EMIT openGridView(ViewsType::OneArtist, ElisaUtils::FilterByArtist, 2, mTargetAlbumAuthor, {}, mTargetImageUrl, ElisaUtils::Album,
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetAlbumAuthor, true, true);
QUrl(QStringLiteral("image://icon/media-optical-audio")), {}, mTargetAlbumAuthor, ViewShowRating, DelegateWithSecondaryText);
}
}
......
......@@ -79,6 +79,20 @@ public:
Q_ENUM(RadioSpecificStyle)
enum DelegateUseSecondaryText {
DelegateWithSecondaryText = true,
DelegateWithoutSecondaryText = false,
};
Q_ENUM(DelegateUseSecondaryText)
enum ViewCanBeRated {
ViewShowRating = true,
ViewHideRating = false,
};
Q_ENUM(ViewCanBeRated)
explicit ViewManager(QObject *parent = nullptr);
Q_SIGNALS:
......@@ -87,13 +101,14 @@ Q_SIGNALS:
const QString &mainTitle, const QString &secondaryTitle, const QUrl &imageUrl,
ElisaUtils::PlayListEntryType dataType, const QUrl &viewDefaultIcon,
const QString &genreNameFilter, const QString &artistNameFilter,
bool viewShowRating, bool viewDelegateDisplaySecondaryText);
ViewManager::ViewCanBeRated viewShowRating,
ViewManager::DelegateUseSecondaryText viewDelegateDisplaySecondaryText);
void openListView(ViewManager::ViewsType viewType, ElisaUtils::FilterType filterType, int expectedDepth,
const QString &mainTitle, const QString &secondaryTitle, qulonglong databaseId,
const QUrl &imageUrl, ElisaUtils::PlayListEntryType dataType, const QVariant &sortRole,
ViewManager::SortOrder sortOrder, bool displaySingleAlbum, ViewManager::AlbumViewStyle showDiscHeaders,
ViewManager::RadioSpecificStyle radioCase);
ViewManager::SortOrder sortOrder, ViewManager::AlbumCardinality displaySingleAlbum,
ViewManager::AlbumViewStyle showDiscHeaders, ViewManager::RadioSpecificStyle radioCase);
void switchFilesBrowserView(ViewManager::ViewsType viewType, int expectedDepth,
const QString &mainTitle, const QUrl &imageUrl);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment