summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorManuel Schneider2014-05-26 21:48:36 +0200
committerManuel Schneider2014-05-26 21:48:36 +0200
commitaa5c44814f34d1c255ba6be3828d465e64f9cf2f (patch)
tree7e1f70e5ae98062d371a79f591b7c3ed2507746a /src/server/mainwindow/mainwindow.cpp
parentRefactor unicast to multicast (diff)
downloadpvs2-aa5c44814f34d1c255ba6be3828d465e64f9cf2f.tar.gz
pvs2-aa5c44814f34d1c255ba6be3828d465e64f9cf2f.tar.xz
pvs2-aa5c44814f34d1c255ba6be3828d465e64f9cf2f.zip
Replace states by two flags indicating the state
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp
index 8e260b4..97b4528 100644
--- a/src/server/mainwindow/mainwindow.cpp
+++ b/src/server/mainwindow/mainwindow.cpp
@@ -56,6 +56,8 @@ MainWindow::MainWindow(QString ipListUrl, QWidget* parent) :
_tutorFrame = NULL;
_selectedFrame = NULL;
+ _broadcast = false;
+ _lockOthers = false;
_streamingSource = NULL;
_sessionNameWindow = new SessionNameWindow(this);
@@ -440,7 +442,8 @@ bool MainWindow::isValidClient(Client* client)
*/
void MainWindow::broadcast(Client *from)
{
- _state = State::Broadcast;
+ _broadcast = true;
+ _lockOthers = false;
// if there is a server running which is not "from" stop it.
if (_streamingSource != NULL && _streamingSource != from)
@@ -472,7 +475,8 @@ void MainWindow::broadcast(Client *from)
*/
void MainWindow::multicast(Client *from, Client *to, bool blockOthers)
{
- _state = blockOthers ? State::ExclusiveUnicast : State::Unicast;
+ _broadcast = false;
+ _lockOthers = blockOthers;
// if there is a server running which is not "from" stop it.
if (_streamingSource != NULL && _streamingSource != from)
@@ -615,8 +619,6 @@ void MainWindow::onButtonStudentToTutorExclusive()
*/
void MainWindow::onButtonStopProjection()
{
- _state = State::Idle;
-
for (QList<ConnectionFrame*>::iterator it(_clientFrames.begin()); it != _clientFrames.end(); ++it)
{
Client *c = (**it).client();
@@ -837,19 +839,12 @@ void MainWindow::onClientAuthenticated(Client* client)
if (ui->action_Lock->isChecked())
client->lockScreen(true);
- switch (_state) {
- case State::Idle:break;
- case State::Unicast:break;
- case State::ExclusiveUnicast:
- client->lockScreen(true);
- break;
- case State::Broadcast:
+ if (_broadcast){
client->setDesiredProjectionSource(_streamingSource->id());
client->startVncClient(_streamingSource);
- break;
- default:break;
+ } else if (_lockOthers)
+ client->lockScreen(true);
}
-}
/***************************************************************************//**
* Handle if VNC Server State has changed.