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 
8 #include "libmyth/mythexp.h"
9 #include "libmythbase/dbutil.h"
10 
11 class MythUIBusyDialog;
12 
15 {
20 };
21 
25 class MPUBLIC 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};
67  QString m_backupResult;
68  MythUIBusyDialog *m_busyPopup {nullptr};
69  bool m_expertMode {false};
70  QString m_schemaSetting;
71  QString m_schemaName;
72  QString m_newSchemaVer;
73 
74 };
75 
76 #endif // SCHEMA_WIZARD_H
MPUBLIC
#define MPUBLIC
Definition: mythexp.h:10
MYTH_SCHEMA_ERROR
@ MYTH_SCHEMA_ERROR
Definition: schemawizard.h:17
dbutil.h
MYTH_SCHEMA_UPGRADE
@ MYTH_SCHEMA_UPGRADE
Definition: schemawizard.h:18
mythexp.h
MythSchemaUpgrade
MythSchemaUpgrade
Return values from PromptForUpgrade()
Definition: schemawizard.h:14
MYTH_SCHEMA_USE_EXISTING
@ MYTH_SCHEMA_USE_EXISTING
Definition: schemawizard.h:19
MYTH_SCHEMA_EXIT
@ MYTH_SCHEMA_EXIT
Definition: schemawizard.h:16
DBUtil
Aggregates database and DBMS utility functions.
Definition: dbutil.h:30
DBUtil::BackupDB
static MythDBBackupStatus BackupDB(QString &filename, bool disableRotation=false)
Requests a backup of the database.
Definition: dbutil.cpp:190
MythUIBusyDialog
Definition: mythprogressdialog.h:36
SchemaUpgradeWizard::m_backupResult
QString m_backupResult
File path, or FAILED
Definition: schemawizard.h:67
MythDBBackupStatus
MythDBBackupStatus
Definition: dbutil.h:9
SchemaUpgradeWizard
Provides UI and helper functions for DB Schema updates.
Definition: schemawizard.h:25
SchemaUpgradeWizard::m_schemaName
QString m_schemaName
Shown to user in logs.
Definition: schemawizard.h:71
SchemaUpgradeWizard::m_schemaSetting
QString m_schemaSetting
To lookup the schema version.
Definition: schemawizard.h:70
kDB_Backup_Unknown
@ kDB_Backup_Unknown
Definition: dbutil.h:11
SchemaUpgradeWizard::m_DBver
QString m_DBver
Schema version in the database.
Definition: schemawizard.h:55
SchemaUpgradeWizard::m_newSchemaVer
QString m_newSchemaVer
What we need to upgrade to.
Definition: schemawizard.h:72