mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 08:21:12 +02:00
gui/videosettings.cpp: fix memleaks when using CMenuForwarder;
comment not needed anotify->changeNotify every menu show; indent showVideoSetup
This commit is contained in:
@@ -205,7 +205,7 @@ int CVideoSettings::showVideoSetup()
|
|||||||
CMenuOptionChooser * vs_43mode_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_43MODE, &g_settings.video_43mode, VIDEOMENU_43MODE_OPTIONS, VIDEOMENU_43MODE_OPTION_COUNT, true, this);
|
CMenuOptionChooser * vs_43mode_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_43MODE, &g_settings.video_43mode, VIDEOMENU_43MODE_OPTIONS, VIDEOMENU_43MODE_OPTION_COUNT, true, this);
|
||||||
|
|
||||||
//display format
|
//display format
|
||||||
CMenuOptionChooser * vs_dispformat_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOFORMAT, &g_settings.video_Format, VIDEOMENU_VIDEOFORMAT_OPTIONS, VIDEOMENU_VIDEOFORMAT_OPTION_COUNT, true, this);
|
CMenuOptionChooser * vs_dispformat_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOFORMAT, &g_settings.video_Format, VIDEOMENU_VIDEOFORMAT_OPTIONS, VIDEOMENU_VIDEOFORMAT_OPTION_COUNT, true, this);
|
||||||
|
|
||||||
//video system
|
//video system
|
||||||
CMenuOptionChooser * vs_videomodes_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOMODE, &g_settings.video_Mode, VIDEOMENU_VIDEOMODE_OPTIONS, VIDEOMENU_VIDEOMODE_OPTION_COUNT, true, this, CRCInput::RC_nokey, "", true);
|
CMenuOptionChooser * vs_videomodes_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_VIDEOMODE, &g_settings.video_Mode, VIDEOMENU_VIDEOMODE_OPTIONS, VIDEOMENU_VIDEOMODE_OPTION_COUNT, true, this, CRCInput::RC_nokey, "", true);
|
||||||
@@ -213,16 +213,16 @@ int CVideoSettings::showVideoSetup()
|
|||||||
//dbdr options
|
//dbdr options
|
||||||
CMenuOptionChooser * vs_dbdropt_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_DBDR, &g_settings.video_dbdr, VIDEOMENU_DBDR_OPTIONS, VIDEOMENU_DBDR_OPTION_COUNT, true, this);
|
CMenuOptionChooser * vs_dbdropt_ch = new CMenuOptionChooser(LOCALE_VIDEOMENU_DBDR, &g_settings.video_dbdr, VIDEOMENU_DBDR_OPTIONS, VIDEOMENU_DBDR_OPTION_COUNT, true, this);
|
||||||
|
|
||||||
//video system modes submenue
|
//video system modes submenue
|
||||||
CMenuWidget* videomodes = new CMenuWidget(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS);
|
CMenuWidget videomodes(LOCALE_MAINSETTINGS_VIDEO, NEUTRINO_ICON_SETTINGS);
|
||||||
videomodes->addIntroItems(LOCALE_VIDEOMENU_ENABLED_MODES);
|
videomodes.addIntroItems(LOCALE_VIDEOMENU_ENABLED_MODES);
|
||||||
|
|
||||||
CAutoModeNotifier * anotify = new CAutoModeNotifier();
|
CAutoModeNotifier * anotify = new CAutoModeNotifier();
|
||||||
for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++)
|
for (int i = 0; i < VIDEOMENU_VIDEOMODE_OPTION_COUNT; i++)
|
||||||
videomodes->addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_video_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, anotify));
|
videomodes.addItem(new CMenuOptionChooser(VIDEOMENU_VIDEOMODE_OPTIONS[i].valname, &g_settings.enabled_video_modes[i], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, anotify));
|
||||||
anotify->changeNotify(NONEXISTANT_LOCALE, 0);
|
//anotify->changeNotify(NONEXISTANT_LOCALE, 0);
|
||||||
|
|
||||||
CMenuForwarder * vs_videomodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, videomodes, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED );
|
CMenuForwarder * vs_videomodes_fw = new CMenuForwarder(LOCALE_VIDEOMENU_ENABLED_MODES, true, NULL, &videomodes, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED );
|
||||||
|
|
||||||
//---------------------------------------
|
//---------------------------------------
|
||||||
videosetup->addIntroItems(LOCALE_MAINSETTINGS_VIDEO, LOCALE_VIDEOMENU_TV_SCART);
|
videosetup->addIntroItems(LOCALE_MAINSETTINGS_VIDEO, LOCALE_VIDEOMENU_TV_SCART);
|
||||||
@@ -242,10 +242,10 @@ int CVideoSettings::showVideoSetup()
|
|||||||
videosetup->addItem(vs_dbdropt_ch); //dbdr options
|
videosetup->addItem(vs_dbdropt_ch); //dbdr options
|
||||||
videosetup->addItem(vs_videomodes_fw); //video modes submenue
|
videosetup->addItem(vs_videomodes_fw); //video modes submenue
|
||||||
|
|
||||||
int res = videosetup->exec(NULL, "");
|
int res = videosetup->exec(NULL, "");
|
||||||
videosetup->hide();
|
videosetup->hide();
|
||||||
selected = videosetup->getSelected();
|
selected = videosetup->getSelected();
|
||||||
delete videosetup;
|
delete videosetup;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user