From d2253d723eb7291df915f066004aee0b5654759b Mon Sep 17 00:00:00 2001 From: Till Theato Date: Tue, 29 Jun 2010 12:53:10 +0000 Subject: [PATCH] Cleanup insert/delete track dialog GUI svn path=/trunk/kdenlive/; revision=4555 --- src/customtrackview.cpp | 21 +++++++------------ src/trackdialog.cpp | 19 +++++------------ src/trackdialog.h | 8 -------- src/widgets/addtrack_ui.ui | 42 ++++++-------------------------------- 4 files changed, 18 insertions(+), 72 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 2c938144..7ac1542f 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -5179,28 +5179,23 @@ void CustomTrackView::saveThumbnails() void CustomTrackView::slotInsertTrack(int ix) { TrackDialog d(m_document, parentWidget()); + d.comboTracks->setCurrentIndex(ix); d.label->setText(i18n("Insert track")); - d.track_nb->setMaximum(m_document->tracksCount() - 1); - d.track_nb->setValue(ix); d.setWindowTitle(i18n("Insert New Track")); - d.slotUpdateName(ix); if (d.exec() == QDialog::Accepted) { - ix = d.track_nb->value(); - if (d.before_select->currentIndex() == 1) { + ix = d.comboTracks->currentIndex(); + if (d.before_select->currentIndex() == 1) ix++; - } TrackInfo info; + info.isMute = false; + info.isLocked = false; if (d.video_track->isChecked()) { info.type = VIDEOTRACK; - info.isMute = false; info.isBlind = false; - info.isLocked = false; } else { info.type = AUDIOTRACK; - info.isMute = false; info.isBlind = true; - info.isLocked = false; } AddTrackCommand *addTrack = new AddTrackCommand(this, ix, info, true); m_commandStack->push(addTrack); @@ -5212,16 +5207,14 @@ void CustomTrackView::slotDeleteTrack(int ix) { if (m_document->tracksCount() < 2) return; TrackDialog d(m_document, parentWidget()); + d.comboTracks->setCurrentIndex(ix); d.label->setText(i18n("Delete track")); d.before_select->setHidden(true); - d.track_nb->setMaximum(m_document->tracksCount() - 1); - d.track_nb->setValue(ix); - d.slotUpdateName(ix); d.setWindowTitle(i18n("Delete Track")); d.video_track->setHidden(true); d.audio_track->setHidden(true); if (d.exec() == QDialog::Accepted) { - ix = d.track_nb->value(); + ix = d.comboTracks->currentIndex(); TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - ix - 1); deleteTimelineTrack(ix, info); setDocumentModified(); diff --git a/src/trackdialog.cpp b/src/trackdialog.cpp index c62318e8..7b54943f 100644 --- a/src/trackdialog.cpp +++ b/src/trackdialog.cpp @@ -26,25 +26,16 @@ TrackDialog::TrackDialog(KdenliveDoc *doc, QWidget * parent) : - QDialog(parent), - m_doc(doc) + QDialog(parent) { //setFont(KGlobalSettings::toolBarFont()); setupUi(this); - connect(track_nb, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateName(int))); + for (int i = 0; i < doc->tracksCount(); ++i) { + TrackInfo info = doc->trackInfoAt(doc->tracksCount() - i - 1); + comboTracks->addItem(info.trackName.isEmpty() ? QString::number(i) : QString::number(i) + ": " + info.trackName); + } } -TrackDialog::~TrackDialog() -{ -} - -void TrackDialog::slotUpdateName(int ix) -{ - ix = m_doc->tracksCount() - ix; - track_name->setText(m_doc->trackInfoAt(ix - 1).trackName); -} - - #include "trackdialog.moc" diff --git a/src/trackdialog.h b/src/trackdialog.h index 0501b3f8..317a651f 100644 --- a/src/trackdialog.h +++ b/src/trackdialog.h @@ -32,14 +32,6 @@ class TrackDialog : public QDialog, public Ui::AddTrack_UI public: TrackDialog(KdenliveDoc *doc, QWidget * parent = 0); - ~TrackDialog(); - -public slots: - - void slotUpdateName(int); - -private: - KdenliveDoc *m_doc; }; diff --git a/src/widgets/addtrack_ui.ui b/src/widgets/addtrack_ui.ui index 46ebad99..1f628f92 100644 --- a/src/widgets/addtrack_ui.ui +++ b/src/widgets/addtrack_ui.ui @@ -6,8 +6,8 @@ 0 0 - 307 - 118 + 257 + 91 @@ -35,32 +35,6 @@ - - - - - 0 - 0 - - - - 0 - - - - - - - - 0 - 0 - - - - - - - @@ -91,6 +65,9 @@ + + + @@ -101,7 +78,7 @@ - + Qt::Horizontal @@ -116,13 +93,6 @@ - - - KIntNumInput - QWidget -
knuminput.h
-
-
-- 2.39.2