source: smplayer/trunk/src/toolbareditor.h@ 165

Last change on this file since 165 was 165, checked in by Silvan Scherrer, 11 years ago

SMPlayer: update trunk to latest 0.8.7

  • Property svn:eol-style set to LF
File size: 2.4 KB
Line 
1/* smplayer, GUI front-end for mplayer.
2 Copyright (C) 2006-2014 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 _TOOLBAR_EDITOR_H_
20#define _TOOLBAR_EDITOR_H_
21
22#include <QStringList>
23#include <QWidget>
24#include <QList>
25#include <QAction>
26#include "ui_toolbareditor.h"
27
28class QListWidget;
29
30class ToolbarEditor : public QDialog, public Ui::ToolbarEditor
31{
32 Q_OBJECT
33
34public:
35
36 ToolbarEditor( QWidget* parent = 0, Qt::WindowFlags f = 0 );
37 ~ToolbarEditor();
38
39 void setAllActions(QList<QAction *> actions_list);
40 void setActiveActions(QList<QAction *> actions_list);
41
42 QStringList activeActionsToStringList();
43
44 void setDefaultActions(QStringList action_names) { default_actions = action_names; }
45 QStringList defaultActions() { return default_actions; }
46
47 //! Save the widget's list of actions into a QStringList
48 static QStringList save(QWidget *w);
49
50 //! Add to the widget the actions specified in l. actions_list is
51 //! the list of all available actions
52 static void load(QWidget *w, QStringList l, QList<QAction *> actions_list);
53
54protected slots:
55 void on_up_button_clicked();
56 void on_down_button_clicked();
57 void on_right_button_clicked();
58 void on_left_button_clicked();
59 void on_separator_button_clicked();
60 void restoreDefaults();
61 void checkRowsAllList(int currentRow);
62 void checkRowsActiveList(int currentRow);
63
64protected:
65 static QAction * findAction(QString s, QList<QAction *> actions_list);
66
67 static void populateList(QListWidget * w, QList<QAction *> actions_list, bool add_separators = false);
68 static int findItem(const QString & action_name, QListWidget * w);
69
70 static QString fixname(const QString & name, const QString & action_name);
71
72 QList<QAction *> all_actions_copy;
73 QStringList default_actions;
74};
75
76#endif
77
Note: See TracBrowser for help on using the repository browser.