diff edgui.cpp @ 403:d34922e6a244

Even more work towards the editor.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 19 Oct 2012 21:52:16 +0300
parents 2fdf440ea66a
children
line wrap: on
line diff
--- a/edgui.cpp	Fri Oct 19 17:49:22 2012 +0300
+++ b/edgui.cpp	Fri Oct 19 21:52:16 2012 +0300
@@ -25,10 +25,16 @@
         name = DOC_DEF_FILENAME;
     else
         name = currTimeline->filename;
+    
+    if (currTimeline != NULL)
+    {
+        if (currTimeline->tl != NULL && currTimeline->tl->name != NULL)
+            name += " (" + QString(currTimeline->tl->name) + ")";
 
-    if (currTimeline && currTimeline->touched())
-        name = "*" + name;
-    
+        if (currTimeline->touched())
+            name = "*" + name;
+    }
+
     setWindowTitle(name + " - " + QCoreApplication::applicationName());
 
     // Enable menu items based on states
@@ -449,14 +455,17 @@
 
 
     //
-    // Effects list table
+    // Effect resource view
     //
-    qDebug() << "- Constructing effects list";
+    qDebug() << "- Constructing effects resource view";
 
-    effectTable = new QTableView(this);
-    effectTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
-    effectTable->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
-
+    resourceView = new QTableView(this);
+    resourceView->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
+    resourceView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
+    resourceView->setSelectionMode(QAbstractItemView::SingleSelection);
+    resourceView->setSelectionBehavior(QAbstractItemView::SelectRows);
+    resourceModel = new QEDResourceModel(this);
+    resourceView->setModel(resourceModel);
 
     //
     // Construct the main screen
@@ -471,7 +480,7 @@
     QVBoxLayout *sideVBox = new QVBoxLayout(sideVBoxContainer);
     sideVBox->setSpacing(0);
     sideVBox->setContentsMargins(0, 0, 0, 0);
-    sideVBox->addWidget(effectTable);
+    sideVBox->addWidget(resourceView);
     sideVBox->addWidget(controlButtons);
 
 
@@ -483,11 +492,11 @@
     timelineScrollBar = new QScrollBar(Qt::Horizontal);
     connect(timelineScrollBar, SIGNAL(valueChanged(int)), this, SLOT(actionTimelineScrollChanged(int)));
     
-    timelineAudioTrack = new QWaveTrackView();
+    timelineAudioTrack = new QEDWaveTrackView();
     connect(timelineAudioTrack, SIGNAL(offsetChanged(float)), this, SLOT(actionOffsetChanged(float)));
     connect(timelineAudioTrack, SIGNAL(timeChanged(float)), this, SLOT(actionTimeChanged(float)));
 
-    timelineView = new QTimelineView();
+    timelineView = new QEDTimelineView();
     connect(timelineView, SIGNAL(timelineChanged()), this, SLOT(actionTimelineChanged()));
 
     QScrollArea *scrollArea = new QScrollArea();
@@ -496,7 +505,7 @@
     scrollArea->setWidgetResizable(true);
 
 
-    demoView = new SWDemoView(this);
+    demoView = new QEDSWDemoView(this);
 
     verticalSplitter->addLayout(horizSplitter);
     verticalSplitter->addWidget(scrollArea);