mirror of
https://gitlab.com/comunic/comunicwatcher
synced 2024-11-21 21:09:26 +00:00
Ready to connect to the API
This commit is contained in:
parent
224069b43b
commit
9ad4255207
@ -1,6 +1,8 @@
|
||||
#include "loginwindow.h"
|
||||
#include "ui_loginwindow.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
LoginWindow::LoginWindow(QWidget *parent)
|
||||
: QDialog(parent)
|
||||
, ui(new Ui::LoginWindow)
|
||||
@ -30,10 +32,24 @@ void LoginWindow::mousePressEvent(QMouseEvent *evt)
|
||||
void LoginWindow::mouseMoveEvent(QMouseEvent *evt)
|
||||
{
|
||||
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();
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
@ -22,12 +22,19 @@ public:
|
||||
~LoginWindow();
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *evt);
|
||||
void mouseMoveEvent(QMouseEvent *evt);
|
||||
void mousePressEvent(QMouseEvent *evt);
|
||||
void mouseMoveEvent(QMouseEvent *evt);
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* Submit login form
|
||||
*/
|
||||
void submitForm();
|
||||
|
||||
void on_closeButton_clicked();
|
||||
|
||||
void on_submitButton_clicked();
|
||||
|
||||
private:
|
||||
Ui::LoginWindow *ui;
|
||||
QPoint mOldPos;
|
||||
|
@ -34,6 +34,7 @@ QLineEdit {
|
||||
border: 1px solid grey;
|
||||
border-radius: 0px;
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
QPushButton {
|
||||
@ -128,7 +129,7 @@ QToolButton:hover:!pressed {
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit"/>
|
||||
<widget class="QLineEdit" name="emailEdit"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
@ -138,10 +139,14 @@ QToolButton:hover:!pressed {
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineEdit_2"/>
|
||||
<widget class="QLineEdit" name="passwordEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::Password</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignHCenter">
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<widget class="QPushButton" name="submitButton">
|
||||
<property name="text">
|
||||
<string>Login</string>
|
||||
</property>
|
||||
|
Loading…
Reference in New Issue
Block a user