summaryrefslogtreecommitdiffstats
path: root/configurationdialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'configurationdialog.cpp')
-rw-r--r--configurationdialog.cpp43
1 files changed, 42 insertions, 1 deletions
diff --git a/configurationdialog.cpp b/configurationdialog.cpp
index 32fc197..065e105 100644
--- a/configurationdialog.cpp
+++ b/configurationdialog.cpp
@@ -41,7 +41,7 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent, Qt::WindowFlags f) : Q
mPictureViewerArgs = new QLineEdit;
pathGrid->addWidget(l2, 1, 0);
pathGrid->addWidget(mPictureViewerArgs, 1, 1);
- QLabel *l3 = new QLabel(tr("Path to &movie viewer"));
+ QLabel *l3 = new QLabel(tr("Path to movie viewer"));
mMovieViewer = new QLineEdit;
mMovieViewer->setCompleter(fsCompleter);
l2->setBuddy(mMovieViewer);
@@ -115,9 +115,38 @@ ConfigurationDialog::ConfigurationDialog(QWidget *parent, Qt::WindowFlags f) : Q
expandButtons->addWidget(mAddExpandPath);
expandButtons->addWidget(mRemoveExpandPath);
uiGrid->addLayout(expandButtons, 4, 1);
+ uiGrid->addLayout(new QHBoxLayout, 5, 0, 2, 3);
uiWidget->setLayout(uiGrid);
mTab->addTab(uiWidget, tr("User interface"));
+ //database tab
+ QWidget *databaseWidget = new QWidget;
+ QGridLayout *dbGrid = new QGridLayout;
+ QLabel *dbl1 = new QLabel(tr("Database &host"));
+ mDatabaseHost = new QLineEdit;
+ dbl1->setBuddy(mDatabaseHost);
+ dbGrid->addWidget(dbl1, 0, 0);
+ dbGrid->addWidget(mDatabaseHost, 0, 1);
+ QLabel *dbl2 = new QLabel(tr("Database &name"));
+ mDatabaseName = new QLineEdit;
+ dbl2->setBuddy(mDatabaseName);
+ dbGrid->addWidget(dbl2, 1, 0);
+ dbGrid->addWidget(mDatabaseName, 1, 1);
+ QLabel *dbl3 = new QLabel(tr("Database &user"));
+ mDatabaseUsername = new QLineEdit;
+ dbl3->setBuddy(mDatabaseUsername);
+ dbGrid->addWidget(dbl3, 2, 0);
+ dbGrid->addWidget(mDatabaseUsername, 2, 1);
+ QLabel *dbl4 = new QLabel(tr("Database &password"));
+ mDatabasePassword = new QLineEdit;
+ dbl4->setBuddy(mDatabasePassword);
+ mDatabasePassword->setEchoMode(QLineEdit::Password);
+ dbGrid->addWidget(dbl4, 3, 0);
+ dbGrid->addWidget(mDatabasePassword, 3, 1);
+ dbGrid->addLayout(new QHBoxLayout, 4, 0, 2, 4);
+ databaseWidget->setLayout(dbGrid);
+ mTab->addTab(databaseWidget, tr("Database"));
+
//main layout
mOk = new QPushButton(tr("Ok"));
connect(mOk, SIGNAL(clicked()), this, SLOT(accept()));
@@ -213,6 +242,12 @@ void ConfigurationDialog::readSettings(){
mIconForFolder->setCurrentIndex(pos);
}
+ //read database
+ mDatabaseHost->setText(s.value("database/hostname").toString());
+ mDatabaseName->setText(s.value("database/dbname").toString());
+ mDatabaseUsername->setText(s.value("database/dbuser").toString());
+ mDatabasePassword->setText(s.value("database/dbpass").toString());
+
}
void ConfigurationDialog::writeSettings(){
@@ -235,5 +270,11 @@ void ConfigurationDialog::writeSettings(){
s.setValue("ui/expandpaths", mEPaths);
s.setValue("ui/folderIcon", mIconForFolder->currentText());
s.setValue("ui/selectstartup", mSelectStartup);
+
+ //write database
+ s.setValue("database/hostname", mDatabaseHost->text());
+ s.setValue("database/dbname", mDatabaseName->text());
+ s.setValue("database/dbuser", mDatabaseUsername->text());
+ s.setValue("database/dbpass", mDatabasePassword->text());
}