Skip to content

Commit

Permalink
Add links to docs in the Help menu (#3274)
Browse files Browse the repository at this point in the history
* Fix #3266 and Fix #3197 
* Add documentation links to Help menu
* Added offline documentation (PDF) for Getting Started Guide and User Guide
  • Loading branch information
SohamG authored and droidmonkey committed Jun 19, 2019
1 parent 05c11d1 commit 9728df2
Show file tree
Hide file tree
Showing 7 changed files with 66 additions and 6 deletions.
2 changes: 2 additions & 0 deletions share/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ if(APPLE)
install(FILES macosx/keepassxc.icns DESTINATION ${DATA_INSTALL_DIR})
endif()

install(DIRECTORY docs/ DESTINATION ${DATA_INSTALL_DIR}/docs FILES_MATCHING PATTERN "*.pdf")

install(DIRECTORY wizard/ DESTINATION ${DATA_INSTALL_DIR}/wizard FILES_MATCHING PATTERN "*.png")

install(DIRECTORY icons/application/ DESTINATION ${DATA_INSTALL_DIR}/icons/application
Expand Down
Binary file added share/docs/KeePassXC_GettingStarted.pdf
Binary file not shown.
Binary file added share/docs/KeePassXC_UserGuide.pdf
Binary file not shown.
7 changes: 7 additions & 0 deletions src/browser/BrowserOptionDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Browsers installed as snaps are currently not supported.</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="extensionLabel"/>
</item>
Expand Down
27 changes: 25 additions & 2 deletions src/gui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,10 @@ MainWindow::MainWindow()
connect(m_ui->actionAbout, SIGNAL(triggered()), SLOT(showAboutDialog()));
connect(m_ui->actionDonate, SIGNAL(triggered()), SLOT(openDonateUrl()));
connect(m_ui->actionBugReport, SIGNAL(triggered()), SLOT(openBugReportUrl()));
connect(m_ui->actionGettingStarted, SIGNAL(triggered()), SLOT(openGettingStartedGuide()));
connect(m_ui->actionUserGuide, SIGNAL(triggered()), SLOT(openUserGuide()));
connect(m_ui->actionOnlineHelp, SIGNAL(triggered()), SLOT(openOnlineHelp()));


#ifdef Q_OS_MACOS
setUnifiedTitleAndToolBarOnMac(true);
Expand Down Expand Up @@ -758,16 +762,35 @@ void MainWindow::showUpdateCheckDialog()
#endif
}

void MainWindow::customOpenUrl(QString url)
{
QDesktopServices::openUrl(QUrl(url));
}

void MainWindow::openDonateUrl()
{
QDesktopServices::openUrl(QUrl("https://keepassxc.org/donate"));
customOpenUrl("https://keepassxc.org/donate");
}

void MainWindow::openBugReportUrl()
{
QDesktopServices::openUrl(QUrl("https://github.com/keepassxreboot/keepassxc/issues"));
customOpenUrl("https://github.com/keepassxreboot/keepassxc/issues");
}

void MainWindow::openGettingStartedGuide()
{
customOpenUrl(filePath()->dataPath("docs/KeePassXC_GettingStarted.pdf"));
}

void MainWindow::openUserGuide()
{
customOpenUrl(filePath()->dataPath("docs/KeePassXC_UserGuide.pdf"));
}

void MainWindow::openOnlineHelp()
{
customOpenUrl("https://keepassxc.org/docs/");
}
void MainWindow::switchToDatabases()
{
if (m_ui->tabWidget->currentIndex() == -1) {
Expand Down
4 changes: 4 additions & 0 deletions src/gui/MainWindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ private slots:
void hasUpdateAvailable(bool hasUpdate, const QString& version, bool isManuallyRequested);
void openDonateUrl();
void openBugReportUrl();
void openGettingStartedGuide();
void openUserGuide();
void openOnlineHelp();
void switchToDatabases();
void switchToSettings(bool enabled);
void switchToPasswordGen(bool enabled);
Expand Down Expand Up @@ -132,6 +135,7 @@ private slots:
bool saveLastDatabases();
void updateTrayIcon();
bool isTrayIconEnabled() const;
void customOpenUrl(QString url);

static QStringList kdbxFilesFromUrls(const QList<QUrl>& urls);
void dragEnterEvent(QDragEnterEvent* event) override;
Expand Down
32 changes: 28 additions & 4 deletions src/gui/MainWindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@
<string>&amp;Help</string>
</property>
<addaction name="actionAbout"/>
<addaction name="separator"/>
<addaction name="actionGettingStarted"/>
<addaction name="actionUserGuide"/>
<addaction name="actionOnlineHelp"/>
<addaction name="separator"/>
<addaction name="actionCheckForUpdates"/>
<addaction name="actionDonate"/>
<addaction name="actionBugReport"/>
Expand Down Expand Up @@ -355,7 +360,7 @@
</action>
<action name="actionCheckForUpdates">
<property name="text">
<string>Check for Updates...</string>
<string>&amp;Check for Updates...</string>
</property>
<property name="menuRole">
<enum>QAction::ApplicationSpecificRole</enum>
Expand Down Expand Up @@ -547,7 +552,7 @@
<bool>true</bool>
</property>
<property name="text">
<string>Password Generator</string>
<string>&amp;Password Generator</string>
</property>
</action>
<action name="actionEntryAutoType">
Expand Down Expand Up @@ -677,9 +682,28 @@
<string>Report a &amp;bug</string>
</property>
</action>
<action name="actionShare_entry">
<action name="actionGettingStarted">
<property name="text">
<string>&amp;Getting Started</string>
</property>
<property name="toolTip">
<string>Open Getting Started Guide PDF</string>
</property>
</action>
<action name="actionOnlineHelp">
<property name="text">
<string>Share entry</string>
<string>&amp;Online Help...</string>
</property>
<property name="toolTip">
<string>Go to online documentation (opens browser)</string>
</property>
</action>
<action name="actionUserGuide">
<property name="text">
<string>&amp;User Guide</string>
</property>
<property name="toolTip">
<string>Open User Guide PDF</string>
</property>
</action>
</widget>
Expand Down

0 comments on commit 9728df2

Please sign in to comment.