/* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ #include #include #include "moviemetadatapage.h" #include "archiveview.h" MovieMetadataPage::MovieMetadataPage(QWidget *parent) : QWizardPage(parent){ setTitle(tr("Edit movie metadata")); setSubTitle(tr("Set the movie metadata here, as far as known")); setupGui(); } void MovieMetadataPage::setupGui(){ mWidget = new MetadataEditorWidget; QVBoxLayout *mainLayout = new QVBoxLayout; mainLayout->addWidget(mWidget); setLayout(mainLayout); } void MovieMetadataPage::initializePage(){ QSettings s; bool clearPage = s.value("ui/clearnewmoviewizard").toBool(); if(clearPage){ QList curMetadata; for(int i = 0; i < ArchiveModel::MetadataNumFields; ++i){ curMetadata << QVariant(); } curMetadata[ArchiveModel::ReleaseYear] = QDate::currentDate().year(); curMetadata[ArchiveModel::Source] = "torrent"; curMetadata[ArchiveModel::ReleaseGroup] = "unknown"; curMetadata[ArchiveModel::Added] = QDate::currentDate(); mWidget->setMetadata(curMetadata); } } void MovieMetadataPage::setGuessedSubject(const QString subject){ mWidget->replaceSubject(subject); }