From c42edb9b6c585848a94c6e20f5ae11ab03582f3e Mon Sep 17 00:00:00 2001 From: AJ Date: Tue, 9 Jul 2024 00:05:00 +0200 Subject: [PATCH] Update --- .../PlanGridController/PlanGridController.cpp | 59 +++++--- src/Core/config/config.hpp | 37 ----- .../Dialogs/CreateMember/CreateMember.cpp | 137 ----------------- .../Dialogs/CreateMember/CreateMember.hpp | 26 ---- .../CreateVeranstaltung.cpp | 141 ------------------ .../CreateVeranstaltung.hpp | 28 ---- .../Dialogs/Krankmelden/Krankmelden.cpp | 62 -------- .../Dialogs/Krankmelden/Krankmelden.hpp | 16 -- .../EinsatzplanFrame/EinsatzplanFrame.hpp | 47 ------ .../EinsatzplanWindow/EinsatzplanWindow.cpp | 8 - .../EinsatzplanWindow/EinsatzplanWindow.hpp | 12 -- src/View/LoginFrame/LoginFrame.cpp | 123 --------------- src/View/LoginFrame/LoginFrame.hpp | 29 ---- src/View/LoginWindow/LoginWindow.cpp | 8 - src/View/LoginWindow/LoginWindow.hpp | 14 -- src/View/PlanGrid/PlanGrid.hpp | 34 ----- src/main.cpp | 10 -- 17 files changed, 41 insertions(+), 750 deletions(-) delete mode 100644 src/Core/config/config.hpp delete mode 100644 src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.cpp delete mode 100644 src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.hpp delete mode 100644 src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.cpp delete mode 100644 src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.hpp delete mode 100644 src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.cpp delete mode 100644 src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.hpp delete mode 100644 src/View/EinsatzplanFrame/EinsatzplanFrame.hpp delete mode 100644 src/View/EinsatzplanWindow/EinsatzplanWindow.cpp delete mode 100644 src/View/EinsatzplanWindow/EinsatzplanWindow.hpp delete mode 100644 src/View/LoginFrame/LoginFrame.cpp delete mode 100644 src/View/LoginFrame/LoginFrame.hpp delete mode 100644 src/View/LoginWindow/LoginWindow.cpp delete mode 100644 src/View/LoginWindow/LoginWindow.hpp delete mode 100644 src/View/PlanGrid/PlanGrid.hpp delete mode 100644 src/main.cpp diff --git a/src/Controller/PlanGridController/PlanGridController.cpp b/src/Controller/PlanGridController/PlanGridController.cpp index 01957d5..d9b675d 100644 --- a/src/Controller/PlanGridController/PlanGridController.cpp +++ b/src/Controller/PlanGridController/PlanGridController.cpp @@ -116,30 +116,53 @@ QMap, QWidget*>* PlanGridController::getVeranstaltungen( )")); container->setFixedSize(240, 100); + if (infoVector.at(8) == "4") { - planMap->insert(qMakePair( - weekdays[std::stoi(infoVector.at(0)) - 1], - QString::fromStdString(infoVector.at(1).erase(5, 8))), - container); + QFrame* container2 = new QFrame( ); - std::string originalString = infoVector.at(1); - if (originalString.length( ) >= 2) { - char secondChar = originalString[1]; - secondChar += 2; - originalString[1] = secondChar; - } + container2->setObjectName("container2"); + container2->setStyleSheet(R"( + #container2{ + background-color: #313131; + } + )"); + auto layout2 = new QVBoxLayout(container2); + container2->setLayout(layout2); + + QPushButton* widget2 = new QPushButton(QString::fromStdString(infoVector.at(4) + " - " + infoVector.at(5) + "\n" + infoVector.at(3) + infoVector.at(6))); + layout2->addWidget(widget2); + widget2->setProperty("MitarbeiterName", QString::fromStdString(infoVector.at(5))); + widget2->setProperty("MitarbeiterID", QString::fromStdString(infoVector.at(7))); + widget2->setObjectName("eintragung2"); + widget2->setFixedSize(210, 70); + widget2->setToolTip(QString::fromStdString(infoVector.at(7))); + widget2->setCursor(Qt::PointingHandCursor); + layout2->setAlignment(Qt::AlignCenter); + + widget2->setStyleSheet(QString::fromStdString(R"( + #eintragung2{ + border: 0px solid #313131; + background-color: )" + color + R"(; + color: #212121; + font-weight: 900; + font-size: 18px; + border-radius: 8px; + } + )")); + + container2->setFixedSize(240, 100); planMap->insert(qMakePair( weekdays[std::stoi(infoVector.at(0)) - 1], - QString::fromStdString(originalString)), - container); - } else { - - planMap->insert(qMakePair( - weekdays[std::stoi(infoVector.at(0)) - 1], - QString::fromStdString(infoVector.at(1).erase(5, 8))), - container); + QString::fromStdString(infoVector.at(2).erase(5, 8))), + container2); } + + planMap->insert(qMakePair( + weekdays[std::stoi(infoVector.at(0)) - 1], + QString::fromStdString(infoVector.at(1).erase(5, 8))), + container); + } return planMap; diff --git a/src/Core/config/config.hpp b/src/Core/config/config.hpp deleted file mode 100644 index d833151..0000000 --- a/src/Core/config/config.hpp +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -inline static const std::map& load_config( ) { - static std::map config; - static bool is_loaded{ false }; - static std::string fn{ "" }; - -#if defined(_WIN32) || defined(_WIN64) - std::string filename = std::string(std::getenv("USER")) + "\\config.cfg"; -#elif defined(__unix__) || defined(__APPLE__) - std::string filename = std::string(std::getenv("HOME")) + "/Dokumente/git/EinsatzplanQT/config.cfg"; -#endif - - if (!is_loaded || fn != filename) { - std::ifstream file(filename); - std::string line; - - while (std::getline(file, line)) { - std::istringstream line_stream(line); - std::string key; - if (std::getline(line_stream, key, '=')) { - std::string value; - if (std::getline(line_stream, value)) - config[key] = value; - } - } - - is_loaded = true; - fn = filename; - } - return config; -} diff --git a/src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.cpp b/src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.cpp deleted file mode 100644 index f53fa09..0000000 --- a/src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.cpp +++ /dev/null @@ -1,137 +0,0 @@ -#include "CreateMember.hpp" - -CreateMemDialog::CreateMemDialog(QWidget* parent) - :QDialog(parent) { - setWindowTitle("Mitarbeiter Hinzufügen"); - setFixedSize(300, 400); - setObjectName("CreateMemDialog"); - setStyleSheet(R"( - #CreateMemDialog{ - background-color: #212121; - border: none; - } - )"); - - m_name = new QLineEdit(this); - m_name->setPlaceholderText("Name"); - m_name->setFixedSize(220, 40); - m_name->setObjectName("name"); - m_name->setStyleSheet(R"( - #name{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - m_name->show( ); - - - m_email = new QLineEdit(this); - m_email->setPlaceholderText("Email"); - m_email->setFixedSize(220, 40); - m_email->setObjectName("email"); - m_email->setStyleSheet(R"( - #email{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - m_email->show( ); - - m_password = new QLineEdit(this); - m_password->setPlaceholderText("Passwort"); - m_password->setEchoMode(QLineEdit::Password); - m_password->setFixedSize(220, 40); - m_password->setObjectName("password"); - m_password->setStyleSheet(R"( - #password{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - m_password->show( ); - - m_admin = new QCheckBox("Admin", this); - m_admin->setFixedSize(220, 40); - m_admin->setObjectName("admin"); - m_admin->setStyleSheet(R"( - #admin{ - color: #DADADA; - font-size: 20px; - border: none; - } - )"); - m_admin->show( ); - - QVBoxLayout* layout = new QVBoxLayout(this); - - layout->setContentsMargins(30, 30, 30, 30); - - layout->addWidget(m_name, 1, Qt::AlignCenter); - layout->addWidget(m_email, 1, Qt::AlignCenter); - layout->addWidget(m_password, 1, Qt::AlignCenter); - layout->addWidget(m_admin, 1, Qt::AlignCenter); - - QHBoxLayout* buttonLayout = new QHBoxLayout( ); - - m_okButton = new QPushButton("OK", this); - m_okButton->setFixedSize(110, 40); - m_okButton->setObjectName("okButton"); - m_okButton->setStyleSheet(R"( - #okButton{ - color: #212121; - font-size: 16px; - font-weight: bold; - background-color: #A5D6A7; - border-radius: 10px; - } - )"); - - m_cancelButton = new QPushButton("Abbrechen", this); - m_cancelButton->setFixedSize(110, 40); - m_cancelButton->setObjectName("cancelButton"); - m_cancelButton->setStyleSheet(R"( - #cancelButton{ - color: #212121; - font-size: 16px; - font-weight: bold; - background-color: #EF9A9A; - border-radius: 10px; - } - )"); - - buttonLayout->addWidget(m_okButton, 1, Qt::AlignCenter); - buttonLayout->addWidget(m_cancelButton, 1, Qt::AlignCenter); - - layout->addLayout(buttonLayout); - - connect(m_okButton, &QPushButton::clicked, this, &QDialog::accept); - connect(m_cancelButton, &QPushButton::clicked, this, &QDialog::reject); -} - -QString CreateMemDialog::getName( ) const { - return m_name->text( ); -} - -QString CreateMemDialog::getEmail( ) const { - return m_email->text( ); -} - -QString CreateMemDialog::getPassword( ) const { - return m_password->text( ); -} - -bool CreateMemDialog::isAdmin( ) const { - return m_admin->isChecked( ); -} diff --git a/src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.hpp b/src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.hpp deleted file mode 100644 index 182f836..0000000 --- a/src/View/EinsatzplanFrame/Dialogs/CreateMember/CreateMember.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -class CreateMemDialog : public QDialog { - Q_OBJECT -protected: - QLineEdit* m_name; - QLineEdit* m_email; - QLineEdit* m_password; - QCheckBox* m_admin; - QPushButton* m_okButton; - QPushButton* m_cancelButton; - -public: - CreateMemDialog(QWidget* parent = nullptr); - - QString getName( ) const; - QString getEmail( ) const; - QString getPassword( ) const; - bool isAdmin( ) const; -}; diff --git a/src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.cpp b/src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.cpp deleted file mode 100644 index 2a7a143..0000000 --- a/src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.cpp +++ /dev/null @@ -1,141 +0,0 @@ -#include "CreateVeranstaltung.hpp" - -CreateVerDialog::CreateVerDialog(QWidget* parent) - : QDialog(parent) { - setWindowTitle("Veranstaltung Hinzufügen"); - setFixedSize(300, 400); - setObjectName("createMemDialog"); - setStyleSheet(R"( - #createMemDialog{ - background-color: #212121; - border: none; - } - )"); - - QVBoxLayout* layout = new QVBoxLayout(this); - layout->setContentsMargins(30, 30, 30, 30); - - m_name = new QLineEdit(this); - m_name->setPlaceholderText("Veranstaltungskürzel"); - m_name->setFixedSize(220, 40); - m_name->setObjectName("name"); - m_name->setStyleSheet(R"( - #name{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - layout->addWidget(m_name, 1, Qt::AlignCenter); - - m_raum = new QLineEdit(this); - m_raum->setPlaceholderText("Raum"); - m_raum->setFixedSize(220, 40); - m_raum->setObjectName("raum"); - m_raum->setStyleSheet(R"( - #raum{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - layout->addWidget(m_raum, 1, Qt::AlignCenter); - - m_campus = new QComboBox(this); - m_campus->addItem("Campus A"); - m_campus->addItem("Campus B"); - m_campus->setFixedSize(220, 40); - m_campus->setObjectName("campus"); - m_campus->setStyleSheet(R"( - #campus{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - } - #campus::Item{ - color: #DADADA; - background-color: #313131; - } - )"); - layout->addWidget(m_campus, 1, Qt::AlignCenter); - - m_time = new QComboBox(this); - m_time->addItem("2h"); - m_time->addItem("4h"); - m_time->setFixedSize(220, 40); - m_time->setObjectName("time"); - m_time->setStyleSheet(R"( - #time{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - } - #time::Item{ - color: #DADADA; - background-color: #313131; - } - )"); - layout->addWidget(m_time, 1, Qt::AlignCenter); - - QHBoxLayout* buttonLayout = new QHBoxLayout( ); - - m_okButton = new QPushButton("OK", this); - m_okButton->setFixedSize(110, 40); - m_okButton->setObjectName("okButton"); - m_okButton->setStyleSheet(R"( - #okButton{ - color: #212121; - font-size: 16px; - font-weight: bold; - background-color: #53EC87; - border-radius: 10px; - } - )"); - - m_cancelButton = new QPushButton("Abbrechen", this); - m_cancelButton->setFixedSize(110, 40); - m_cancelButton->setObjectName("cancelButton"); - m_cancelButton->setStyleSheet(R"( - #cancelButton{ - color: #212121; - font-size: 16px; - font-weight: bold; - background-color: #FF5555; - border-radius: 10px; - } - )"); - - buttonLayout->addWidget(m_okButton, 1, Qt::AlignCenter); - buttonLayout->addWidget(m_cancelButton, 1, Qt::AlignCenter); - - layout->addLayout(buttonLayout, 1); - - connect(m_okButton, &QPushButton::clicked, this, &QDialog::accept); - connect(m_cancelButton, &QPushButton::clicked, this, &QDialog::reject); -} - -QString CreateVerDialog::getName( ) const { - return m_name->text( ); -} - -QString CreateVerDialog::getRaum( ) const { - return m_raum->text( ); -} - -QString CreateVerDialog::getCampus( ) const { - return m_campus->currentText( ); -} - -QString CreateVerDialog::getTime( ) const { - return m_time->currentText( ); -} diff --git a/src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.hpp b/src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.hpp deleted file mode 100644 index 50e666a..0000000 --- a/src/View/EinsatzplanFrame/Dialogs/CreateVeranstaltung/CreateVeranstaltung.hpp +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include - -class CreateVerDialog : public QDialog { - Q_OBJECT -protected: - QLineEdit* m_name; - QLineEdit* m_raum; - - QComboBox* m_campus; - QComboBox* m_time; - - QPushButton* m_okButton; - QPushButton* m_cancelButton; - -public: - CreateVerDialog(QWidget* parent = nullptr); - - QString getName( ) const; - QString getRaum( ) const; - QString getCampus( ) const; - QString getTime( ) const; -}; diff --git a/src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.cpp b/src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.cpp deleted file mode 100644 index 3442058..0000000 --- a/src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "Krankmelden.hpp" - -Krankmelden::Krankmelden(const QString& mitarbeiterName, QWidget* parent) : - QDialog(parent), - m_text(new QLabel(QString::fromStdString(mitarbeiterName.toStdString( ) + " krankmelden?"))) { - setWindowTitle("Mitarbeiter Krankmelden?"); - setFixedSize(350, 150); - setObjectName("Krankmelden"); - setStyleSheet(R"( - #Krankmelden{ - background-color: #212121; - border: none; - } - )"); - - m_accept = new QPushButton("Ja", this); - m_accept->setFixedSize(110, 40); - m_accept->setObjectName("acceptButton"); - m_accept->setStyleSheet(R"( - #acceptButton{ - color: #212121; - font-size: 16px; - font-weight: bold; - background-color: #A5D6A7; - border-radius: 10px; - } - )"); - m_decline = new QPushButton("Nein", this); - m_decline->setFixedSize(110, 40); - m_decline->setObjectName("declineButton"); - m_decline->setStyleSheet(R"( - #declineButton{ - color: #212121; - font-size: 16px; - font-weight: bold; - background-color: #EF9A9A; - border-radius: 10px; - } - )"); - - m_text->setObjectName("mitarbeiterName"); - m_text->setStyleSheet(R"( - #mitarbeiterName{ - background-color: none; - border:none; - color: #D8D8D8; - font-size:18px; - } - )"); - - QVBoxLayout* mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(m_text, 0, Qt::AlignCenter); - - QHBoxLayout* layout = new QHBoxLayout( ); - mainLayout->addLayout(layout, 1); - - layout->addWidget(m_accept, 1, Qt::AlignCenter); - layout->addWidget(m_decline, 1, Qt::AlignCenter); - - connect(m_accept, &QPushButton::clicked, this, &QDialog::accept); - connect(m_decline, &QPushButton::clicked, this, &QDialog::reject); -} diff --git a/src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.hpp b/src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.hpp deleted file mode 100644 index b747b5a..0000000 --- a/src/View/EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.hpp +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -class Krankmelden : public QDialog { - Q_OBJECT -protected: - QPushButton* m_accept; - QPushButton* m_decline; - QLabel* m_text; -public: - Krankmelden(const QString& mitarbeiterName, QWidget* parent = nullptr); -}; diff --git a/src/View/EinsatzplanFrame/EinsatzplanFrame.hpp b/src/View/EinsatzplanFrame/EinsatzplanFrame.hpp deleted file mode 100644 index 3c93a4a..0000000 --- a/src/View/EinsatzplanFrame/EinsatzplanFrame.hpp +++ /dev/null @@ -1,47 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../PlanGrid/PlanGrid.hpp" -#include "../../Controller/EinsatzplanFrameController/EinsatzplanFrameController.hpp" -#include "Dialogs/CreateMember/CreateMember.hpp" -#include "Dialogs/CreateVeranstaltung/CreateVeranstaltung.hpp" - -class EinsatzplanFrame : public QFrame { - Q_OBJECT -protected: - EinsatzplanFrameController* m_controller; - - QLabel* m_profileImg; - QLabel* m_id; - QLabel* m_einsatzplanLabel; - - PlanGrid* m_planGrid; - - QPushButton* m_abmeldenButton; - QPushButton* m_createMemberButton; - QPushButton* m_deleteMemberButton; - QPushButton* m_createVeranstaltungButton; - QPushButton* m_deleteVeranstaltungButton; - -public: - EinsatzplanFrame(QWidget* parent = nullptr, QString id = "0000000", bool admin = true); - -private slots: - void abmelden( ); - void deleteVeranstaltung( ); - void createVeranstaltung( ); - void deleteMember( ); - void createMember( ); -}; diff --git a/src/View/EinsatzplanWindow/EinsatzplanWindow.cpp b/src/View/EinsatzplanWindow/EinsatzplanWindow.cpp deleted file mode 100644 index f4296a9..0000000 --- a/src/View/EinsatzplanWindow/EinsatzplanWindow.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "EinsatzplanWindow.hpp" - -EinsatzplanWindow::EinsatzplanWindow(QWidget* parent, QString id, bool admin) - :QMainWindow(parent) { - m_frame = new EinsatzplanFrame(this, id, admin); - setFixedSize(1400, 800); - m_frame->setFixedSize(size( )); -} diff --git a/src/View/EinsatzplanWindow/EinsatzplanWindow.hpp b/src/View/EinsatzplanWindow/EinsatzplanWindow.hpp deleted file mode 100644 index 0e88b96..0000000 --- a/src/View/EinsatzplanWindow/EinsatzplanWindow.hpp +++ /dev/null @@ -1,12 +0,0 @@ -# pragma once -# include -# include "../EinsatzplanFrame/EinsatzplanFrame.hpp" - -class EinsatzplanWindow : public QMainWindow { - Q_OBJECT -private: - EinsatzplanFrame* m_frame; - -public: - EinsatzplanWindow(QWidget* parent = nullptr, QString id = "0000000", bool admin = true); -}; diff --git a/src/View/LoginFrame/LoginFrame.cpp b/src/View/LoginFrame/LoginFrame.cpp deleted file mode 100644 index cf5e46b..0000000 --- a/src/View/LoginFrame/LoginFrame.cpp +++ /dev/null @@ -1,123 +0,0 @@ -#include "LoginFrame.hpp" - -LoginFrame::LoginFrame(QWidget* parent) - :QFrame(parent) { - //configure LoginFrame - setObjectName("LoginFrame"); - setStyleSheet(R"( - #LoginFrame{ - background-color: #212121; - border: none; - } - )"); - setFrameStyle(QFrame::Box); - - //create QWidgets and add LoginFrame as parent - m_header = new QLabel("Einsatzplan", this); - m_header->setFrameStyle(QFrame::Box); - m_header->setObjectName("Header"); - m_header->setStyleSheet(R"( - #Header{ - color: #93F8FF; - font-size: 36px; - font-weight: bold; - border: none; - } - )"); - m_header->show( ); - - m_id = new QLineEdit(this); - m_id->setPlaceholderText("ID..."); - m_id->setObjectName("ID"); - m_id->setFixedSize(300, 40); - m_id->setStyleSheet(R"( - #ID{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - m_id->show( ); - - m_password = new QLineEdit(this); - m_password->setPlaceholderText("Passwort..."); - m_password->setObjectName("Password"); - m_password->setEchoMode(QLineEdit::Password); - m_password->setFixedSize(300, 40); - m_password->setStyleSheet(R"( - #Password{ - color: #DADADA; - font-size: 16px; - background-color: #313131; - border-radius: 10px; - padding: 5px; - border: 2px solid #414141; - } - )"); - m_password->show( ); - - m_loginButton = new QPushButton("Login", this); - m_loginButton->setObjectName("loginButton"); - m_loginButton->setFixedSize(QSize(150, 50)); - m_loginButton->setStyleSheet(R"( - #loginButton{ - color: #212121; - font-size: 24px; - font-weight: bold; - background-color: #53EC87; - border-radius: 10px; - } - #loginButton:pressed { - background-color: #43DC77; - } - )"); - m_loginButton->show( ); - - //create layout - QVBoxLayout* layout = new QVBoxLayout( ); - - //layout->setContentsMargins(50, 20, 50, 20); - layout->addWidget(m_header, 3, Qt::AlignCenter); - layout->addWidget(m_id, 1, Qt::AlignCenter); - layout->addWidget(m_password, 1, Qt::AlignCenter); - layout->addWidget(m_loginButton, 3, Qt::AlignCenter); - - //add Layout to LoginFrame - setLayout(layout); - - //connect loginButton with function - connect(m_loginButton, &QPushButton::clicked, this, &LoginFrame::loginButtonClicked); -} - -//try Login if Button clicked -void LoginFrame::loginButtonClicked( ) { - QString id = m_id->text( ); - QString password = m_password->text( ); - - //check if Contents Valid - if (id.isEmpty( ) || password.isEmpty( )) { - QMessageBox::warning(this, "Error", "Bitte füllen Sie sowohl die ID als auch das Passwort aus."); - } else { - LoginFrameController* controller = new LoginFrameController( ); - int res = controller->tryLogin(id, password); - if (res == -1) { - QMessageBox::warning(this, "Error", "ID und Passwort stimmen nicht überein!"); - } else { - ((QWidget*)(this->parent( )))->hide( ); - EinsatzplanWindow* win = new EinsatzplanWindow(nullptr, id, res); - win->show( ); - return; - } - } -} - -LoginFrame::~LoginFrame( ) { - m_header->~QLabel( ); - m_id->~QLineEdit( ); - m_password->~QLineEdit( ); - m_loginButton->~QPushButton( ); - m_parent->~QMainWindow( ); -} diff --git a/src/View/LoginFrame/LoginFrame.hpp b/src/View/LoginFrame/LoginFrame.hpp deleted file mode 100644 index 7c339c6..0000000 --- a/src/View/LoginFrame/LoginFrame.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "../../Controller/LoginFrameController/LoginFrameController.hpp" -#include "../../View/EinsatzplanWindow/EinsatzplanWindow.hpp" - -class LoginFrame : public QFrame { - Q_OBJECT -protected: - QMainWindow* m_parent; - QLabel* m_header; - QLineEdit* m_id; - QLineEdit* m_password; - QPushButton* m_loginButton; - - void loginButtonClicked( ); - -public: - LoginFrame(QWidget* parent = nullptr); - ~LoginFrame( ); -}; diff --git a/src/View/LoginWindow/LoginWindow.cpp b/src/View/LoginWindow/LoginWindow.cpp deleted file mode 100644 index a649dff..0000000 --- a/src/View/LoginWindow/LoginWindow.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "LoginWindow.hpp" - -LoginWindow::LoginWindow(QWidget* parent) - :QMainWindow(parent) { - m_frame = new LoginFrame(this); - setFixedSize(400, 550); - m_frame->setFixedSize(size( )); -} diff --git a/src/View/LoginWindow/LoginWindow.hpp b/src/View/LoginWindow/LoginWindow.hpp deleted file mode 100644 index 3fc2003..0000000 --- a/src/View/LoginWindow/LoginWindow.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -#include "../LoginFrame/LoginFrame.hpp" - -class LoginWindow : public QMainWindow { - Q_OBJECT -private: - LoginFrame* m_frame; - -public: - LoginWindow(QWidget* parent = nullptr); -}; diff --git a/src/View/PlanGrid/PlanGrid.hpp b/src/View/PlanGrid/PlanGrid.hpp deleted file mode 100644 index cdde752..0000000 --- a/src/View/PlanGrid/PlanGrid.hpp +++ /dev/null @@ -1,34 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include "../../Controller/PlanGridController/PlanGridController.hpp" -#include "../EinsatzplanFrame/Dialogs/Krankmelden/Krankmelden.hpp" -#include "../EinsatzplanFrame/Dialogs/CreateMember/CreateMember.hpp" - -class PlanGrid : public QWidget { - Q_OBJECT -private: - QString m_weekdays[5]; - QString m_times[6]; - -protected: - QGridLayout* gridLayout; - QMap, QWidget*>* planMap; - - void KrankmeldenDialog( ); - -public: - PlanGrid(QWidget* parent = nullptr); - - PlanGridController* planGridController; - - void populateGrid( ); - - inline void setPlanMap(QMap, QWidget*>* planMap) { - this->planMap = planMap; - } -}; diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index 2b8750c..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#include "View/LoginWindow/LoginWindow.hpp" - -int main(int argc, char* argv[]) { - QApplication app(argc, argv); - LoginWindow* loginWindow = new LoginWindow( ); - loginWindow->show( ); - return app.exec( ); -}