Sayonara Player
LocalLibraryMenu.h
1 /* LocalLibraryMenu.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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 sigReloadLibrary();
51  void sigImportFile();
52  void sigImportFolder();
53  void sigInfo();
54 
55  void sigNameChanged(const QString& name);
56  void sigPathChanged(const QString& path);
57 
58  public:
59  explicit LocalLibraryMenu(const QString& name, const QString& path, QWidget* parent = nullptr);
60  ~LocalLibraryMenu() override;
61 
62  void refreshName(const QString& name);
63  void refreshPath(const QString& path);
64 
65  void setLibraryBusy(bool b);
66  void setLibraryEmpty(bool b);
67 
68  void addPreferenceAction(Gui::PreferenceAction* action);
69 
70  private:
71  void initMenu();
72  void shortcutChanged(ShortcutIdentifier identifier);
73 
74  private slots:
75  void editClicked();
76  void editAccepted();
77 
78  protected:
79  void languageChanged() override;
80  void skinChanged() override;
81  };
82 }
83 
84 #endif // LOCALLIBRARYMENU_H
Library::LocalLibraryMenu
A menu in the player's menubar containing some library actions.
Definition: LocalLibraryMenu.h:45
Gui::WidgetTemplate
Template for Sayonara Widgets. This template is responsible for holding a reference to the settings.
Definition: WidgetTemplate.h:87
Gui::PreferenceAction
A PreferenceAction can be added to each widget supporting QActions. When triggering this action,...
Definition: PreferenceAction.h:40
Library
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:31