MythTV master
schemawizard.h
Go to the documentation of this file.
1
2#ifndef SCHEMA_WIZARD_H
3#define SCHEMA_WIZARD_H
4
5#include <QObject>
6#include <QString>
7
10
12
14enum MythSchemaUpgrade : std::uint8_t
15{
20};
21
25class MUI_PUBLIC SchemaUpgradeWizard : public QObject, public DBUtil
26{
27 Q_OBJECT
28
29 public:
30 SchemaUpgradeWizard(QString DBSchemaSetting, QString appName,
31 QString upgradeSchemaVal);
32 ~SchemaUpgradeWizard() override;
33
34
37
39 int Compare(void);
40
43 static SchemaUpgradeWizard *Get(const QString &DBSchemaSetting,
44 const QString &appName,
45 const QString &upgradeSchemaVal);
46
48 enum MythSchemaUpgrade PromptForUpgrade(const char *name,
49 bool upgradeAllowed,
50 bool upgradeIfNoUI,
51 int minDBMSmajor = 0,
52 int minDBMSminor = 0,
53 int minDBMSpoint = 0);
54
55 QString m_DBver;
56 bool m_emptyDB {false};
57 int m_versionsBehind {-1};
58
60
61 private:
62 void BusyPopup(const QString &message);
63 static MythSchemaUpgrade GuiPrompt(const QString &message,
64 bool upgradable, bool expert);
65
66 bool m_autoUpgrade {false};
68 MythUIBusyDialog *m_busyPopup {nullptr};
69 bool m_expertMode {false};
71 QString m_schemaName;
73
74};
75
76#endif // SCHEMA_WIZARD_H
Aggregates database and DBMS utility functions.
Definition: dbutil.h:31
static MythDBBackupStatus BackupDB(QString &filename, bool disableRotation=false)
Requests a backup of the database.
Definition: dbutil.cpp:186
Provides UI and helper functions for DB Schema updates.
Definition: schemawizard.h:26
QString m_schemaName
Shown to user in logs.
Definition: schemawizard.h:71
QString m_newSchemaVer
What we need to upgrade to.
Definition: schemawizard.h:72
QString m_schemaSetting
To lookup the schema version.
Definition: schemawizard.h:70
QString m_backupResult
File path, or FAILED
Definition: schemawizard.h:67
QString m_DBver
Schema version in the database.
Definition: schemawizard.h:55
MythDBBackupStatus
Definition: dbutil.h:10
@ kDB_Backup_Unknown
Definition: dbutil.h:11
#define MUI_PUBLIC
Definition: mythuiexp.h:9
MythSchemaUpgrade
Return values from PromptForUpgrade()
Definition: schemawizard.h:15
@ MYTH_SCHEMA_ERROR
Definition: schemawizard.h:17
@ MYTH_SCHEMA_UPGRADE
Definition: schemawizard.h:18
@ MYTH_SCHEMA_EXIT
Definition: schemawizard.h:16
@ MYTH_SCHEMA_USE_EXISTING
Definition: schemawizard.h:19