]> git.sesse.net Git - kdenlive/commitdiff
Add "Configure Tracks" dialog to change the settings (name, type, ...) of all tracks...
authorTill Theato <root@ttill.de>
Sat, 29 May 2010 18:56:46 +0000 (18:56 +0000)
committerTill Theato <root@ttill.de>
Sat, 29 May 2010 18:56:46 +0000 (18:56 +0000)
svn path=/trunk/kdenlive/; revision=4487

15 files changed:
src/CMakeLists.txt
src/configtrackscommand.cpp [new file with mode: 0644]
src/configtrackscommand.h [new file with mode: 0644]
src/customtrackview.cpp
src/customtrackview.h
src/documentchecker.cpp
src/headertrack.cpp
src/headertrack.h
src/mainwindow.cpp
src/mainwindow.h
src/tracksconfigdialog.cpp [new file with mode: 0644]
src/tracksconfigdialog.h [new file with mode: 0644]
src/trackview.cpp
src/trackview.h
src/widgets/tracksconfigdialog_ui.ui [new file with mode: 0644]

index 0801e35a9267a48db983e7ad76d0ef002172a3b8..ec46730e236da4c0680b46514a35ed0adf1a7667 100644 (file)
@@ -88,6 +88,7 @@ kde4_add_ui_files(kdenlive_UI
   widgets/templateclip_ui.ui
   widgets/keyframeeditor_ui.ui
   widgets/timecodedisplay_ui.ui
+  widgets/tracksconfigdialog_ui.ui
 )
 
 set(kdenlive_SRCS
@@ -188,6 +189,8 @@ set(kdenlive_SRCS
   kis_cubic_curve.cpp
   kis_curve_widget.cpp
   timecodedisplay.cpp
+  tracksconfigdialog.cpp
+  configtrackscommand.cpp
 )
 
 add_definitions( ${KDE4_DEFINITIONS} )
diff --git a/src/configtrackscommand.cpp b/src/configtrackscommand.cpp
new file mode 100644 (file)
index 0000000..4904f61
--- /dev/null
@@ -0,0 +1,45 @@
+/***************************************************************************
+ *   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          *
+ ***************************************************************************/
+
+
+#include "configtrackscommand.h"
+#include "customtrackview.h"
+
+#include <KLocale>
+
+ConfigTracksCommand::ConfigTracksCommand(CustomTrackView* view, QList< TrackInfo > oldInfos, QList< TrackInfo > newInfos, QUndoCommand* parent) :
+        QUndoCommand(parent),
+        m_view(view),
+        m_oldInfos(oldInfos),
+        m_newInfos(newInfos)
+{
+    setText(i18n("Configure Tracks"));
+}
+
+// virtual
+void ConfigTracksCommand::undo()
+{
+    m_view->configTracks(m_oldInfos);
+}
+
+// virtual
+void ConfigTracksCommand::redo()
+{
+    m_view->configTracks(m_newInfos);
+}
diff --git a/src/configtrackscommand.h b/src/configtrackscommand.h
new file mode 100644 (file)
index 0000000..27f88b7
--- /dev/null
@@ -0,0 +1,45 @@
+/***************************************************************************
+ *   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 CONFIGTRACKSCOMMAND_H
+#define CONFIGTRACKSCOMMAND_H
+
+#include <QUndoCommand>
+#include <QGraphicsView>
+#include <QPointF>
+
+#include <KDebug>
+#include "definitions.h"
+
+class CustomTrackView;
+
+class ConfigTracksCommand : public QUndoCommand
+{
+public:
+    ConfigTracksCommand(CustomTrackView *view, QList <TrackInfo> oldInfos, QList <TrackInfo> newInfos, QUndoCommand * parent = 0);
+    virtual void undo();
+    virtual void redo();
+
+private:
+    CustomTrackView *m_view;
+    QList <TrackInfo> m_oldInfos;
+    QList <TrackInfo> m_newInfos;
+};
+
+#endif
index d667a11d12aef31b03130913254afbdb788c7895..e9915c32325a6b6aba25a695a716153b7ca3f90e 100644 (file)
@@ -57,6 +57,8 @@
 #include "splitaudiocommand.h"
 #include "changecliptypecommand.h"
 #include "trackdialog.h"
+#include "tracksconfigdialog.h"
+#include "configtrackscommand.h"
 
 #include <KDebug>
 #include <KLocale>
@@ -2618,6 +2620,16 @@ void CustomTrackView::changeTrack(int ix, TrackInfo type)
     viewport()->update();
 }
 
+void CustomTrackView::configTracks(QList < TrackInfo > trackInfos)
+{
+    for (int i = 0; i < trackInfos.count(); ++i) {
+        m_document->setTrackType(i, trackInfos.at(i));
+        m_document->renderer()->mltChangeTrackState(i + 1, m_document->trackInfoAt(i).isMute, m_document->trackInfoAt(i).isBlind);
+    }
+
+    QTimer::singleShot(300, this, SIGNAL(trackHeightChanged()));
+    viewport()->update();
+}
 
 void CustomTrackView::slotSwitchTrackAudio(int ix)
 {
@@ -2765,6 +2777,10 @@ void CustomTrackView::slotInsertSpace()
     GenTime spaceDuration = d.selectedDuration();
     track = d.selectedTrack();
 
+    // TODO: Make "All Tracks" work
+    if (track == -1)
+        return;
+
     if (m_document->isTrackLocked(m_document->tracksCount() - track - 1)) {
         emit displayMessage(i18n("Cannot insert space in a locked track"), ErrorMessage);
         return;
@@ -5362,6 +5378,15 @@ void CustomTrackView::slotChangeTrack(int ix)
     }
 }
 
+void CustomTrackView::slotConfigTracks(int ix)
+{
+    TracksConfigDialog d(m_document, ix, parentWidget());
+    if (d.exec() == QDialog::Accepted) {
+        ConfigTracksCommand *configTracks = new ConfigTracksCommand(this, m_document->tracksList(), d.tracksList());
+        m_commandStack->push(configTracks);
+        setDocumentModified();
+    }
+}
 
 void CustomTrackView::deleteTimelineTrack(int ix, TrackInfo trackinfo)
 {
index 5650f63d5b77903094ed53595664a382c81e8320..2c704280e6f06f06b31c754723a4cedb5f1520f9 100644 (file)
@@ -54,6 +54,8 @@ public:
     void addTrack(TrackInfo type, int ix = -1);
     void removeTrack(int ix);
     void changeTrack(int ix, TrackInfo type);
+    /** @brief Makes the document use new track infos (name, type, ...). */
+    void configTracks(QList <TrackInfo> trackInfos);
     int cursorPos();
     void checkAutoScroll();
     void moveClip(const ItemInfo start, const ItemInfo end, bool refresh);
@@ -101,6 +103,7 @@ public:
     void clipEnd();
     void changeClipSpeed();
     void doChangeClipSpeed(ItemInfo info, ItemInfo speedIndependantInfo, const double speed, const double oldspeed, int strobe, const QString &id);
+    /** @brief Sets the document as modified. */
     void setDocumentModified();
     void setInPoint();
     void setOutPoint();
@@ -183,6 +186,8 @@ public slots:
     void slotInsertTrack(int ix);
     void slotDeleteTrack(int ix);
     void slotChangeTrack(int ix);
+    /** @brief Shows the configure tracks dialog. */
+    void slotConfigTracks(int ix);
     void clipNameChanged(const QString id, const QString name);
     void slotTrackUp();
     void slotTrackDown();
index 0496e61ae6dfdb8e20912d0350f52166b923f5be..7d9881229025f76c0b33ac01b3e653fd9c35eed0 100644 (file)
@@ -112,9 +112,9 @@ bool DocumentChecker::hasMissingClips()
         }
     }
 
-    if (missingClips.isEmpty() && missingLumas.isEmpty()) {
+    if (missingClips.isEmpty() && missingLumas.isEmpty())
         return false;
-    }
+
     m_dialog = new QDialog();
     m_dialog->setFont(KGlobalSettings::toolBarFont());
     m_ui.setupUi(m_dialog);
index 117d67f267c80c03a865f0429dbcabd2358ee745..026a548a0a5e4bb20937f45732d14330d9f69973 100644 (file)
@@ -108,6 +108,12 @@ void HeaderTrack::mousePressEvent(QMouseEvent * event)
     QWidget::mousePressEvent(event);
 }
 
+void HeaderTrack::mouseDoubleClickEvent(QMouseEvent* event)
+{
+    emit configTrack(m_index);
+    QWidget::mouseDoubleClickEvent(event);
+}
+
 void HeaderTrack::setSelectedIndex(int ix)
 {
     if (m_index == ix) {
index 22a9b7426b26c6b5c7081ebf7499a7246fa260dd..d5af624dc0b472aaaeec3fea94aef61cce665e55 100644 (file)
@@ -39,6 +39,7 @@ public:
 
 protected:
     virtual void mousePressEvent(QMouseEvent * event);
+    virtual void mouseDoubleClickEvent(QMouseEvent * event);
 
 private:
     int m_index;
@@ -63,6 +64,7 @@ signals:
     void changeTrack(int);
     void renameTrack(int);
     void selectTrack(int);
+    void configTrack(int);
 };
 
 #endif
index a1841723a56fa9c232f770124886ee24f27d7007..13aa01b4c8ccb7f0fe01ddd98dd502ccab4307ee 100644 (file)
@@ -1995,6 +1995,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
             disconnect(m_activeTimeline, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int)));
             disconnect(m_activeTimeline, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
             disconnect(m_activeTimeline, SIGNAL(changeTrack(int)), this, SLOT(slotChangeTrack(int)));
+            disconnect(m_activeTimeline, SIGNAL(configTrack(int)), this, SLOT(slotConfigTrack(int)));
             disconnect(m_activeDocument, SIGNAL(docModified(bool)), this, SLOT(slotUpdateDocumentState(bool)));
             disconnect(m_effectStack, SIGNAL(updateClipEffect(ClipItem*, QDomElement, QDomElement, int)), m_activeTimeline->projectView(), SLOT(slotUpdateClipEffect(ClipItem*, QDomElement, QDomElement, int)));
             disconnect(m_effectStack, SIGNAL(removeEffect(ClipItem*, QDomElement)), m_activeTimeline->projectView(), SLOT(slotDeleteEffect(ClipItem*, QDomElement)));
@@ -2037,6 +2038,7 @@ void MainWindow::connectDocument(TrackView *trackView, KdenliveDoc *doc)   //cha
     connect(trackView, SIGNAL(insertTrack(int)), this, SLOT(slotInsertTrack(int)));
     connect(trackView, SIGNAL(deleteTrack(int)), this, SLOT(slotDeleteTrack(int)));
     connect(trackView, SIGNAL(changeTrack(int)), this, SLOT(slotChangeTrack(int)));
+    connect(trackView, SIGNAL(configTrack(int)), this, SLOT(slotConfigTrack(int)));
     connect(trackView, SIGNAL(updateTracksInfo()), this, SLOT(slotUpdateTrackInfo()));
     connect(trackView, SIGNAL(mousePosition(int)), this, SLOT(slotUpdateMousePosition(int)));
     connect(m_projectMonitor, SIGNAL(renderPosition(int)), trackView, SLOT(moveCursorPos(int)));
@@ -2412,6 +2414,15 @@ void MainWindow::slotChangeTrack(int ix)
         m_activeTimeline->projectView()->slotChangeTrack(ix);
 }
 
+void MainWindow::slotConfigTrack(int ix)
+{
+    m_projectMonitor->activateMonitor();
+    if (m_activeTimeline)
+        m_activeTimeline->projectView()->slotConfigTracks(ix);
+    if (m_activeDocument)
+        m_transitionConfig->updateProjectFormat(m_activeDocument->mltProfile(), m_activeDocument->timecode(), m_activeDocument->tracksList());
+}
+
 void MainWindow::slotEditGuide()
 {
     if (m_activeTimeline)
index 8e829b0a40e85647d00b2fba17ccae055adad129..22f7c4ca99d4d27697a531b3769e8e86ffefa7cc 100644 (file)
@@ -240,6 +240,9 @@ private:
     QString getMimeType();
 
 public slots:
+    /** @brief Prepares opening @param url.
+    *
+    * Checks if already open and whether backup exists */
     void openFile(const KUrl &url);
     void slotGotProgressInfo(const QString &message, int progress);
     Q_SCRIPTABLE void setRenderingProgress(const QString &url, int progress);
@@ -250,6 +253,7 @@ private slots:
     void queryQuit();
     void activateDocument();
     void connectDocument(TrackView*, KdenliveDoc*);
+    /** @brief Shows file open dialog. */
     void openFile();
     void openLastFile();
     /** @brief Checks whether a URL is available to save to.
@@ -366,6 +370,8 @@ private slots:
     void slotInsertTrack(int ix = 0);
     void slotDeleteTrack(int ix = 0);
     void slotChangeTrack(int ix = 0);
+    /** @brief Shows the configure tracks dialog and updates transitions afterwards. */
+    void slotConfigTrack(int ix = -1);
     void slotGetNewLumaStuff();
     void slotGetNewTitleStuff();
     void slotGetNewRenderStuff();
diff --git a/src/tracksconfigdialog.cpp b/src/tracksconfigdialog.cpp
new file mode 100644 (file)
index 0000000..e018283
--- /dev/null
@@ -0,0 +1,160 @@
+/***************************************************************************
+ *   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          *
+ ***************************************************************************/
+
+#include "tracksconfigdialog.h"
+#include "kdenlivedoc.h"
+
+#include <QTableWidget>
+#include <QComboBox>
+#include <KDebug>
+
+TracksDelegate::TracksDelegate(QObject *parent) :
+        QItemDelegate(parent)
+{
+}
+
+QWidget *TracksDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem & /* option */, const QModelIndex & /*index*/) const
+{
+    QComboBox *comboBox = new QComboBox(parent);
+    comboBox->addItem(i18n("Video"));
+    comboBox->addItem(i18n("Audio"));
+    connect(comboBox, SIGNAL(activated(int)), this, SLOT(emitCommitData()));
+    return comboBox;
+}
+
+void TracksDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const
+{
+    QComboBox *comboBox = qobject_cast<QComboBox *>(editor);
+    if (!comboBox)
+        return;
+    int pos = comboBox->findText(index.model()->data(index).toString(), Qt::MatchExactly);
+    comboBox->setCurrentIndex(pos);
+}
+
+void TracksDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
+{
+    QComboBox *comboBox = qobject_cast<QComboBox *>(editor);
+    if (!comboBox)
+        return;
+    model->setData(index, comboBox->currentText());
+}
+
+void TracksDelegate::emitCommitData()
+{
+    emit commitData(qobject_cast<QWidget *>(sender()));
+}
+
+
+TracksConfigDialog::TracksConfigDialog(KdenliveDoc * doc, int selected, QWidget* parent) :
+        QDialog(parent),
+        m_doc(doc)
+{
+    setupUi(this);
+
+    table->setColumnCount(5);
+    table->setHorizontalHeaderLabels(QStringList() << i18n("Name") << i18n("Type") << i18n("Hidden") << i18n("Muted") << i18n("Locked"));
+    table->horizontalHeader()->setResizeMode(0, QHeaderView::Stretch);
+    table->horizontalHeader()->setResizeMode(1, QHeaderView::Fixed);
+    table->horizontalHeader()->setResizeMode(2, QHeaderView::Fixed);
+    table->horizontalHeader()->setResizeMode(3, QHeaderView::Fixed);
+    table->horizontalHeader()->setResizeMode(4, QHeaderView::Fixed);
+
+    table->setItemDelegateForColumn(1, new TracksDelegate(this));
+
+    setupOriginal(selected);
+    connect(table, SIGNAL(itemChanged(QTableWidgetItem *)), this, SLOT(slotUpdateRow(QTableWidgetItem *)));
+}
+
+const QList <TrackInfo> TracksConfigDialog::tracksList()
+{
+    QList <TrackInfo> tracks;
+    TrackInfo info;
+    for (int i = table->rowCount() - 1; i >= 0; i--) {
+        info.trackName = table->item(i, 0)->text();
+        QTableWidgetItem *item = table->item(i, 1);
+        if (item->text() == i18n("Audio")) {
+            info.type = AUDIOTRACK;
+            info.isBlind = true;
+        } else {
+            info.type = VIDEOTRACK;
+            info.isBlind = (table->item(i, 2)->checkState() == Qt::Checked);
+        }
+        info.isMute = (table->item(i, 3)->checkState() == Qt::Checked);
+        info.isLocked = (table->item(i, 4)->checkState() == Qt::Checked);
+        tracks << info;
+    }
+    return tracks;
+}
+
+void TracksConfigDialog::setupOriginal(int selected)
+{
+    table->setRowCount(m_doc->tracksCount());
+
+    QStringList numbers;
+    TrackInfo info;
+    for (int i = m_doc->tracksCount() - 1; i >= 0; i--) {
+        numbers << QString::number(i);
+        info = m_doc->trackInfoAt(m_doc->tracksCount() - i - 1);
+        table->setItem(i, 0, new QTableWidgetItem(info.trackName));
+
+        QTableWidgetItem *item1 = new QTableWidgetItem(i18n("Video"));
+        if (info.type == AUDIOTRACK)
+            item1->setText(i18n("Audio"));
+        table->setItem(i, 1, item1);
+        table->openPersistentEditor(item1);
+
+        QTableWidgetItem *item2 = new QTableWidgetItem("");
+        item2->setFlags(item2->flags() & ~Qt::ItemIsEditable);
+        item2->setCheckState(info.isBlind ? Qt::Checked : Qt::Unchecked);
+        if (info.type == AUDIOTRACK)
+            item2->setFlags(item2->flags() & ~Qt::ItemIsEnabled);
+        table->setItem(i, 2, item2);
+
+        QTableWidgetItem *item3 = new QTableWidgetItem("");
+        item3->setFlags(item3->flags() & ~Qt::ItemIsEditable);
+        item3->setCheckState(info.isMute ? Qt::Checked : Qt::Unchecked);
+        table->setItem(i, 3, item3);
+
+        QTableWidgetItem *item4 = new QTableWidgetItem("");
+        item4->setFlags(item4->flags() & ~Qt::ItemIsEditable);
+        item4->setCheckState(info.isLocked ? Qt::Checked : Qt::Unchecked);
+        table->setItem(i, 4, item4);
+    }
+    table->setVerticalHeaderLabels(numbers);
+
+    table->resizeColumnsToContents();
+    if (selected != -1)
+        table->selectRow(selected);
+}
+
+void TracksConfigDialog::slotUpdateRow(QTableWidgetItem* item)
+{
+    if (table->column(item) == 1) {
+        QTableWidgetItem *item2 = table->item(table->row(item), 2);
+        if (item->text() == i18n("Audio")) {
+            item2->setFlags(item2->flags() & ~Qt::ItemIsEnabled);
+            item2->setCheckState(Qt::Checked);
+        } else {
+            item2->setFlags(item2->flags() | Qt::ItemIsEnabled);
+            item2->setCheckState(Qt::Unchecked);
+        }
+    }
+}
+
+#include "tracksconfigdialog.moc"
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
index db91031c709d5844c13c32146c006e7fb2b50978..9099c873bda38eec87f47d0b09c24df052e18d9f 100644 (file)
@@ -537,6 +537,7 @@ void TrackView::slotRebuildTrackHeaders()
         connect(header, SIGNAL(insertTrack(int)), this, SIGNAL(insertTrack(int)));
         connect(header, SIGNAL(changeTrack(int)), this, SIGNAL(changeTrack(int)));
         connect(header, SIGNAL(renameTrack(int)), this, SLOT(slotRenameTrack(int)));
+        connect(header, SIGNAL(configTrack(int)), this, SIGNAL(configTrack(int)));
         headers_container->layout()->addWidget(header);
     }
     frame = new QFrame(this);
index efa5a230118c84e9f079c40625e41d4b55ff0f6f..144e0dfa05ad5160179ab930f984925921180c86 100644 (file)
@@ -97,7 +97,7 @@ private:
 private slots:
     void setCursorPos(int pos);
     void moveCursorPos(int pos);
-    /** @brief Rebuild the track headers */
+    /** @brief Rebuilds the track headers */
     void slotRebuildTrackHeaders();
     /** @brief The tracks count or a track name changed, rebuild and notify */
     void slotReloadTracks();
@@ -120,6 +120,7 @@ signals:
     void insertTrack(int);
     void deleteTrack(int);
     void changeTrack(int);
+    void configTrack(int);
     void updateTracksInfo();
     void setZoom(int);
 };
diff --git a/src/widgets/tracksconfigdialog_ui.ui b/src/widgets/tracksconfigdialog_ui.ui
new file mode 100644 (file)
index 0000000..b441dbd
--- /dev/null
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>TracksConfigDialog_UI</class>
+ <widget class="QDialog" name="TracksConfigDialog_UI">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>508</width>
+    <height>305</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Configure Tracks</string>
+  </property>
+  <property name="sizeGripEnabled">
+   <bool>false</bool>
+  </property>
+  <property name="modal">
+   <bool>false</bool>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_2">
+   <item row="1" column="0">
+    <widget class="QDialogButtonBox" name="buttonBox">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QTableWidget" name="table">
+     <property name="sizePolicy">
+      <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>accepted()</signal>
+   <receiver>TracksConfigDialog_UI</receiver>
+   <slot>accept()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>248</x>
+     <y>254</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>157</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+  <connection>
+   <sender>buttonBox</sender>
+   <signal>rejected()</signal>
+   <receiver>TracksConfigDialog_UI</receiver>
+   <slot>reject()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>316</x>
+     <y>260</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>286</x>
+     <y>274</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+</ui>