Fri, 11 Feb 2022 16:00:06 +0100
Menus setup started.
#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 "database/database.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; class MainWindow; class Bmsapp : public QObject { Q_OBJECT friend class MainWindow; public: Bmsapp(); static QDir getResourceDir(); /* System wide resources */ /** * @brief Blocking call that executes the application. * @return Exit code from the application. */ static int run(); private: static MainWindow* m_mainWindow; /** * @brief Ensure some directories and files exist. * @return true if all is ok. */ static bool ensureDirectoriesExist(); /** * @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(); /** * @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