-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreatechanneldialog.cpp
40 lines (36 loc) · 1 KB
/
createchanneldialog.cpp
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
#include "createchanneldialog.h"
#include "ui_createchanneldialog.h"
CreateChannelDialog::CreateChannelDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CreateChannelDialog)
{
ui->setupUi(this);
setWindowIcon(QIcon("icon.png"));
}
CreateChannelDialog::~CreateChannelDialog()
{
delete ui;
}
void CreateChannelDialog::on_cancelButton_clicked()
{
ui->nameEdit->clear();
ui->topicEdit->clear();
ui->descriptionEdit->clear();
this->hide();
}
void CreateChannelDialog::on_createButton_clicked()
{
if(ui->nameEdit->text() == "" || ui->topicEdit->text() == "" || ui->descriptionEdit->text() == "")
{
QMessageBox msg(QMessageBox::Information, "Notify", "Please, fill all fields.", QMessageBox::Ok);
msg.exec();
}
else
{
emit createChannel(ui->nameEdit->text(), ui->topicEdit->text(), ui->descriptionEdit->text());
this->hide();
ui->nameEdit->clear();
ui->topicEdit->clear();
ui->descriptionEdit->clear();
}
}