Sayonara Player
GUI_LocalLibrary.h
1 /* GUI_LocalLibrary.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  * GUI_LocalLibrary.h
24  *
25  * Created on: Apr 24, 2011
26  * Author: Lucio Carreras
27  */
28 
29 #ifndef GUI_LOCAL_LIBRARY_H_
30 #define GUI_LOCAL_LIBRARY_H_
31 
32 
33 #include "GUI/Library/ui_GUI_LocalLibrary.h"
34 #include "GUI_AbstractLibrary.h"
35 #include "Components/Library/LibraryNamespaces.h"
36 #include "Interfaces/LibraryInterface/LibraryContainer/LibraryContainer.h"
37 
38 class GUI_LibraryInfoBox;
39 class GUI_ImportFolder;
40 class LocalLibraryMenu;
41 
43  public GUI_AbstractLibrary,
44  private Ui::GUI_LocalLibrary
45 {
46 
47  friend class GUI_AbstractLibrary;
48 
49 Q_OBJECT
50 
51 public:
52 
53  GUI_LocalLibrary(QWidget* parent=nullptr);
54  virtual ~GUI_LocalLibrary();
55 
56  QComboBox* get_libchooser() const;
57  QMenu* get_menu() const;
58 
59 protected:
60  void showEvent(QShowEvent* e) override;
61  void init_shortcuts() override;
62 
63  Library::ReloadQuality show_quality_dialog();
64 
65 
66 protected slots:
67 
68  void disc_pressed(int);
69  void lib_no_lib_path();
70  void progress_changed(const QString& type, int progress);
71 
72  void genre_selection_changed(const QModelIndex& index);
73  void paths_activated(const QStringList& paths);
74 
75  // after drag and drop from library views we land here
76 
77 
78  void reload_library_requested();
79  void import_dirs_requested();
80  void import_files_requested();
81  void import_files(const QStringList& files);
82 
83 
84  // importer requests dialog
85  void import_dialog_requested();
86 
87  // set library path clicked
88  void set_library_path_clicked();
89 
90  void splitter_artist_moved(int pos, int idx);
91  void splitter_tracks_moved(int pos, int idx);
92  void splitter_genre_moved(int pos, int idx);
93 
94  // reimplemented from Abstract Library
95  Library::TrackDeletionMode show_delete_dialog(int n_tracks) override;
96  void reload_finished();
97 
98  void show_info_box();
99 
100  // reimplemented from Sayonara widget
101  void language_changed() override;
102 
103  void _sl_libpath_changed();
104 
105 
106 private:
107  GUI_LibraryInfoBox* _library_info_box=nullptr;
108  GUI_ImportFolder* _ui_importer=nullptr;
109  LocalLibraryMenu* _local_library_menu=nullptr;
110 
111 };
112 
113 
114 
115 
118 {
119  Q_OBJECT
120 
121 private:
122  GUI_LocalLibrary* _ui=nullptr;
123 
124 public:
125 
126  LocalLibraryContainer(QObject* parent=nullptr);
127 
128  // override from LibraryViewInterface
129  QString get_name() const override;
130  QString get_display_name() const override;
131  QIcon get_icon() const override;
132  QWidget* get_ui() const override;
133  QComboBox* get_libchooser() override;
134  QMenu* get_menu() override;
135  void init_ui() override;
136 };
137 
138 #endif /* GUI_LocalLibrary_H_ */
139 
QMenu * get_menu() override
return actions menu (may be nullptr). The title does not have to be set
QWidget * get_ui() const override
Should return the UI for the library view.
QIcon get_icon() const override
Should return the icon displayed in the library view combobox.
Definition: GUI_ImportFolder.h:34
Definition: ui_GUI_LocalLibrary.h:450
An interface class needed when implementing a library plugin.
Definition: LibraryContainer.h:42
void init_ui() override
Should initialize the ui. The ui constructor should be called within this function.
QString get_name() const override
Should return an untranslated name used for identifying this widget.
Definition: GUI_AbstractLibrary.h:57
Definition: GUI_LibraryInfoBox.h:33
QComboBox * get_libchooser() override
Should return the library chooser combo box.
Definition: LocalLibraryMenu.h:33
Definition: GUI_LocalLibrary.h:42
QString get_display_name() const override
Should return the translated name displayed in the library view combobox.
Definition: GUI_LocalLibrary.h:116