Sayonara Player
LocalLibraryMenu.h
1 /* LocalLibraryMenu.h */
2 
3 /* Copyright (C) 2011-2019 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 namespace Gui
32 {
33  class PreferenceAction;
34 }
35 
36 namespace Library
37 {
44  public Gui::WidgetTemplate<QMenu>
45  {
46  Q_OBJECT
47  PIMPL(LocalLibraryMenu)
48 
49  signals:
50  void sig_reload_library();
51  void sig_import_file();
52  void sig_import_folder();
53  void sig_info();
54 
55  void sig_name_changed(const QString& name);
56  void sig_path_changed(const QString& path);
57 
58  public:
59  explicit LocalLibraryMenu(const QString& name, const QString& path, QWidget* parent=nullptr);
60  virtual ~LocalLibraryMenu();
61 
62  void refresh_name(const QString& name);
63  void refresh_path(const QString& path);
64 
65  void set_show_album_covers_checked(bool checked);
66  void set_library_busy(bool b);
67  void add_preference_action(Gui::PreferenceAction* action);
68 
69  private:
70  void init_menu();
71 
72  protected:
73  void language_changed() override;
74  void skin_changed() override;
75  void shortcut_changed(ShortcutIdentifier identifier);
76 
77  private slots:
78  void show_album_covers_changed();
79  void show_album_covers_triggered(bool b);
80 
81  void show_album_artists_changed();
82  void show_album_artists_triggered(bool b);
83 
84  void realtime_search_changed();
85  void realtime_search_triggered(bool b);
86 
87  void edit_clicked();
88  void edit_accepted();
89  };
90 }
91 
92 #endif // LOCALLIBRARYMENU_H
Definition: AbstractLibrary.h:36
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings...
Definition: WidgetTemplate.h:84
A PreferenceAction can be added to each widget supporting QActions. When triggering this action...
Definition: PreferenceAction.h:38
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32
A menu in the player&#39;s menubar containing some library actions.
Definition: LocalLibraryMenu.h:43