| 1 | /* smplayer, GUI front-end for mplayer.
|
|---|
| 2 | Copyright (C) 2006-2013 Ricardo Villalba <rvm@users.sourceforge.net>
|
|---|
| 3 |
|
|---|
| 4 | This program is free software; you can redistribute it and/or modify
|
|---|
| 5 | it under the terms of the GNU General Public License as published by
|
|---|
| 6 | the Free Software Foundation; either version 2 of the License, or
|
|---|
| 7 | (at your option) any later version.
|
|---|
| 8 |
|
|---|
| 9 | This program is distributed in the hope that it will be useful,
|
|---|
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 12 | GNU General Public License for more details.
|
|---|
| 13 |
|
|---|
| 14 | You should have received a copy of the GNU General Public License
|
|---|
| 15 | along with this program; if not, write to the Free Software
|
|---|
| 16 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|---|
| 17 | */
|
|---|
| 18 |
|
|---|
| 19 | #ifndef EDITABLETOOLBAR_H
|
|---|
| 20 | #define EDITABLETOOLBAR_H
|
|---|
| 21 |
|
|---|
| 22 | #include <QToolBar>
|
|---|
| 23 | #include <QList>
|
|---|
| 24 | #include <QStringList>
|
|---|
| 25 |
|
|---|
| 26 | class QAction;
|
|---|
| 27 | class QWidget;
|
|---|
| 28 |
|
|---|
| 29 | class EditableToolbar : public QToolBar
|
|---|
| 30 | {
|
|---|
| 31 | Q_OBJECT
|
|---|
| 32 |
|
|---|
| 33 | public:
|
|---|
| 34 | EditableToolbar( QWidget * parent = 0 );
|
|---|
| 35 | ~EditableToolbar();
|
|---|
| 36 |
|
|---|
| 37 | void setActionsFromStringList(QStringList action_names);
|
|---|
| 38 | QStringList actionsToStringList();
|
|---|
| 39 |
|
|---|
| 40 | void setAvailableActions(QList<QAction *> available_actions) { all_actions = available_actions; }
|
|---|
| 41 |
|
|---|
| 42 | void takeAvailableActionsFrom(QWidget * w) { widget = w; }
|
|---|
| 43 |
|
|---|
| 44 | void setDefaultActions(QStringList action_names) { default_actions = action_names; }
|
|---|
| 45 | QStringList defaultActions() { return default_actions; }
|
|---|
| 46 |
|
|---|
| 47 | public slots:
|
|---|
| 48 | void edit();
|
|---|
| 49 |
|
|---|
| 50 | protected:
|
|---|
| 51 | QList<QAction *> allActions();
|
|---|
| 52 |
|
|---|
| 53 | QList<QAction *> all_actions;
|
|---|
| 54 | QWidget * widget;
|
|---|
| 55 |
|
|---|
| 56 | QStringList default_actions;
|
|---|
| 57 | };
|
|---|
| 58 |
|
|---|
| 59 | #endif
|
|---|