Integrated help into the system. Most all the sub-screens that are actually complete

and working have integrated help now. Press F1 to bring up help for a given window.
This commit is contained in:
Collin Kidder
2017-11-30 21:02:16 -05:00
parent 3d5c4c55c6
commit 9302c18c33
39 changed files with 528 additions and 13 deletions
+21 -2
View File
@@ -3,13 +3,12 @@
#include "connectionwindow.h"
#include "mainwindow.h"
#include "helpwindow.h"
#include "ui_connectionwindow.h"
#include "connections/canconfactory.h"
#include "connections/canconmanager.h"
#include "canbus.h"
ConnectionWindow::ConnectionWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::ConnectionWindow)
@@ -88,6 +87,7 @@ void ConnectionWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
qDebug() << "Show connectionwindow";
installEventFilter(this);
readSettings();
ui->tableConnections->selectRow(0);
currentRowChanged(ui->tableConnections->currentIndex(), ui->tableConnections->currentIndex());
@@ -97,9 +97,28 @@ void ConnectionWindow::showEvent(QShowEvent* event)
void ConnectionWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
removeEventFilter(this);
writeSettings();
}
bool ConnectionWindow::eventFilter(QObject *obj, QEvent *event)
{
if (event->type() == QEvent::KeyRelease) {
QKeyEvent *keyEvent = static_cast<QKeyEvent *>(event);
switch (keyEvent->key())
{
case Qt::Key_F1:
HelpWindow::getRef()->showHelp("connectionwindow.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void ConnectionWindow::readSettings()
{
QSettings settings;