-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadduser.cpp
More file actions
44 lines (35 loc) · 920 Bytes
/
adduser.cpp
File metadata and controls
44 lines (35 loc) · 920 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
35
36
37
38
39
40
41
42
43
44
#include "adduser.h"
#include "ui_adduser.h"
AddUser::AddUser(QWidget *parent) :
QDialog(parent),
ui(new Ui::AddUser)
{
ui->setupUi(this);
ui->role->addItems(QStringList()<<"Admin"<<"Salesman"<<"Storekeeper");
ui->host->addItems(QStringList()<<"Access only from server"<<"Local network: 192.168.%"<<"Local network: 10.122.%"<<"Access from any place");
}
AddUser::~AddUser()
{
delete ui;
}
QString AddUser::name() const
{
return ui->name->text();
}
QString AddUser::role() const
{
return ui->role->currentText();
}
QString AddUser::host() const
{
int curInd=ui->host->currentIndex();
if(curInd==0)return "localhost";
if(curInd==1)return "192.168.%";
if(curInd==2)return "10.122.%";
if(curInd==3)return "%";
return ui->host->currentText();
}
QString AddUser::password() const
{
return ui->password->text();
}