-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2979 from xerus2000/database-help
Update database help message
- Loading branch information
Showing
7 changed files
with
60 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,47 +70,47 @@ MixxxDb::MixxxDb( | |
|
||
bool MixxxDb::initDatabaseSchema( | ||
const QSqlDatabase& database, | ||
const QString& schemaFile, | ||
int schemaVersion) { | ||
int schemaVersion, | ||
const QString& schemaFile) { | ||
QString okToExit = tr("Click OK to exit."); | ||
QString upgradeFailed = tr("Cannot upgrade database schema"); | ||
QString upgradeToVersionFailed = | ||
tr("Unable to upgrade your database schema to version %1") | ||
.arg(QString::number(schemaVersion)); | ||
QString helpEmail = tr("For help with database issues contact:") + "\n" + | ||
"mixxx[email protected]"; | ||
|
||
switch (SchemaManager(database).upgradeToSchemaVersion(schemaFile, schemaVersion)) { | ||
case SchemaManager::Result::CurrentVersion: | ||
case SchemaManager::Result::UpgradeSucceeded: | ||
case SchemaManager::Result::NewerVersionBackwardsCompatible: | ||
return true; // done | ||
case SchemaManager::Result::UpgradeFailed: | ||
QMessageBox::warning( | ||
0, upgradeFailed, | ||
upgradeToVersionFailed + "\n" + | ||
tr("Your mixxxdb.sqlite file may be corrupt.") + "\n" + | ||
tr("Try renaming it and restarting Mixxx.") + "\n" + | ||
helpEmail + "\n\n" + okToExit, | ||
QMessageBox::Ok); | ||
return false; // abort | ||
case SchemaManager::Result::NewerVersionIncompatible: | ||
QMessageBox::warning( | ||
0, upgradeFailed, | ||
upgradeToVersionFailed + "\n" + | ||
tr("Your mixxxdb.sqlite file was created by a newer " | ||
"version of Mixxx and is incompatible.") + | ||
"\n\n" + okToExit, | ||
QMessageBox::Ok); | ||
return false; // abort | ||
case SchemaManager::Result::SchemaError: | ||
QMessageBox::warning( | ||
0, upgradeFailed, | ||
upgradeToVersionFailed + "\n" + | ||
tr("The database schema file is invalid.") + "\n" + | ||
helpEmail + "\n\n" + okToExit, | ||
QMessageBox::Ok); | ||
return false; // abort | ||
QString helpContact = tr("For help with database issues consult:") + "\n" + | ||
"https://www.mixxx.org/support"; | ||
|
||
switch (SchemaManager(database).upgradeToSchemaVersion(schemaVersion, schemaFile)) { | ||
case SchemaManager::Result::CurrentVersion: | ||
case SchemaManager::Result::UpgradeSucceeded: | ||
case SchemaManager::Result::NewerVersionBackwardsCompatible: | ||
return true; // done | ||
case SchemaManager::Result::UpgradeFailed: | ||
QMessageBox::warning(0, | ||
upgradeFailed, | ||
upgradeToVersionFailed + "\n" + | ||
tr("Your mixxxdb.sqlite file may be corrupt.") + | ||
"\n" + tr("Try renaming it and restarting Mixxx.") + | ||
"\n" + helpContact + "\n\n" + okToExit, | ||
QMessageBox::Ok); | ||
return false; // abort | ||
case SchemaManager::Result::NewerVersionIncompatible: | ||
QMessageBox::warning(0, | ||
upgradeFailed, | ||
upgradeToVersionFailed + "\n" + | ||
tr("Your mixxxdb.sqlite file was created by a newer " | ||
"version of Mixxx and is incompatible.") + | ||
"\n\n" + okToExit, | ||
QMessageBox::Ok); | ||
return false; // abort | ||
case SchemaManager::Result::SchemaError: | ||
QMessageBox::warning(0, | ||
upgradeFailed, | ||
upgradeToVersionFailed + "\n" + | ||
tr("The database schema file is invalid.") + "\n" + | ||
helpContact + "\n\n" + okToExit, | ||
QMessageBox::Ok); | ||
return false; // abort | ||
} | ||
// Suppress compiler warning | ||
DEBUG_ASSERT(!"unhandled switch/case"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters