-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgroupmainpage.cpp
More file actions
34 lines (29 loc) · 873 Bytes
/
groupmainpage.cpp
File metadata and controls
34 lines (29 loc) · 873 Bytes
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
#include "groupmainpage.h"
#include "server.h"
#include "groupwidget.h"
GroupMainPage::GroupMainPage(QString name, QWidget* parent) : SGWidget(name)
{
}
bool GroupMainPage::create_group(QString group)
{
QString full_string = server::GROUP_CREATE + group;
if(server::request_response(full_string, group)) // Group id replaced with the response (group name + code)
{
GroupWidget* group_widget = new GroupWidget(group);
emit group_joined(group_widget, group);
return true;
}
return false;
}
bool GroupMainPage::join_group(QString group)
{
QString full_string = server::GROUP_JOIN + group;
QString retrn;
if(server::request_response(full_string, retrn))
{
GroupWidget* group_widget = new GroupWidget(group);
emit group_joined(group_widget, group);
return true;
}
return false;
}