mirror of
https://gitlab.com/comunic/comunicwatcher
synced 2024-11-22 05:19:25 +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 "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)
|
move(x()+delta.x(), y()+delta.y());
|
||||||
// if locked, ignore delta on y axis, stay at the top
|
|
||||||
move(x()+delta.x(), y());
|
|
||||||
else
|
|
||||||
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();
|
||||||
|
}
|
||||||
|
@ -22,12 +22,19 @@ public:
|
|||||||
~LoginWindow();
|
~LoginWindow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent(QMouseEvent *evt);
|
void mousePressEvent(QMouseEvent *evt);
|
||||||
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>
|
||||||
|
Loading…
Reference in New Issue
Block a user