Provides UI and helper functions for DB Schema updates. More...
#include <schemawizard.h>
Public Member Functions | |
| SchemaUpgradeWizard (const QString &DBSchemaSetting, const QString &appName, const QString &upgradeSchemaVal) | |
| ~SchemaUpgradeWizard () | |
| MythDBBackupStatus | BackupDB (void) |
| Call DBUtil::BackupDB(), and store results. | |
| int | Compare (void) |
| How many schema versions old is the DB? | |
| enum MythSchemaUpgrade | PromptForUpgrade (const char *name, const bool upgradeAllowed, const bool upgradeIfNoUI, const int minDMBSmajor=0, const int minDBMSminor=0, const int minDBMSpoint=0) |
| Query user, to prevent silent, automatic database upgrades. | |
Static Public Member Functions | |
| static SchemaUpgradeWizard * | Get (const QString &DBSchemaSetting, const QString &appName, const QString &upgradeSchemaVal) |
| Instead of creating a new wizard, use the existing one for its DB backup file & results and expert settings. | |
Public Attributes | |
| QString | DBver |
| Schema version in the database. | |
| bool | emptyDB |
| Is the database currently empty? | |
| int | versionsBehind |
| How many schema versions old is the DB? | |
| MythDBBackupStatus | backupStatus |
| BackupDB() status. | |
Private Member Functions | |
| void | BusyPopup (const QString &message) |
| Delete any current "busy" popup, create new one. | |
| MythSchemaUpgrade | GuiPrompt (const QString &message, bool upgradable, bool expert) |
Private Attributes | |
| bool | m_autoUpgrade |
| If no UI, always upgrade. | |
| QString | m_backupResult |
| File path, or __FAILED__. | |
| MythUIBusyDialog * | m_busyPopup |
| Displayed during long pauses. | |
| bool | m_expertMode |
| Also allow newer DB schema. | |
| QString | m_schemaSetting |
| To lookup the schema version. | |
| QString | m_schemaName |
| Shown to user in logs. | |
| QString | m_newSchemaVer |
| What we need to upgrade to. | |
Provides UI and helper functions for DB Schema updates.
See dbcheck.cpp's UpgradeTVDatabaseSchema() for usage.
Definition at line 25 of file schemawizard.h.
| SchemaUpgradeWizard::SchemaUpgradeWizard | ( | const QString & | DBSchemaSetting, | |
| const QString & | appName, | |||
| const QString & | upgradeSchemaVal | |||
| ) |
Definition at line 19 of file schemawizard.cpp.
Referenced by Get().
| SchemaUpgradeWizard::~SchemaUpgradeWizard | ( | ) |
Definition at line 47 of file schemawizard.cpp.
| MythDBBackupStatus SchemaUpgradeWizard::BackupDB | ( | void | ) |
Call DBUtil::BackupDB(), and store results.
Definition at line 85 of file schemawizard.cpp.
Referenced by PromptForUpgrade().
| int SchemaUpgradeWizard::Compare | ( | void | ) |
How many schema versions old is the DB?
Definition at line 99 of file schemawizard.cpp.
Referenced by PromptForUpgrade(), UpgradeMusicDatabaseSchema(), and UpgradeTVDatabaseSchema().
| SchemaUpgradeWizard * SchemaUpgradeWizard::Get | ( | const QString & | DBSchemaSetting, | |
| const QString & | appName, | |||
| const QString & | upgradeSchemaVal | |||
| ) | [static] |
Instead of creating a new wizard, use the existing one for its DB backup file & results and expert settings.
Definition at line 53 of file schemawizard.cpp.
Referenced by UpgradeMusicDatabaseSchema(), and UpgradeTVDatabaseSchema().
| enum MythSchemaUpgrade SchemaUpgradeWizard::PromptForUpgrade | ( | const char * | name, | |
| const bool | upgradeAllowed, | |||
| const bool | upgradeIfNoUI, | |||
| const int | minDBMSmajor = 0, |
|||
| const int | minDBMSminor = 0, |
|||
| const int | minDBMSpoint = 0 | |||
| ) |
Query user, to prevent silent, automatic database upgrades.
Tell the user that a schema needs to be upgraded, ask if that's OK, remind them about backups, et c.
The GUI buttons default to Exit. The shell command prompting requires an explicit "yes".
| name | What schema are we planning to upgrade? (TV? Music?) | |
| upgradeAllowed | In not true, and DBSchemaAutoUpgrade isn't set for expert mode, this is just a few information messages | |
| upgradeIfNoUI | Default for non-interactive shells |
Definition at line 197 of file schemawizard.cpp.
Referenced by UpgradeMusicDatabaseSchema(), and UpgradeTVDatabaseSchema().
| void SchemaUpgradeWizard::BusyPopup | ( | const QString & | message | ) | [private] |
Delete any current "busy" popup, create new one.
Wish there was a way to change the message on existing popup.
Definition at line 77 of file schemawizard.cpp.
| MythSchemaUpgrade SchemaUpgradeWizard::GuiPrompt | ( | const QString & | message, | |
| bool | upgradable, | |||
| bool | expert | |||
| ) | [private] |
Definition at line 143 of file schemawizard.cpp.
Referenced by PromptForUpgrade().
| QString SchemaUpgradeWizard::DBver |
Schema version in the database.
Definition at line 55 of file schemawizard.h.
Referenced by Compare(), Get(), PromptForUpgrade(), and UpgradeMusicDatabaseSchema().
Is the database currently empty?
Definition at line 56 of file schemawizard.h.
Referenced by BackupDB(), Compare(), and PromptForUpgrade().
How many schema versions old is the DB?
Definition at line 57 of file schemawizard.h.
Referenced by Compare(), Get(), and PromptForUpgrade().
BackupDB() status.
Definition at line 59 of file schemawizard.h.
Referenced by BackupDB(), and PromptForUpgrade().
bool SchemaUpgradeWizard::m_autoUpgrade [private] |
If no UI, always upgrade.
Definition at line 66 of file schemawizard.h.
Referenced by PromptForUpgrade(), and SchemaUpgradeWizard().
QString SchemaUpgradeWizard::m_backupResult [private] |
File path, or __FAILED__.
Definition at line 67 of file schemawizard.h.
Referenced by BackupDB(), and PromptForUpgrade().
MythUIBusyDialog* SchemaUpgradeWizard::m_busyPopup [private] |
Displayed during long pauses.
Definition at line 68 of file schemawizard.h.
Referenced by BusyPopup().
bool SchemaUpgradeWizard::m_expertMode [private] |
Also allow newer DB schema.
Definition at line 69 of file schemawizard.h.
Referenced by PromptForUpgrade(), and SchemaUpgradeWizard().
QString SchemaUpgradeWizard::m_schemaSetting [private] |
To lookup the schema version.
Definition at line 70 of file schemawizard.h.
QString SchemaUpgradeWizard::m_schemaName [private] |
Shown to user in logs.
Definition at line 71 of file schemawizard.h.
QString SchemaUpgradeWizard::m_newSchemaVer [private] |
What we need to upgrade to.
Definition at line 72 of file schemawizard.h.
Referenced by Compare(), Get(), and PromptForUpgrade().
1.6.3