-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupdialog.cpp
128 lines (95 loc) · 4.53 KB
/
setupdialog.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/***************************************************************************
setupdialog.h - description
-------------------
begin : jan 2015
copyright : (C) 2015 by Jaime Robles
email : [email protected]
***************************************************************************/
/*****************************************************************************
* This file is part of Kluster. *
* *
* Kluster is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* Kluster is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with Kluster, If not, see <http://www.gnu.org/licenses/>. *
* *
*****************************************************************************/
#include "setupdialog.h"
SetupDialog::SetupDialog(const bool _firstTime)
{
qDebug() << "SetupDialog::SetupDialog 1" << endl;
dxclusterServersComboBox = new QComboBox;
addClusterButton = new QPushButton(tr("Add"));
deleteClusterButton = new QPushButton(tr("Delete"));
closeButton = new QPushButton(tr("Cancel"));
okButton = new QPushButton(tr("OK"));
connect(closeButton, SIGNAL(clicked()), this, SLOT(slotCancelButtonClicked()));
connect(okButton, SIGNAL(clicked()), this, SLOT(slotOkButtonClicked()));
firstTime = _firstTime;
initClass();
}
SetupDialog::~SetupDialog()
{
}
void SetupDialog::initClass()
{
addDXClusters();
dxclusterServersComboBox->setToolTip(tr("Select the DX-Cluster server you want to use."));
addClusterButton->setToolTip(tr("Click to add a new DX-Cluster server."));
deleteClusterButton->setToolTip(tr("Click to delete the currently selected DX-Cluster server."));
okButton->setToolTip(tr("Click to accept the setup."));
closeButton->setToolTip(tr("Click to cancel."));
QHBoxLayout *serversButtonsLayout = new QHBoxLayout;
serversButtonsLayout->addSpacerItem(new QSpacerItem(10,0,QSizePolicy::Expanding,QSizePolicy::Maximum));
serversButtonsLayout->addWidget(addClusterButton);
serversButtonsLayout->addWidget(deleteClusterButton);
QVBoxLayout *serversLayout = new QVBoxLayout;
serversLayout->addWidget(dxclusterServersComboBox);
serversLayout->addLayout(serversButtonsLayout);
connect(addClusterButton, SIGNAL(clicked()), this, SLOT(slotAddButtonClicked()) );
connect(deleteClusterButton, SIGNAL(clicked()), this, SLOT(slotDeleteButtonClicked()) );
QHBoxLayout *buttonsLayout = new QHBoxLayout;
buttonsLayout->addStretch(1);
buttonsLayout->addWidget(okButton);
buttonsLayout->addWidget(closeButton);
QVBoxLayout *setupLayout = new QVBoxLayout;
setupLayout->addLayout(serversLayout);
setupLayout->addLayout(buttonsLayout);
setLayout(setupLayout);
}
void SetupDialog::slotAddButtonClicked()
{
qDebug() << "SetupDialog::slotAddButtonClicked()" << endl;
}
void SetupDialog::slotDeleteButtonClicked()
{
qDebug() << "SetupDialog::slotDeleteButtonClicked()" << endl;
}
void SetupDialog::slotOkButtonClicked()
{
qDebug() << "SetupDialog::slotOkButtonClicked()" << endl;
QDialog::accept();
}
void SetupDialog::slotCancelButtonClicked()
{
qDebug() << "SetupDialog::slotCancelButtonClicked()" << endl;
close();
}
void SetupDialog::addDXClusters()
{
dxclusterServersComboBox->addItem("dxfun.com:8000");
dxclusterServersComboBox->addItem("dxspots.com:23");
dxclusterServersComboBox->addItem("eadx.org:23");
dxclusterServersComboBox->addItem("k1ttt.net:23");
dxclusterServersComboBox->addItem("telnet.reversebeacon.net:7300");
dxclusterServersComboBox->addItem("dx.ea7urc.org:8000");
dxclusterServersComboBox->addItem("ei7mre.ath.cx:7300");
}