mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-26 22:09:58 -06:00
Support read only opening of database files
When opening a read only database file show a 'Read only' note in the status bar of the main window and disable all editing buttons in the UI. See issue #402.
This commit is contained in:
@@ -43,7 +43,7 @@ class DBBrowserDB : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DBBrowserDB () : _db(0), isEncrypted(false) {}
|
||||
explicit DBBrowserDB () : _db(0), isEncrypted(false), isReadOnly(false) {}
|
||||
virtual ~DBBrowserDB (){}
|
||||
bool open ( const QString & db);
|
||||
bool attach(const QString& filename, QString attach_as = "");
|
||||
@@ -106,6 +106,7 @@ public:
|
||||
DBBrowserObject getObjectByName(const QString& name) const;
|
||||
bool isOpen() const;
|
||||
bool encrypted() const { return isEncrypted; }
|
||||
bool readOnly() const { return isReadOnly; }
|
||||
bool getDirty() const;
|
||||
void logSQL(QString statement, int msgtype);
|
||||
|
||||
@@ -131,6 +132,7 @@ private:
|
||||
QStringList savepointList;
|
||||
|
||||
bool isEncrypted;
|
||||
bool isReadOnly;
|
||||
|
||||
bool tryEncryptionSettings(const QString& filename, bool* encrypted, CipherDialog*& cipherSettings);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user