2010-05-09 22:18:05 +02:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LIBRARYFILTERWIDGET_H
|
|
|
|
#define LIBRARYFILTERWIDGET_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
|
|
#include "librarymodel.h"
|
|
|
|
|
|
|
|
class GroupByDialog;
|
2010-08-28 21:29:20 +02:00
|
|
|
class LineEditInterface;
|
2010-06-09 01:06:29 +02:00
|
|
|
class SettingsDialog;
|
2010-05-10 23:50:31 +02:00
|
|
|
class Ui_LibraryFilterWidget;
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
class QMenu;
|
|
|
|
class QActionGroup;
|
|
|
|
class QSignalMapper;
|
|
|
|
|
|
|
|
class LibraryFilterWidget : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
LibraryFilterWidget(QWidget* parent = 0);
|
|
|
|
~LibraryFilterWidget();
|
|
|
|
|
|
|
|
void SetFilterHint(const QString& hint);
|
|
|
|
void SetAgeFilterEnabled(bool enabled);
|
|
|
|
void SetGroupByEnabled(bool enabled);
|
2010-06-09 17:38:00 +02:00
|
|
|
void AddMenuAction(QAction* action);
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
void SetSettingsGroup(const QString& group) { settings_group_ = group; }
|
|
|
|
void SetLibraryModel(LibraryModel* model);
|
|
|
|
|
2010-08-29 14:15:30 +02:00
|
|
|
public slots:
|
|
|
|
void AppendAndFocus(const QString& text);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void UpPressed();
|
|
|
|
void DownPressed();
|
|
|
|
void ReturnPressed();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void keyReleaseEvent(QKeyEvent* e);
|
|
|
|
|
2010-05-09 22:18:05 +02:00
|
|
|
private slots:
|
|
|
|
void GroupingChanged(const LibraryModel::Grouping& g);
|
|
|
|
void GroupByClicked(QAction* action);
|
|
|
|
void ClearFilter();
|
|
|
|
|
|
|
|
private:
|
2010-05-10 23:50:31 +02:00
|
|
|
Ui_LibraryFilterWidget* ui_;
|
2010-05-09 22:18:05 +02:00
|
|
|
LibraryModel* model_;
|
|
|
|
|
|
|
|
boost::scoped_ptr<GroupByDialog> group_by_dialog_;
|
2010-06-09 01:06:29 +02:00
|
|
|
SettingsDialog* settings_dialog_;
|
2010-05-09 22:18:05 +02:00
|
|
|
|
|
|
|
QMenu* filter_age_menu_;
|
|
|
|
QMenu* group_by_menu_;
|
2010-06-09 17:38:00 +02:00
|
|
|
QMenu* library_menu_;
|
2010-05-09 22:18:05 +02:00
|
|
|
QActionGroup* group_by_group_;
|
|
|
|
QSignalMapper* filter_age_mapper_;
|
|
|
|
|
|
|
|
QString settings_group_;
|
2010-08-28 21:29:20 +02:00
|
|
|
|
|
|
|
LineEditInterface* filter_;
|
2010-05-09 22:18:05 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LIBRARYFILTERWIDGET_H
|