mirror of
https://github.com/libretro/RetroArch
synced 2025-02-28 03:39:59 +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()
|
QWidget *MenuSoundsPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_MENU_SOUNDS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -23,25 +23,5 @@ ConfigurationPage::ConfigurationPage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *ConfigurationPage::widget()
|
QWidget *ConfigurationPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_CONFIGURATION_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -23,25 +23,5 @@ CorePage::CorePage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *CorePage::widget()
|
QWidget *CorePage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_CORE_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -23,25 +23,5 @@ DirectoryPage::DirectoryPage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *DirectoryPage::widget()
|
QWidget *DirectoryPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_DIRECTORY_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -24,25 +24,5 @@ DriversPage::DriversPage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *DriversPage::widget()
|
QWidget *DriversPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_DRIVER_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -23,25 +23,5 @@ LoggingPage::LoggingPage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *LoggingPage::widget()
|
QWidget *LoggingPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_LOGGING_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -164,25 +164,5 @@ UpdaterPage::UpdaterPage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *UpdaterPage::widget()
|
QWidget *UpdaterPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_UPDATER_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
@ -534,4 +534,28 @@ public:
|
|||||||
QWidget *widget();
|
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
|
#endif
|
||||||
|
@ -56,25 +56,5 @@ RewindPage::RewindPage(QObject *parent) :
|
|||||||
|
|
||||||
QWidget *RewindPage::widget()
|
QWidget *RewindPage::widget()
|
||||||
{
|
{
|
||||||
unsigned i;
|
return create_widget(DISPLAYLIST_REWIND_SETTINGS_LIST);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user