Files
OpenRGB/qt/OpenRGBSoftwareInfoPage/OpenRGBSoftwareInfoPage.cpp

65 lines
2.0 KiB
C++

/*---------------------------------------------------------*\
| OpenRGBSoftwareInfoPage.cpp |
| |
| User interface for software information page |
| |
| This file is part of the OpenRGB project |
| SPDX-License-Identifier: GPL-2.0-or-later |
\*---------------------------------------------------------*/
#include <QSysInfo>
#include "OpenRGBSoftwareInfoPage.h"
#include "OpenRGBPluginInterface.h"
#include "NetworkProtocol.h"
#include "ResourceManager.h"
#include "ui_OpenRGBSoftwareInfoPage.h"
OpenRGBSoftwareInfoPage::OpenRGBSoftwareInfoPage(QWidget *parent) :
QFrame(parent),
ui(new Ui::OpenRGBSoftwareInfoPage)
{
ui->setupUi(this);
UpdateInterface();
}
OpenRGBSoftwareInfoPage::~OpenRGBSoftwareInfoPage()
{
delete ui;
}
void OpenRGBSoftwareInfoPage::changeEvent(QEvent *event)
{
if(event->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this);
UpdateInterface();
}
}
void OpenRGBSoftwareInfoPage::UpdateInterface()
{
if(ResourceManager::get()->IsLocalClient())
{
ui->ModeValue->setText(tr("Local Client"));
}
else
{
ui->ModeValue->setText(tr("Standalone"));
}
ui->SDKVersionValue->setText(QString::number(OPENRGB_SDK_PROTOCOL_VERSION));
ui->PluginAPIVersionValue->setText(QString::number(OPENRGB_PLUGIN_API_VERSION));
ui->QtVersionValue->setText(QT_VERSION_STR);
ui->VersionValue->setText(VERSION_STRING);
ui->BuildDateValue->setText(BUILDDATE_STRING);
ui->GitCommitIDValue->setText(GIT_COMMIT_ID);
ui->GitCommitDateValue->setText(GIT_COMMIT_DATE);
ui->GitBranchValue->setText(GIT_BRANCH);
ui->OsVersionValue->setText(QSysInfo::prettyProductName());
#if(HID_HOTPLUG_ENABLED)
ui->HIDHotplugValue->setText(tr("Supported"));
#else
ui->HIDHotplugValue->setText(tr("Unsupported"));
#endif
}