diff options
Diffstat (limited to 'client/settingsmenu.cpp')
-rw-r--r-- | client/settingsmenu.cpp | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/client/settingsmenu.cpp b/client/settingsmenu.cpp new file mode 100644 index 0000000..139c616 --- /dev/null +++ b/client/settingsmenu.cpp @@ -0,0 +1,47 @@ +#include "settingsmenu.h" +//#include "ui_SettingsMenu.h" +#include "main.h" + +#include "mainwindow.h" + +SettingsMenu::SettingsMenu(QWidget *parent) : + QDialog(parent), + ui(new Ui::SettingsMenu) +{ + _dbip = "localhost"; + ui->setupUi(this); +} + +SettingsMenu::~SettingsMenu() +{ + delete ui; +} + +void SettingsMenu::on_pushButton_cancel_clicked() +{ + SettingsMenu::~SettingsMenu(); +} + +void SettingsMenu::on_pushButton_login_clicked() +{ + _dbip = ui->lineEdit_adress->text(); + _dbName = ui->lineEdit_database->text(); + QString username = ui->lineEdit_username->text(); + QString password = ui->lineEdit_password->text(); + + dbRef.setHostName(_dbip); + dbRef.setUserName(username); + dbRef.setPassword(password); + dbRef.setDatabaseName(_dbName); + + if(dbRef.open()){ + QMessageBox::information(this, "Connection", "GREAT SUCCES!"); + SettingsMenu::~SettingsMenu(); + } else { + QMessageBox::warning(this, "No connection", "Failed to connect"); + } +} + + + + |