Sayonara Player
LocalLibraryMenu.h
1 /* LocalLibraryMenu.h */
2 
3 /* Copyright (C) 2011-2017 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 #ifndef LOCALLIBRARYMENU_H
22 #define LOCALLIBRARYMENU_H
23 
24 #include "GUI/Utils/Widgets/WidgetTemplate.h"
25 #include "GUI/Utils/Shortcuts/ShortcutIdentifier.h"
26 #include "Utils/Pimpl.h"
27 
28 #include <QMenu>
29 #include <QAction>
30 
31 class PreferenceAction;
32 
33 namespace Library
34 {
36  public Gui::WidgetTemplate<QMenu>
37  {
38  Q_OBJECT
39  PIMPL(LocalLibraryMenu)
40 
41  signals:
42  void sig_reload_library();
43  void sig_import_file();
44  void sig_import_folder();
45  void sig_info();
46 
47  void sig_name_changed(const QString& name);
48  void sig_path_changed(const QString& path);
49 
50  public:
51  explicit LocalLibraryMenu(const QString& name, const QString& path, QWidget* parent=nullptr);
52  virtual ~LocalLibraryMenu();
53 
54  void refresh_name(const QString& name);
55  void refresh_path(const QString& path);
56 
57  void set_show_album_covers_checked(bool checked);
58  void set_library_busy(bool b);
59  void add_preference_action(PreferenceAction* action);
60 
61  private:
62  void init_menu();
63 
64  protected:
65  void language_changed() override;
66  void skin_changed() override;
67  void shortcut_changed(ShortcutIdentifier identifier);
68 
69  private slots:
70  void show_album_covers_changed();
71  void show_album_covers_triggered(bool b);
72 
73  void show_album_artists_changed();
74  void show_album_artists_triggered(bool b);
75 
76  void realtime_search_changed();
77  void realtime_search_triggered(bool b);
78 
79  void edit_clicked();
80  void edit_accepted();
81  };
82 }
83 
84 #endif // LOCALLIBRARYMENU_H
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings...
Definition: WidgetTemplate.h:78
Definition: PreferenceAction.h:30
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Definition: LocalLibraryMenu.h:35