summaryrefslogtreecommitdiffstats
path: root/src/client/main.cpp
diff options
context:
space:
mode:
authorBjörn Hagemeister2014-08-25 18:08:15 +0200
committerBjörn Hagemeister2014-08-25 18:08:15 +0200
commit6cb63e7e30906f428c601ba00fd15c14e07093cf (patch)
treef83ea27e10616a384c26480e662854cf02ac8834 /src/client/main.cpp
parentNew Feature: Button for reloading room configuration of choosable room. (diff)
downloadpvs2-6cb63e7e30906f428c601ba00fd15c14e07093cf.tar.gz
pvs2-6cb63e7e30906f428c601ba00fd15c14e07093cf.tar.xz
pvs2-6cb63e7e30906f428c601ba00fd15c14e07093cf.zip
Client is able to auto - connect to the same room belonging manager.
Diffstat (limited to 'src/client/main.cpp')
-rw-r--r--src/client/main.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/client/main.cpp b/src/client/main.cpp
index 0907528..b268ca3 100644
--- a/src/client/main.cpp
+++ b/src/client/main.cpp
@@ -5,7 +5,7 @@
int main(int argc, char** argv)
{
if (argc > 2) {
- std::cerr << "Usage: " << argv[0] << " [sessionId]" << std::endl;
+ std::cerr << "Usage: " << argv[0] << " [sessionId] | --auto" << std::endl;
exit(EXIT_FAILURE);
}
@@ -42,7 +42,16 @@ int main(int argc, char** argv)
translator.load(":pvsclient");
app.installTranslator(&translator);
+ if (argc == 2) {
+ if (argv[1] == std::string("--auto")) {
+ qDebug() << "Calling Toolbar(true)";
+ Toolbar *pvsclient = new Toolbar(true); // auto connect client without session ID.
+ } else {
+ Toolbar *pvsclient = new Toolbar(QByteArray(argv[1])); // connect client with given session ID.
+ }
+ } else {
+ Toolbar *pvsclient = new Toolbar(); // create normal client.
+ }
- Toolbar *pvsclient = argc == 2 ? new Toolbar(QByteArray(argv[1])) : new Toolbar();
return app.exec();
}