Destruction added
This commit is contained in:
@@ -8,4 +8,6 @@ LoginFrameController::LoginFrameController()
|
|||||||
bool LoginFrameController::tryLogin(std::string id, std::string password){
|
bool LoginFrameController::tryLogin(std::string id, std::string password){
|
||||||
//DatabaseHandler dbHandler = new Databasehandler();
|
//DatabaseHandler dbHandler = new Databasehandler();
|
||||||
//dbHandler.CheckValidLogin();
|
//dbHandler.CheckValidLogin();
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
@@ -110,11 +110,23 @@ void LoginFrame::loginButtonClicked(){
|
|||||||
|
|
||||||
//check if Contents Valid
|
//check if Contents Valid
|
||||||
if (id.isEmpty() || password.isEmpty()){
|
if (id.isEmpty() || password.isEmpty()){
|
||||||
QMessageBox::warning(this, "Fehler", "Bitte füllen Sie sowohl die ID als auch das Passwort aus.");
|
QMessageBox::warning(this, "Error", "Bitte füllen Sie sowohl die ID als auch das Passwort aus.");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LoginFrameController* controller = new LoginFrameController();
|
LoginFrameController* controller = new LoginFrameController();
|
||||||
bool valid = controller->tryLogin(id.toStdString(), password.toStdString());
|
if (!controller->tryLogin(id.toStdString(), password.toStdString())){
|
||||||
|
QMessageBox:: warning(this, "Error", "ID und Passwort stimmen nicht überein!");
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this->~LoginFrame();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LoginFrame::~LoginFrame(){
|
||||||
|
header_m->~QLabel();
|
||||||
|
id_m->~QLineEdit();
|
||||||
|
password_m->~QLineEdit();
|
||||||
|
loginButton_m->~QPushButton();
|
||||||
|
parent_m->~QMainWindow();
|
||||||
}
|
}
|
||||||
@@ -6,11 +6,13 @@
|
|||||||
# include <QLabel>
|
# include <QLabel>
|
||||||
# include <QVBoxLayout>
|
# include <QVBoxLayout>
|
||||||
# include <QMessageBox>
|
# include <QMessageBox>
|
||||||
|
# include <QMainWindow>
|
||||||
# include "../../Controller/LoginFrameController/LoginFrameController.hpp"
|
# include "../../Controller/LoginFrameController/LoginFrameController.hpp"
|
||||||
|
|
||||||
class LoginFrame : public QFrame{
|
class LoginFrame : public QFrame{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
protected:
|
protected:
|
||||||
|
QMainWindow* parent_m;
|
||||||
QLabel* header_m;
|
QLabel* header_m;
|
||||||
QLineEdit* id_m;
|
QLineEdit* id_m;
|
||||||
QLineEdit* password_m;
|
QLineEdit* password_m;
|
||||||
@@ -20,4 +22,5 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
LoginFrame(QWidget* parent = nullptr);
|
LoginFrame(QWidget* parent = nullptr);
|
||||||
|
~LoginFrame();
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user