2 // sqlsettingsdialog.cpp: The SQL Settings dialog
4 // Part of the SCheMatic Project
5 // (C) 2012 Underground Software
7 // JLH = James Hammons <jlhamm@acm.org>
10 // --- ---------- ------------------------------------------------------------
11 // JLH 09/19/2012 Created this file
13 #include "sqlsettingsdialog.h"
16 SQLSettingsDialog::SQLSettingsDialog(QWidget * parent/*= 0*/): QDialog(parent),
17 buttonBox(new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel)),
18 edit1(new QLineEdit()),
19 edit2(new QLineEdit()),
20 edit3(new QLineEdit()),
21 edit4(new QLineEdit()),
22 edit5(new QLineEdit())
24 connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
25 connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
27 edit4->setEchoMode(QLineEdit::Password);
29 QFormLayout * formLayout = new QFormLayout;
30 formLayout->addRow(tr("&Database Driver:"), edit1);
31 formLayout->addRow(tr("&Database Server Hostname:"), edit2);
32 formLayout->addRow(tr("&Database Name:"), edit3);
33 formLayout->addRow(tr("&Database Username:"), edit4);
34 formLayout->addRow(tr("&Database Password:"), edit5);
36 QVBoxLayout * mainLayout = new QVBoxLayout;
37 mainLayout->addLayout(formLayout);
38 mainLayout->addWidget(buttonBox);
39 setLayout(mainLayout);
41 setWindowTitle(tr("SQL Server Connection"));
45 SQLSettingsDialog::~SQLSettingsDialog()