Skip to content

Commit

Permalink
Merge pull request #7924 from jordan-woyak/info-widget-fix
Browse files Browse the repository at this point in the history
DolphinQt: Fix unused widgets in InfoWidget from being visible.
  • Loading branch information
JMC47 committed Apr 2, 2019
2 parents 8e1fb12 + d106169 commit a2df9be
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 26 deletions.
30 changes: 17 additions & 13 deletions Source/Core/DolphinQt/Config/InfoWidget.cpp
Expand Up @@ -102,24 +102,23 @@ QGroupBox* InfoWidget::CreateBannerDetails()


layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);


m_name = CreateValueDisplay();
m_maker = CreateValueDisplay();
m_description = new QTextEdit(group);
m_description->setReadOnly(true);
CreateLanguageSelector(); CreateLanguageSelector();

layout->addRow(tr("Show Language:"), m_language_selector); layout->addRow(tr("Show Language:"), m_language_selector);

if (m_game.GetPlatform() == DiscIO::Platform::GameCubeDisc) if (m_game.GetPlatform() == DiscIO::Platform::GameCubeDisc)
{ {
layout->addRow(tr("Name:"), m_name); layout->addRow(tr("Name:"), m_name = CreateValueDisplay());
layout->addRow(tr("Maker:"), m_maker); layout->addRow(tr("Maker:"), m_maker = CreateValueDisplay());
layout->addRow(tr("Description:"), m_description); layout->addRow(tr("Description:"), m_description = new QTextEdit());
m_description->setReadOnly(true);
} }
else if (DiscIO::IsWii(m_game.GetPlatform())) else if (DiscIO::IsWii(m_game.GetPlatform()))
{ {
layout->addRow(tr("Name:"), m_name); layout->addRow(tr("Name:"), m_name = CreateValueDisplay());
} }


ChangeLanguage();

QPixmap banner = ToQPixmap(m_game.GetBannerImage()); QPixmap banner = ToQPixmap(m_game.GetBannerImage());
if (!banner.isNull()) if (!banner.isNull())
layout->addRow(tr("Banner:"), CreateBannerGraphic(banner)); layout->addRow(tr("Banner:"), CreateBannerGraphic(banner));
Expand Down Expand Up @@ -183,16 +182,21 @@ void InfoWidget::CreateLanguageSelector()
connect(m_language_selector, connect(m_language_selector,
static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
&InfoWidget::ChangeLanguage); &InfoWidget::ChangeLanguage);
ChangeLanguage();
} }


void InfoWidget::ChangeLanguage() void InfoWidget::ChangeLanguage()
{ {
DiscIO::Language language = DiscIO::Language language =
static_cast<DiscIO::Language>(m_language_selector->currentData().toInt()); static_cast<DiscIO::Language>(m_language_selector->currentData().toInt());
m_name->setText(QString::fromStdString(m_game.GetLongName(language)));
m_maker->setText(QString::fromStdString(m_game.GetLongMaker(language))); if (m_name)
m_description->setText(QString::fromStdString(m_game.GetDescription(language))); m_name->setText(QString::fromStdString(m_game.GetLongName(language)));

if (m_maker)
m_maker->setText(QString::fromStdString(m_game.GetLongMaker(language)));

if (m_description)
m_description->setText(QString::fromStdString(m_game.GetDescription(language)));
} }


QWidget* InfoWidget::CreateChecksumComputer() QWidget* InfoWidget::CreateChecksumComputer()
Expand Down
6 changes: 3 additions & 3 deletions Source/Core/DolphinQt/Config/InfoWidget.h
Expand Up @@ -38,7 +38,7 @@ class InfoWidget final : public QWidget
UICommon::GameFile m_game; UICommon::GameFile m_game;
QLineEdit* m_checksum_result; QLineEdit* m_checksum_result;
QComboBox* m_language_selector; QComboBox* m_language_selector;
QLineEdit* m_name; QLineEdit* m_name = {};
QLineEdit* m_maker; QLineEdit* m_maker = {};
QTextEdit* m_description; QTextEdit* m_description = {};
}; };
4 changes: 0 additions & 4 deletions Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.cpp
Expand Up @@ -6,10 +6,6 @@


#include "DolphinQt/QtUtils/DoubleClickEventFilter.h" #include "DolphinQt/QtUtils/DoubleClickEventFilter.h"


DoubleClickEventFilter::DoubleClickEventFilter(QObject* parent) : QObject(parent)
{
}

bool DoubleClickEventFilter::eventFilter(QObject* object, QEvent* event) bool DoubleClickEventFilter::eventFilter(QObject* object, QEvent* event)
{ {
if (event->type() == QEvent::MouseButtonDblClick) if (event->type() == QEvent::MouseButtonDblClick)
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt/QtUtils/DoubleClickEventFilter.h
Expand Up @@ -10,7 +10,7 @@ class DoubleClickEventFilter : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit DoubleClickEventFilter(QObject* parent); using QObject::QObject;


signals: signals:
void doubleClicked(); void doubleClicked();
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/DolphinQt/QtUtils/WindowActivationEventFilter.cpp
Expand Up @@ -7,10 +7,6 @@


#include "DolphinQt/QtUtils/WindowActivationEventFilter.h" #include "DolphinQt/QtUtils/WindowActivationEventFilter.h"


WindowActivationEventFilter::WindowActivationEventFilter(QObject* parent) : QObject(parent)
{
}

bool WindowActivationEventFilter::eventFilter(QObject* object, QEvent* event) bool WindowActivationEventFilter::eventFilter(QObject* object, QEvent* event)
{ {
if (event->type() == QEvent::WindowDeactivate) if (event->type() == QEvent::WindowDeactivate)
Expand Down
Expand Up @@ -10,7 +10,7 @@ class WindowActivationEventFilter : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit WindowActivationEventFilter(QObject* parent); using QObject::QObject;


signals: signals:
void windowActivated(); void windowActivated();
Expand Down

0 comments on commit a2df9be

Please sign in to comment.