/* KScreen System Copyright (C) 2019 Raul Rodrigo Segura This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #ifndef VALIDATIONFORM #define VALIDATIONFORM #include "ui_validation.h" // From KDE #include #include #include #include #include #include class AsyncN4D: public QThread { Q_OBJECT public: std::string user; std::string password; AsyncN4D(std::string user,std::string password) { this->user=user; this->password=password; } void run() { /*edupals::n4d::Client client("https://localhost",9779);*/ edupals::n4d::Client client("https://localhost:9779",user,password); bool result = client.validate_auth(); emit message(result); } signals: void message(bool); }; class ValidationForm : public QDialog, private Ui_validationForm { Q_OBJECT public: ValidationForm(QWidget *parent); virtual ~ValidationForm(){}; void fillUi(); std::string getUser(); std::string getPassword(); private: QWidget *parent; KMessageWidget *notificationwidget; AsyncN4D* an4d; void setEnableWidgets(bool status); private slots: void validateUser(); void n4dDone(bool status); }; #endif