-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOwnerProfile.cpp
More file actions
51 lines (44 loc) · 1.1 KB
/
OwnerProfile.cpp
File metadata and controls
51 lines (44 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "OwnerProfile.h"
#include "ui_OwnerProfile.h"
OwnerProfile::OwnerProfile(QWidget *parent) :
QDialog(parent),
ui(new Ui::OwnerProfile)
{
ui->setupUi(this);
setWindowTitle("Your profile");
setWindowIcon(QIcon("icon.png"));
}
OwnerProfile::~OwnerProfile()
{
delete ui;
}
void OwnerProfile::on_closeButton_clicked()
{
ui->infLabel->clear();
this->hide();
}
void OwnerProfile::on_saveButton_clicked()
{
emit changeInfo(ui->nicknameEdit->text(), ui->infoEdit->toPlainText());
this->hide();
}
void OwnerProfile::on_changeButton_clicked()
{
if(ui->curPasswordEdit->text() != "" && ui->newPasswordEdit->text() != "")
{
emit changePassword(ui->curPasswordEdit->text(), ui->newPasswordEdit->text());
ui->curPasswordEdit->clear();
ui->newPasswordEdit->clear();
}
else
ui->infLabel->setText("Please, fill all records");
}
void OwnerProfile::setResult(QString text)
{
ui->infLabel->setText(text);
}
void OwnerProfile::setInfo(QString username, QString info)
{
ui->nicknameEdit->setText(username);
ui->infoEdit->setText(info);
}