Files
OpenRGB/qt/OpenRGBPluginContainer.cpp
Chris 2e02f1d782 Adding ability to switch language files at runtime to resolve #2743
* Removing .qm files from Windows build as they are inbuilt as of a7adfe251
* Moving translation change code to the OpenRGBSettingsPage
* Adding a changeEvent() to applicable Widgets to facilitate language updates
* Workaround added to TabLabel to accomodate translation context origin
* Added zh_TW locale to OpenRGB.pro
* Updated all translations to include the latest untranslated strings
2022-11-27 04:07:30 +00:00

42 lines
884 B
C++

#include "OpenRGBPluginContainer.h"
#include "ui_OpenRGBPluginContainer.h"
Ui::OpenRGBPluginContainer::OpenRGBPluginContainer(QWidget *plugin, QWidget *parent) :
QWidget(parent),
ui(new Ui::OpenRGBPluginContainerUi)
{
ui->setupUi(this);
plugin_widget = plugin;
plugin_widget->setParent(this);
ui->PluginContainerLayout->layout()->addWidget(plugin_widget);
Hide();
}
Ui::OpenRGBPluginContainer::~OpenRGBPluginContainer()
{
delete ui;
}
void Ui::OpenRGBPluginContainer::changeEvent(QEvent *event)
{
if(event->type() == QEvent::LanguageChange)
{
ui->retranslateUi(this);
}
}
void Ui::OpenRGBPluginContainer::Hide()
{
plugin_widget->hide();
ui->PluginContainerLayout->layout()->invalidate();
}
void Ui::OpenRGBPluginContainer::Show()
{
plugin_widget->show();
ui->PluginContainerLayout->layout()->invalidate();
}