diff options
author | Arno <am@disconnect.de> | 2011-01-09 11:39:05 +0100 |
---|---|---|
committer | Arno <am@disconnect.de> | 2011-01-09 11:39:05 +0100 |
commit | 9603ec4b1e8cb85770f2d6b69dbe31a0fcff44f7 (patch) | |
tree | 77f32c8bf0c8863d02d2c867176f6c0c4768cfc5 | |
parent | cde287db9cb3ae5739cb45c5639313ea4847c960 (diff) | |
download | SheMov-9603ec4b1e8cb85770f2d6b69dbe31a0fcff44f7.tar.gz SheMov-9603ec4b1e8cb85770f2d6b69dbe31a0fcff44f7.tar.bz2 SheMov-9603ec4b1e8cb85770f2d6b69dbe31a0fcff44f7.zip |
Show iconized covers
When archiving covers, optionally show an iconized version of the cover
picture instead of the default decoration icon.
-rw-r--r-- | configurationdialog.cpp | 4 | ||||
-rw-r--r-- | configurationdialog.h | 1 | ||||
-rw-r--r-- | newmoviewizard.cpp | 10 |
3 files changed, 15 insertions, 0 deletions
diff --git a/configurationdialog.cpp b/configurationdialog.cpp index 2381c60..39a6858 100644 --- a/configurationdialog.cpp +++ b/configurationdialog.cpp @@ -159,6 +159,8 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent, Qt::WindowFlags f) : Q QVBoxLayout *archiveLayout = new QVBoxLayout; mAutoAddCovers = new QCheckBox(tr("Automatically add covers")); archiveLayout->addWidget(mAutoAddCovers); + mIconizeCovers = new QCheckBox(tr("Iconize covers")); + archiveLayout->addWidget(mIconizeCovers); archiveBox->setLayout(archiveLayout); //misc - assemble @@ -332,6 +334,7 @@ void ConfigurationDialog::readSettings(){ mGrabFrameFrom->setText(s.value("ui/grabframe", "00:00:00").toString()); mGrabFrameFrom->setEnabled(s.value("ui/hovermovies", false).toBool()); mAutoAddCovers->setChecked(s.value("ui/autoaddcovers", false).toBool()); + mIconizeCovers->setChecked(s.value("ui/iconizecovers", false).toBool()); //read paths mArchiveDir->setText(s.value("paths/archivedir").toString()); @@ -403,6 +406,7 @@ void ConfigurationDialog::writeSettings(){ s.setValue("ui/hovermovies", (mHoverMovies->checkState() == Qt::Checked)); s.setValue("ui/grabframe", mGrabFrameFrom->text()); s.setValue("ui/autoaddcovers", (mAutoAddCovers->checkState() == Qt::Checked)); + s.setValue("ui/iconizecovers", (mIconizeCovers->checkState() == Qt::Checked)); //write database s.setValue("database/hostname", mDatabaseHost->text()); diff --git a/configurationdialog.h b/configurationdialog.h index 4d4717f..e33928f 100644 --- a/configurationdialog.h +++ b/configurationdialog.h @@ -65,6 +65,7 @@ class ConfigurationDialog : public QDialog { QCheckBox *mHoverArchive; QCheckBox *mHoverMovies; QCheckBox *mAutoAddCovers; + QCheckBox *mIconizeCovers; QSpinBox *mHoverOpacity; QLabel *mSeenColor; QLabel *mClipboardColor; diff --git a/newmoviewizard.cpp b/newmoviewizard.cpp index 4c4e7c9..f5fe333 100644 --- a/newmoviewizard.cpp +++ b/newmoviewizard.cpp @@ -469,6 +469,16 @@ QVariant WizardTreeModel::data(const QModelIndex &index, int role) const{ return item->data(FilePart); } if(role == Qt::DecorationRole){ + if(index.column() == 0){ + QSettings s; + bool iconizeCover = s.value("ui/iconizecovers", false).toBool(); + if(iconizeCover){ + int fileType = item->data(FileType).toInt(); + if((fileType == FrontCover) || (fileType == BackCover) || (fileType == GeneralCover)){ + return QIcon(item->data(FullPath).toString()); + } + } + } return SmTreeModel::data(index, role); } return QVariant(); |