fix error popup when sql is disabled
This commit is contained in:
@@ -81,8 +81,10 @@ namespace mysql
|
||||
{
|
||||
|
||||
prompt.setIcon(QMessageBox::Warning);
|
||||
prompt.setText("Failed to load MySQL database, check your settings.");
|
||||
prompt.setText("Failed to load MySQL database, check your settings. \nIf you did not intend to use this feature, disable it in Noggit->settings->MySQL");
|
||||
prompt.setWindowTitle("Noggit Database Error");
|
||||
// disable if connection is not valid
|
||||
// settings.value("project/mysql/enabled") = false;
|
||||
std::stringstream promptText;
|
||||
|
||||
promptText << "\n# ERR: " << e.what();
|
||||
|
||||
@@ -126,12 +126,17 @@ namespace Noggit::Ui::Windows
|
||||
#ifdef USE_MYSQL_UID_STORAGE
|
||||
bool use_mysql = settings.value("project/mysql/enabled", false).toBool();
|
||||
|
||||
mysql::testConnection(true);
|
||||
bool valid_conn = false;
|
||||
if (use_mysql)
|
||||
{
|
||||
valid_conn = mysql::testConnection(true);
|
||||
}
|
||||
|
||||
if ((use_mysql && mysql::hasMaxUIDStoredDB(_world->getMapID()))
|
||||
if ((valid_conn && mysql::hasMaxUIDStoredDB(_world->getMapID()))
|
||||
|| uid_storage::hasMaxUIDStored(_world->getMapID())
|
||||
)
|
||||
{
|
||||
|
||||
_world->mapIndex.loadMaxUID();
|
||||
enterMapAt(pos, camera_pitch, camera_yaw, uid_fix_mode::none, from_bookmark);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user