Skip to content

Commit

Permalink
Added2ViewLogicGroupedAndNonGrouped
Browse files Browse the repository at this point in the history
  • Loading branch information
evelynnev committed Jan 27, 2025
1 parent f269193 commit 027d7b9
Show file tree
Hide file tree
Showing 12 changed files with 4,572 additions and 525 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1266,10 +1266,12 @@ add_library(
src/library/trackset/crate/cratetablemodel.cpp
#EVE
src/library/trackset/smarties/smartiesfeature.cpp
src/library/trackset/smarties/groupedsmartiesfeature.cpp
src/library/trackset/smarties/smartiesfeaturehelper.cpp
src/library/trackset/smarties/smartiesstorage.cpp
src/library/trackset/smarties/smartiestablemodel.cpp
src/library/trackset/smarties/dlgsmartiesinfo.cpp
src/library/trackset/smarties/dlggroupedsmartiesinfo.cpp
src/library/trackset/smarties/dlgsmartiesinfo.ui
src/library/trackset/playlistfeature.cpp
src/library/trackset/setlogfeature.cpp
Expand Down
47 changes: 41 additions & 6 deletions src/library/library.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "library/trackmodel.h"
#include "library/trackset/crate/cratefeature.h"
// EVE
#include "library/trackset/smarties/groupedsmartiesfeature.h"
#include "library/trackset/smarties/smartiesfeature.h"
// EVE
#include "library/trackset/playlistfeature.h"
Expand Down Expand Up @@ -77,6 +78,7 @@ Library::Library(
m_pPlaylistFeature(nullptr),
m_pCrateFeature(nullptr),
m_pSmartiesFeature(nullptr),
m_pGroupedSmartiesFeature(nullptr),
m_pAnalysisFeature(nullptr) {
qRegisterMetaType<LibraryRemovalType>("LibraryRemovalType");

Expand Down Expand Up @@ -109,10 +111,6 @@ Library::Library(

m_pCrateFeature = new CrateFeature(this, m_pConfig);
addFeature(m_pCrateFeature);
// EVE
m_pSmartiesFeature = new SmartiesFeature(this, m_pConfig);
addFeature(m_pSmartiesFeature);
// EVE

#ifdef __ENGINEPRIME__
connect(m_pCrateFeature,
Expand All @@ -127,6 +125,24 @@ Library::Library(
Qt::DirectConnection);
#endif

// EVE
if ((m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesEnabled"), true)) &&
(m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesReplace"), false))) {
qDebug() << "[GROUPEDSMARTIESFEATURE] -> GroupedSmartiesEnabled "
<< m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesEnabled"));

qDebug() << "[GROUPEDSMARTIESFEATURE] -> GroupedSmartiesReplace "
<< m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesReplace"));
} else {
m_pSmartiesFeature = new SmartiesFeature(this, m_pConfig);
addFeature(m_pSmartiesFeature);
}
if (m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesEnabled"), true)) {
m_pGroupedSmartiesFeature = new GroupedSmartiesFeature(this, m_pConfig);
addFeature(m_pGroupedSmartiesFeature);
}
// EVE

m_pBrowseFeature = new BrowseFeature(
this, m_pConfig, pRecordingManager);
connect(m_pBrowseFeature,
Expand Down Expand Up @@ -606,14 +622,33 @@ void Library::slotCreateCrate() {
m_pCrateFeature->slotCreateCrate();
}

// EVE
void Library::slotCreateSmartiesFromSearch(const QString& text) {
m_pSmartiesFeature->slotCreateSmartiesFromSearch(text);
if ((m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesEnabled"), true)) &&
(m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesReplace"), true))) {
m_pGroupedSmartiesFeature->slotCreateSmartiesFromSearch(text);
} else {
m_pSmartiesFeature->slotCreateSmartiesFromSearch(text);
}
}

// void Library::slotCreateSmartiesFromSearch(const QString& text) {
// m_pSmartiesFeature->slotCreateSmartiesFromSearch(text);
// }

void Library::slotCreateSmarties() {
m_pSmartiesFeature->slotCreateSmarties();
if ((m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesEnabled"), true)) &&
(m_pConfig->getValue(ConfigKey("[Library]", "GroupedSmartiesReplace"), true))) {
m_pGroupedSmartiesFeature->slotCreateSmarties();
} else {
m_pSmartiesFeature->slotCreateSmarties();
}
}

// void Library::slotCreateSmarties() {
// m_pSmartiesFeature->slotCreateSmarties();
// }

void Library::onSkinLoadFinished() {
// Enable the default selection when a new skin is loaded.
m_pSidebarModel->activateDefaultSelection();
Expand Down
2 changes: 2 additions & 0 deletions src/library/library.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class ControlObject;
class CrateFeature;
// EVE
class SmartiesFeature;
class GroupedSmartiesFeature;
// EVE
class LibraryControl;
class LibraryFeature;
Expand Down Expand Up @@ -204,6 +205,7 @@ class Library: public QObject {
PlaylistFeature* m_pPlaylistFeature;
CrateFeature* m_pCrateFeature;
SmartiesFeature* m_pSmartiesFeature;
GroupedSmartiesFeature* m_pGroupedSmartiesFeature;
AnalysisFeature* m_pAnalysisFeature;
BrowseFeature* m_pBrowseFeature;
QFont m_trackTableFont;
Expand Down
Loading

0 comments on commit 027d7b9

Please sign in to comment.