mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
Disable 'Attach Database' when appropiate. Better 'Choose...' messages
Disable 'Attach Database' when no database is opened. Added to the function that enables and disable actions depending on database state. See issue #1254 Display more specific 'Choose a file...' messages in two places. See issue #331.
This commit is contained in:
@@ -297,7 +297,7 @@ void EditDialog::importData()
|
||||
|
||||
QString fileName = FileDialog::getOpenFileName(
|
||||
this,
|
||||
tr("Choose a file")
|
||||
tr("Choose a file to import")
|
||||
#ifndef Q_OS_MAC // Filters on OS X are buggy
|
||||
, tr("Text files(*.txt);;Image files(%1);;JSON files(*.json);;All files(*)").arg(image_formats)
|
||||
#endif
|
||||
|
||||
@@ -1570,6 +1570,7 @@ void MainWindow::activateFields(bool enable)
|
||||
bool write = !db.readOnly();
|
||||
|
||||
ui->fileCloseAction->setEnabled(enable);
|
||||
ui->fileAttachAction->setEnabled(enable);
|
||||
ui->fileCompactAction->setEnabled(enable && write);
|
||||
ui->fileExportJsonAction->setEnabled(enable);
|
||||
ui->fileExportCSVAction->setEnabled(enable);
|
||||
@@ -2051,7 +2052,7 @@ bool MainWindow::loadProject(QString filename, bool readOnly)
|
||||
if(filename.isEmpty())
|
||||
{
|
||||
filename = FileDialog::getOpenFileName(this,
|
||||
tr("Choose a file to open"),
|
||||
tr("Choose a project file to open"),
|
||||
tr("DB Browser for SQLite project file (*.sqbpro)"));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user