From 320129633d9cab92cdf1c28da270155c256d83bc Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Mon, 20 Jul 2020 17:49:12 -0500 Subject: [PATCH] Add SMBus detection mode selection box --- qt/OpenRGBSystemInfoPage.cpp | 22 +++++++++- qt/OpenRGBSystemInfoPage.ui | 85 +++++++++++++++++++++--------------- 2 files changed, 72 insertions(+), 35 deletions(-) diff --git a/qt/OpenRGBSystemInfoPage.cpp b/qt/OpenRGBSystemInfoPage.cpp index 435a581e..45f80572 100644 --- a/qt/OpenRGBSystemInfoPage.cpp +++ b/qt/OpenRGBSystemInfoPage.cpp @@ -28,6 +28,12 @@ OpenRGBSystemInfoPage::OpenRGBSystemInfoPage(std::vector& } ui->SMBusAdaptersBox->setCurrentIndex(0); + + ui->SMBusDetectionModeBox->addItem("Auto"); + ui->SMBusDetectionModeBox->addItem("Quick"); + ui->SMBusDetectionModeBox->addItem("Read"); + + ui->SMBusDetectionModeBox->setCurrentIndex(0); } OpenRGBSystemInfoPage::~OpenRGBSystemInfoPage() @@ -47,7 +53,21 @@ void Ui::OpenRGBSystemInfoPage::on_DetectButton_clicked() if(busses.size() > current_index) { i2c_smbus_interface* bus = busses[current_index]; - ui->SMBusDataText->setPlainText(i2c_detect(bus, MODE_QUICK).c_str()); + + switch(ui->SMBusDetectionModeBox->currentIndex()) + { + case 0: + ui->SMBusDataText->setPlainText(i2c_detect(bus, MODE_AUTO).c_str()); + break; + + case 1: + ui->SMBusDataText->setPlainText(i2c_detect(bus, MODE_QUICK).c_str()); + break; + + case 2: + ui->SMBusDataText->setPlainText(i2c_detect(bus, MODE_READ).c_str()); + break; + } } } diff --git a/qt/OpenRGBSystemInfoPage.ui b/qt/OpenRGBSystemInfoPage.ui index ce1795d7..a6edfd64 100644 --- a/qt/OpenRGBSystemInfoPage.ui +++ b/qt/OpenRGBSystemInfoPage.ui @@ -14,38 +14,10 @@ Frame - - - - SMBus Adapters: - - + + - - - - - - - Detect Devices - - - - - - - SMBus Dumper: - - - - - - - Address: - - - - + @@ -61,15 +33,60 @@ - + Dump Device - - + + + + Address: + + + + + + + SMBus Dumper: + + + + + + + SMBus Adapters: + + + + + + + Detect Devices + + + + + + + + + + SMBus Detector: + + + + + + + Detection Mode: + + + + +