Merge pull request #386 from PhenomRetroShare/Add_AbilityToChangeOpModeInCmdLine

Add the ability to change OpMode in command line.
This commit is contained in:
csoler 2017-07-17 23:12:06 +02:00 committed by GitHub
commit e56340e0a1
10 changed files with 143 additions and 44 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)

View file

@ -46,7 +46,7 @@ public:
QColor getOpMode_Minimal_Color() const;
void setOpMode_Minimal_Color( QColor c );
private slots:
public slots:
void setOpMode();
private: