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 "mythexp.h"
9 #include "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(const QString &DBSchemaSetting, const QString &appName,
31  const QString &upgradeSchemaVal);
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  const bool upgradeAllowed,
50  const bool upgradeIfNoUI,
51  const int minDBMSmajor = 0,
52  const int minDBMSminor = 0,
53  const 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  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
Provides UI and helper functions for DB Schema updates.
Definition: schemawizard.h:25
#define MPUBLIC
Definition: mythexp.h:10
QString m_schemaSetting
To lookup the schema version.
Definition: schemawizard.h:70
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
const char * name
Definition: ParseText.cpp:328
MythDBBackupStatus
Definition: dbutil.h:9
Aggregates database and DBMS utility functions.
Definition: dbutil.h:30
MythSchemaUpgrade
Return values from PromptForUpgrade()
Definition: schemawizard.h:14
QString m_DBver
Schema version in the database.
Definition: schemawizard.h:55
QString m_backupResult
File path, or FAILED
Definition: schemawizard.h:67
MythDBBackupStatus BackupDB(QString &filename, bool disableRotation=false)
Requests a backup of the database.
Definition: dbutil.cpp:194