summaryrefslogtreecommitdiffstats
path: root/src/server/sessionnamewindow
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/sessionnamewindow')
-rw-r--r--src/server/sessionnamewindow/sessionnamewindow.cpp28
-rw-r--r--src/server/sessionnamewindow/sessionnamewindow.h13
2 files changed, 19 insertions, 22 deletions
diff --git a/src/server/sessionnamewindow/sessionnamewindow.cpp b/src/server/sessionnamewindow/sessionnamewindow.cpp
index f79efbf..74aa05d 100644
--- a/src/server/sessionnamewindow/sessionnamewindow.cpp
+++ b/src/server/sessionnamewindow/sessionnamewindow.cpp
@@ -9,32 +9,30 @@
#
# General information about OpenSLX can be found at http://openslx.org/
# -----------------------------------------------------------------------------
- # mainWindow.cpp
- This is the Main class for the pvsManager. The GUI is contructed here.
- # -----------------------------------------------------------------------------
*/
-#include <QtWidgets>
#include "sessionnamewindow.h"
+#include "ui_sessionnamewindow.h"
#include "../serverapp/serverapp.h"
#include "../numerickeyboard/numerickeyboard.h"
-#include "ui_sessionnamewindow.h"
-
+#include "../../shared/util.h"
-SessionNameWindow::SessionNameWindow(QWidget *parent) :
- QDialog(parent), ui(new Ui::SessionName)
+#include <QCloseEvent>
+SessionNameWindow::SessionNameWindow(QWidget *parent)
+ : QDialog(parent)
+ , ui(new Ui::SessionName)
{
ui->setupUi(this);
- connect(ui->bboxOkCancel, SIGNAL(accepted()), this, SLOT(onOkClicked()));
- connect(ui->bboxOkCancel, SIGNAL(rejected()), this, SLOT(close()));
- connect(ui->cmdRandom, SIGNAL(clicked(bool)), this, SLOT(onGenerateRandomName()));
+ connect(ui->bboxOkCancel, &QDialogButtonBox::accepted, this, &SessionNameWindow::onOkClicked);
+ connect(ui->bboxOkCancel, &QDialogButtonBox::rejected, this, &SessionNameWindow::close);
+ connect(ui->cmdRandom, &QPushButton::clicked, this, &SessionNameWindow::onGenerateRandomName);
/* add a virtual numeric keyboard */
- NumericKeyboard *keyboard = new NumericKeyboard();
+ auto *keyboard = new NumericKeyboard();
ui->keyboard_placeholder->addWidget(keyboard);
- connect(keyboard, SIGNAL(digitTyped(int)), this, SLOT(onDigitTyped(int)));
- connect(keyboard, SIGNAL(digitDelete()), this, SLOT(onDigitDelete()));
+ connect(keyboard, &NumericKeyboard::digitTyped, this, &SessionNameWindow::onDigitTyped);
+ connect(keyboard, &NumericKeyboard::digitDelete, this, &SessionNameWindow::onDigitDelete);
}
@@ -73,7 +71,7 @@ void SessionNameWindow::onOkClicked()
void SessionNameWindow::onGenerateRandomName()
{
- ui->lineEditName->setText(QString::number(qrand() % 9000 + 1000));
+ ui->lineEditName->setText(QString::number(slxrand() % 9000 + 1000));
}
/** deletes the last digit of the saved sessionname */
diff --git a/src/server/sessionnamewindow/sessionnamewindow.h b/src/server/sessionnamewindow/sessionnamewindow.h
index e46b895..024df48 100644
--- a/src/server/sessionnamewindow/sessionnamewindow.h
+++ b/src/server/sessionnamewindow/sessionnamewindow.h
@@ -1,8 +1,7 @@
-#ifndef _SESSIONNAMEWINDOW_H_
-#define _SESSIONNAMEWINDOW_H_
-
-#include <QtWidgets>
+#ifndef PVS_SESSIONNAMEWINDOW_H_
+#define PVS_SESSIONNAMEWINDOW_H_
+#include <QDialog>
namespace Ui
{
@@ -17,13 +16,13 @@ private:
Ui::SessionName *ui;
public:
- SessionNameWindow(QWidget *parent = 0);
- ~SessionNameWindow();
+ explicit SessionNameWindow(QWidget *parent = nullptr);
+ ~SessionNameWindow() override;
void show(const QString& name);
protected:
- void closeEvent(QCloseEvent *e);
+ void closeEvent(QCloseEvent *e) override;
private slots:
void onOkClicked();