Add the ability to change OpMode in command line.

So you can change OpMode while running via ssh to get more bandwidth.
Usage: RetroShare06 --opmode [full|noturtle|gaming|minimal]
This commit is contained in:
Phenom 2016-05-16 12:10:04 +02:00
parent 1491a051dc
commit 8563957591
4 changed files with 66 additions and 25 deletions

View file

@ -1492,6 +1492,23 @@ void MainWindow::processLastArgs()
/* Now use files from the command line, because no RetroShare was running */
openRsCollection(Rshare::files()->takeFirst());
}
/* Handle the -opmode options. */
if (opModeStatus) {
QString opmode = Rshare::opmode().toLower();
if (opmode == "noturtle") {
opModeStatus->setCurrentIndex(RS_OPMODE_NOTURTLE - 1);
} else if (opmode == "gaming") {
opModeStatus->setCurrentIndex(RS_OPMODE_GAMING - 1);
} else if (opmode == "minimal") {
opModeStatus->setCurrentIndex(RS_OPMODE_MINIMAL - 1);
} else {
opModeStatus->setCurrentIndex(RS_OPMODE_FULL - 1);
}
opModeStatus->setOpMode();
} else {
std::cerr << "ERR: MainWindow::processLastArgs opModeStatus is not initialized.";
}
}
void MainWindow::switchVisibilityStatus(StatusElement e,bool b)