blob: 5bf765162dbd9bf2c6bdeced9d011b667041e4af (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/*
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 <QVBoxLayout>
#include <QSettings>
#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<QVariant> 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);
}
}
|