-
Notifications
You must be signed in to change notification settings - Fork 7
/
regionwizard.cpp
76 lines (68 loc) · 1.51 KB
/
regionwizard.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "regionwizard.h"
#include "ui_regionwizard.h"
#include <QUuid>
RegionWizard::RegionWizard(QWidget *parent) :
QWizard(parent),
ui(new Ui::RegionWizard)
{
ui->setupUi(this);
}
RegionWizard::~RegionWizard()
{
delete ui;
}
void RegionWizard::changeEvent(QEvent *e)
{
QWizard::changeEvent(e);
switch (e->type()) {
case QEvent::LanguageChange:
ui->retranslateUi(this);
break;
default:
break;
}
}
QGridLayout* RegionWizard::GetRegionGridLayout()
{
return ui->formLayoutRegionData;
}
QFormLayout* RegionWizard::GetAvatarLayout()
{
return ui->formLayoutAvatarData;
}
void RegionWizard::on_btnNewUUID_clicked()
{
QUuid quuid = QUuid::createUuid();
QString str = quuid.toString();
QString plainUuid = str.mid(1,str.length()-2);
ui->lineEdit_12->setText(plainUuid);
}
void RegionWizard::GoToStart()
{
this->restart();
SetDefaults();
}
void RegionWizard::SetDefaults()
{
this->ui->lineEditExternalHostName->setText("SYSTEMIP");
}
void RegionWizard::on_btnNextPort_clicked()
{
QList<int> ports = this->m_Wizard->GetRegionPorts();
int nextPort = 9000;
bool conflict = true;
while(nextPort<50000&&conflict==true)
{
nextPort++;
bool match = false;
foreach(int p, ports)
{
if(nextPort==p)
match = true;
}
if(match==false)
conflict = false;
}
QString strPort = QString::number(nextPort);
ui->lineEdit_4->setText(strPort);
}