summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorSimon Rettberg2022-10-30 12:03:43 +0100
committerSimon Rettberg2022-10-30 12:03:43 +0100
commit9bacddf36631572b610f042e17b5ee631dfebbca (patch)
treeb7537d8a5293f28e7d02d41545f609bfa10921c1 /src/server/mainwindow/mainwindow.cpp
parentFix Qt fix (diff)
downloadpvs2-9bacddf36631572b610f042e17b5ee631dfebbca.tar.gz
pvs2-9bacddf36631572b610f042e17b5ee631dfebbca.tar.xz
pvs2-9bacddf36631572b610f042e17b5ee631dfebbca.zip
Modernize cmake file and project structure a bit
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index f6ff566..b63545f 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -38,7 +38,6 @@
#include "../util/platform/screensaver.h"
// Auto-generated ui class
#include "ui_mainwindow.h"
-#include "ui_reloadroom.h"
#include <iostream>
#include <vector>
@@ -711,20 +710,20 @@ void MainWindow::startVncServerIfNecessary(int from)
void MainWindow::onButtonReloadRoomConfig()
{
- connect(_reloadWindow->ui->buttonBox, SIGNAL(accepted()), this, SLOT(onReloadRoomOk()));
- connect(_reloadWindow->ui->buttonBox, SIGNAL(rejected()), this, SLOT(onReloadRoomCancel()));
+ connect(_reloadWindow->buttonBox(), SIGNAL(accepted()), this, SLOT(onReloadRoomOk()));
+ connect(_reloadWindow->buttonBox(), SIGNAL(rejected()), this, SLOT(onReloadRoomCancel()));
QList<QString> keyList = serverApp->getRooms().keys();
for (QList<QString>::iterator it = keyList.begin(); it != keyList.end() ; it++) {
- _reloadWindow->ui->roomList->addItem(*it);
+ _reloadWindow->addRoom(*it);
}
_reloadWindow->show();
}
void MainWindow::onReloadRoomCancel()
{
- disconnect(_reloadWindow->ui->buttonBox, SIGNAL(accepted()), this, SLOT(onReloadRoomOk()));
- disconnect(_reloadWindow->ui->buttonBox, SIGNAL(rejected()), this, SLOT(onReloadRoomCancel()));
- _reloadWindow->ui->roomList->clear();
+ disconnect(_reloadWindow->buttonBox(), SIGNAL(accepted()), this, SLOT(onReloadRoomOk()));
+ disconnect(_reloadWindow->buttonBox(), SIGNAL(rejected()), this, SLOT(onReloadRoomCancel()));
+ _reloadWindow->clearRoomList();
_reloadWindow->hide();
}
@@ -785,7 +784,8 @@ void MainWindow::reloadCurrentRoom()
void MainWindow::onReloadRoomOk()
{
- if (_reloadWindow->ui->roomList->currentItem() == nullptr) {
+ QString roomToReload = _reloadWindow->currentRoom();
+ if (roomToReload.isEmpty()) {
QMessageBox::critical(this, "Warning", tr("No item selected, please select room!"), 0, 1);
return;
}
@@ -794,8 +794,8 @@ void MainWindow::onReloadRoomOk()
"Note that all clients will be deleted."),
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
if (ret == QMessageBox::Yes) {
- disconnect(_reloadWindow->ui->buttonBox, SIGNAL(accepted()), this, SLOT(onReloadRoomOk()));
- disconnect(_reloadWindow->ui->buttonBox, SIGNAL(rejected()), this, SLOT(onReloadRoomCancel()));
+ disconnect(_reloadWindow->buttonBox(), SIGNAL(accepted()), this, SLOT(onReloadRoomOk()));
+ disconnect(_reloadWindow->buttonBox(), SIGNAL(rejected()), this, SLOT(onReloadRoomCancel()));
// Delete all clients.
for (QList<ConnectionFrame*>::iterator it = _clientFrames.begin(); it != _clientFrames.end(); it++) {
(*it)->hide();
@@ -804,11 +804,10 @@ void MainWindow::onReloadRoomOk()
_clientFrames.clear();
// Load new room configuration.
- QString roomToReload = _reloadWindow->ui->roomList->currentItem()->data(0).toString();
serverApp->setCurrentRoom(roomToReload);
reloadCurrentRoom();
- _reloadWindow->ui->roomList->clear();
+ _reloadWindow->clearRoomList();
_reloadWindow->hide();
}