Commit 3c2bc7a1 authored by Leander Schulten's avatar Leander Schulten
Browse files

Fixes #34 (show an error when OpenSSL support is missing). Improve error...

Fixes #34 (show an error when OpenSSL support is missing). Improve error dialog (unified UI look and feel)
parent 995f70d6
Pipeline #170869 passed with stage
in 1 minute and 40 seconds
......@@ -25,12 +25,15 @@ public:
* @brief newError notify qml to show the error
* @param errorMessage The Message to show
*/
void newError(QString errorMessage){
void newError(const QString &errorMessage){
this->errorMessage += errorMessage;
this->errorMessage += ". \n";
if(!this->errorMessage.endsWith(".")){
this->errorMessage += ".";
}
this->errorMessage += "\n";
emit errorMessageChanged();
}
static void showError(QString errorMessage){
static void showError(const QString &errorMessage){
get()->newError(errorMessage);
}
signals:
......
......@@ -46,6 +46,7 @@
#include "modules/dmxconsumer.h"
#include "sortedmodelview.h"
#include "updater.h"
#include <QSslSocket>
#ifdef DrMinGW
#include "exchndl.h"
......@@ -69,6 +70,10 @@ int main(int argc, char *argv[])
ExcHndlSetLogFileNameA(path.toStdString().c_str());
#endif
if (!QSslSocket::supportsSsl()||true) {
ErrorNotifier::showError("No OpenSSL library found!\nUpdates are not possible and the Spotify support does not work.");
}
Updater updater;
QObject::connect(&updater,&Updater::needUpdate,[&](){
updater.update();
......
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.0
import custom.licht 1.0
import QtQuick.Dialogs 1.2
import "ControlPane"
import "components"
......@@ -147,13 +146,18 @@ ApplicationWindow {
}
}
MessageDialog{
text: ErrorNotifier.errorMessage
modality: "WindowModal"
icon: "Critical"
Dialog{
modal: true
title: "Error"
standardButtons: "Ok"
onTextChanged: visible = true;
standardButtons: Dialog.Ok
width: 300
y: 50
x: (root.width-width)/2;
contentItem: Text{
text: ErrorNotifier.errorMessage
wrapMode: "WrapAtWordBoundaryOrAnywhere"
}
onAccepted: ErrorNotifier.errorMessage = "";
visible: ErrorNotifier.errorMessage.length !== 0
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment