Sayonara Player
GUI_DirectoryWidget.h
1 /* GUI_DirectoryWidget.h */
2 
3 /* Copyright (C) 2011-2016 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef GUI_DIRECTORYWIDGET_H
24 #define GUI_DIRECTORYWIDGET_H
25 
26 #include "GUI/DirectoryWidget/ui_GUI_DirectoryWidget.h"
27 #include "GUI/Helper/SayonaraWidget/SayonaraWidget.h"
28 #include "Interfaces/LibraryInterface/LibraryContainer/LibraryContainer.h"
29 
30 
31 #include <QWidget>
32 #include <QFileSystemModel>
33 #include <QShowEvent>
34 #include <QMouseEvent>
35 
36 class LocalLibrary;
37 class IconProvider;
38 class LocalLibrary;
40 class LibraryContextMenu;
41 
43  public SayonaraWidget,
45 {
46  Q_OBJECT
47 
48 public:
49  explicit GUI_DirectoryWidget(QWidget *parent = 0);
51 
52  QComboBox* get_libchooser();
53 
54 
55 private:
56  IconProvider* _icon_provider=nullptr;
57  QFileSystemModel* _file_model=nullptr;
58  LocalLibrary* _local_library=nullptr;
59  AbstractSearchFileTreeModel* _dir_model=nullptr;
60 
61 
62 
63  QModelIndex _found_idx;
64  QString _search_term;
65  QStringList _found_strings;
66 
67 private:
68  void showEvent(QShowEvent* e) override;
69  void init_shortcuts();
70 
71 private slots:
72  void search_button_clicked();
73  void search_term_changed(const QString& term);
74  void directory_loaded(const QString& path);
75  void files_loaded(const QString& path);
76  void init_dir_view();
77  void dir_clicked(QModelIndex idx);
78  void dir_pressed(QModelIndex idx);
79  void file_dbl_clicked(QModelIndex idx);
80  void file_pressed(QModelIndex idx);
81  void dir_info_clicked();
82  void dir_append_clicked();
83  void dir_play_next_clicked();
84  void dir_delete_clicked();
85 
86  void file_info_clicked();
87  void file_append_clicked();
88  void file_play_next_clicked();
89  void file_delete_clicked();
90 };
91 
92 
93 // for showing up in library tree
96 {
97 
98  Q_OBJECT
99 
100 private:
101  GUI_DirectoryWidget* ui=nullptr;
102 
103 public:
104 
105  DirectoryLibraryContainer(QObject* parent=nullptr);
106 
107  QIcon get_icon() const override;
108  QString get_display_name() const override;
109  QString get_name() const override;
110  QWidget* get_ui() const override;
111  QComboBox* get_libchooser() override;
112  void init_ui() override;
113 
114 };
115 
116 
117 
118 #endif // GUI_DIRECTORYWIDGET_H
Definition: GUI_DirectoryWidget.h:94
Definition: DirectoryIconProvider.h:29
Definition: GUI_DirectoryWidget.h:42
Definition: LocalLibrary.h:31
Widget with Settings connection. Also contains triggers for language_changed() and skin_changed() wi...
Definition: SayonaraWidget.h:41
Definition: ui_GUI_DirectoryWidget.h:146
An interface class needed when implementing a library plugin.
Definition: LibraryContainer.h:42
Definition: LibraryContextMenu.h:33
Definition: SearchableFileTreeView.h:32