Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
40545ad
Search related tracks in collection
uklotzde Oct 17, 2020
b222007
Reduce log spam
uklotzde Oct 18, 2020
8e2ba9e
Add more search options for related tracks
uklotzde Oct 17, 2020
a6e71c5
Make "Search related Tracks" the first menu entry
uklotzde Oct 17, 2020
234a591
WTrackWidgetGroup: Enable searching for related tracks
uklotzde Oct 18, 2020
a41d28a
WTrackText: Enable searching for related tracks
uklotzde Oct 18, 2020
8f15c9c
WTrackProperty: Enable searching for related tracks
uklotzde Oct 18, 2020
653b555
Search for related tracks by title
uklotzde Oct 18, 2020
012d9bc
Extract WSearchRelatedTracksMenu from WTrackMenu
uklotzde Oct 18, 2020
a1e6689
Add missing receiver context for signal connection via functor
uklotzde Oct 18, 2020
b4ea497
Delete obsolete TODO comment
uklotzde Oct 18, 2020
15f4eb6
Search for tracks with similar bpm +/-6%
uklotzde Oct 18, 2020
d4660d2
WSearchRelatedTracksMenu: Add member function for adding actions
uklotzde Oct 19, 2020
b3f8ead
WSearchRelatedTracksMenu: Search for grouping and (release) year
uklotzde Oct 19, 2020
57d80c6
WSearchRelatedTracksMenu: Reorder and relabel menu entries
uklotzde Oct 19, 2020
1f0d13a
WTrackMenu: Use const reference
uklotzde Oct 20, 2020
f6bbcc0
Merge branch 'master' into wtrackmenu_search_related
uklotzde Oct 20, 2020
897ed46
WSearchRelatedTracksMenu: Re-add missing quotes for key search
uklotzde Oct 20, 2020
c6eae53
WSearchRelatedTracksMenu: Split artists from title/grouping actions
uklotzde Oct 20, 2020
544d142
Merge branch 'main' into wtrackmenu_search_related
uklotzde Oct 22, 2020
da79a1e
WSearchRelatedTracksMenu: Use an in/out parameter
uklotzde Oct 24, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -902,6 +902,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/widget/wpushbutton.cpp
src/widget/wrecordingduration.cpp
src/widget/wsearchlineedit.cpp
src/widget/wsearchrelatedtracksmenu.cpp
src/widget/wsingletoncontainer.cpp
src/widget/wsizeawarestack.cpp
src/widget/wskincolor.cpp
Expand Down
1 change: 1 addition & 0 deletions build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,7 @@ def sources(self, build):
"src/widget/wspinny.cpp",
"src/widget/wskincolor.cpp",
"src/widget/wsearchlineedit.cpp",
"src/widget/wsearchrelatedtracksmenu.cpp",
"src/widget/wpixmapstore.cpp",
"src/widget/paintable.cpp",
"src/widget/wimagestore.cpp",
Expand Down
12 changes: 6 additions & 6 deletions src/library/autodj/dlgautodj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const char* kPreferenceGroupName = "[Auto DJ]";
const char* kRepeatPlaylistPreference = "Requeue";
} // anonymous namespace

DlgAutoDJ::DlgAutoDJ(
WLibrary* parent,
DlgAutoDJ::DlgAutoDJ(WLibrary* parent,
UserSettingsPointer pConfig,
Library* pLibrary,
AutoDJProcessor* pProcessor,
Expand All @@ -26,10 +25,11 @@ DlgAutoDJ::DlgAutoDJ(
Ui::DlgAutoDJ(),
m_pConfig(pConfig),
m_pAutoDJProcessor(pProcessor),
m_pTrackTableView(new WTrackTableView(this, m_pConfig,
pLibrary->trackCollections(),
parent->getTrackTableBackgroundColorOpacity(),
/*no sorting*/ false)),
m_pTrackTableView(new WTrackTableView(this,
m_pConfig,
pLibrary,
parent->getTrackTableBackgroundColorOpacity(),
/*no sorting*/ false)),
m_bShowButtonText(parent->getShowButtonText()),
m_pAutoDJTableModel(nullptr) {
setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/library/dlganalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ DlgAnalysis::DlgAnalysis(WLibrary* parent,
m_pAnalysisLibraryTableView = new WAnalysisLibraryTableView(
this,
pConfig,
pLibrary->trackCollections(),
pLibrary,
parent->getTrackTableBackgroundColorOpacity());
connect(m_pAnalysisLibraryTableView,
&WAnalysisLibraryTableView::loadTrack,
Expand Down
2 changes: 1 addition & 1 deletion src/library/dlghidden.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DlgHidden::DlgHidden(
new WTrackTableView(
this,
pConfig,
pLibrary->trackCollections(),
pLibrary,
parent->getTrackTableBackgroundColorOpacity(),
false)) {
setupUi(this);
Expand Down
2 changes: 1 addition & 1 deletion src/library/dlgmissing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ DlgMissing::DlgMissing(
new WTrackTableView(
this,
pConfig,
pLibrary->trackCollections(),
pLibrary,
parent->getTrackTableBackgroundColorOpacity(),
false)) {
setupUi(this);
Expand Down
11 changes: 10 additions & 1 deletion src/library/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void Library::bindLibraryWidget(
WLibrary* pLibraryWidget, KeyboardEventFilter* pKeyboard) {
WTrackTableView* pTrackTableView = new WTrackTableView(pLibraryWidget,
m_pConfig,
m_pTrackCollectionManager,
this,
pLibraryWidget->getTrackTableBackgroundColorOpacity(),
true);
pTrackTableView->installEventFilter(pKeyboard);
Expand Down Expand Up @@ -551,3 +551,12 @@ TrackCollection& Library::trackCollection() {
DEBUG_ASSERT(m_pTrackCollectionManager->internalCollection());
return *m_pTrackCollectionManager->internalCollection();
}

void Library::searchTracksInCollection(const QString& query) {
VERIFY_OR_DEBUG_ASSERT(m_pMixxxLibraryFeature) {
return;
}
m_pMixxxLibraryFeature->searchAndActivate(query);
emit switchToView(m_sTrackViewName);
m_pSidebarModel->activateDefaultSelection();
}
4 changes: 4 additions & 0 deletions src/library/library.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ class Library: public QObject {
void setRowHeight(int rowHeight);
void setEditMedatataSelectedClick(bool enable);

/// Triggers a new search in the internal track collection
/// and shows the results by switching the view.
void searchTracksInCollection(const QString& query);

public slots:
void slotShowTrackModel(QAbstractItemModel* model);
void slotSwitchToView(const QString& view);
Expand Down
9 changes: 8 additions & 1 deletion src/library/mixxxlibraryfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,15 @@ void MixxxLibraryFeature::refreshLibraryModels() {
}
}

void MixxxLibraryFeature::searchAndActivate(const QString& query) {
VERIFY_OR_DEBUG_ASSERT(m_pLibraryTableModel) {
return;
}
m_pLibraryTableModel->search(query);
activate();
}

void MixxxLibraryFeature::activate() {
qDebug() << "MixxxLibraryFeature::activate()";
emit showTrackModel(m_pLibraryTableModel);
emit enableCoverArtDisplay(true);
}
Expand Down
2 changes: 2 additions & 0 deletions src/library/mixxxlibraryfeature.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ class MixxxLibraryFeature final : public LibraryFeature {
return true;
}

void searchAndActivate(const QString& query);

public slots:
void activate() override;
void activateChild(const QModelIndex& index) override;
Expand Down
2 changes: 1 addition & 1 deletion src/library/recording/dlgrecording.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ DlgRecording::DlgRecording(
new WTrackTableView(
this,
pConfig,
pLibrary->trackCollections(),
pLibrary,
parent->getTrackTableBackgroundColorOpacity(),
true)),
m_browseModel(this, pLibrary->trackCollections(), pRecordingManager),
Expand Down
6 changes: 3 additions & 3 deletions src/skin/legacyskinparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ QWidget* LegacySkinParser::parseText(const QDomElement& node) {

WTrackText* p = new WTrackText(m_pParent,
m_pConfig,
m_pLibrary->trackCollections(),
m_pLibrary,
group);
setupLabelWidget(node, p);

Expand Down Expand Up @@ -1021,7 +1021,7 @@ QWidget* LegacySkinParser::parseTrackProperty(const QDomElement& node) {
WTrackProperty* p = new WTrackProperty(
m_pParent,
m_pConfig,
m_pLibrary->trackCollections(),
m_pLibrary,
group);
setupLabelWidget(node, p);

Expand Down Expand Up @@ -1053,7 +1053,7 @@ QWidget* LegacySkinParser::parseTrackWidgetGroup(const QDomElement& node) {
WTrackWidgetGroup* pGroup = new WTrackWidgetGroup(
m_pParent,
m_pConfig,
m_pLibrary->trackCollections(),
m_pLibrary,
group);
commonWidgetSetup(node, pGroup);
pGroup->setup(node, *m_pContext);
Expand Down
4 changes: 2 additions & 2 deletions src/widget/wanalysislibrarytableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
WAnalysisLibraryTableView::WAnalysisLibraryTableView(
QWidget* parent,
UserSettingsPointer pConfig,
TrackCollectionManager* pTrackCollectionManager,
Library* pLibrary,
double trackTableBackgroundColorOpacity)
: WTrackTableView(parent,
pConfig,
pTrackCollectionManager,
pLibrary,
trackTableBackgroundColorOpacity,
true) {
setDragDropMode(QAbstractItemView::DragOnly);
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wanalysislibrarytableview.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class WAnalysisLibraryTableView : public WTrackTableView {
WAnalysisLibraryTableView(
QWidget* parent,
UserSettingsPointer pConfig,
TrackCollectionManager* pTrackCollectionManager,
Library* pLibrary,
double trackTableBackgroundColorOpacity);

void onSearch(const QString& text) override;
Expand Down
Loading