-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathformconnect.cc
42 lines (36 loc) · 1.7 KB
/
formconnect.cc
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
// ============================================================================
// Copyright Jean-Charles LAMBERT - 2007-2023
// Yannick Dalbin
// e-mail: [email protected]
// address: Centre de donneeS Astrophysique de Marseille (CeSAM)
// Laboratoire d'Astrophysique de Marseille
// Pôle de l'Etoile, site de Château-Gombert
// 38, rue Frédéric Joliot-Curie
// 13388 Marseille cedex 13 France
// CNRS U.M.R 7326
// ============================================================================
// See the complete license in LICENSE and/or "http://www.cecill.info".
// ============================================================================
#include <QMessageBox>
#include "formconnect.h"
#include "ui_formconnect.h"
namespace glnemo {
FormConnect::FormConnect(QWidget *parent) {
if (parent) {;} // remove compiler warning
ui.setupUi(this);
}
FormConnect::~FormConnect() {
}
void FormConnect::on_buttonBox_accepted() {
if(ui.txtIP->text().length() == 0 || ui.txtPort->text().length() == 0) {
QMessageBox::warning(this, tr("Missing"), tr("Please enter an IP address and a communication port"));
show();
}
else {
bool vel, dens;
vel = (ui.chkVel->checkState() == 2);
dens = (ui.chkDens->checkState() == 2);
emit newConnect(ui.txtIP->text().toStdString(), ui.txtPort->text().toInt(), vel, dens, true);
}
}
}