mirror of
				https://gitlab.com/comunic/comunicwatcher
				synced 2025-10-31 10:14:45 +00:00 
			
		
		
		
	Ready to connect to the API
This commit is contained in:
		| @@ -1,6 +1,8 @@ | |||||||
| #include "loginwindow.h" | #include "loginwindow.h" | ||||||
| #include "ui_loginwindow.h" | #include "ui_loginwindow.h" | ||||||
|  |  | ||||||
|  | #include <QMessageBox> | ||||||
|  |  | ||||||
| LoginWindow::LoginWindow(QWidget *parent) | LoginWindow::LoginWindow(QWidget *parent) | ||||||
|     : QDialog(parent) |     : QDialog(parent) | ||||||
|     , ui(new Ui::LoginWindow) |     , ui(new Ui::LoginWindow) | ||||||
| @@ -30,10 +32,24 @@ void LoginWindow::mousePressEvent(QMouseEvent *evt) | |||||||
| void LoginWindow::mouseMoveEvent(QMouseEvent *evt) | void LoginWindow::mouseMoveEvent(QMouseEvent *evt) | ||||||
| { | { | ||||||
|     const QPoint delta = evt->globalPos() - mOldPos; |     const QPoint delta = evt->globalPos() - mOldPos; | ||||||
|     if (false) |  | ||||||
|         // if locked, ignore delta on y axis, stay at the top |  | ||||||
|         move(x()+delta.x(), y()); |  | ||||||
|     else |  | ||||||
|     move(x()+delta.x(), y()+delta.y()); |     move(x()+delta.x(), y()+delta.y()); | ||||||
|     mOldPos = evt->globalPos(); |     mOldPos = evt->globalPos(); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | void LoginWindow::submitForm() | ||||||
|  | { | ||||||
|  |     if(ui->emailEdit->text().isEmpty()) { | ||||||
|  |         QMessageBox::warning(this, tr("Error"), tr("Please specify an email address!")); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     if(ui->passwordEdit->text().isEmpty()) { | ||||||
|  |         QMessageBox::warning(this, tr("Error"), tr("Please specify your password!")); | ||||||
|  |         return; | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void LoginWindow::on_submitButton_clicked() | ||||||
|  | { | ||||||
|  |     submitForm(); | ||||||
|  | } | ||||||
|   | |||||||
| @@ -26,8 +26,15 @@ protected: | |||||||
|     void mouseMoveEvent(QMouseEvent *evt); |     void mouseMoveEvent(QMouseEvent *evt); | ||||||
|  |  | ||||||
| private slots: | private slots: | ||||||
|  |     /** | ||||||
|  |      * Submit login form | ||||||
|  |      */ | ||||||
|  |     void submitForm(); | ||||||
|  |  | ||||||
|     void on_closeButton_clicked(); |     void on_closeButton_clicked(); | ||||||
|  |  | ||||||
|  |     void on_submitButton_clicked(); | ||||||
|  |  | ||||||
| private: | private: | ||||||
|     Ui::LoginWindow *ui; |     Ui::LoginWindow *ui; | ||||||
|     QPoint mOldPos; |     QPoint mOldPos; | ||||||
|   | |||||||
| @@ -34,6 +34,7 @@ QLineEdit { | |||||||
|  border:  1px solid grey; |  border:  1px solid grey; | ||||||
|  border-radius: 0px; |  border-radius: 0px; | ||||||
|  background-color: white; |  background-color: white; | ||||||
|  | color: black; | ||||||
| } | } | ||||||
|  |  | ||||||
| QPushButton { | QPushButton { | ||||||
| @@ -128,7 +129,7 @@ QToolButton:hover:!pressed { | |||||||
|     </widget> |     </widget> | ||||||
|    </item> |    </item> | ||||||
|    <item> |    <item> | ||||||
|     <widget class="QLineEdit" name="lineEdit"/> |     <widget class="QLineEdit" name="emailEdit"/> | ||||||
|    </item> |    </item> | ||||||
|    <item> |    <item> | ||||||
|     <widget class="QLabel" name="label_3"> |     <widget class="QLabel" name="label_3"> | ||||||
| @@ -138,10 +139,14 @@ QToolButton:hover:!pressed { | |||||||
|     </widget> |     </widget> | ||||||
|    </item> |    </item> | ||||||
|    <item> |    <item> | ||||||
|     <widget class="QLineEdit" name="lineEdit_2"/> |     <widget class="QLineEdit" name="passwordEdit"> | ||||||
|  |      <property name="echoMode"> | ||||||
|  |       <enum>QLineEdit::Password</enum> | ||||||
|  |      </property> | ||||||
|  |     </widget> | ||||||
|    </item> |    </item> | ||||||
|    <item alignment="Qt::AlignHCenter"> |    <item alignment="Qt::AlignHCenter"> | ||||||
|     <widget class="QPushButton" name="pushButton"> |     <widget class="QPushButton" name="submitButton"> | ||||||
|      <property name="text"> |      <property name="text"> | ||||||
|       <string>Login</string> |       <string>Login</string> | ||||||
|      </property> |      </property> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user