diff --git a/src/gui/formbackupdatabasesettings.cpp b/src/gui/formbackupdatabasesettings.cpp index dac0be2c4..b44132f94 100644 --- a/src/gui/formbackupdatabasesettings.cpp +++ b/src/gui/formbackupdatabasesettings.cpp @@ -41,8 +41,13 @@ FormBackupDatabaseSettings::FormBackupDatabaseSettings(QWidget *parent) : QDialo connect(m_ui->m_txtBackupName->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(checkOkButton())); connect(m_ui->m_btnSelectFolder, SIGNAL(clicked()), this, SLOT(selectFolder())); - selectFolder(qApp->documentsFolderPath()); + selectFolder(qApp->documentsFolderPath()); m_ui->m_txtBackupName->lineEdit()->setText(QString(APP_LOW_NAME) + "_" + QDateTime::currentDateTime().toString("yyyyMMddHHmm")); + + if (qApp->database()->activeDatabaseDriver() != DatabaseFactory::SQLITE && + qApp->database()->activeDatabaseDriver() != DatabaseFactory::SQLITE_MEMORY) { + m_ui->m_checkBackupDatabase->setDisabled(true); + } } FormBackupDatabaseSettings::~FormBackupDatabaseSettings() { @@ -50,7 +55,7 @@ FormBackupDatabaseSettings::~FormBackupDatabaseSettings() { } void FormBackupDatabaseSettings::performBackup() { - + // TODO: Backup. } void FormBackupDatabaseSettings::selectFolder(QString path) { diff --git a/src/miscellaneous/databasefactory.cpp b/src/miscellaneous/databasefactory.cpp index 793f94380..3c60c6d54 100755 --- a/src/miscellaneous/databasefactory.cpp +++ b/src/miscellaneous/databasefactory.cpp @@ -342,6 +342,10 @@ void DatabaseFactory::determineDriver() { } } +DatabaseFactory::UsedDriver DatabaseFactory::activeDatabaseDriver() const { + return m_activeDatabaseDriver; +} + QSqlDatabase DatabaseFactory::mysqlConnection(const QString &connection_name) { if (!m_mysqlDatabaseInitialized) { // Return initialized database. diff --git a/src/miscellaneous/databasefactory.h b/src/miscellaneous/databasefactory.h index 135f6b9a3..813bd29b8 100755 --- a/src/miscellaneous/databasefactory.h +++ b/src/miscellaneous/databasefactory.h @@ -85,6 +85,8 @@ class DatabaseFactory : public QObject { QString mysqlInterpretErrorCode(MySQLError error_code); + UsedDriver activeDatabaseDriver() const; + private: // // GENERAL stuff.