73 lines
1.7 KiB
C++
Raw Normal View History

2019-03-27 02:37:34 +01:00
#include "options.h"
UserCategory::UserCategory(QWidget *parent) :
OptionsCategory(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_USER_SETTINGS);
setCategoryIcon("menu_user");
}
QVector<OptionsPage*> UserCategory::pages()
{
QVector<OptionsPage*> pages;
pages << new UserPage(this);
pages << new AccountsPage(this);
return pages;
}
UserPage::UserPage(QObject *parent) :
OptionsPage(parent)
{
}
QWidget *UserPage::widget()
{
2019-04-14 23:30:34 +02:00
QWidget *widget = new QWidget;
2019-03-27 02:37:34 +01:00
FormLayout *layout = new FormLayout;
2019-04-14 23:30:34 +02:00
layout->add(MENU_ENUM_LABEL_NETPLAY_NICKNAME);
layout->add(MENU_ENUM_LABEL_USER_LANGUAGE);
2019-03-27 02:37:34 +01:00
widget->setLayout(layout);
return widget;
}
AccountsPage::AccountsPage(QObject *parent) :
OptionsPage(parent)
{
setDisplayName(MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST);
}
QWidget *AccountsPage::widget()
{
2019-04-14 23:30:34 +02:00
QWidget *widget = new QWidget;
QVBoxLayout *layout = new QVBoxLayout;
2019-03-27 02:37:34 +01:00
SettingsGroup *youtubeGroup = new SettingsGroup(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACCOUNTS_YOUTUBE));
2019-04-14 23:30:34 +02:00
SettingsGroup *twitchGroup = new SettingsGroup(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACCOUNTS_TWITCH));
2019-03-27 02:37:34 +01:00
#ifdef HAVE_CHEEVOS
SettingsGroup *cheevosGroup = new SettingsGroup(msg_hash_to_str(MENU_ENUM_LABEL_VALUE_ACCOUNTS_RETRO_ACHIEVEMENTS));
2019-04-14 23:30:34 +02:00
cheevosGroup->add(MENU_ENUM_LABEL_CHEEVOS_USERNAME);
cheevosGroup->add(MENU_ENUM_LABEL_CHEEVOS_PASSWORD);
2019-03-27 02:37:34 +01:00
layout->addWidget(cheevosGroup);
#endif
2019-04-14 23:30:34 +02:00
youtubeGroup->add(MENU_ENUM_LABEL_YOUTUBE_STREAM_KEY);
2019-03-27 02:37:34 +01:00
layout->addWidget(youtubeGroup);
2019-04-14 23:30:34 +02:00
twitchGroup->add(MENU_ENUM_LABEL_TWITCH_STREAM_KEY);
2019-03-27 02:37:34 +01:00
layout->addWidget(twitchGroup);
layout->addStretch();
widget->setLayout(layout);
return widget;
}