From 48643430a52fe73234472760ed250e7ae37dc26b Mon Sep 17 00:00:00 2001 From: Justin Clift Date: Fri, 19 Aug 2016 16:14:42 +0100 Subject: [PATCH] Add SQLCipher FAQ option in the Help menu This new Help menu option only displays for SQLCipher enabled builds. For non-SQLCipher ones, it's not shown. Closes #734. --- src/MainWindow.cpp | 10 ++++++++++ src/MainWindow.h | 1 + src/MainWindow.ui | 13 +++++++++++++ 3 files changed, 24 insertions(+) diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 4535973b..f61e069f 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -182,6 +182,11 @@ void MainWindow::init() // Add keyboard shortcut for "Edit Cell" dock ui->viewMenu->actions().at(3)->setShortcut(QKeySequence(tr("Ctrl+E"))); + // If we're not compiling in SQLCipher, hide it's FAQ link in the help menu +#ifndef ENABLE_SQLCIPHER + ui->actionSqlCipherFaq->setVisible(false); +#endif + // Set statusbar fields statusEncryptionLabel = new QLabel(ui->statusbar); statusEncryptionLabel->setEnabled(false); @@ -1985,6 +1990,11 @@ void MainWindow::on_actionBug_report_triggered() QDesktopServices::openUrl(QUrl("https://github.com/sqlitebrowser/sqlitebrowser/issues/new")); } +void MainWindow::on_actionSqlCipherFaq_triggered() +{ + QDesktopServices::openUrl(QUrl("https://discuss.zetetic.net/c/sqlcipher/sqlcipher-faq")); +} + void MainWindow::on_actionWebsite_triggered() { QDesktopServices::openUrl(QUrl("http://sqlitebrowser.org")); diff --git a/src/MainWindow.h b/src/MainWindow.h index 6c47d573..34fafbb5 100644 --- a/src/MainWindow.h +++ b/src/MainWindow.h @@ -220,6 +220,7 @@ private slots: void on_butSavePlot_clicked(); void on_actionWiki_triggered(); void on_actionBug_report_triggered(); + void on_actionSqlCipherFaq_triggered(); void on_actionWebsite_triggered(); void updateBrowseDataColumnWidth(int section, int /*old_size*/, int new_size); bool loadProject(QString filename = QString()); diff --git a/src/MainWindow.ui b/src/MainWindow.ui index 56183a8e..651ef375 100644 --- a/src/MainWindow.ui +++ b/src/MainWindow.ui @@ -888,6 +888,7 @@ + @@ -1933,6 +1934,18 @@ Duplicate record + + + + :/icons/browser_open:/icons/browser_open + + + SQLCipher FAQ... + + + Opens the SQLCipher FAQ in a browser window + +