diff options
author | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-17 17:36:23 +0000 |
---|---|---|
committer | am <am@f440f766-f032-0410-8965-dc7d17de2ca0> | 2009-07-17 17:36:23 +0000 |
commit | a477a1998c03bc0e7251463aff5486e3c0872d23 (patch) | |
tree | 1de3c2d32f1f1811a7dcc2058bfaf26c18f7e296 /configurationdialog.cpp | |
parent | 1b1e48aa11c4518e100004dac594540e6024fa68 (diff) | |
download | SheMov-a477a1998c03bc0e7251463aff5486e3c0872d23.tar.gz SheMov-a477a1998c03bc0e7251463aff5486e3c0872d23.tar.bz2 SheMov-a477a1998c03bc0e7251463aff5486e3c0872d23.zip |
Huge changes:
-Created an application icon and one for archives
-implemented database configuration dialog
-implemented listeditor
-implemented covereditor
-implemented md5sum helper
-implemented archivefilewidget
-Debugging spree: fixed SQL-statements and ListModel
git-svn-id: file:///var/svn/repos2/shemov/trunk@389 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'configurationdialog.cpp')
-rw-r--r-- | configurationdialog.cpp | 43 |
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()); } |