gui: mainwindow: Add menu action to open web user manual

This commit is contained in:
Albert S. 2022-07-23 20:16:14 +02:00
parent a33c7f1859
commit ab064c3e3b
4 changed files with 15 additions and 0 deletions

View File

@ -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)
{

View File

@ -626,6 +626,7 @@
<string>looqs</string>
</property>
<addaction name="menuSyncIndexAction"/>
<addaction name="menuOpenUserManualAction"/>
<addaction name="menuAboutAction"/>
<addaction name="menuAboutQtAction"/>
<addaction name="separator"/>
@ -647,6 +648,11 @@
<string>Sync index (remove deleted, update existing files)</string>
</property>
</action>
<action name="menuOpenUserManualAction">
<property name="text">
<string>Open user manual</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>

View File

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

View File

@ -25,5 +25,6 @@ bool isTextFile(QFileInfo fileInfo);
bool isMountPath(QString path);
bool noSandboxModeRequested();
QString versionText();
QString userManualUrl();
} // namespace Common
#endif