Improve UI handling, add disable option
qcpfix
Phil Taylor 2023-03-18 16:38:24 +00:00
rodzic 898d5960d8
commit eb65ae0b1c
5 zmienionych plików z 242 dodań i 135 usunięć

Wyświetl plik

@ -197,18 +197,49 @@ void controllerSetup::newDevice(USBDEVICE* dev, CONTROLLER* cntrl, QVector<BUTTO
noControllersText->hide();
QWidget* tab = new QWidget();
tab->setObjectName(dev->path);
QWidget* widget = new QWidget(tab);
QVBoxLayout* mainlayout = new QVBoxLayout();
mainlayout->setContentsMargins(0,0,0,0);
tab->setLayout(mainlayout);
QHBoxLayout* toplayout = new QHBoxLayout();
mainlayout->addLayout(toplayout);
toplayout->setContentsMargins(0,0,0,0);
QWidget* widget = new QWidget();
mainlayout->addWidget(widget);
QVBoxLayout* layout = new QVBoxLayout(widget);
layout->setContentsMargins(0,0,0,0);
QGraphicsView *view = new QGraphicsView(widget);
//mainlayout->addLayout(layout);
QCheckBox* disabled = new QCheckBox();
disabled->setText("Disable");
toplayout->addWidget(disabled);
QLabel* connectionLabel = new QLabel();
if (dev->connected) {
connectionLabel->setStyleSheet("QLabel { color : green; }");
connectionLabel->setText("Connected");
} else {
connectionLabel->setStyleSheet("QLabel { color : red; }");
connectionLabel->setText("Not Connected");
}
connectionLabel->setAlignment(Qt::AlignRight);
toplayout->addWidget(connectionLabel);
dev->message = connectionLabel;
connect(disabled, qOverload<bool>(&QCheckBox::clicked),
[dev,this,widget,connectionLabel](bool checked) { this->disableClicked(dev->path,checked,widget,connectionLabel); });
disabled->setChecked(dev->disabled);
QGraphicsView *view = new QGraphicsView();
layout->addWidget(view);
QHBoxLayout* senslayout = new QHBoxLayout(widget);
QHBoxLayout* senslayout = new QHBoxLayout();
layout->addLayout(senslayout);
QLabel* senslabel = new QLabel("Sensitivity");
senslayout->addWidget(senslabel);
QSlider *sens = new QSlider(widget);
QSlider *sens = new QSlider();
sens->setMinimum(1);
sens->setMaximum(21);
sens->setOrientation(Qt::Horizontal);
@ -218,78 +249,6 @@ void controllerSetup::newDevice(USBDEVICE* dev, CONTROLLER* cntrl, QVector<BUTTO
connect(sens, &QSlider::valueChanged,
[dev,this](int val) { this->sensitivityMoved(dev->path,val); });
if (dev->usbDevice == QuickKeys)
{
// Add QuickKeys section
QGridLayout* grid = new QGridLayout(widget);
layout->addLayout(grid);
QLabel* brightlabel = new QLabel("Brightness");
grid->addWidget(brightlabel,0,0);
QComboBox *brightness = new QComboBox(widget);
brightness->addItem("Off");
brightness->addItem("Low");
brightness->addItem("Medium");
brightness->addItem("High");
brightness->setCurrentIndex(cntrl->brightness);
grid->addWidget(brightness,1,0);
connect(brightness, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->brightnessChanged(dev->path,index); });
QLabel* speedlabel = new QLabel("Speed");
grid->addWidget(speedlabel,0,1);
QComboBox *speed = new QComboBox(widget);
speed->addItem("Fastest");
speed->addItem("Faster");
speed->addItem("Normal");
speed->addItem("Slower");
speed->addItem("Slowest");
speed->setCurrentIndex(cntrl->speed);
grid->addWidget(speed,1,1);
connect(speed, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->speedChanged(dev->path,index); });
QLabel* orientlabel = new QLabel("Orientation");
grid->addWidget(orientlabel,0,2);
QComboBox *orientation = new QComboBox(widget);
orientation->addItem("Rotate 0");
orientation->addItem("Rotate 90");
orientation->addItem("Rotate 180");
orientation->addItem("Rotate 270");
orientation->setCurrentIndex(cntrl->orientation);
grid->addWidget(orientation,1,2);
connect(orientation, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->orientationChanged(dev->path,index); });
QLabel* colorlabel = new QLabel("Dial Color");
grid->addWidget(colorlabel,0,3);
QPushButton* color = new QPushButton("Select");
grid->addWidget(color,1,3);
connect(color, &QPushButton::clicked,
[dev,this]() { this->colorPicker(dev->path); });
QLabel* timeoutlabel = new QLabel("Timeout");
grid->addWidget(timeoutlabel,0,4);
QSpinBox *timeout = new QSpinBox(widget);
timeout->setValue(cntrl->timeout);
grid->addWidget(timeout,1,4);
connect(timeout, qOverload<int>(&QSpinBox::valueChanged),
[dev,this](int index) { this->timeoutChanged(dev->path,index); });
// Finally update the device with the default values
emit programSensitivity(dev->path, cntrl->sensitivity);
emit programBrightness(dev->path,cntrl->brightness);
emit programOrientation(dev->path,cntrl->orientation);
emit programSpeed(dev->path,cntrl->speed);
emit programTimeout(dev->path,cntrl->timeout);
emit programWheelColour(dev->path, cntrl->color.red(), cntrl->color.green(), cntrl->color.blue());
}
QLabel *helpText = new QLabel(widget);
helpText->setText("<p><b>Button configuration:</b> Right-click on each button to configure it.</p><p>Top selection is command to send when button is pressed and bottom is (optional) command to send when button is released.</p>");
helpText->setAlignment(Qt::AlignCenter);
layout->addWidget(helpText);
QImage image;
switch (dev->usbDevice) {
@ -325,6 +284,79 @@ void controllerSetup::newDevice(USBDEVICE* dev, CONTROLLER* cntrl, QVector<BUTTO
connect(scene, SIGNAL(mousePressed(controllerScene *,QPoint)), this, SLOT(mousePressed(controllerScene *,QPoint)));
scene->addItem(bgImage);
QGridLayout* grid = new QGridLayout();
layout->addLayout(grid);
if (dev->usbDevice == QuickKeys)
{
// Add QuickKeys section
QLabel* brightlabel = new QLabel("Brightness");
grid->addWidget(brightlabel,0,0);
QComboBox *brightness = new QComboBox();
brightness->addItem("Off");
brightness->addItem("Low");
brightness->addItem("Medium");
brightness->addItem("High");
brightness->setCurrentIndex(cntrl->brightness);
grid->addWidget(brightness,1,0);
connect(brightness, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->brightnessChanged(dev->path,index); });
QLabel* speedlabel = new QLabel("Speed");
grid->addWidget(speedlabel,0,1);
QComboBox *speed = new QComboBox();
speed->addItem("Fastest");
speed->addItem("Faster");
speed->addItem("Normal");
speed->addItem("Slower");
speed->addItem("Slowest");
speed->setCurrentIndex(cntrl->speed);
grid->addWidget(speed,1,1);
connect(speed, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->speedChanged(dev->path,index); });
QLabel* orientlabel = new QLabel("Orientation");
grid->addWidget(orientlabel,0,2);
QComboBox *orientation = new QComboBox();
orientation->addItem("Rotate 0");
orientation->addItem("Rotate 90");
orientation->addItem("Rotate 180");
orientation->addItem("Rotate 270");
orientation->setCurrentIndex(cntrl->orientation);
grid->addWidget(orientation,1,2);
connect(orientation, qOverload<int>(&QComboBox::currentIndexChanged),
[dev,this](int index) { this->orientationChanged(dev->path,index); });
QLabel* colorlabel = new QLabel("Dial Color");
grid->addWidget(colorlabel,0,3);
QPushButton* color = new QPushButton("Select");
grid->addWidget(color,1,3);
connect(color, &QPushButton::clicked,
[dev,this]() { this->colorPicker(dev->path); });
QLabel* timeoutlabel = new QLabel("Timeout");
grid->addWidget(timeoutlabel,0,4);
QSpinBox *timeout = new QSpinBox();
timeout->setValue(cntrl->timeout);
grid->addWidget(timeout,1,4);
connect(timeout, qOverload<int>(&QSpinBox::valueChanged),
[dev,this](int index) { this->timeoutChanged(dev->path,index); });
// Finally update the device with the default values
emit programSensitivity(dev->path, cntrl->sensitivity);
emit programBrightness(dev->path,cntrl->brightness);
emit programOrientation(dev->path,cntrl->orientation);
emit programSpeed(dev->path,cntrl->speed);
emit programTimeout(dev->path,cntrl->timeout);
emit programWheelColour(dev->path, cntrl->color.red(), cntrl->color.green(), cntrl->color.blue());
}
QLabel *helpText = new QLabel();
helpText->setText("<p><b>Button configuration:</b> Right-click on each button to configure it.</p><p>Top selection is command to send when button is pressed and bottom is (optional) command to send when button is released.</p>");
helpText->setAlignment(Qt::AlignCenter);
layout->addWidget(helpText);
ui->tabWidget->addTab(tab,dev->product);
ui->tabWidget->show();
@ -420,7 +452,7 @@ void controllerSetup::newDevice(USBDEVICE* dev, CONTROLLER* cntrl, QVector<BUTTO
knobEventProxy->setWidget(knobEvent);
this->adjustSize();
//QTimer::singleShot(0, this, [this,view]() {this->resize(view->minimumSizeHint());});
}
@ -428,13 +460,6 @@ void controllerSetup::newDevice(USBDEVICE* dev, CONTROLLER* cntrl, QVector<BUTTO
}
void controllerSetup::receiveSensitivity(int val)
{
//ui->sensitivitySlider->blockSignals(true);
//ui->sensitivitySlider->setValue(val);
// ui->sensitivitySlider->blockSignals(false);
}
void controllerSetup::sensitivityMoved(QString path, int val)
{
qInfo(logUsbControl()) << "Setting sensitivity" << val <<"for device" << path;
@ -477,3 +502,18 @@ void controllerSetup::timeoutChanged(QString path, int val)
emit programOverlay(path, 3, QString("Sleep timeout set to %0 minutes").arg(val));
}
void controllerSetup::disableClicked(QString path, bool clicked, QWidget* widget, QLabel* label)
{
// Disable checkbox has been clicked
emit programDisable(path,clicked);
widget->setEnabled(!clicked);
/*
if (!clicked) {
label->setStyleSheet("QLabel { color : green; }");
label->setText("Connected");
} else {
label->setStyleSheet("QLabel { color : red; }");
label->setText("Not Connected");
}
*/
}

Wyświetl plik

@ -18,6 +18,7 @@
#include <QGridLayout>
#include <QPushButton>
#include <QScopedPointer>
#include <QCheckBox>
#include <QDebug>
#include <QObject>
@ -71,6 +72,7 @@ signals:
void programOrientation(QString path, quint8 value);
void programSpeed(QString path, quint8 value);
void programTimeout(QString path, quint8 value);
void programDisable(QString path, bool disable);
public slots:
void newDevice(USBDEVICE* dev, CONTROLLER* cntrl, QVector<BUTTON>* but, QVector<KNOB>* kb, QVector<COMMAND>* cmd, QMutex* mut);
@ -79,13 +81,13 @@ public slots:
void onEventIndexChanged(int index);
void offEventIndexChanged(int index);
void knobEventIndexChanged(int index);
void receiveSensitivity(int val);
void sensitivityMoved(QString path, int val);
void brightnessChanged(QString path, int index);
void orientationChanged(QString path, int index);
void speedChanged(QString path, int index);
void colorPicker(QString path);
void timeoutChanged(QString path, int val);
void disableClicked(QString path, bool clicked, QWidget* widget, QLabel* label);
private:

Wyświetl plik

@ -165,7 +165,7 @@ void usbController::run()
newDev.product = gamepad->name();
newDev.path = gamepad->name();
// Is this a new device? If so add it to usbDevices
//auto p = std::find_if(usbDevices.begin(),usbDevices.end(),[newDev](const USBDEVICE& dev) {return dev.path == newDev.path; });
// auto p = std::find_if(usbDevices.begin(),usbDevices.end(),[newDev](const USBDEVICE& dev) {return dev.path == newDev.path; });
//if (p == usbDevices.end()) {
// usbDevices.append(newDev);
//}
@ -270,14 +270,18 @@ void usbController::run()
auto it = usbDevices.begin();
while (it != usbDevices.end())
{
if (!it->connected)
if (it.value().remove)
{
it = usbDevices.erase(it);
}
else
{
++it;
}
}
#else
// Remove any devices from the list that are not connected (doesn't work on QT5!
usbDevices.erase(std::remove_if(usbDevices.begin(), usbDevices.end(), [](const USBDEVICE& dev) { return (!dev.connected); }),usbDevices.end());
// Remove any devices from the list that are not connected (doesn't work on QT5!)
usbDevices.erase(std::remove_if(usbDevices.begin(), usbDevices.end(), [](const USBDEVICE& dev) { return (dev.remove); }),usbDevices.end());
#endif
struct hid_device_info* devs;
devs = hid_enumerate(0x0, 0x0);
@ -299,8 +303,9 @@ void usbController::run()
newDev.usbDevice = (usbDeviceType)knownUsbDevices[i][0];
newDev.uuid = QUuid::createUuid();
// Is this a new device? If so add it to usbDevices
auto p = std::find_if(usbDevices.begin(),usbDevices.end(),[newDev](const USBDEVICE& dev) {return dev.path == newDev.path; });
if (p == usbDevices.end()) {
if (!usbDevices.contains(newDev.path))
{
usbDevices.insert(newDev.path,newDev);
}
}
@ -313,8 +318,17 @@ void usbController::run()
for (USBDEVICE &dev: usbDevices) {
if (!dev.connected && !dev.path.isEmpty()) {
qInfo(logUsbControl()) << QString("Attempting to connect to %0").arg(dev.product);
dev.handle = hid_open_path(dev.path.toLocal8Bit());
if (!controllers->contains(dev.path)) {
controllers->insert(dev.path,CONTROLLER());
}
dev.disabled = (*controllers)[dev.path].disabled;
if (!dev.disabled) {
qInfo(logUsbControl()) << QString("Attempting to connect to %0").arg(dev.product);
dev.handle = hid_open_path(dev.path.toLocal8Bit());
}
if (dev.handle)
{
@ -323,28 +337,15 @@ void usbController::run()
dev.connected=true;
hid_set_nonblocking(dev.handle, 1);
if (dev.usbDevice == shuttleXpress || dev.usbDevice == shuttlePro2)
{
dev.knobValues.append(0);
dev.knobSend.append(0);
}
else if (dev.usbDevice == RC28) {
if (dev.usbDevice == RC28) {
getVersion();
ledControl(false, 0);
ledControl(false, 1);
ledControl(false, 2);
ledControl(true, 3);
dev.knobValues.append(0);
dev.knobSend.append(0);
}
else if (dev.usbDevice == eCoderPlus)
{
dev.knobValues.append({ 0,0,0,0 });
dev.knobSend.append({ 0,0,0,0 });
}
else if (dev.usbDevice == QuickKeys) {
// Subscribe to event streams
QByteArray b(32,0x0);
b[0] = (qint8)0x02;
b[1] = (qint8)0xb0;
@ -359,19 +360,42 @@ void usbController::run()
b.replace(10, sizeof(dev.deviceId), dev.deviceId.toLocal8Bit());
hid_write(dev.handle, (const unsigned char*)b.constData(), b.size());
programOverlay(dev.path, 3, "Hello from wfview");
}
}
else if (!dev.disabled)
{
// This should only get displayed once if we fail to connect to a device
if (dev.usbDevice != usbNone)
{
qInfo(logUsbControl()) << QString("Error connecting to %0: %1")
.arg(dev.product)
.arg(QString::fromWCharArray(hid_error(dev.handle)));
}
// Call me again in 2 seconds to try connecting again
}
if (!dev.uiCreated)
{
if (dev.usbDevice == shuttleXpress || dev.usbDevice == shuttlePro2 || dev.usbDevice == RC28 || dev.usbDevice == QuickKeys)
{
dev.knobValues.append(0);
dev.knobSend.append(0);
}
else if (dev.usbDevice == eCoderPlus)
{
dev.knobValues.append({ 0,0,0,0 });
dev.knobSend.append({ 0,0,0,0 });
}
dev.knobPrevious.append(dev.knobValues);
// Find our defaults/knobs/buttons for this controller:
// First see if we have any stored and add them to the list if not.
if (!controllers->contains(dev.path)) {
controllers->insert(dev.path,CONTROLLER());
}
auto bti = std::find_if(buttonList->begin(), buttonList->end(), [dev](const BUTTON& b)
{ return (b.devicePath == dev.path); });
if (bti == buttonList->end())
@ -405,19 +429,19 @@ void usbController::run()
}
// Let the UI know we have a new controller
emit newDevice(&dev, &(*controllers)[dev.path],buttonList, knobList, &commands, mutex);
}
else
{
// This should only get displayed once if we fail to connect to a device
if (dev.usbDevice != usbNone)
dev.uiCreated = true;
} else {
if (dev.connected)
{
qInfo(logUsbControl()) << QString("Error connecting to %0: %1")
.arg(dev.product)
.arg(QString::fromWCharArray(hid_error(dev.handle)));
dev.message->setStyleSheet("QLabel { color : green; }");
dev.message->setText("Connected");
} else {
dev.message->setStyleSheet("QLabel { color : red; }");
dev.message->setText("Not Connected");
}
// Call me again in 2 seconds to try connecting again
}
}
}
@ -439,7 +463,7 @@ void usbController::runTimer()
for (USBDEVICE &dev: usbDevices)
{
if (!dev.connected || !dev.handle) {
if (dev.disabled || !dev.connected || !dev.handle) {
continue;
}
@ -454,7 +478,8 @@ void usbController::runTimer()
emit removeDevice(&dev);
hid_close(dev.handle);
dev.handle = NULL;
dev.connected=false;
dev.connected = false;
dev.remove = true;
devicesConnected--;
break;
}
@ -813,8 +838,10 @@ void usbController::runTimer()
}
}
// Run every 25ms
QTimer::singleShot(25, this, SLOT(runTimer()));
if (devicesConnected>0) {
// Run the periodic timer to get data if we have any devices
QTimer::singleShot(25, this, SLOT(runTimer()));
}
}
void usbController::receivePTTStatus(bool on) {
@ -843,7 +870,7 @@ void usbController::receivePTTStatus(bool on) {
void usbController::ledControl(bool on, unsigned char num)
{
for (USBDEVICE &dev: usbDevices) {
if (dev.usbDevice == RC28) {
if (dev.connected && dev.usbDevice == RC28) {
QByteArray data(3, 0x0);
data[1] = 0x01;
static unsigned char ledNum = 0x07;
@ -869,7 +896,7 @@ void usbController::ledControl(bool on, unsigned char num)
void usbController::getVersion()
{
for (USBDEVICE &dev: usbDevices) {
if (dev.usbDevice == RC28) {
if (dev.connected && dev.usbDevice == RC28) {
QByteArray data(64, 0x0);
data[0] = 63;
@ -940,7 +967,7 @@ void usbController::programButton(QString path, quint8 val, QString text)
if (usbDevices.contains(path))
{
USBDEVICE* dev=&usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle && val < 8) {
if (dev->connected && dev->usbDevice == QuickKeys && val < 8 && path == dev->path) {
text = text.mid(0, 10); // Make sure text is no more than 10 characters.
qDebug(logUsbControl()) << QString("Programming button %0 with %1").arg(val).arg(text);
QByteArray data(32, 0x0);
@ -977,7 +1004,7 @@ void usbController::programBrightness(QString path, quint8 val) {
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle) {
if (dev->connected && dev->usbDevice == QuickKeys && path == dev->path) {
qDebug(logUsbControl()) << QString("Programming brightness to %0").arg(val+1);
QByteArray data(32, 0x0);
data[0] = (qint8)0x02;
@ -998,7 +1025,7 @@ void usbController::programOrientation(QString path, quint8 val) {
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle) {
if (dev->connected && dev->usbDevice == QuickKeys && path == dev->path) {
qDebug(logUsbControl()) << QString("Programming orientation to %0").arg(val+1);
QByteArray data(32, 0x0);
data[0] = (qint8)0x02;
@ -1017,7 +1044,7 @@ void usbController::programSpeed(QString path, quint8 val) {
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle) {
if (dev->connected && dev->usbDevice == QuickKeys && path == dev->path) {
qDebug(logUsbControl()) << QString("Programming speed to %0").arg(val+1);
QByteArray data(32, 0x0);
data[0] = (qint8)0x02;
@ -1041,7 +1068,7 @@ void usbController::programWheelColour(QString path, quint8 r, quint8 g, quint8
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle) {
if (dev->connected && dev->usbDevice == QuickKeys && path == dev->path) {
QByteArray data(32, 0x0);
data[0] = (qint8)0x02;
data[1] = (qint8)0xb4;
@ -1064,7 +1091,7 @@ void usbController::programOverlay(QString path, quint8 duration, QString text)
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle) {
if (dev->connected && dev->usbDevice == QuickKeys && path == dev->path) {
text = text.mid(0, 32);
QByteArray data(32, 0x0);
data[0] = (qint8)0x02;
@ -1086,11 +1113,11 @@ void usbController::programOverlay(QString path, quint8 duration, QString text)
}
void usbController::programTimeout(QString path, quint8 val)
{
{
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
if (dev->usbDevice == QuickKeys && dev->handle && path == dev->path) {
if (dev->connected && dev->usbDevice == QuickKeys && path == dev->path) {
qInfo(logUsbControl()) << QString("Programming %0 timeout to %1 minutes").arg(dev->product).arg(val);
QByteArray data(32, 0x0);
data[0] = (qint8)0x02;
@ -1107,6 +1134,35 @@ void usbController::programTimeout(QString path, quint8 val)
/* End of functions for Xencelabs QuickKeys*/
void usbController::programDisable(QString path, bool disabled)
{
QMutexLocker locker(mutex);
if (usbDevices.contains(path))
{
USBDEVICE* dev = &usbDevices[path];
dev->disabled = disabled;
(*controllers)[path].disabled = disabled;
if (disabled)
{
// Disconnect the device:
if (dev->handle) {
qInfo(logUsbControl()) << "Disconnecting device:" << dev->product;
programOverlay(dev->path, 60, "Goodbye from wfview");
if (dev->usbDevice == RC28) {
ledControl(false, 3);
}
hid_close(dev->handle);
dev->connected=false;
dev->handle=NULL;
}
}
}
}
/* Button/Knob/Command defaults */

Wyświetl plik

@ -61,7 +61,10 @@ using namespace std;
struct USBDEVICE {
usbDeviceType usbDevice = usbNone;
bool remove = false;
bool connected = false;
bool uiCreated = false;
bool disabled = false;
hid_device* handle = NULL;
QString product = "";
QString manufacturer = "";
@ -84,7 +87,7 @@ struct USBDEVICE {
QByteArray lastData = QByteArray(8,0x0);
unsigned char lastDialPos=0;
QUuid uuid;
QLabel* message;
};
struct COMMAND {
@ -148,6 +151,7 @@ struct KNOB {
};
struct CONTROLLER {
bool disabled=false;
int sensitivity=1;
quint8 speed=2;
quint8 timeout=30;
@ -182,6 +186,8 @@ public slots:
void programWheelColour(QString path, quint8 r, quint8 g, quint8 b);
void programOverlay(QString path, quint8 duration, QString text);
void programTimeout(QString path, quint8 val);
void programDisable(QString path, bool disabled);
signals:
void jogPlus();

Wyświetl plik

@ -1693,6 +1693,7 @@ void wfmain::setupUsbControllerDevice()
connect(shut, SIGNAL(programWheelColour(QString, quint8, quint8, quint8)), usbControllerDev, SLOT(programWheelColour(QString, quint8, quint8, quint8)));
connect(shut, SIGNAL(programOverlay(QString, quint8, QString)), usbControllerDev, SLOT(programOverlay(QString, quint8, QString)));
connect(shut, SIGNAL(programTimeout(QString, quint8)), usbControllerDev, SLOT(programTimeout(QString, quint8)));
connect(shut, SIGNAL(programDisable(QString, bool)), usbControllerDev, SLOT(programDisable(QString, bool)));
connect(this, SIGNAL(setPTT(bool)), usbControllerDev, SLOT(receivePTTStatus(bool)));
connect(this, SIGNAL(initUsbController(QMutex*,usbMap*,QVector<BUTTON>*,QVector<KNOB>*)), usbControllerDev, SLOT(init(QMutex*,usbMap*,QVector<BUTTON>*,QVector<KNOB>*)));
@ -2492,6 +2493,7 @@ void wfmain::loadSettings()
settings->setArrayIndex(nc);
CONTROLLER tempPrefs;
QString tempPath = settings->value("Path", "").toString();
tempPrefs.disabled = settings->value("Disabled", false).toBool();
tempPrefs.sensitivity = settings->value("Sensitivity", 1).toInt();
tempPrefs.brightness = (quint8)settings->value("Brightness", 2).toInt();
tempPrefs.orientation = (quint8)settings->value("Orientation", 2).toInt();
@ -2985,6 +2987,7 @@ void wfmain::saveSettings()
settings->setArrayIndex(nc);
settings->setValue("Path", i.key());
settings->setValue("Disabled", i.value().disabled);
settings->setValue("Sensitivity", i.value().sensitivity);
settings->setValue("Brightness", i.value().brightness);
settings->setValue("Orientation", i.value().orientation);