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
+7 -4
View File
@@ -4,7 +4,7 @@
# #
#------------------------------------------------- #-------------------------------------------------
QT = core gui printsupport qml serialbus serialport widgets QT = core gui printsupport qml serialbus serialport widgets help
CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT
@@ -63,7 +63,8 @@ SOURCES += main.cpp\
bus_protocols/j1939_handler.cpp \ bus_protocols/j1939_handler.cpp \
bus_protocols/uds_handler.cpp \ bus_protocols/uds_handler.cpp \
jsedit.cpp \ jsedit.cpp \
frameplaybackobject.cpp frameplaybackobject.cpp \
helpwindow.cpp
HEADERS += mainwindow.h \ HEADERS += mainwindow.h \
can_structs.h \ can_structs.h \
@@ -117,7 +118,8 @@ HEADERS += mainwindow.h \
bus_protocols/uds_handler.h \ bus_protocols/uds_handler.h \
bus_protocols/isotp_message.h \ bus_protocols/isotp_message.h \
jsedit.h \ jsedit.h \
frameplaybackobject.h frameplaybackobject.h \
helpwindow.h
FORMS += ui/candatagrid.ui \ FORMS += ui/candatagrid.ui \
ui/connectionwindow.ui \ ui/connectionwindow.ui \
@@ -143,7 +145,8 @@ FORMS += ui/candatagrid.ui \
ui/snifferwindow.ui \ ui/snifferwindow.ui \
ui/udsscanwindow.ui \ ui/udsscanwindow.ui \
ui/bisectwindow.ui \ ui/bisectwindow.ui \
ui/signalviewerwindow.ui ui/signalviewerwindow.ui \
helpwindow.ui
DISTFILES += DISTFILES +=
+21
View File
@@ -3,6 +3,7 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "framefileio.h" #include "framefileio.h"
#include "helpwindow.h"
#include <QDebug> #include <QDebug>
#include <algorithm> #include <algorithm>
@@ -23,10 +24,12 @@ BisectWindow::BisectWindow(const QVector<CANFrame> *frames, QWidget *parent) :
connect(ui->slidePercentage, &QSlider::sliderReleased, this, &BisectWindow::updatePercentText); connect(ui->slidePercentage, &QSlider::sliderReleased, this, &BisectWindow::updatePercentText);
connect(ui->editFrameNumber, &QLineEdit::editingFinished, this, &BisectWindow::updateFrameNumSlider); connect(ui->editFrameNumber, &QLineEdit::editingFinished, this, &BisectWindow::updateFrameNumSlider);
connect(ui->editPercentage, &QLineEdit::editingFinished, this, &BisectWindow::updatePercentSlider); connect(ui->editPercentage, &QLineEdit::editingFinished, this, &BisectWindow::updatePercentSlider);
installEventFilter(this);
} }
BisectWindow::~BisectWindow() BisectWindow::~BisectWindow()
{ {
removeEventFilter(this);
delete ui; delete ui;
} }
@@ -39,6 +42,24 @@ void BisectWindow::showEvent(QShowEvent* event)
updatePercentText(); updatePercentText();
} }
bool BisectWindow::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("bisector.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void BisectWindow::refreshIDList() void BisectWindow::refreshIDList()
{ {
int id; int id;
+1
View File
@@ -39,6 +39,7 @@ private:
void refreshIDList(); void refreshIDList();
void refreshFrameNumbers(); void refreshFrameNumbers();
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // BISECTWINDOW_H #endif // BISECTWINDOW_H
+21 -2
View File
@@ -3,13 +3,12 @@
#include "connectionwindow.h" #include "connectionwindow.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
#include "ui_connectionwindow.h" #include "ui_connectionwindow.h"
#include "connections/canconfactory.h" #include "connections/canconfactory.h"
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
#include "canbus.h" #include "canbus.h"
ConnectionWindow::ConnectionWindow(QWidget *parent) : ConnectionWindow::ConnectionWindow(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::ConnectionWindow) ui(new Ui::ConnectionWindow)
@@ -88,6 +87,7 @@ void ConnectionWindow::showEvent(QShowEvent* event)
{ {
QDialog::showEvent(event); QDialog::showEvent(event);
qDebug() << "Show connectionwindow"; qDebug() << "Show connectionwindow";
installEventFilter(this);
readSettings(); readSettings();
ui->tableConnections->selectRow(0); ui->tableConnections->selectRow(0);
currentRowChanged(ui->tableConnections->currentIndex(), ui->tableConnections->currentIndex()); currentRowChanged(ui->tableConnections->currentIndex(), ui->tableConnections->currentIndex());
@@ -97,9 +97,28 @@ void ConnectionWindow::showEvent(QShowEvent* event)
void ConnectionWindow::closeEvent(QCloseEvent *event) void ConnectionWindow::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
writeSettings(); 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() void ConnectionWindow::readSettings()
{ {
QSettings settings; QSettings settings;
+1
View File
@@ -80,6 +80,7 @@ private:
void saveConnections(); void saveConnections();
void showEvent(QShowEvent *); void showEvent(QShowEvent *);
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
}; };
+21
View File
@@ -5,6 +5,7 @@
#include <QMenu> #include <QMenu>
#include <QSettings> #include <QSettings>
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
#include "helpwindow.h"
/* /*
* Notes about new functionality: * Notes about new functionality:
@@ -93,14 +94,34 @@ FramePlaybackWindow::~FramePlaybackWindow()
void FramePlaybackWindow::showEvent(QShowEvent *) void FramePlaybackWindow::showEvent(QShowEvent *)
{ {
readSettings(); readSettings();
installEventFilter(this);
} }
void FramePlaybackWindow::closeEvent(QCloseEvent *event) void FramePlaybackWindow::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
writeSettings(); writeSettings();
} }
bool FramePlaybackWindow::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("playbackwindow.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void FramePlaybackWindow::readSettings() void FramePlaybackWindow::readSettings()
{ {
QSettings settings; QSettings settings;
+1
View File
@@ -66,6 +66,7 @@ private:
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void calculateWhichBus(); void calculateWhichBus();
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // FRAMEPLAYBACKWINDOW_H #endif // FRAMEPLAYBACKWINDOW_H
+21
View File
@@ -5,6 +5,7 @@
#include <QFileDialog> #include <QFileDialog>
#include <QDebug> #include <QDebug>
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
/* /*
@@ -51,16 +52,36 @@ FrameSenderWindow::FrameSenderWindow(const QVector<CANFrame> *frames, QWidget *p
intervalTimer->start(); intervalTimer->start();
elapsedTimer.start(); elapsedTimer.start();
installEventFilter(this);
} }
FrameSenderWindow::~FrameSenderWindow() FrameSenderWindow::~FrameSenderWindow()
{ {
removeEventFilter(this);
delete ui; delete ui;
intervalTimer->stop(); intervalTimer->stop();
delete intervalTimer; delete intervalTimer;
} }
bool FrameSenderWindow::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("customsender.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void FrameSenderWindow::createBlankRow() void FrameSenderWindow::createBlankRow()
{ {
int row = ui->tableSender->rowCount(); int row = ui->tableSender->rowCount();
+1
View File
@@ -53,6 +53,7 @@ private:
void processCellChange(int line, int col); void processCellChange(int line, int col);
void buildFrameCache(); void buildFrameCache();
void processIncomingFrame(CANFrame *frame); void processIncomingFrame(CANFrame *frame);
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // FRAMESENDERWINDOW_H #endif // FRAMESENDERWINDOW_H
+94
View File
@@ -0,0 +1,94 @@
#include <QDebug>
#include "helpwindow.h"
#include "ui_helpwindow.h"
HelpWindow* HelpWindow::self = 0;
HelpWindow::HelpWindow(QWidget *parent) :
QDialog(parent),
ui(new Ui::HelpWindow)
{
ui->setupUi(this);
m_helpEngine = new QHelpEngineCore("SavvyCAN.qhc", this);
if (!m_helpEngine->setupData()) {
delete m_helpEngine;
m_helpEngine = 0;
qDebug() << "Could not load help file!";
}
readSettings();
}
HelpWindow::~HelpWindow()
{
writeSettings();
delete ui;
}
void HelpWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
writeSettings();
}
void HelpWindow::readSettings()
{
QSettings settings;
if (settings.value("Main/SaveRestorePositions", false).toBool())
{
resize(settings.value("HelpViewer/WindowSize", QSize(600, 700)).toSize());
move(settings.value("HelpViewer/WindowPos", QPoint(50, 50)).toPoint());
}
}
void HelpWindow::writeSettings()
{
QSettings settings;
if (settings.value("Main/SaveRestorePositions", false).toBool())
{
settings.setValue("HelpViewer/WindowSize", size());
settings.setValue("HelpViewer/WindowPos", pos());
}
}
HelpWindow* HelpWindow::getRef()
{
if (!self)
{
self = new HelpWindow();
}
return self;
}
void HelpWindow::showHelp(QString help)
{
if (m_helpEngine) {
qDebug() << "Searching for " << help;
QByteArray helpData = m_helpEngine->fileData(QUrl("qthelp://org.sphinx.savvycan.181/doc/" + help));
ui->textHelp->setText(helpData);
}
else
{
qDebug() << "Help engine not loaded!";
}
readSettings();
self->show();
}
/*
QVariant HelpBrowser::loadResource(int type, const QUrl &name)
{
QByteArray ba;
if (type < 4 && m_helpEngine) {
QUrl url(name);
if (name.isRelative())
url = source().resolved(url);
ba = m_helpEngine->fileData(url);
}
return ba;
}
*/
+31
View File
@@ -0,0 +1,31 @@
#ifndef HELPWINDOW_H
#define HELPWINDOW_H
#include <QDialog>
#include <QtHelp>
namespace Ui {
class HelpWindow;
}
class HelpWindow : public QDialog
{
Q_OBJECT
public:
explicit HelpWindow(QWidget *parent = 0);
~HelpWindow();
void showHelp(QString help);
static HelpWindow *getRef();
private:
void readSettings();
void writeSettings();
void closeEvent(QCloseEvent *event);
Ui::HelpWindow *ui;
static HelpWindow *self;
QHelpEngineCore *m_helpEngine;
};
#endif // HELPWINDOW_H
+24
View File
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>HelpWindow</class>
<widget class="QDialog" name="HelpWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>600</width>
<height>700</height>
</rect>
</property>
<property name="windowTitle">
<string>SavvyCAN Help</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QTextBrowser" name="textHelp"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+22
View File
@@ -1,5 +1,6 @@
#include "mainsettingsdialog.h" #include "mainsettingsdialog.h"
#include "ui_mainsettingsdialog.h" #include "ui_mainsettingsdialog.h"
#include "helpwindow.h"
MainSettingsDialog::MainSettingsDialog(QWidget *parent) : MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -73,6 +74,7 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
connect(ui->cbUseFiltered, SIGNAL(toggled(bool)), this, SLOT(updateSettings())); connect(ui->cbUseFiltered, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
connect(ui->lineClockFormat, SIGNAL(editingFinished()), this, SLOT(updateSettings())); connect(ui->lineClockFormat, SIGNAL(editingFinished()), this, SLOT(updateSettings()));
connect(ui->cbUseOpenGL, SIGNAL(toggled(bool)), this, SLOT(updateSettings())); connect(ui->cbUseOpenGL, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
installEventFilter(this);
} }
MainSettingsDialog::~MainSettingsDialog() MainSettingsDialog::~MainSettingsDialog()
@@ -84,9 +86,29 @@ MainSettingsDialog::~MainSettingsDialog()
void MainSettingsDialog::closeEvent(QCloseEvent *event) void MainSettingsDialog::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
settings->sync(); settings->sync();
} }
bool MainSettingsDialog::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("preferences.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void MainSettingsDialog::updateSettings() void MainSettingsDialog::updateSettings()
{ {
settings->setValue("Main/UseHex", ui->cbDisplayHex->isChecked()); settings->setValue("Main/UseHex", ui->cbDisplayHex->isChecked());
+1
View File
@@ -27,6 +27,7 @@ private:
QSettings *settings; QSettings *settings;
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // MAINSETTINGSDIALOG_H #endif // MAINSETTINGSDIALOG_H
+23
View File
@@ -6,6 +6,7 @@
#include <QtSerialPort/QSerialPortInfo> #include <QtSerialPort/QSerialPortInfo>
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
#include "connections/connectionwindow.h" #include "connections/connectionwindow.h"
#include "helpwindow.h"
#include "utility.h" #include "utility.h"
/* /*
@@ -130,6 +131,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->actionSignal_Viewer, &QAction::triggered, this, &MainWindow::showSignalViewer); connect(ui->actionSignal_Viewer, &QAction::triggered, this, &MainWindow::showSignalViewer);
connect(ui->actionSave_Continuous_Logfile, &QAction::triggered, this, &MainWindow::handleContinousLogging); connect(ui->actionSave_Continuous_Logfile, &QAction::triggered, this, &MainWindow::handleContinousLogging);
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames); connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
lbStatusConnected.setText(tr("Connected to 0 buses")); lbStatusConnected.setText(tr("Connected to 0 buses"));
@@ -171,6 +173,7 @@ MainWindow::MainWindow(QWidget *parent) :
connectionWindow = new ConnectionWindow(); connectionWindow = new ConnectionWindow();
connect(this, SIGNAL(suspendCapturing(bool)), connectionWindow, SLOT(setSuspendAll(bool))); connect(this, SIGNAL(suspendCapturing(bool)), connectionWindow, SLOT(setSuspendAll(bool)));
installEventFilter(this);
} }
MainWindow::~MainWindow() MainWindow::~MainWindow()
@@ -235,10 +238,30 @@ void MainWindow::exitApp()
void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
writeSettings(); writeSettings();
exitApp(); exitApp();
} }
bool MainWindow::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("mainscreen.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void MainWindow::updateSettings() void MainWindow::updateSettings()
{ {
readUpdateableSettings(); readUpdateableSettings();
+1
View File
@@ -176,6 +176,7 @@ private:
void killWindow(QDialog *win); void killWindow(QDialog *win);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // MAINWINDOW_H #endif // MAINWINDOW_H
+21
View File
@@ -1,6 +1,7 @@
#include "discretestatewindow.h" #include "discretestatewindow.h"
#include "ui_discretestatewindow.h" #include "ui_discretestatewindow.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
DiscreteStateWindow::DiscreteStateWindow(const QVector<CANFrame> *frames, QWidget *parent) : DiscreteStateWindow::DiscreteStateWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -55,10 +56,12 @@ DiscreteStateWindow::DiscreteStateWindow(const QVector<CANFrame> *frames, QWidge
}); });
refreshFilterList(); refreshFilterList();
installEventFilter(this);
} }
DiscreteStateWindow::~DiscreteStateWindow() DiscreteStateWindow::~DiscreteStateWindow()
{ {
removeEventFilter(this);
timer->stop(); timer->stop();
for (int i = 0; i < stateFrames.count(); i++) for (int i = 0; i < stateFrames.count(); i++)
@@ -71,6 +74,24 @@ DiscreteStateWindow::~DiscreteStateWindow()
delete ui; delete ui;
} }
bool DiscreteStateWindow::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("discretestate.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void DiscreteStateWindow::typeChanged() void DiscreteStateWindow::typeChanged()
{ {
if (ui->rbLogged->isChecked()) if (ui->rbLogged->isChecked())
+1
View File
@@ -53,6 +53,7 @@ private:
void refreshFilterList(); void refreshFilterList();
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void updateStateLabel(); void updateStateLabel();
+22 -1
View File
@@ -1,6 +1,6 @@
#include "filecomparatorwindow.h" #include "filecomparatorwindow.h"
#include "ui_filecomparatorwindow.h" #include "ui_filecomparatorwindow.h"
#include "helpwindow.h"
#include <QSettings> #include <QSettings>
FileComparatorWindow::FileComparatorWindow(QWidget *parent) : FileComparatorWindow::FileComparatorWindow(QWidget *parent) :
@@ -16,10 +16,13 @@ FileComparatorWindow::FileComparatorWindow(QWidget *parent) :
ui->lblFirstFile->setText(""); ui->lblFirstFile->setText("");
ui->lblRefFrames->setText("0"); ui->lblRefFrames->setText("0");
installEventFilter(this);
} }
FileComparatorWindow::~FileComparatorWindow() FileComparatorWindow::~FileComparatorWindow()
{ {
removeEventFilter(this);
delete ui; delete ui;
} }
@@ -34,6 +37,24 @@ void FileComparatorWindow::closeEvent(QCloseEvent *event)
writeSettings(); writeSettings();
} }
bool FileComparatorWindow::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("filecomparison.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void FileComparatorWindow::readSettings() void FileComparatorWindow::readSettings()
{ {
QSettings settings; QSettings settings;
+1
View File
@@ -43,6 +43,7 @@ private:
void calculateDetails(); void calculateDetails();
void showEvent(QShowEvent *); void showEvent(QShowEvent *);
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
}; };
+4
View File
@@ -1,6 +1,7 @@
#include "flowviewwindow.h" #include "flowviewwindow.h"
#include "ui_flowviewwindow.h" #include "ui_flowviewwindow.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
const QColor FlowViewWindow::graphColors[8] = {Qt::blue, Qt::green, Qt::black, Qt::red, //0 1 2 3 const QColor FlowViewWindow::graphColors[8] = {Qt::blue, Qt::green, Qt::black, Qt::red, //0 1 2 3
Qt::gray, Qt::yellow, Qt::cyan, Qt::darkMagenta}; //4 5 6 7 Qt::gray, Qt::yellow, Qt::cyan, Qt::darkMagenta}; //4 5 6 7
@@ -193,6 +194,9 @@ bool FlowViewWindow::eventFilter(QObject *obj, QEvent *event)
case Qt::Key_Y: case Qt::Key_Y:
btnFwdOneClick(); btnFwdOneClick();
break; break;
case Qt::Key_F1:
HelpWindow::getRef()->showHelp("flowview.html");
break;
} }
return true; return true;
} else { } else {
+21
View File
@@ -1,6 +1,7 @@
#include "frameinfowindow.h" #include "frameinfowindow.h"
#include "ui_frameinfowindow.h" #include "ui_frameinfowindow.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
#include <QtDebug> #include <QtDebug>
FrameInfoWindow::FrameInfoWindow(const QVector<CANFrame> *frames, QWidget *parent) : FrameInfoWindow::FrameInfoWindow(const QVector<CANFrame> *frames, QWidget *parent) :
@@ -42,6 +43,7 @@ FrameInfoWindow::FrameInfoWindow(const QVector<CANFrame> *frames, QWidget *paren
ui->graphHistogram->setAntialiasedElements(QCP::aeNone); ui->graphHistogram->setAntialiasedElements(QCP::aeNone);
} }
installEventFilter(this);
} }
void FrameInfoWindow::showEvent(QShowEvent* event) void FrameInfoWindow::showEvent(QShowEvent* event)
@@ -56,8 +58,27 @@ void FrameInfoWindow::showEvent(QShowEvent* event)
} }
} }
bool FrameInfoWindow::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("framedetails.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
FrameInfoWindow::~FrameInfoWindow() FrameInfoWindow::~FrameInfoWindow()
{ {
removeEventFilter(this);
delete ui; delete ui;
} }
+1
View File
@@ -36,6 +36,7 @@ private:
void refreshIDList(); void refreshIDList();
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
void dumpNode(QTreeWidgetItem* item, QFile *file, int indent); void dumpNode(QTreeWidgetItem* item, QFile *file, int indent);
+21
View File
@@ -3,6 +3,7 @@
#include "utility.h" #include "utility.h"
#include <QDebug> #include <QDebug>
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
FuzzingWindow::FuzzingWindow(const QVector<CANFrame> *frames, QWidget *parent) : FuzzingWindow::FuzzingWindow(const QVector<CANFrame> *frames, QWidget *parent) :
@@ -41,13 +42,33 @@ FuzzingWindow::FuzzingWindow(const QVector<CANFrame> *frames, QWidget *parent) :
for (int n = 0; n < numBuses; n++) ui->cbBuses->addItem(QString::number(n)); for (int n = 0; n < numBuses; n++) ui->cbBuses->addItem(QString::number(n));
ui->cbBuses->addItem(tr("All")); ui->cbBuses->addItem(tr("All"));
installEventFilter(this);
} }
FuzzingWindow::~FuzzingWindow() FuzzingWindow::~FuzzingWindow()
{ {
removeEventFilter(this);
delete ui; delete ui;
} }
bool FuzzingWindow::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("fuzzingwindow.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void FuzzingWindow::updatedFrames(int numFrames) void FuzzingWindow::updatedFrames(int numFrames)
{ {
int id; int id;
+1
View File
@@ -64,6 +64,7 @@ private:
void calcNextID(); void calcNextID();
void calcNextBitPattern(); void calcNextBitPattern();
void redrawGrid(); void redrawGrid();
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // FUZZINGWINDOW_H #endif // FUZZINGWINDOW_H
+4
View File
@@ -2,6 +2,7 @@
#include "ui_graphingwindow.h" #include "ui_graphingwindow.h"
#include "newgraphdialog.h" #include "newgraphdialog.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
#include <QDebug> #include <QDebug>
GraphingWindow::GraphingWindow(const QVector<CANFrame> *frames, QWidget *parent) : GraphingWindow::GraphingWindow(const QVector<CANFrame> *frames, QWidget *parent) :
@@ -397,6 +398,9 @@ bool GraphingWindow::eventFilter(QObject *obj, QEvent *event)
case Qt::Key_Minus: case Qt::Key_Minus:
zoomOut(); zoomOut();
break; break;
case Qt::Key_F1:
HelpWindow::getRef()->showHelp("graphwindow.html");
break;
} }
return true; return true;
} else if (event->type() == QEvent::TouchBegin) } else if (event->type() == QEvent::TouchBegin)
+21
View File
@@ -1,6 +1,7 @@
#include "isotp_interpreterwindow.h" #include "isotp_interpreterwindow.h"
#include "ui_isotp_interpreterwindow.h" #include "ui_isotp_interpreterwindow.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "helpwindow.h"
ISOTP_InterpreterWindow::ISOTP_InterpreterWindow(const QVector<CANFrame> *frames, QWidget *parent) : ISOTP_InterpreterWindow::ISOTP_InterpreterWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -60,14 +61,34 @@ void ISOTP_InterpreterWindow::showEvent(QShowEvent* event)
QDialog::showEvent(event); QDialog::showEvent(event);
readSettings(); readSettings();
decoder->updatedFrames(-2); decoder->updatedFrames(-2);
installEventFilter(this);
} }
void ISOTP_InterpreterWindow::closeEvent(QCloseEvent *event) void ISOTP_InterpreterWindow::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
writeSettings(); writeSettings();
} }
bool ISOTP_InterpreterWindow::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("isotp_decoder.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void ISOTP_InterpreterWindow::readSettings() void ISOTP_InterpreterWindow::readSettings()
{ {
QSettings settings; QSettings settings;
+1
View File
@@ -43,6 +43,7 @@ private:
QHash<int, bool> idFilters; QHash<int, bool> idFilters;
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
+22
View File
@@ -2,6 +2,7 @@
#include "ui_newgraphdialog.h" #include "ui_newgraphdialog.h"
#include <QColorDialog> #include <QColorDialog>
#include "utility.h" #include "utility.h"
#include "helpwindow.h"
NewGraphDialog::NewGraphDialog(DBCHandler *handler, QWidget *parent) : NewGraphDialog::NewGraphDialog(DBCHandler *handler, QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -33,10 +34,13 @@ NewGraphDialog::NewGraphDialog(DBCHandler *handler, QWidget *parent) :
dataLen = 1; dataLen = 1;
loadMessages(); loadMessages();
installEventFilter(this);
} }
NewGraphDialog::~NewGraphDialog() NewGraphDialog::~NewGraphDialog()
{ {
removeEventFilter(this);
delete ui; delete ui;
} }
@@ -48,6 +52,24 @@ void NewGraphDialog::showEvent(QShowEvent* event)
qDebug() << "S" << ui->gridData->geometry(); qDebug() << "S" << ui->gridData->geometry();
} }
bool NewGraphDialog::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("graphsetup.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void NewGraphDialog::addButtonClicked() void NewGraphDialog::addButtonClicked()
{ {
accept(); accept();
+2
View File
@@ -32,6 +32,8 @@ private slots:
void copySignalToParamsUI(); void copySignalToParamsUI();
private: private:
bool eventFilter(QObject *obj, QEvent *event);
Ui::NewGraphDialog *ui; Ui::NewGraphDialog *ui;
DBCHandler *dbcHandler; DBCHandler *dbcHandler;
int startBit, dataLen; int startBit, dataLen;
+22
View File
@@ -2,6 +2,7 @@
#include "ui_rangestatewindow.h" #include "ui_rangestatewindow.h"
#include "mainwindow.h" #include "mainwindow.h"
#include "utility.h" #include "utility.h"
#include "helpwindow.h"
RangeStateWindow::RangeStateWindow(const QVector<CANFrame> *frames, QWidget *parent) : RangeStateWindow::RangeStateWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -88,14 +89,35 @@ void RangeStateWindow::showEvent(QShowEvent* event)
readSettings(); readSettings();
refreshFilterList(); refreshFilterList();
installEventFilter(this);
} }
void RangeStateWindow::closeEvent(QCloseEvent *event) void RangeStateWindow::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
writeSettings(); writeSettings();
} }
bool RangeStateWindow::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("rangestate.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void RangeStateWindow::readSettings() void RangeStateWindow::readSettings()
{ {
QSettings settings; QSettings settings;
+1
View File
@@ -36,6 +36,7 @@ private:
void signalsFactory(); void signalsFactory();
bool processSignal(int startBit, int bitLength, int sensitivity, bool bigEndian, bool isSigned); bool processSignal(int startBit, int bitLength, int sensitivity, bool bigEndian, bool isSigned);
void createGraph(QVector<int> values); void createGraph(QVector<int> values);
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // RANGESTATEWINDOW_H #endif // RANGESTATEWINDOW_H
+20 -1
View File
@@ -2,6 +2,7 @@
#include <QListWidgetItem> #include <QListWidgetItem>
#include "snifferwindow.h" #include "snifferwindow.h"
#include "ui_snifferwindow.h" #include "ui_snifferwindow.h"
#include "helpwindow.h"
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
SnifferWindow::SnifferWindow(QWidget *parent) : SnifferWindow::SnifferWindow(QWidget *parent) :
@@ -50,7 +51,7 @@ void SnifferWindow::showEvent(QShowEvent* event)
QDialog::showEvent(event); QDialog::showEvent(event);
connect(CANConManager::getInstance(), &CANConManager::framesReceived, &mModel, &SnifferModel::update); connect(CANConManager::getInstance(), &CANConManager::framesReceived, &mModel, &SnifferModel::update);
mTimer.start(); mTimer.start();
installEventFilter(this);
qDebug() << "show"; qDebug() << "show";
} }
@@ -69,8 +70,26 @@ void SnifferWindow::closeEvent(QCloseEvent *event)
mMap.clear(); mMap.clear();
/* reset filtering */ /* reset filtering */
mFilter = false; mFilter = false;
removeEventFilter(this);
} }
bool SnifferWindow::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("sniffer.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void SnifferWindow::update() void SnifferWindow::update()
{ {
+1
View File
@@ -45,6 +45,7 @@ public slots:
private: private:
void filter(bool pFilter); void filter(bool pFilter);
bool eventFilter(QObject *obj, QEvent *event);
Ui::snifferWindow* ui; Ui::snifferWindow* ui;
SnifferModel mModel; SnifferModel mModel;
+21
View File
@@ -4,6 +4,7 @@
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
#include "bus_protocols/uds_handler.h" #include "bus_protocols/uds_handler.h"
#include "utility.h" #include "utility.h"
#include "helpwindow.h"
UDSScanWindow::UDSScanWindow(const QVector<CANFrame> *frames, QWidget *parent) : UDSScanWindow::UDSScanWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -39,16 +40,36 @@ UDSScanWindow::UDSScanWindow(const QVector<CANFrame> *frames, QWidget *parent) :
int numBuses = CANConManager::getInstance()->getNumBuses(); int numBuses = CANConManager::getInstance()->getNumBuses();
for (int n = 0; n < numBuses; n++) ui->cbBuses->addItem(QString::number(n)); for (int n = 0; n < numBuses; n++) ui->cbBuses->addItem(QString::number(n));
installEventFilter(this);
} }
UDSScanWindow::~UDSScanWindow() UDSScanWindow::~UDSScanWindow()
{ {
removeEventFilter(this);
delete ui; delete ui;
waitTimer->stop(); waitTimer->stop();
delete waitTimer; delete waitTimer;
delete udsHandler; delete udsHandler;
} }
bool UDSScanWindow::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("uds_scanner.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void UDSScanWindow::adaptiveToggled() void UDSScanWindow::adaptiveToggled()
{ {
if (ui->cbAllowAdaptiveOffset->isChecked()) ui->spinReplyOffset->setEnabled(false); if (ui->cbAllowAdaptiveOffset->isChecked()) ui->spinReplyOffset->setEnabled(false);
+1
View File
@@ -51,5 +51,6 @@ private:
void sendOnBuses(UDS_MESSAGE frame, int buses); void sendOnBuses(UDS_MESSAGE frame, int buses);
void setupNodes(); void setupNodes();
void dumpNode(QTreeWidgetItem* item, QFile *file, int indent); void dumpNode(QTreeWidgetItem* item, QFile *file, int indent);
bool eventFilter(QObject *obj, QEvent *event);
}; };
#endif // UDSSCANWINDOW_H #endif // UDSSCANWINDOW_H
+26 -5
View File
@@ -6,6 +6,7 @@
#include <QSettings> #include <QSettings>
#include "connections/canconmanager.h" #include "connections/canconmanager.h"
#include "helpwindow.h"
ScriptingWindow::ScriptingWindow(const QVector<CANFrame> *frames, QWidget *parent) : ScriptingWindow::ScriptingWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent), QDialog(parent),
@@ -88,12 +89,37 @@ void ScriptingWindow::updatedValue(int row, int col)
} }
} }
void ScriptingWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
installEventFilter(this);
}
void ScriptingWindow::closeEvent(QCloseEvent *event) void ScriptingWindow::closeEvent(QCloseEvent *event)
{ {
Q_UNUSED(event); Q_UNUSED(event);
removeEventFilter(this);
writeSettings(); writeSettings();
} }
bool ScriptingWindow::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("scriptingwindow.html");
break;
}
return true;
} else {
// standard event processing
return QObject::eventFilter(obj, event);
}
return false;
}
void ScriptingWindow::readSettings() void ScriptingWindow::readSettings()
{ {
QSettings settings; QSettings settings;
@@ -115,11 +141,6 @@ void ScriptingWindow::writeSettings()
} }
} }
void ScriptingWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
}
void ScriptingWindow::changeCurrentScript() void ScriptingWindow::changeCurrentScript()
{ {
ui->tableVariables->clear(); ui->tableVariables->clear();
+1
View File
@@ -49,6 +49,7 @@ private:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
void readSettings(); void readSettings();
void writeSettings(); void writeSettings();
bool eventFilter(QObject *obj, QEvent *event);
Ui::ScriptingWindow *ui; Ui::ScriptingWindow *ui;
JSEdit *editor; JSEdit *editor;
+1
View File
@@ -1,5 +1,6 @@
#include "signalviewerwindow.h" #include "signalviewerwindow.h"
#include "ui_signalviewerwindow.h" #include "ui_signalviewerwindow.h"
#include "helpwindow.h"
SignalViewerWindow::SignalViewerWindow(QWidget *parent) : SignalViewerWindow::SignalViewerWindow(QWidget *parent) :
QDialog(parent), QDialog(parent),