From 05149150a58494017663354bfb56f2f2695d21c7 Mon Sep 17 00:00:00 2001 From: mgrojo Date: Wed, 6 Dec 2017 19:26:59 +0100 Subject: [PATCH] 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. --- src/EditDialog.cpp | 2 +- src/MainWindow.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/EditDialog.cpp b/src/EditDialog.cpp index dd297189..43b7fb40 100644 --- a/src/EditDialog.cpp +++ b/src/EditDialog.cpp @@ -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 diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 19e965f7..7dd07825 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -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)")); }