File indexing completed on 2024-05-12 15:27:52

0001 /***************************************************************************
0002 File                 : MQTTErrorWidget.h
0003 Project              : LabPlot
0004 Description          : Widget for informing about an MQTT error, and for trying to solve it
0005 --------------------------------------------------------------------
0006 Copyright            : (C) 2018 by Kovacs Ferencz (kferike98@gmail.com)
0007 ***************************************************************************/
0008 
0009 /***************************************************************************
0010 *                                                                         *
0011 *  This program is free software; you can redistribute it and/or modify   *
0012 *  it under the terms of the GNU General Public License as published by   *
0013 *  the Free Software Foundation; either version 2 of the License, or      *
0014 *  (at your option) any later version.                                    *
0015 *                                                                         *
0016 *  This program is distributed in the hope that it will be useful,        *
0017 *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
0018 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
0019 *  GNU General Public License for more details.                           *
0020 *                                                                         *
0021 *   You should have received a copy of the GNU General Public License     *
0022 *   along with this program; if not, write to the Free Software           *
0023 *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
0024 *   Boston, MA  02110-1301  USA                                           *
0025 *                                                                         *
0026 ***************************************************************************/
0027 
0028 #ifndef MQTTERRORWIDGET_H
0029 #define MQTTERRORWIDGET_H
0030 
0031 #include <QMqttClient>
0032 #include "ui_mqtterrorwidget.h"
0033 
0034 class MQTTClient;
0035 
0036 class MQTTErrorWidget : public QWidget {
0037     Q_OBJECT
0038 
0039 public:
0040     explicit MQTTErrorWidget(QMqttClient::ClientError error = QMqttClient::NoError, MQTTClient* client = nullptr, QWidget* parent = nullptr);
0041 
0042 private:
0043     Ui::MQTTErrorWidget ui;
0044     QMqttClient::ClientError m_error;
0045     MQTTClient* m_client;
0046 
0047 private slots:
0048     void tryToReconnect();
0049 };
0050 
0051 #endif // MQTTERRORWIDGET_H