]> Shamusworld >> Repos - schematic/blob - src/sqlsettingsdialog.cpp
30b1a53ba5cfebc966f6fe03d67b58997b2bb00e
[schematic] / src / sqlsettingsdialog.cpp
1 //
2 // sqlsettingsdialog.cpp: The SQL Settings dialog
3 //
4 // Part of the SCheMatic Project
5 // (C) 2012 Underground Software
6 //
7 // JLH = James Hammons <jlhamm@acm.org>
8 //
9 // WHO  WHEN        WHAT
10 // ---  ----------  ------------------------------------------------------------
11 // JLH  09/19/2012  Created this file
12
13 #include "sqlsettingsdialog.h"
14
15
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 {
23         connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
24         connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
25
26         edit4->setEchoMode(QLineEdit::Password);
27
28         QFormLayout * formLayout = new QFormLayout;
29         formLayout->addRow(tr("&MySQL Server Hostname:"), edit1);
30         formLayout->addRow(tr("&Database Name:"), edit2);
31         formLayout->addRow(tr("&Database Username:"), edit3);
32         formLayout->addRow(tr("&Database Password:"), edit4);
33
34         QVBoxLayout * mainLayout = new QVBoxLayout;
35         mainLayout->addLayout(formLayout);
36         mainLayout->addWidget(buttonBox);
37         setLayout(mainLayout);
38
39         setWindowTitle(tr("MySQL Server Connection"));
40 }
41
42 SQLSettingsDialog::~SQLSettingsDialog()
43 {
44 }