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
@@ -63,7 +63,8 @@ SOURCES += main.cpp\
bus_protocols/j1939_handler.cpp \
bus_protocols/uds_handler.cpp \
jsedit.cpp \
frameplaybackobject.cpp
frameplaybackobject.cpp \
helpwindow.cpp
HEADERS += mainwindow.h \
can_structs.h \
@@ -117,7 +118,8 @@ HEADERS += mainwindow.h \
bus_protocols/uds_handler.h \
bus_protocols/isotp_message.h \
jsedit.h \
frameplaybackobject.h
frameplaybackobject.h \
helpwindow.h
FORMS += ui/candatagrid.ui \
ui/connectionwindow.ui \
@@ -143,7 +145,8 @@ FORMS += ui/candatagrid.ui \
ui/snifferwindow.ui \
ui/udsscanwindow.ui \
ui/bisectwindow.ui \
ui/signalviewerwindow.ui
ui/signalviewerwindow.ui \
helpwindow.ui
DISTFILES +=
+21
View File
@@ -3,6 +3,7 @@
#include "mainwindow.h"
#include "framefileio.h"
#include "helpwindow.h"
#include <QDebug>
#include <algorithm>
@@ -23,10 +24,12 @@ BisectWindow::BisectWindow(const QVector<CANFrame> *frames, QWidget *parent) :
connect(ui->slidePercentage, &QSlider::sliderReleased, this, &BisectWindow::updatePercentText);
connect(ui->editFrameNumber, &QLineEdit::editingFinished, this, &BisectWindow::updateFrameNumSlider);
connect(ui->editPercentage, &QLineEdit::editingFinished, this, &BisectWindow::updatePercentSlider);
installEventFilter(this);
}
BisectWindow::~BisectWindow()
{
removeEventFilter(this);
delete ui;
}
@@ -39,6 +42,24 @@ void BisectWindow::showEvent(QShowEvent* event)
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()
{
int id;
+1
View File
@@ -39,6 +39,7 @@ private:
void refreshIDList();
void refreshFrameNumbers();
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // BISECTWINDOW_H
+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;
+1
View File
@@ -80,6 +80,7 @@ private:
void saveConnections();
void showEvent(QShowEvent *);
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings();
void writeSettings();
};
+21
View File
@@ -5,6 +5,7 @@
#include <QMenu>
#include <QSettings>
#include "connections/canconmanager.h"
#include "helpwindow.h"
/*
* Notes about new functionality:
@@ -93,14 +94,34 @@ FramePlaybackWindow::~FramePlaybackWindow()
void FramePlaybackWindow::showEvent(QShowEvent *)
{
readSettings();
installEventFilter(this);
}
void FramePlaybackWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
removeEventFilter(this);
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()
{
QSettings settings;
+1
View File
@@ -66,6 +66,7 @@ private:
void readSettings();
void writeSettings();
void calculateWhichBus();
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // FRAMEPLAYBACKWINDOW_H
+21
View File
@@ -5,6 +5,7 @@
#include <QFileDialog>
#include <QDebug>
#include "mainwindow.h"
#include "helpwindow.h"
#include "connections/canconmanager.h"
/*
@@ -51,16 +52,36 @@ FrameSenderWindow::FrameSenderWindow(const QVector<CANFrame> *frames, QWidget *p
intervalTimer->start();
elapsedTimer.start();
installEventFilter(this);
}
FrameSenderWindow::~FrameSenderWindow()
{
removeEventFilter(this);
delete ui;
intervalTimer->stop();
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()
{
int row = ui->tableSender->rowCount();
+1
View File
@@ -53,6 +53,7 @@ private:
void processCellChange(int line, int col);
void buildFrameCache();
void processIncomingFrame(CANFrame *frame);
bool eventFilter(QObject *obj, QEvent *event);
};
#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 "ui_mainsettingsdialog.h"
#include "helpwindow.h"
MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
QDialog(parent),
@@ -73,6 +74,7 @@ MainSettingsDialog::MainSettingsDialog(QWidget *parent) :
connect(ui->cbUseFiltered, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
connect(ui->lineClockFormat, SIGNAL(editingFinished()), this, SLOT(updateSettings()));
connect(ui->cbUseOpenGL, SIGNAL(toggled(bool)), this, SLOT(updateSettings()));
installEventFilter(this);
}
MainSettingsDialog::~MainSettingsDialog()
@@ -84,9 +86,29 @@ MainSettingsDialog::~MainSettingsDialog()
void MainSettingsDialog::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
removeEventFilter(this);
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()
{
settings->setValue("Main/UseHex", ui->cbDisplayHex->isChecked());
+1
View File
@@ -27,6 +27,7 @@ private:
QSettings *settings;
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // MAINSETTINGSDIALOG_H
+23
View File
@@ -6,6 +6,7 @@
#include <QtSerialPort/QSerialPortInfo>
#include "connections/canconmanager.h"
#include "connections/connectionwindow.h"
#include "helpwindow.h"
#include "utility.h"
/*
@@ -130,6 +131,7 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->actionSignal_Viewer, &QAction::triggered, this, &MainWindow::showSignalViewer);
connect(ui->actionSave_Continuous_Logfile, &QAction::triggered, this, &MainWindow::handleContinousLogging);
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
lbStatusConnected.setText(tr("Connected to 0 buses"));
@@ -171,6 +173,7 @@ MainWindow::MainWindow(QWidget *parent) :
connectionWindow = new ConnectionWindow();
connect(this, SIGNAL(suspendCapturing(bool)), connectionWindow, SLOT(setSuspendAll(bool)));
installEventFilter(this);
}
MainWindow::~MainWindow()
@@ -235,10 +238,30 @@ void MainWindow::exitApp()
void MainWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
removeEventFilter(this);
writeSettings();
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()
{
readUpdateableSettings();
+1
View File
@@ -176,6 +176,7 @@ private:
void killWindow(QDialog *win);
void readSettings();
void writeSettings();
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // MAINWINDOW_H
+21
View File
@@ -1,6 +1,7 @@
#include "discretestatewindow.h"
#include "ui_discretestatewindow.h"
#include "mainwindow.h"
#include "helpwindow.h"
DiscreteStateWindow::DiscreteStateWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent),
@@ -55,10 +56,12 @@ DiscreteStateWindow::DiscreteStateWindow(const QVector<CANFrame> *frames, QWidge
});
refreshFilterList();
installEventFilter(this);
}
DiscreteStateWindow::~DiscreteStateWindow()
{
removeEventFilter(this);
timer->stop();
for (int i = 0; i < stateFrames.count(); i++)
@@ -71,6 +74,24 @@ DiscreteStateWindow::~DiscreteStateWindow()
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()
{
if (ui->rbLogged->isChecked())
+1
View File
@@ -53,6 +53,7 @@ private:
void refreshFilterList();
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings();
void writeSettings();
void updateStateLabel();
+22 -1
View File
@@ -1,6 +1,6 @@
#include "filecomparatorwindow.h"
#include "ui_filecomparatorwindow.h"
#include "helpwindow.h"
#include <QSettings>
FileComparatorWindow::FileComparatorWindow(QWidget *parent) :
@@ -16,10 +16,13 @@ FileComparatorWindow::FileComparatorWindow(QWidget *parent) :
ui->lblFirstFile->setText("");
ui->lblRefFrames->setText("0");
installEventFilter(this);
}
FileComparatorWindow::~FileComparatorWindow()
{
removeEventFilter(this);
delete ui;
}
@@ -34,6 +37,24 @@ void FileComparatorWindow::closeEvent(QCloseEvent *event)
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()
{
QSettings settings;
+1
View File
@@ -43,6 +43,7 @@ private:
void calculateDetails();
void showEvent(QShowEvent *);
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings();
void writeSettings();
};
+4
View File
@@ -1,6 +1,7 @@
#include "flowviewwindow.h"
#include "ui_flowviewwindow.h"
#include "mainwindow.h"
#include "helpwindow.h"
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
@@ -193,6 +194,9 @@ bool FlowViewWindow::eventFilter(QObject *obj, QEvent *event)
case Qt::Key_Y:
btnFwdOneClick();
break;
case Qt::Key_F1:
HelpWindow::getRef()->showHelp("flowview.html");
break;
}
return true;
} else {
+21
View File
@@ -1,6 +1,7 @@
#include "frameinfowindow.h"
#include "ui_frameinfowindow.h"
#include "mainwindow.h"
#include "helpwindow.h"
#include <QtDebug>
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);
}
installEventFilter(this);
}
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()
{
removeEventFilter(this);
delete ui;
}
+1
View File
@@ -36,6 +36,7 @@ private:
void refreshIDList();
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings();
void writeSettings();
void dumpNode(QTreeWidgetItem* item, QFile *file, int indent);
+21
View File
@@ -3,6 +3,7 @@
#include "utility.h"
#include <QDebug>
#include "mainwindow.h"
#include "helpwindow.h"
#include "connections/canconmanager.h"
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));
ui->cbBuses->addItem(tr("All"));
installEventFilter(this);
}
FuzzingWindow::~FuzzingWindow()
{
removeEventFilter(this);
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)
{
int id;
+1
View File
@@ -64,6 +64,7 @@ private:
void calcNextID();
void calcNextBitPattern();
void redrawGrid();
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // FUZZINGWINDOW_H
+4
View File
@@ -2,6 +2,7 @@
#include "ui_graphingwindow.h"
#include "newgraphdialog.h"
#include "mainwindow.h"
#include "helpwindow.h"
#include <QDebug>
GraphingWindow::GraphingWindow(const QVector<CANFrame> *frames, QWidget *parent) :
@@ -397,6 +398,9 @@ bool GraphingWindow::eventFilter(QObject *obj, QEvent *event)
case Qt::Key_Minus:
zoomOut();
break;
case Qt::Key_F1:
HelpWindow::getRef()->showHelp("graphwindow.html");
break;
}
return true;
} else if (event->type() == QEvent::TouchBegin)
+21
View File
@@ -1,6 +1,7 @@
#include "isotp_interpreterwindow.h"
#include "ui_isotp_interpreterwindow.h"
#include "mainwindow.h"
#include "helpwindow.h"
ISOTP_InterpreterWindow::ISOTP_InterpreterWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent),
@@ -60,14 +61,34 @@ void ISOTP_InterpreterWindow::showEvent(QShowEvent* event)
QDialog::showEvent(event);
readSettings();
decoder->updatedFrames(-2);
installEventFilter(this);
}
void ISOTP_InterpreterWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
removeEventFilter(this);
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()
{
QSettings settings;
+1
View File
@@ -43,6 +43,7 @@ private:
QHash<int, bool> idFilters;
void closeEvent(QCloseEvent *event);
bool eventFilter(QObject *obj, QEvent *event);
void readSettings();
void writeSettings();
+22
View File
@@ -2,6 +2,7 @@
#include "ui_newgraphdialog.h"
#include <QColorDialog>
#include "utility.h"
#include "helpwindow.h"
NewGraphDialog::NewGraphDialog(DBCHandler *handler, QWidget *parent) :
QDialog(parent),
@@ -33,10 +34,13 @@ NewGraphDialog::NewGraphDialog(DBCHandler *handler, QWidget *parent) :
dataLen = 1;
loadMessages();
installEventFilter(this);
}
NewGraphDialog::~NewGraphDialog()
{
removeEventFilter(this);
delete ui;
}
@@ -48,6 +52,24 @@ void NewGraphDialog::showEvent(QShowEvent* event)
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()
{
accept();
+2
View File
@@ -32,6 +32,8 @@ private slots:
void copySignalToParamsUI();
private:
bool eventFilter(QObject *obj, QEvent *event);
Ui::NewGraphDialog *ui;
DBCHandler *dbcHandler;
int startBit, dataLen;
+22
View File
@@ -2,6 +2,7 @@
#include "ui_rangestatewindow.h"
#include "mainwindow.h"
#include "utility.h"
#include "helpwindow.h"
RangeStateWindow::RangeStateWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent),
@@ -88,14 +89,35 @@ void RangeStateWindow::showEvent(QShowEvent* event)
readSettings();
refreshFilterList();
installEventFilter(this);
}
void RangeStateWindow::closeEvent(QCloseEvent *event)
{
Q_UNUSED(event);
removeEventFilter(this);
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()
{
QSettings settings;
+1
View File
@@ -36,6 +36,7 @@ private:
void signalsFactory();
bool processSignal(int startBit, int bitLength, int sensitivity, bool bigEndian, bool isSigned);
void createGraph(QVector<int> values);
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // RANGESTATEWINDOW_H
+20 -1
View File
@@ -2,6 +2,7 @@
#include <QListWidgetItem>
#include "snifferwindow.h"
#include "ui_snifferwindow.h"
#include "helpwindow.h"
#include "connections/canconmanager.h"
SnifferWindow::SnifferWindow(QWidget *parent) :
@@ -50,7 +51,7 @@ void SnifferWindow::showEvent(QShowEvent* event)
QDialog::showEvent(event);
connect(CANConManager::getInstance(), &CANConManager::framesReceived, &mModel, &SnifferModel::update);
mTimer.start();
installEventFilter(this);
qDebug() << "show";
}
@@ -69,8 +70,26 @@ void SnifferWindow::closeEvent(QCloseEvent *event)
mMap.clear();
/* reset filtering */
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()
{
+1
View File
@@ -45,6 +45,7 @@ public slots:
private:
void filter(bool pFilter);
bool eventFilter(QObject *obj, QEvent *event);
Ui::snifferWindow* ui;
SnifferModel mModel;
+21
View File
@@ -4,6 +4,7 @@
#include "connections/canconmanager.h"
#include "bus_protocols/uds_handler.h"
#include "utility.h"
#include "helpwindow.h"
UDSScanWindow::UDSScanWindow(const QVector<CANFrame> *frames, QWidget *parent) :
QDialog(parent),
@@ -39,16 +40,36 @@ UDSScanWindow::UDSScanWindow(const QVector<CANFrame> *frames, QWidget *parent) :
int numBuses = CANConManager::getInstance()->getNumBuses();
for (int n = 0; n < numBuses; n++) ui->cbBuses->addItem(QString::number(n));
installEventFilter(this);
}
UDSScanWindow::~UDSScanWindow()
{
removeEventFilter(this);
delete ui;
waitTimer->stop();
delete waitTimer;
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()
{
if (ui->cbAllowAdaptiveOffset->isChecked()) ui->spinReplyOffset->setEnabled(false);
+1
View File
@@ -51,5 +51,6 @@ private:
void sendOnBuses(UDS_MESSAGE frame, int buses);
void setupNodes();
void dumpNode(QTreeWidgetItem* item, QFile *file, int indent);
bool eventFilter(QObject *obj, QEvent *event);
};
#endif // UDSSCANWINDOW_H
+26 -5
View File
@@ -6,6 +6,7 @@
#include <QSettings>
#include "connections/canconmanager.h"
#include "helpwindow.h"
ScriptingWindow::ScriptingWindow(const QVector<CANFrame> *frames, QWidget *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)
{
Q_UNUSED(event);
removeEventFilter(this);
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()
{
QSettings settings;
@@ -115,11 +141,6 @@ void ScriptingWindow::writeSettings()
}
}
void ScriptingWindow::showEvent(QShowEvent* event)
{
QDialog::showEvent(event);
}
void ScriptingWindow::changeCurrentScript()
{
ui->tableVariables->clear();
+1
View File
@@ -49,6 +49,7 @@ private:
void closeEvent(QCloseEvent *event);
void readSettings();
void writeSettings();
bool eventFilter(QObject *obj, QEvent *event);
Ui::ScriptingWindow *ui;
JSEdit *editor;
+1
View File
@@ -1,5 +1,6 @@
#include "signalviewerwindow.h"
#include "ui_signalviewerwindow.h"
#include "helpwindow.h"
SignalViewerWindow::SignalViewerWindow(QWidget *parent) :
QDialog(parent),