]> git.sesse.net Git - kdenlive/blobdiff - src/tracksconfigdialog.h
Add "Configure Tracks" dialog to change the settings (name, type, ...) of all tracks...
[kdenlive] / src / tracksconfigdialog.h
diff --git a/src/tracksconfigdialog.h b/src/tracksconfigdialog.h
new file mode 100644 (file)
index 0000000..3c2bea5
--- /dev/null
@@ -0,0 +1,73 @@
+/***************************************************************************
+ *   Copyright (C) 2010 by Till Theato (root@ttill.de)                     *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA          *
+ ***************************************************************************/
+
+#ifndef TRACKSCONFIGDIALOG_H
+#define TRACKSCONFIGDIALOG_H
+
+#include "ui_tracksconfigdialog_ui.h"
+
+#include <QItemDelegate>
+
+class TracksDelegate : public QItemDelegate
+{
+    Q_OBJECT
+public:
+    TracksDelegate(QObject *parent = 0);
+    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
+    void setEditorData(QWidget *editor, const QModelIndex &index) const;
+    void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
+private slots:
+    void emitCommitData();
+};
+
+
+struct TrackInfo;
+class KdenliveDoc;
+class QTableWidgetItem;
+
+/**
+ * @class TracksConfigDialog
+ * @brief A dialog to change the name, type, ... of tracks.
+ * @author Till Theato
+ */
+
+class TracksConfigDialog : public QDialog, public Ui::TracksConfigDialog_UI
+{
+    Q_OBJECT
+public:
+    /** @brief Sets up the table.
+    * @param doc the kdenlive document whose tracks to use
+    * @param selected the track which should be selected by default
+    * @param parent the parent widget */
+    TracksConfigDialog(KdenliveDoc * doc, int selected = -1, QWidget * parent = 0);
+
+    /** @brief Returns the new list of tracks created from the table. */
+    const QList <TrackInfo> tracksList();
+
+private slots:
+    /** @brief Updates the "hidden" checkbox if type was changed. */
+    void slotUpdateRow(QTableWidgetItem *item);
+
+private:
+    /** @brief Recreates the table from the list of tracks in m_doc. */
+    void setupOriginal(int selected = -1);
+    KdenliveDoc *m_doc;
+};
+
+#endif