From fed4dee95b7233f91fd25894243f326af0394142 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Fri, 28 Aug 2009 13:32:28 +0000 Subject: [PATCH] cleanup svn path=/trunk/kdenlive/; revision=3844 --- src/customtrackview.cpp | 42 ++++++++++++++++++++--------------------- src/markerdialog.cpp | 40 +++++++++++++++++++-------------------- src/markerdialog.h | 3 +-- src/trackdialog.cpp | 6 +++--- src/trackdialog.h | 3 +-- 5 files changed, 46 insertions(+), 48 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 6cd89d6f..f8cf2d79 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -4344,19 +4344,19 @@ void CustomTrackView::saveThumbnails() void CustomTrackView::slotInsertTrack(int ix) { TrackDialog d(m_document, parentWidget()); - d.view.label->setText(i18n("Insert track")); - d.view.track_nb->setMaximum(m_document->tracksCount() - 1); - d.view.track_nb->setValue(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.view.track_nb->value(); - if (d.view.before_select->currentIndex() == 1) { + ix = d.track_nb->value(); + if (d.before_select->currentIndex() == 1) { ix++; } TrackInfo info; - if (d.view.video_track->isChecked()) { + if (d.video_track->isChecked()) { info.type = VIDEOTRACK; info.isMute = false; info.isBlind = false; @@ -4376,16 +4376,16 @@ void CustomTrackView::slotInsertTrack(int ix) void CustomTrackView::slotDeleteTrack(int ix) { TrackDialog d(m_document, parentWidget()); - d.view.label->setText(i18n("Delete track")); - d.view.before_select->setHidden(true); - d.view.track_nb->setMaximum(m_document->tracksCount() - 1); - d.view.track_nb->setValue(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.view.video_track->setHidden(true); - d.view.audio_track->setHidden(true); + d.video_track->setHidden(true); + d.audio_track->setHidden(true); if (d.exec() == QDialog::Accepted) { - ix = d.view.track_nb->value(); + ix = d.track_nb->value(); TrackInfo info = m_document->trackInfoAt(m_document->tracksCount() - ix - 1); deleteTimelineTrack(ix, info); setDocumentModified(); @@ -4397,25 +4397,25 @@ void CustomTrackView::slotDeleteTrack(int ix) void CustomTrackView::slotChangeTrack(int ix) { TrackDialog d(m_document, parentWidget()); - d.view.label->setText(i18n("Change track")); - d.view.before_select->setHidden(true); - d.view.track_nb->setMaximum(m_document->tracksCount() - 1); - d.view.track_nb->setValue(ix); + d.label->setText(i18n("Change 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("Change Track Type")); if (m_document->trackInfoAt(m_document->tracksCount() - ix - 1).type == VIDEOTRACK) - d.view.video_track->setChecked(true); + d.video_track->setChecked(true); else - d.view.audio_track->setChecked(true); + d.audio_track->setChecked(true); if (d.exec() == QDialog::Accepted) { TrackInfo info; info.isLocked = false; info.isMute = false; - ix = d.view.track_nb->value(); + ix = d.track_nb->value(); - if (d.view.video_track->isChecked()) { + if (d.video_track->isChecked()) { info.type = VIDEOTRACK; info.isBlind = false; } else { diff --git a/src/markerdialog.cpp b/src/markerdialog.cpp index 90969a47..d72716c0 100644 --- a/src/markerdialog.cpp +++ b/src/markerdialog.cpp @@ -35,7 +35,7 @@ MarkerDialog::MarkerDialog(DocClipBase *clip, CommentedTime t, Timecode tc, cons { setFont(KGlobalSettings::toolBarFont()); m_fps = m_tc.fps(); - m_view.setupUi(this); + setupUi(this); setWindowTitle(caption); m_previewTimer = new QTimer(this); @@ -75,21 +75,21 @@ MarkerDialog::MarkerDialog(DocClipBase *clip, CommentedTime t, Timecode tc, cons p.fill(Qt::black); } if (!p.isNull()) { - m_view.clip_thumb->setFixedWidth(p.width()); - m_view.clip_thumb->setFixedHeight(p.height()); - m_view.clip_thumb->setPixmap(p); + clip_thumb->setFixedWidth(p.width()); + clip_thumb->setFixedHeight(p.height()); + clip_thumb->setPixmap(p); } - connect(m_view.marker_position, SIGNAL(textChanged(const QString &)), this, SIGNAL(updateThumb())); - } else m_view.clip_thumb->setHidden(true); + connect(marker_position, SIGNAL(textChanged(const QString &)), this, SIGNAL(updateThumb())); + } else clip_thumb->setHidden(true); - m_view.marker_position->setText(tc.getTimecode(t.time())); + marker_position->setText(tc.getTimecode(t.time())); - m_view.marker_comment->setText(t.comment()); - m_view.marker_comment->selectAll(); - m_view.marker_comment->setFocus(); + marker_comment->setText(t.comment()); + marker_comment->selectAll(); + marker_comment->setFocus(); - connect(m_view.position_up, SIGNAL(clicked()), this, SLOT(slotTimeUp())); - connect(m_view.position_down, SIGNAL(clicked()), this, SLOT(slotTimeDown())); + connect(position_up, SIGNAL(clicked()), this, SLOT(slotTimeUp())); + connect(position_down, SIGNAL(clicked()), this, SLOT(slotTimeDown())); adjustSize(); } @@ -104,38 +104,38 @@ MarkerDialog::~MarkerDialog() void MarkerDialog::slotUpdateThumb() { m_previewTimer->stop(); - int pos = m_tc.getFrameCount(m_view.marker_position->text()); + int pos = m_tc.getFrameCount(marker_position->text()); int width = 100.0 * m_dar; if (width % 2 == 1) width++; QPixmap p = KThumb::getFrame(m_producer, pos, width, 100); - if (!p.isNull()) m_view.clip_thumb->setPixmap(p); + if (!p.isNull()) clip_thumb->setPixmap(p); else kDebug() << "!!!!!!!!!!! ERROR CREATING THUMB"; } void MarkerDialog::slotTimeUp() { - int duration = m_tc.getFrameCount(m_view.marker_position->text()); + int duration = m_tc.getFrameCount(marker_position->text()); if (m_clip && duration >= m_clip->duration().frames(m_fps)) return; duration ++; - m_view.marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps))); + marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps))); } void MarkerDialog::slotTimeDown() { - int duration = m_tc.getFrameCount(m_view.marker_position->text()); + int duration = m_tc.getFrameCount(marker_position->text()); if (duration <= 0) return; duration --; - m_view.marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps))); + marker_position->setText(m_tc.getTimecode(GenTime(duration, m_fps))); } CommentedTime MarkerDialog::newMarker() { - return CommentedTime(GenTime(m_tc.getFrameCount(m_view.marker_position->text()), m_fps), m_view.marker_comment->text()); + return CommentedTime(GenTime(m_tc.getFrameCount(marker_position->text()), m_fps), marker_comment->text()); } void MarkerDialog::wheelEvent(QWheelEvent * event) { - if (m_view.marker_position->underMouse() || m_view.clip_thumb->underMouse()) { + if (marker_position->underMouse() || clip_thumb->underMouse()) { if (event->delta() > 0) slotTimeUp(); else diff --git a/src/markerdialog.h b/src/markerdialog.h index a9e6315b..5c6707c3 100644 --- a/src/markerdialog.h +++ b/src/markerdialog.h @@ -32,7 +32,7 @@ class Producer; class Profile; }; -class MarkerDialog : public QDialog +class MarkerDialog : public QDialog, public Ui::MarkerDialog_UI { Q_OBJECT @@ -52,7 +52,6 @@ protected: private: Mlt::Producer *m_producer; Mlt::Profile *m_profile; - Ui::MarkerDialog_UI m_view; DocClipBase *m_clip; Timecode m_tc; double m_fps; diff --git a/src/trackdialog.cpp b/src/trackdialog.cpp index 2526d983..c62318e8 100644 --- a/src/trackdialog.cpp +++ b/src/trackdialog.cpp @@ -30,8 +30,8 @@ TrackDialog::TrackDialog(KdenliveDoc *doc, QWidget * parent) : m_doc(doc) { //setFont(KGlobalSettings::toolBarFont()); - view.setupUi(this); - connect(view.track_nb, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateName(int))); + setupUi(this); + connect(track_nb, SIGNAL(valueChanged(int)), this, SLOT(slotUpdateName(int))); } TrackDialog::~TrackDialog() @@ -41,7 +41,7 @@ TrackDialog::~TrackDialog() void TrackDialog::slotUpdateName(int ix) { ix = m_doc->tracksCount() - ix; - view.track_name->setText(m_doc->trackInfoAt(ix - 1).trackName); + track_name->setText(m_doc->trackInfoAt(ix - 1).trackName); } diff --git a/src/trackdialog.h b/src/trackdialog.h index 0716b355..0501b3f8 100644 --- a/src/trackdialog.h +++ b/src/trackdialog.h @@ -26,14 +26,13 @@ class KdenliveDoc; -class TrackDialog : public QDialog +class TrackDialog : public QDialog, public Ui::AddTrack_UI { Q_OBJECT public: TrackDialog(KdenliveDoc *doc, QWidget * parent = 0); ~TrackDialog(); - Ui::AddTrack_UI view; public slots: -- 2.39.2