From aaef34e66368a2803ae876d734809b69f0c258a2 Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 27 Jan 2011 13:06:32 +0100 Subject: Finished metadata Created a modes for metadata, revamped NewMovieWizard to use the model and created a MetadataWidget to edit and display metadata. --- filepropertiesdialog.cpp | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) (limited to 'filepropertiesdialog.cpp') diff --git a/filepropertiesdialog.cpp b/filepropertiesdialog.cpp index bcbcde6..e7e6a34 100644 --- a/filepropertiesdialog.cpp +++ b/filepropertiesdialog.cpp @@ -14,21 +14,27 @@ #include #include #include +#include #include "filepropertiesdialog.h" +#include "seriesmetadatamodel.h" #include "smtreemodel.h" #include "smtreeitem.h" #include "helper.h" -FilePropertiesDialog::FilePropertiesDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){ - //main layout - QVBoxLayout *mainLayout = new QVBoxLayout; +FilePropertiesDialog::FilePropertiesDialog(int seriesPartId, QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){ + //tab + mTab = new QTabWidget; + + //stream data widget + QVBoxLayout *streamDataLayout = new QVBoxLayout; + QWidget *streamData = new QWidget; //description mDescriptionLabel = new QLabel(tr("Properties for [none]")); mDescriptionLabel->setAutoFillBackground(true); mDescriptionLabel->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); - mainLayout->addWidget(mDescriptionLabel); + streamDataLayout->addWidget(mDescriptionLabel); QSettings s; QVariant varColor = s.value("ui/alternatecolor"); QColor labelColor = varColor.value(); @@ -43,16 +49,30 @@ FilePropertiesDialog::FilePropertiesDialog(QWidget *parent, Qt::WindowFlags f) : mView->setAlternatingRowColors(true); mView->setEditTriggers(QAbstractItemView::NoEditTriggers); mView->setModel(mModel); - mainLayout->addWidget(mView); + streamDataLayout->addWidget(mView); + streamData->setLayout(streamDataLayout); + mTab->addTab(streamData, tr("Stream data")); + + //metadata widget + mMetadata = new MetadataWidget; + mMetadata->setSeriesPartId(seriesPartId); + mTab->addTab(mMetadata, tr("Metadata")); - //ok button + //buttons QHBoxLayout *buttonLayout = new QHBoxLayout; - mClose = new QPushButton(tr("Close")); - connect(mClose, SIGNAL(clicked()), this, SLOT(accept())); - buttonLayout->setAlignment(Qt::AlignCenter); - buttonLayout->addWidget(mClose); - mainLayout->addLayout(buttonLayout); + mOk = new QPushButton(tr("Ok")); + connect(mOk, SIGNAL(clicked()), this, SLOT(accept())); + connect(mOk, SIGNAL(clicked()), mMetadata, SLOT(accept())); + mCancel = new QPushButton(tr("Cancel")); + connect(mCancel, SIGNAL(clicked()), this, SLOT(reject())); + buttonLayout->setAlignment(Qt::AlignRight); + buttonLayout->addWidget(mOk); + buttonLayout->addWidget(mCancel); + //main layout + QVBoxLayout *mainLayout = new QVBoxLayout; + mainLayout->addWidget(mTab); + mainLayout->addLayout(buttonLayout); setLayout(mainLayout); setMinimumWidth(450); } -- cgit v1.2.3-70-g09d2