1 /***************************************************************************
2 * Copyright (C) 2010 by Till Theato (root@ttill.de) *
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. *
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. *
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 ***************************************************************************/
20 #ifndef TRACKSCONFIGDIALOG_H
21 #define TRACKSCONFIGDIALOG_H
23 #include "ui_tracksconfigdialog_ui.h"
25 #include <QItemDelegate>
27 class TracksDelegate : public QItemDelegate
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;
36 void emitCommitData();
42 class QTableWidgetItem;
45 * @class TracksConfigDialog
46 * @brief A dialog to change the name, type, ... of tracks.
50 class TracksConfigDialog : public QDialog, public Ui::TracksConfigDialog_UI
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 TracksConfigDialog(KdenliveDoc * doc, int selected = -1, QWidget * parent = 0);
60 /** @brief Returns the new list of tracks created from the table. */
61 const QList <TrackInfo> tracksList();
63 /** @brief A list of tracks, which sould be deleted. */
64 QList <int> deletedTracks();
67 /** @brief Updates the "hidden" checkbox if type was changed. */
68 void slotUpdateRow(QTableWidgetItem *item);
71 /** @brief Recreates the table from the list of tracks in m_doc. */
72 void setupOriginal(int selected = -1);
74 /** @brief Marks a track to be deleted. */
79 QList <int> m_deletedRows;