diff options
author | Simon Rettberg | 2022-10-30 20:34:23 +0100 |
---|---|---|
committer | Simon Rettberg | 2022-10-30 20:34:23 +0100 |
commit | 9f479b8f76238a03bce5d13aee14efd34e659c6e (patch) | |
tree | e320d32838202ac4604032da7a4bc3702cc304da /src/server/sessionnamewindow/sessionnamewindow.cpp | |
parent | Update translation files (diff) | |
download | pvs2-9f479b8f76238a03bce5d13aee14efd34e659c6e.tar.gz pvs2-9f479b8f76238a03bce5d13aee14efd34e659c6e.tar.xz pvs2-9f479b8f76238a03bce5d13aee14efd34e659c6e.zip |
Clean up and modernize code
- static "new-style" signal->slot connections
- Fix a lot of things Clang-Tidy complained about
- Move includes to .cpp files and use forward decls in .h
- Don't use <QtWidgets> and <QtCore>, but specific includes instead
Diffstat (limited to 'src/server/sessionnamewindow/sessionnamewindow.cpp')
-rw-r--r-- | src/server/sessionnamewindow/sessionnamewindow.cpp | 28 |
1 files changed, 13 insertions, 15 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 */ |