Sun, 27 Mar 2022 20:38:25 +0200
Added MQTT settings.
#ifndef _BMSAPP_H #define _BMSAPP_H #include <QApplication> #include <QDateTime> #include <QDebug> #include <QDir> // #include <QDomDocument> #include <QFile> #include <QList> #include <QMenu> #include <QMetaProperty> #include <QObject> #include <QSettings> #include <QString> #include <QTextStream> #include <QTranslator> #include <QtSql> #include <QUuid> #include <QStyle> #include <QPlainTextEdit> #include <QMessageBox> #include <QLabel> #include <QImage> #include <QImageReader> #include <QImageWriter> #include <QColorSpace> #include <QGraphicsView> #include <QFileDialog> #include <QXmlStreamReader> #include <QXmlStreamWriter> #include <QJsonArray> #include <QJsonDocument> #include <QJsonObject> #include <QMap> #include <QPrinter> #include <QWidget> #include "Utils.h" #include "PrinterDialog.h" typedef struct IniMySQL { QString host; ///< MySQL host QString port; ///< MySQL port QString name; ///< MySQL database QString user; ///< MySQL username QString pass; ///< MySQL password QString charset; ///< MySQL character encoding } IniMySQL; static IniMySQL dbProd; static IniMySQL dbDev; typedef struct IniMQTT { QString host; ///< MQTT host QString port; ///< MQTT port QString user; ///< MQTT username QString pass; ///< MQTT password } IniMQTT; static IniMQTT mqttProd; static IniMQTT mqttDev; class MainWindow; class Bmsapp : public QObject { Q_OBJECT friend class MainWindow; public: Bmsapp(); /** * @brief Blocking call that executes the application. * @return Exit code from the application. */ static int run(bool useDevelop, bool startConfig); MainWindow* m_mainWindow; private: /** * @brief Run before showing MainWindow, does all system setup. * @return false if anything goes awry, true if it's ok to start MainWindow. */ static bool initialize(bool useDevelop); /** * @brief Run after QApplication exits to clean up shit, close database, etc. */ static void cleanup(); /** * @brief Read user settings for the MySQL connection. */ static void readsettings(); /** * @brief Write or update the user settings for the MySQL connection. */ static void writesettings(); }; #endif