3 #include "../connectwindow/connectwindow.h"
4 #include "../toolbar/toolbar.h"
5 #include "../net/serverconnection.h"
7 #include <QNetworkInterface>
9 #include <QLibraryInfo>
15 , _connection(nullptr)
18 setOrganizationName(
"openslx");
19 setOrganizationDomain(
"openslx.org");
20 setApplicationName(
"pvsclient");
21 setQuitOnLastWindowClosed(
false);
24 QSettings::setPath(QSettings::IniFormat, QSettings::SystemScope,
"/opt/");
31 auto *qtTranslator =
new QTranslator(
this);
32 if (!qtTranslator->load(QLocale::system(),
"qt",
"_", QLibraryInfo::location(QLibraryInfo::TranslationsPath))) {
33 qDebug() <<
"Could not load system string translations" << QLocale::system() << QLibraryInfo::location(QLibraryInfo::TranslationsPath);
35 installTranslator(qtTranslator);
38 auto *translator =
new QTranslator(
this);
39 if (!translator->load(QLocale::system(),
":/",
"l_")) {
40 qDebug() <<
"Could not load app translations" << QLocale::system();
42 installTranslator(translator);
62 for (
const QString &a : QApplication::arguments()) {
63 if (a ==
"--exam-mode") {
65 }
else if (a ==
"--auto") {
67 }
else if (a.startsWith(
"--session=")) {
70 }
else if (a.startsWith(
"--config=")) {
86 QSharedPointer<QSettings> set;
89 set = QSharedPointer<QSettings>(
new QSettings(QSettings::IniFormat, QSettings::SystemScope,
"openslx/pvs2",
"pvs2"));
92 set = QSharedPointer<QSettings>(
new QSettings(
_iniPath, QSettings::IniFormat));
94 set->setIniCodec(
"UTF-8");
106 if (connection !=
nullptr)
107 connection->blockSignals(
true);
Class for handling the client connection.
QStringList parseParameters()
ConnectionMode _connectionMode
virtual QStringList arguments()
ServerConnection * connection() const
void disconnected(ServerConnection *connection)
ServerConnection * _connection
ClientApp(int &argc, char **argv)
QSharedPointer< QSettings > getSettings()
void connected(ServerConnection *connection)
void disconnected(ServerConnection *connection)
ConnectWindow * _connectWindow
void connected(ServerConnection *connection)