From ab064c3e3b45961bb3f21e8d9e77ccf2bcab533e Mon Sep 17 00:00:00 2001 From: Albert S Date: Sat, 23 Jul 2022 20:16:14 +0200 Subject: [PATCH] gui: mainwindow: Add menu action to open web user manual --- gui/mainwindow.cpp | 3 +++ gui/mainwindow.ui | 6 ++++++ shared/common.cpp | 5 +++++ shared/common.h | 1 + 4 files changed, 15 insertions(+) diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index a2a8bbf..00cac24 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -171,6 +171,9 @@ void MainWindow::connectSignals() connect(ui->menuAboutQtAction, &QAction::triggered, this, [this](bool checked) { QMessageBox::aboutQt(this, "About Qt"); }); connect(ui->menuSyncIndexAction, &QAction::triggered, this, &MainWindow::startIndexSync); + connect(ui->menuOpenUserManualAction, &QAction::triggered, this, + [this]() { QDesktopServices::openUrl(Common::userManualUrl()); }); + connect(indexSyncer, &IndexSyncer::finished, this, [&](unsigned int totalUpdated, unsigned int totalDeleted, unsigned int totalErrored) { diff --git a/gui/mainwindow.ui b/gui/mainwindow.ui index 0ea2355..2d707a6 100644 --- a/gui/mainwindow.ui +++ b/gui/mainwindow.ui @@ -626,6 +626,7 @@ looqs + @@ -647,6 +648,11 @@ Sync index (remove deleted, update existing files) + + + Open user manual + + diff --git a/shared/common.cpp b/shared/common.cpp index f8e1434..339dd4e 100644 --- a/shared/common.cpp +++ b/shared/common.cpp @@ -234,3 +234,8 @@ QString Common::versionText() QString tag = GIT_TAG; return tag + " (" + commitid + ") built " + __DATE__ + " " + __TIME__; } + +QString Common::userManualUrl() +{ + return QString("https://github.com/quitesimpleorg/looqs/blob/%1/USAGE.md").arg(QString(GIT_COMMIT_ID)); +} diff --git a/shared/common.h b/shared/common.h index bbc04be..26308de 100644 --- a/shared/common.h +++ b/shared/common.h @@ -25,5 +25,6 @@ bool isTextFile(QFileInfo fileInfo); bool isMountPath(QString path); bool noSandboxModeRequested(); QString versionText(); +QString userManualUrl(); } // namespace Common #endif