mirror of
https://github.com/libretro/RetroArch
synced 2025-02-27 18:41:01 +00:00
(UI/QT) Create create_widget
This commit is contained in:
parent
9ba1b522c2
commit
a58297a577
@ -76,25 +76,5 @@ MenuSoundsPage::MenuSoundsPage(QObject *parent) :
|
||||
|
||||
QWidget *MenuSoundsPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget();
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_MENU_SOUNDS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_MENU_SOUNDS_LIST);
|
||||
}
|
||||
|
@ -23,25 +23,5 @@ ConfigurationPage::ConfigurationPage(QObject *parent) :
|
||||
|
||||
QWidget *ConfigurationPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
|
||||
}
|
||||
|
@ -23,25 +23,5 @@ CorePage::CorePage(QObject *parent) :
|
||||
|
||||
QWidget *CorePage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_CORE_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_CORE_SETTINGS_LIST);
|
||||
}
|
||||
|
@ -23,25 +23,5 @@ DirectoryPage::DirectoryPage(QObject *parent) :
|
||||
|
||||
QWidget *DirectoryPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_DIRECTORY_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_DIRECTORY_SETTINGS_LIST);
|
||||
}
|
||||
|
@ -24,25 +24,5 @@ DriversPage::DriversPage(QObject *parent) :
|
||||
|
||||
QWidget *DriversPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_DRIVER_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_DRIVER_SETTINGS_LIST);
|
||||
}
|
||||
|
@ -23,25 +23,5 @@ LoggingPage::LoggingPage(QObject *parent) :
|
||||
|
||||
QWidget *LoggingPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_LOGGING_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_LOGGING_SETTINGS_LIST);
|
||||
}
|
||||
|
@ -164,25 +164,5 @@ UpdaterPage::UpdaterPage(QObject *parent) :
|
||||
|
||||
QWidget *UpdaterPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_UPDATER_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_UPDATER_SETTINGS_LIST);
|
||||
}
|
||||
|
@ -534,4 +534,28 @@ public:
|
||||
QWidget *widget();
|
||||
};
|
||||
|
||||
static inline QWidget *create_widget(enum menu_displaylist_ctl_state name)
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(list, name);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -56,25 +56,5 @@ RewindPage::RewindPage(QObject *parent) :
|
||||
|
||||
QWidget *RewindPage::widget()
|
||||
{
|
||||
unsigned i;
|
||||
QWidget *widget = new QWidget;
|
||||
FormLayout *layout = new FormLayout;
|
||||
file_list_t *list = (file_list_t*)calloc(1, sizeof(*list));
|
||||
|
||||
menu_displaylist_build_list(
|
||||
list, DISPLAYLIST_REWIND_SETTINGS_LIST);
|
||||
|
||||
for (i = 0; i < list->size; i++)
|
||||
{
|
||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||
file_list_get_actiondata_at_offset(list, i);
|
||||
|
||||
layout->add(cbs->enum_idx);
|
||||
}
|
||||
|
||||
file_list_free(list);
|
||||
|
||||
widget->setLayout(layout);
|
||||
|
||||
return widget;
|
||||
return create_widget(DISPLAYLIST_REWIND_SETTINGS_LIST);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user