|
@@ -24,6 +24,7 @@ using namespace std;
|
|
|
|
|
|
QUrl sendFileUrl = QUrl("");
|
|
|
bool _RESTART = false;
|
|
|
+bool configExists = false;
|
|
|
|
|
|
QMLHandler::QMLHandler(QObject *parent) : QObject(parent) {}
|
|
|
|
|
@@ -44,8 +45,6 @@ void QMLHandler::loadSettingsToGUI() {
|
|
|
|
|
|
// Main
|
|
|
void QMLHandler::onStart(bool startWithCli) {
|
|
|
- bool configExists = Config::loadFile();
|
|
|
-
|
|
|
if (configExists) {
|
|
|
// Config exists
|
|
|
if (Config::checkConfig()) {
|
|
@@ -62,8 +61,20 @@ void QMLHandler::onStart(bool startWithCli) {
|
|
|
// Invalid CLI Path
|
|
|
emit invalidCliPathPopupOpen();
|
|
|
} else if (startWithCli) {
|
|
|
- // Everything OK, init CLI
|
|
|
- CliManager::init();
|
|
|
+ // CLI exists, check for SSL
|
|
|
+ if (Config::getValue("Use-SSL") == "1") {
|
|
|
+ if (!ifstream(Config::getValue("SSL-Path"))) {
|
|
|
+ // SSL file does not exist
|
|
|
+ emit ipPopupSetStatus("Invalid SSL-Path. SSL has been disabled.");
|
|
|
+ CliManager::init(false);
|
|
|
+ } else {
|
|
|
+ // All good, start CLI with SSL
|
|
|
+ CliManager::init(true);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // All good, SSL is disabled, start CLI without SSL
|
|
|
+ CliManager::init(false);
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
// Config is invalid
|
|
@@ -237,3 +248,5 @@ void QMLHandler::onReceivingDequeueFileButton(QString fileName) {
|
|
|
}
|
|
|
|
|
|
void QMLHandler::setRestart(bool restart) { _RESTART = restart; }
|
|
|
+
|
|
|
+void QMLHandler::setConfigExists(bool exists) { configExists = exists; }
|