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())
23 connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
24 connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
26 edit4->setEchoMode(QLineEdit::Password);
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);
34 QVBoxLayout * mainLayout = new QVBoxLayout;
35 mainLayout->addLayout(formLayout);
36 mainLayout->addWidget(buttonBox);
37 setLayout(mainLayout);
39 setWindowTitle(tr("MySQL Server Connection"));
42 SQLSettingsDialog::~SQLSettingsDialog()