1 /* GUI_PlayerMenubar.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 GUI_PLAYERMENUBAR_H 22 #define GUI_PLAYERMENUBAR_H 23 24 #include "Gui/Utils/Shortcuts/ShortcutIdentifier.h" 25 #include "Gui/Utils/Widgets/WidgetTemplate.h" 26 #include "Utils/Pimpl.h" 27 28 #include <QMenuBar> 29 30 namespace Library 31 { 32 class AbstractContainer; 33 } 34 35 namespace PlayerPlugin 36 { 37 class Base; 38 } 39 40 class PlaylistCreator; 41 42 class Menubar : 43 public Gui::WidgetTemplate<QMenuBar> 44 { 45 Q_OBJECT 46 PIMPL(Menubar) 47 48 signals: 49 void sigCloseClicked(); 50 void sigMinimizeClicked(); 51 void sigLoggerClicked(); 52 53 public: 54 explicit Menubar(PlaylistCreator* playlistCreator, QWidget* parent = nullptr); 55 ~Menubar() override; 56 57 void insertPreferenceAction(QAction* action); 58 59 void showLibraryAction(bool visible); 60 void setShowLibraryActionEnabled(bool b); 61 void showLibraryMenu(bool b); 62 63 private: 64 void initDonateLink(); 65 void initConnections(); 66 void styleChanged(); 67 68 QAction* changeCurrentLibrary(Library::AbstractContainer* library); 69 70 private slots: 71 void openDirClicked(); 72 void openFilesClicked(); 73 void shutdownClicked(); 74 void closeClicked(); 75 void minimizeClicked(); 76 void skinToggled(bool b); 77 void bigCoverToggled(bool b); 78 void showLibraryToggled(bool b); 79 void showFullscreenToggled(bool b); 80 void helpClicked(); 81 void aboutClicked(); 82 void shortcutChanged(ShortcutIdentifier identifier); 83 void pluginAdded(PlayerPlugin::Base* plugin); 84 85 protected: 86 void languageChanged() override; 87 void skinChanged() override; 88 }; 89 90 #endif // GUI_PLAYERMENUBAR_H 91