Add empty software information tab to information UI

This commit is contained in:
Adam Honse 2020-02-28 12:31:32 -06:00
parent 977feabe6e
commit e10881db3e
5 changed files with 152 additions and 0 deletions

View file

@ -53,6 +53,7 @@ SOURCES += \
net_port/net_port.cpp \
qt/OpenRGBDialog2.cpp \
qt/OpenRGBProfileSaveDialog.cpp \
qt/OpenRGBSoftwareInfoPage.cpp \
qt/OpenRGBSystemInfoPage.cpp \
qt/hsv.cpp \
serial_port/serial_port.cpp \
@ -140,6 +141,7 @@ HEADERS += \
net_port/net_port.h \
qt/OpenRGBDialog2.h \
qt/OpenRGBProfileSaveDialog.h \
qt/OpenRGBSoftwareInfoPage.h \
qt/OpenRGBSystemInfoPage.h \
serial_port/find_usb_serial_port.h \
serial_port/serial_port.h \
@ -202,6 +204,7 @@ FORMS += \
qt/OpenRGBDialog.ui \
qt/OpenRGBDialog2.ui \
qt/OpenRGBProfileSaveDialog.ui \
qt/OpenRGBSoftwareInfoPage.ui \
qt/OpenRGBSystemInfoPage.ui
#-----------------------------------------------

View file

@ -2,6 +2,7 @@
#include "OpenRGBDialog2.h"
#include "OpenRGBDevicePage.h"
#include "OpenRGBDeviceInfoPage.h"
#include "OpenRGBSoftwareInfoPage.h"
#include "OpenRGBSystemInfoPage.h"
#include "OpenRGBProfileSaveDialog.h"
#include "RGBController_Dummy.h"
@ -258,6 +259,25 @@ OpenRGBDialog2::OpenRGBDialog2(std::vector<i2c_smbus_interface *>& bus, std::vec
SystemTabLabel->setGeometry(0, 0, 200, 20);
InformationTabBar->setTabButton(control.size(), QTabBar::LeftSide, SystemTabLabel);
OpenRGBSoftwareInfoPage *SoftInfoPage = new OpenRGBSoftwareInfoPage();
ui->InformationTabBar->addTab(SoftInfoPage, "");
/*-----------------------------------------------------*\
| Use Qt's HTML capabilities to display both icon and |
| text in the tab label. Choose icon based on device |
| type and append device name string. |
\*-----------------------------------------------------*/
QString SoftwareLabelString = "<html><table><tr><td width='30'><img src='";
SoftwareLabelString += ":/keyboard.svg";
SoftwareLabelString += "' height='15' width='15'></td><td>Software</td></tr></table></html>";
QLabel *SoftwareTabLabel = new QLabel();
SoftwareTabLabel->setText(SoftwareLabelString);
SoftwareTabLabel->setIndent(20);
SoftwareTabLabel->setGeometry(0, 0, 200, 20);
InformationTabBar->setTabButton(control.size() + 1, QTabBar::LeftSide, SoftwareTabLabel);
}
OpenRGBDialog2::~OpenRGBDialog2()

View file

@ -0,0 +1,15 @@
#include "OpenRGBSoftwareInfoPage.h"
using namespace Ui;
OpenRGBSoftwareInfoPage::OpenRGBSoftwareInfoPage(QWidget *parent) :
QFrame(parent),
ui(new Ui::OpenRGBSoftwareInfoPageUi)
{
ui->setupUi(this);
}
OpenRGBSoftwareInfoPage::~OpenRGBSoftwareInfoPage()
{
delete ui;
}

View file

@ -0,0 +1,23 @@
#ifndef OPENRGBSOFTWAREINFOPAGE_H
#define OPENRGBSOFTWAREINFOPAGE_H
#include <QFrame>
#include "ui_OpenRGBSoftwareInfoPage.h"
namespace Ui {
class OpenRGBSoftwareInfoPage;
}
class Ui::OpenRGBSoftwareInfoPage : public QFrame
{
Q_OBJECT
public:
explicit OpenRGBSoftwareInfoPage(QWidget *parent = nullptr);
~OpenRGBSoftwareInfoPage();
private:
Ui::OpenRGBSoftwareInfoPageUi *ui;
};
#endif // OPENRGBSOFTWAREINFOPAGE_H

View file

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>OpenRGBSoftwareInfoPageUi</class>
<widget class="QFrame" name="OpenRGBSoftwareInfoPageUi">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>500</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Frame</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="4" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="GitBranchLabel">
<property name="text">
<string>Git Branch:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="GitCommitIDValue">
<property name="text">
<string>Git Commit ID Value</string>
</property>
</widget>
</item>
<item row="0" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="VersionLabel">
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="1" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="BuildDateLabel">
<property name="text">
<string>Build Date:</string>
</property>
</widget>
</item>
<item row="3" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="GitCommitDateLabel">
<property name="text">
<string>Git Commit Date:</string>
</property>
</widget>
</item>
<item row="2" column="0" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="GitCommitIDLabel">
<property name="text">
<string>Git Commit ID:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="BuildDateValue">
<property name="text">
<string>Build Date Value</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="GitBranchValue">
<property name="text">
<string>Git Branch Value</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="GitCommitDateValue">
<property name="text">
<string>Git Commit Date Value</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="VersionValue">
<property name="text">
<string>Version Value</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>