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:
+26
-5
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user