diff options
author | Christian Klinger | 2016-09-12 13:09:15 +0200 |
---|---|---|
committer | Christian Klinger | 2016-09-12 13:09:15 +0200 |
commit | 211bed049d7073ea95789eeedc483541f8a85b2c (patch) | |
tree | 57068ba430f7c5f218777597192bc81fcbe06ea1 /src/server/mainwindow/mainwindow.cpp | |
parent | Merge branch 'master' of git.openslx.org:pvs2 (diff) | |
download | pvs2-211bed049d7073ea95789eeedc483541f8a85b2c.tar.gz pvs2-211bed049d7073ea95789eeedc483541f8a85b2c.tar.xz pvs2-211bed049d7073ea95789eeedc483541f8a85b2c.zip |
removed USER_SETTINGS etc.
(this also changes filename of the crt ans rsa files, but this shouldn't
be a problem. (formerly the name of those files depended on the name and
location of the ini-files)
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 8fbba96..bed07f6 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -118,7 +118,7 @@ MainWindow::MainWindow(QWidget* parent) : connect(ui->action_DeleteClient, SIGNAL(triggered()), this, SLOT(onDeleteClient())); /* In exam-mode: disable most features */ - SYSTEM_SETTINGS(conf); + SETTINGS(conf); if (conf.contains("examMode")) { Global::setExam(conf.value("examMode").toBool()); } @@ -351,21 +351,6 @@ bool MainWindow::loadPosition(QSettings& settings, const QString& id, int& x, in return true; } -/***************************************************************************//** - * Save position of given connectionFrame. - * @param cf - */ -void MainWindow::savePosition(ConnectionFrame *cf) -{ - Client *client = cf->client(); - if (client == NULL) - return; - QPoint pos(cf->pos().x() / getTileWidthPx(), cf->pos().y() / getTileHeightPx()); - USER_SETTINGS(settings); - settings.beginGroup("client_position"); - settings.setValue(client->ip(), pos); - settings.endGroup(); -} /***************************************************************************//** * Tells the new client the current situation in class room. @@ -414,7 +399,7 @@ void MainWindow::tryToUseRoomTemplate() { qDebug() << "tryToUseRoomTemplate()"; QMap<QString, Room* > roomsList; - SYSTEM_SETTINGS(conf); + SETTINGS(conf); if (!conf.contains("rooms")) { qDebug() << "Invalid config file (no rooms are set)!"; return; } QStringList rooms = conf.value("rooms").toStringList(); @@ -731,8 +716,6 @@ void MainWindow::onPlaceFrame(bool activateTrash, ConnectionFrame* connectionFra const QPoint &preferredPixels = connectionFrame->frameGeometry().center(); placeFrameInFreeSlot(connectionFrame, preferredPixels); - /* save in local config to remember position */ - savePosition(connectionFrame); resizeEvent(NULL); } @@ -1296,13 +1279,10 @@ void MainWindow::onClientAuthenticated(Client* client) // Try to load last known position int x, y; bool ok; - USER_SETTINGS(usr); - ok = loadPosition(usr, client->ip(), x, y); - if (!ok) - { - SYSTEM_SETTINGS(sys); - ok = loadPosition(sys, client->ip(), x, y); - } + + SETTINGS(sys); + ok = loadPosition(sys, client->ip(), x, y); + if (x >= _tilesX || y >= _tilesY) ok = false; if (ok) |