blob: 0665a96b3ce5450b7e0879c07800ef3b9aa598e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
// browsefeature.h
// Created 9/8/2009 by RJ Ryan (rryan@mit.edu)
#ifndef BROWSEFEATURE_H
#define BROWSEFEATURE_H
#include <QStringListModel>
#include <QSortFilterProxyModel>
#include <QObject>
#include <QVariant>
#include <QIcon>
#include <QModelIndex>
#include <QPoint>
#include <QString>
#include "preferences/usersettings.h"
#include "library/browse/browsetablemodel.h"
#include "library/browse/foldertreemodel.h"
#include "library/libraryfeature.h"
#include "library/proxytrackmodel.h"
#define QUICK_LINK_NODE "::mixxx_quick_lnk_node::"
#define DEVICE_NODE "::mixxx_device_node::"
class Library;
class TrackCollection;
class WLibrarySidebar;
class BrowseFeature : public LibraryFeature {
Q_OBJECT
public:
BrowseFeature(Library* pLibrary,
UserSettingsPointer pConfig,
RecordingManager* pRecordingManager);
virtual ~BrowseFeature();
QVariant title();
QIcon getIcon();
void bindLibraryWidget(WLibrary* libraryWidget,
KeyboardEventFilter* keyboard);
void bindSidebarWidget(WLibrarySidebar* pSidebarWidget);
TreeItemModel* getChildModel();
public slots:
void slotAddQuickLink();
void slotRemoveQuickLink();
void slotAddToLibrary();
void activate();
void activateChild(const QModelIndex& index);
void onRightClickChild(const QPoint& globalPos, QModelIndex index);
void onLazyChildExpandation(const QModelIndex& index);
void slotLibraryScanStarted();
void slotLibraryScanFinished();
signals:
void setRootIndex(const QModelIndex&);
void requestAddDir(QString);
void scanLibrary();
private:
QString getRootViewHtml() const;
QString extractNameFromPath(QString spath);
QStringList getDefaultQuickLinks() const;
void saveQuickLinks();
void loadQuickLinks();
TrackCollection* const m_pTrackCollection;
BrowseTableModel m_browseModel;
ProxyTrackModel m_proxyModel;
FolderTreeModel m_childModel;
QAction* m_pAddQuickLinkAction;
QAction* m_pRemoveQuickLinkAction;
QAction* m_pAddtoLibraryAction;
TreeItem* m_pLastRightClickedItem;
TreeItem* m_pQuickLinkItem;
QStringList m_quickLinkList;
QIcon m_icon;
QPointer<WLibrarySidebar> m_pSidebarWidget;
};
#endif // BROWSEFEATURE_H
|