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:
mgrojo
2017-12-06 19:26:59 +01:00
parent a4728ff5f6
commit 05149150a5
2 changed files with 3 additions and 2 deletions

View File

@@ -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)"));
}