]> git.sesse.net Git - kdenlive/commitdiff
Fix several warnings, cleanup effect settings layout
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 20 Oct 2008 22:57:37 +0000 (22:57 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 20 Oct 2008 22:57:37 +0000 (22:57 +0000)
svn path=/branches/KDE4/; revision=2521

src/effectstackedit.cpp
src/effectstackedit.h
src/effectstackview.cpp
src/headertrack.cpp
src/initeffects.cpp
src/mainwindow.cpp
src/mainwindow.h
src/trackview.cpp
src/transitionsettings.cpp

index ebc14ecc1038f6ed9ba4c5271bf403bdc296fedb..85192626b084b86c1e8681a27bacf635727ffb04 100644 (file)
 
 QMap<QString, QImage> EffectStackEdit::iconCache;
 
-EffectStackEdit::EffectStackEdit(QFrame* frame, QWidget *parent): QObject(parent), m_in(0), m_out(0) {
-    QScrollArea *area;
-    QVBoxLayout *vbox1 = new QVBoxLayout(frame);
-    QVBoxLayout *vbox2 = new QVBoxLayout(frame);
-    vbox = new QVBoxLayout(frame);
+EffectStackEdit::EffectStackEdit(QWidget *parent): QWidget(parent), m_in(0), m_out(0) {
+    setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));
+    setBackgroundRole(QPalette::Dark);
+    QVBoxLayout *vbox1 = new QVBoxLayout(parent);
     vbox1->setContentsMargins(0, 0, 0, 0);
     vbox1->setSpacing(0);
-    vbox2->setContentsMargins(0, 0, 0, 0);
-    vbox2->setSpacing(0);
-    vbox->setContentsMargins(0, 0, 0, 0);
-    vbox->setSpacing(0);
-    frame->setLayout(vbox1);
-    QFont widgetFont = frame->font();
-    widgetFont.setPointSize(widgetFont.pointSize() - 2);
-    frame->setFont(widgetFont);
 
-    area = new QScrollArea(frame);
-    QWidget *wid = new QWidget(area);
+    QScrollArea *area = new QScrollArea;
+    QWidget *wid = new QWidget(parent);
     area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     area->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
     wid->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
-    //area->setSizePolicy(QSizePolicy(QSizePolicy::Expanding,QSizePolicy::MinimumExpanding));
+    area->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::MinimumExpanding));
 
     vbox1->addWidget(area);
-    wid->setLayout(vbox2);
-    vbox2->addLayout(vbox);
-    vbox2->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::MinimumExpanding));
     area->setWidget(wid);
     area->setWidgetResizable(true);
+    vbox = new QVBoxLayout(wid);
+    vbox->setContentsMargins(0, 0, 0, 0);
+    vbox->setSpacing(0);
     wid->show();
 
 }
@@ -259,6 +250,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement& d, int in, int out) {
             vbox->addWidget(toFillin);
         }
     }
+    vbox->addStretch();
 }
 
 void EffectStackEdit::slotSeekToPos(int pos) {
@@ -416,4 +408,10 @@ void EffectStackEdit::clearAllItems() {
     uiItems.clear();
     items.clear();
     valueItems.clear();
+    QLayoutItem *item = vbox->itemAt(0);
+    while (item) {
+        vbox->removeItem(item);
+        delete item;
+        item = vbox->itemAt(0);
+    }
 }
index 23de5c0c278dd921694b9d3276c70bc71966ba4e..00274847abf56eeb67065ab26bbe8698b2dea77c 100644 (file)
@@ -37,10 +37,10 @@ struct wipeInfo {
 
 class QFrame;
 
-class EffectStackEdit : public QObject {
+class EffectStackEdit : public QWidget {
     Q_OBJECT
 public:
-    EffectStackEdit(QFrame* frame, QWidget *parent);
+    EffectStackEdit(QWidget *parent);
     ~EffectStackEdit();
     void updateProjectFormat(MltVideoProfile profile);
     static QMap<QString, QImage> iconCache;
index 06093ae5e8cdf1c301743cfd5c4543475119913d..1d2b40d4d4eca3bbbacabe9c42073df7612de473 100644 (file)
@@ -35,7 +35,7 @@
 EffectStackView::EffectStackView(QWidget *parent)
         : QWidget(parent) {
     ui.setupUi(this);
-    effectedit = new EffectStackEdit(ui.frame, this);
+    effectedit = new EffectStackEdit(ui.frame);
     //ui.effectlist->horizontalHeader()->setVisible(false);
     //ui.effectlist->verticalHeader()->setVisible(false);
     clipref = NULL;
index 584cabf24c91d2cba85f484713b1426fbd3a2699..612148238db0af88aefaf346162e828a2f8ec208 100644 (file)
@@ -50,13 +50,15 @@ HeaderTrack::HeaderTrack(int index, TrackInfo info, QWidget *parent)
     connect(view.buttonAudio, SIGNAL(clicked()), this, SLOT(switchAudio()));
 
     m_contextMenu = new QMenu(this);
-    QAction *insertAction = new QAction(i18n("Insert track"), this);
+
+    //TODO: implement add/remove track
+    /*QAction *insertAction = new QAction(i18n("Insert track"), this);
     m_contextMenu->addAction(insertAction);
-    connect(insertAction, SIGNAL(triggered(QAction *)), this, SLOT(slotAddTrack()));
+    connect(insertAction, SIGNAL(triggered()), this, SLOT(slotAddTrack()));
 
     QAction *removeAction = new QAction(KIcon("edit-delete"), i18n("Delete track"), this);
     m_contextMenu->addAction(removeAction);
-    connect(removeAction, SIGNAL(triggered(QAction *)), this, SLOT(slotDeleteTrack()));
+    connect(removeAction, SIGNAL(triggered()), this, SLOT(slotDeleteTrack()));*/
 }
 
 void HeaderTrack::switchVideo() {
index 10d6a313b13af423a102841a1c119eb5914a26a0..347537c27b6c83949ee85aa931fe6ad603532c75 100644 (file)
@@ -596,8 +596,8 @@ void initEffects::fillTransitionsList(Mlt::Repository * repository, EffectsList*
 
 
         transitions->append(ret.documentElement());
-        kDebug() << "//// ////  TRANSITON XML";
-        kDebug() << ret.toString();
+        //kDebug() << "//// ////  TRANSITON XML";
+        //kDebug() << ret.toString();
         /*
 
          <transition fill="1" in="11" a_track="1" out="73" mlt_service="luma" b_track="2" softness="0" resource="/home/marco/Projekte/kdenlive/install_cmake/share/apps/kdenlive/pgm/PAL/square2.pgm" />
index c931c4f1ec5f64f02372a0dd058fc8d84caea290..282a7ec16e8fba7b96253e75ab19965388416cf4 100644 (file)
@@ -202,7 +202,7 @@ MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
     tabifyDockWidget(clipMonitorDock, recMonitorDock);
     setCentralWidget(m_timelineArea);
 
-    setupGUI(Default, NULL /*"kdenliveui.rc"*/);
+    setupGUI();
     //kDebug() << factory() << " " << factory()->container("video_effects_menu", this);
 
     m_projectMonitor->setupMenu(static_cast<QMenu*>(factory()->container("monitor_go", this)));
@@ -315,8 +315,6 @@ MainWindow::MainWindow(const QString &MltPath, QWidget *parent)
     m_monitorManager->initMonitors(m_clipMonitor, m_projectMonitor);
     slotConnectMonitors();
 
-    setAutoSaveSettings();
-
     if (KdenliveSettings::openlastproject()) {
         openLastFile();
     } else {
@@ -518,11 +516,13 @@ void MainWindow::setupActions() {
 
     QString style1 = "QToolButton {background-color: rgba(230, 230, 230, 220); border-style: inset; border:1px solid #999999;border-radius: 3px;margin: 0px 3px;padding: 0px;} QToolButton:checked { background-color: rgba(224, 224, 0, 100); border-style: inset; border:1px solid #cc6666;border-radius: 3px;}";
 
-    m_buttonSelectTool = toolbar->addAction(KIcon("kdenlive-select-tool"), i18n("Selection tool"));
+    m_buttonSelectTool = new KAction(KIcon("kdenlive-select-tool"), i18n("Selection tool"), this);
+    toolbar->addAction(m_buttonSelectTool);
     m_buttonSelectTool->setCheckable(true);
     m_buttonSelectTool->setChecked(true);
 
-    m_buttonRazorTool = toolbar->addAction(KIcon("edit-cut"), i18n("Razor tool"));
+    m_buttonRazorTool = new KAction(KIcon("edit-cut"), i18n("Razor tool"), this);
+    toolbar->addAction(m_buttonRazorTool);
     m_buttonRazorTool->setCheckable(true);
     m_buttonRazorTool->setChecked(false);
 
@@ -544,7 +544,8 @@ void MainWindow::setupActions() {
     connect(m_toolGroup, SIGNAL(triggered(QAction *)), this, SLOT(slotChangeTool(QAction *)));
 
     toolbar->addSeparator();
-    m_buttonFitZoom = toolbar->addAction(KIcon("zoom-fit-best"), i18n("Fit zoom to project"));
+    m_buttonFitZoom = new KAction(KIcon("zoom-fit-best"), i18n("Fit zoom to project"), this);
+    toolbar->addAction(m_buttonFitZoom);
     m_buttonFitZoom->setCheckable(false);
     connect(m_buttonFitZoom, SIGNAL(triggered()), this, SLOT(slotFitZoom()));
 
@@ -572,22 +573,26 @@ void MainWindow::setupActions() {
 
     toolbar->addWidget(m_zoomSlider);
 
-    m_buttonVideoThumbs = toolbar->addAction(KIcon("kdenlive-show-videothumb"), i18n("Show video thumbnails"));
+    m_buttonVideoThumbs = new KAction(KIcon("kdenlive-show-videothumb"), i18n("Show video thumbnails"), this);
+    toolbar->addAction(m_buttonVideoThumbs);
     m_buttonVideoThumbs->setCheckable(true);
     m_buttonVideoThumbs->setChecked(KdenliveSettings::videothumbnails());
     connect(m_buttonVideoThumbs, SIGNAL(triggered()), this, SLOT(slotSwitchVideoThumbs()));
 
-    m_buttonAudioThumbs = toolbar->addAction(KIcon("kdenlive-show-audiothumb"), i18n("Show audio thumbnails"));
+    m_buttonAudioThumbs = new KAction(KIcon("kdenlive-show-audiothumb"), i18n("Show audio thumbnails"), this);
+    toolbar->addAction(m_buttonAudioThumbs);
     m_buttonAudioThumbs->setCheckable(true);
     m_buttonAudioThumbs->setChecked(KdenliveSettings::audiothumbnails());
     connect(m_buttonAudioThumbs, SIGNAL(triggered()), this, SLOT(slotSwitchAudioThumbs()));
 
-    m_buttonShowMarkers = toolbar->addAction(KIcon("kdenlive-show-markers"), i18n("Show markers comments"));
+    m_buttonShowMarkers = new KAction(KIcon("kdenlive-show-markers"), i18n("Show markers comments"), this);
+    toolbar->addAction(m_buttonShowMarkers);
     m_buttonShowMarkers->setCheckable(true);
     m_buttonShowMarkers->setChecked(KdenliveSettings::showmarkers());
     connect(m_buttonShowMarkers, SIGNAL(triggered()), this, SLOT(slotSwitchMarkersComments()));
 
-    m_buttonSnap = toolbar->addAction(KIcon("kdenlive-snap"), i18n("Snap"));
+    m_buttonSnap = new KAction(KIcon("kdenlive-snap"), i18n("Snap"), this);
+    toolbar->addAction(m_buttonSnap);
     m_buttonSnap->setCheckable(true);
     m_buttonSnap->setChecked(KdenliveSettings::snaptopoints());
     connect(m_buttonSnap, SIGNAL(triggered()), this, SLOT(slotSwitchSnap()));
index f15288ea1ddcdb7747720c9e626348e66ac1ebdb..783675cd151f5d024563439a8a9aac6328eb10d6 100644 (file)
@@ -138,15 +138,15 @@ private:
     KAction *m_projectSearch;
     KAction *m_projectSearchNext;
 
-    QAction *m_buttonAudioThumbs;
-    QAction *m_buttonVideoThumbs;
-    QAction *m_buttonShowMarkers;
-    QAction *m_buttonFitZoom;
-    QAction *m_buttonSelectTool;
-    QAction *m_buttonRazorTool;
-    QAction *m_buttonSnap;
+    KAction *m_buttonAudioThumbs;
+    KAction *m_buttonVideoThumbs;
+    KAction *m_buttonShowMarkers;
+    KAction *m_buttonFitZoom;
+    KAction *m_buttonSelectTool;
+    KAction *m_buttonRazorTool;
+    KAction *m_buttonSnap;
     QActionGroup *m_toolGroup;
-    QAction *m_saveAction;
+    KAction *m_saveAction;
     QSlider *m_zoomSlider;
     StatusBarMessageLabel *m_messageLabel;
 
index 13772ca0630a3823b9db3bc2cf6cd4880b6a4a8e..e28ddb8971473863538a171af8a5e11de08e9c76 100644 (file)
@@ -309,8 +309,10 @@ void TrackView::slotRebuildTrackHeaders() {
         HeaderTrack *header = new HeaderTrack(i, list.at(max - i - 1), this);
         connect(header, SIGNAL(switchTrackVideo(int)), m_trackview, SLOT(slotSwitchTrackVideo(int)));
         connect(header, SIGNAL(switchTrackAudio(int)), m_trackview, SLOT(slotSwitchTrackAudio(int)));
+        /*
+        //TODO: re-enable when add / remove track is implemented
         connect(header, SIGNAL(deleteTrack(int)), m_trackview, SLOT(slotDeleteTrack(int)));
-        connect(header, SIGNAL(insertTrack(int)), m_trackview, SLOT(slotInsertTrack(int)));
+        connect(header, SIGNAL(insertTrack(int)), m_trackview, SLOT(slotInsertTrack(int)));*/
         m_headersLayout->addWidget(header);
     }
     view->headers_container->adjustSize();
index c9cc9d069a8c4ba4310cc49fe4a7f83682162097..db4f5f6ad5843569c010847c80893bb9e9e80d62 100644 (file)
@@ -27,7 +27,7 @@
 
 TransitionSettings::TransitionSettings(QWidget* parent): QWidget(parent) {
     ui.setupUi(this);
-    effectEdit = new EffectStackEdit(ui.frame, this);
+    effectEdit = new EffectStackEdit(ui.frame);
     connect(effectEdit, SIGNAL(seekTimeline(int)), this, SIGNAL(seekTimeline(int)));
     setEnabled(false);
     ui.transitionList->addItems(MainWindow::transitions.effectNames());