summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-04-06 07:38:36 +0200
committerArno <am@disconnect.de>2013-04-06 07:38:36 +0200
commit466a1fd7de9cfe5e90d812e7370ef2d22c68f00e (patch)
tree7131f265a3a5d703f95a430b760744bcc226cb6c
parent3956fb84ccc26d5ba3be1814192b0c377adfbad0 (diff)
downloadSheMov-466a1fd7de9cfe5e90d812e7370ef2d22c68f00e.tar.gz
SheMov-466a1fd7de9cfe5e90d812e7370ef2d22c68f00e.tar.bz2
SheMov-466a1fd7de9cfe5e90d812e7370ef2d22c68f00e.zip
Make check for present files configurable
Add a configuration option for checking the database when browsing the filesystem.
-rw-r--r--configurationdialog.cpp11
-rw-r--r--configurationdialog.h1
-rw-r--r--fileview.cpp2
3 files changed, 13 insertions, 1 deletions
diff --git a/configurationdialog.cpp b/configurationdialog.cpp
index 12198e3..db54dfe 100644
--- a/configurationdialog.cpp
+++ b/configurationdialog.cpp
@@ -278,9 +278,16 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent, Qt::WindowFlags f) : S
dbFormL->addRow(tr("Database &password"), mDatabasePassword);
QGroupBox *dbBox = new QGroupBox(tr("Database connection"));
dbBox->setLayout(dbFormL);
- QWidget *dbWidget = new QWidget;
QVBoxLayout *dbWidgetLayout = new QVBoxLayout;
dbWidgetLayout->addWidget(dbBox);
+ QGroupBox *miscDbBox = new QGroupBox(tr("Misc."));
+ QVBoxLayout *miscDbLayout= new QVBoxLayout;
+ mCheckPresent = new QCheckBox(tr("Check database for files"));
+ miscDbLayout->addWidget(mCheckPresent);
+ miscDbBox->setLayout(miscDbLayout);
+ dbWidgetLayout->addWidget(miscDbBox);
+ dbWidgetLayout->addStretch();
+ QWidget *dbWidget = new QWidget;
dbWidget->setLayout(dbWidgetLayout);
mTab->addTab(dbWidget, tr("Database"));
@@ -473,6 +480,7 @@ void ConfigurationDialog::readSettings(){
mDatabaseName->setText(s.value("database/dbname").toString());
mDatabaseUsername->setText(s.value("database/dbuser").toString());
mDatabasePassword->setText(s.value("database/dbpass").toString());
+ mCheckPresent->setChecked(s.value("database/checkpresent", false).toBool());
//read colors
QVariant clip = s.value("ui/clipcolor", QVariant(QColor(Qt::darkBlue)));
@@ -557,6 +565,7 @@ void ConfigurationDialog::writeSettings(){
s.setValue("database/dbname", mDatabaseName->text());
s.setValue("database/dbuser", mDatabaseUsername->text());
s.setValue("database/dbpass", mDatabasePassword->text());
+ s.setValue("database/checkpresent", (mCheckPresent->checkState() == Qt::Checked));
//write movies
mMovieConfig->writeSettings();
diff --git a/configurationdialog.h b/configurationdialog.h
index cc074de..86d816a 100644
--- a/configurationdialog.h
+++ b/configurationdialog.h
@@ -80,6 +80,7 @@ class ConfigurationDialog : public SmDialog {
QCheckBox *mAutoAddCovers;
QCheckBox *mIconizeCovers;
QCheckBox *mAutoRefresh;
+ QCheckBox *mCheckPresent;
QSpinBox *mHoverOpacity;
QSpinBox *mCursorOffset;
QSpinBox *mPVWidth;
diff --git a/fileview.cpp b/fileview.cpp
index b6adee0..a6108bb 100644
--- a/fileview.cpp
+++ b/fileview.cpp
@@ -109,6 +109,8 @@ void FileView::readConfig(){
mWhen = s.value("ui/grabframe", "00:00:00").toString();
mHoverWin->setWindowOpacity(s.value("ui/hoveropacity", 10).toFloat() / 10.0);
mCursorOffset = s.value("ui/cursoroffset").toInt();
+ bool checkPresent = s.value("database/checkpresent").toBool();
+ mModel->setCheckForPresent(checkPresent);
readHeaderConfig();
}