]> git.sesse.net Git - kdenlive/blob - src/tracksconfigdialog.h
Fix label
[kdenlive] / src / tracksconfigdialog.h
1 /***************************************************************************
2  *   Copyright (C) 2010 by Till Theato (root@ttill.de)                     *
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                         *
16  *   Free Software Foundation, Inc.,                                       *
17  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
18  ***************************************************************************/
19
20 #ifndef TRACKSCONFIGDIALOG_H
21 #define TRACKSCONFIGDIALOG_H
22
23 #include "ui_tracksconfigdialog_ui.h"
24
25 #include <QItemDelegate>
26
27 class TracksDelegate : public QItemDelegate
28 {
29     Q_OBJECT
30 public:
31     TracksDelegate(QObject *parent = 0);
32     QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
33     void setEditorData(QWidget *editor, const QModelIndex &index) const;
34     void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
35 private slots:
36     void emitCommitData();
37 };
38
39
40 struct TrackInfo;
41 class KdenliveDoc;
42 class QTableWidgetItem;
43
44 /**
45  * @class TracksConfigDialog
46  * @brief A dialog to change the name, type, ... of tracks.
47  * @author Till Theato
48  */
49
50 class TracksConfigDialog : public QDialog, public Ui::TracksConfigDialog_UI
51 {
52     Q_OBJECT
53 public:
54     /** @brief Sets up the table.
55     * @param doc the kdenlive document whose tracks to use
56     * @param selected the track which should be selected by default
57     * @param parent the parent widget */
58     explicit TracksConfigDialog(KdenliveDoc * doc, int selected = -1, QWidget * parent = 0);
59
60     /** @brief Returns the new list of tracks created from the table. */
61     const QList <TrackInfo> tracksList();
62
63     /** @brief A list of tracks, which sould be deleted. */
64     QList <int> deletedTracks() const;
65
66 private slots:
67     /** @brief Updates the "hidden" checkbox if type was changed. */
68     void slotUpdateRow(QTableWidgetItem *item);
69
70 private slots:
71     /** @brief Recreates the table from the list of tracks in m_doc. */
72     void setupOriginal(int selected = -1);
73
74     /** @brief Marks a track to be deleted. */
75     void slotDelete();
76
77 private:
78     KdenliveDoc *m_doc;
79     QList <int> m_deletedRows;
80 };
81
82 #endif