38 lines
979 B
C++
38 lines
979 B
C++
#ifndef APPLICATION_CONTROLLER_H
|
|
#define APPLICATION_CONTROLLER_H
|
|
|
|
#include <QString>
|
|
|
|
class ApplicationController {
|
|
private:
|
|
static qint32 userId_;
|
|
static qint32 accessLevel_;
|
|
|
|
public:
|
|
explicit ApplicationController() = default;
|
|
|
|
static bool setupApplication();
|
|
|
|
static inline qint32 accessLevel();
|
|
static inline qint32 userId();
|
|
|
|
private slots:
|
|
static void onLoginFailed();
|
|
static void onLoginSuccessful(qint32 userId, qint32 accessLevel);
|
|
|
|
private:
|
|
// Database
|
|
static bool connectToDatabase(const QString &databaseFileName);
|
|
static bool ensureDatabaseExists(const QString &databaseFileName);
|
|
|
|
// Translations
|
|
static bool loadTranslations(const QString &locale, const QString &filename,
|
|
const QString &prefix, const QString &directory);
|
|
};
|
|
|
|
inline qint32 ApplicationController::accessLevel() { return accessLevel_; }
|
|
|
|
inline qint32 ApplicationController::userId() { return userId_; }
|
|
|
|
#endif // APPLICATION_CONTROLLER_H
|