Merge branch 'master' into multituner

This commit is contained in:
[CST] Focus
2012-02-19 12:25:28 +04:00
46 changed files with 392 additions and 150 deletions

View File

@@ -615,6 +615,7 @@ int CChannelList::show()
if(!CRecordManager::getInstance()->RecordingStatus(chanlist[selected]->channel_id))
{
printf("[neutrino channellist] start direct recording...\n");
hide();
if (CRecordManager::getInstance()->Record(chanlist[selected]->channel_id))
{
if(SameTP())

View File

@@ -852,7 +852,10 @@ void CInfoViewer::loop(bool show_dot)
while (!(res & (messages_return::cancel_info | messages_return::cancel_all))) {
g_RCInput->getMsgAbsoluteTimeout (&msg, &data, &timeoutEnd);
if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) {
if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
res = CNeutrinoApp::getInstance()->handleMsg(msg, data);
} else if (msg == CRCInput::RC_sat || msg == CRCInput::RC_favorites) {
g_RCInput->postMsg (msg, 0);
res = messages_return::cancel_info;
}

View File

@@ -146,14 +146,6 @@ const CMenuOptionChooser::keyval KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS[KEYBINDI
{ 2, LOCALE_KEYBINDINGMENU_ALLCHANNELS_ON_OK }
};
#define KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT 3
const CMenuOptionChooser::keyval_ext KEYBINDINGMENU_SCREENSHOT_FMT_OPTIONS[KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT] =
{
{ CScreenShot::FORMAT_PNG, NONEXISTANT_LOCALE, "PNG" },
{ CScreenShot::FORMAT_JPG, NONEXISTANT_LOCALE, "JPEG" },
{ CScreenShot::FORMAT_BMP, NONEXISTANT_LOCALE, "BMP" }
};
typedef struct key_settings_t
{
const neutrino_locale_t keydescription;
@@ -175,6 +167,7 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] =
{LOCALE_KEYBINDINGMENU_ADDREMIND, &g_settings.key_channelList_addremind, },
{LOCALE_KEYBINDINGMENU_BOUQUETUP, &g_settings.key_bouquet_up, },
{LOCALE_KEYBINDINGMENU_BOUQUETDOWN, &g_settings.key_bouquet_down, },
{LOCALE_EXTRA_KEY_CURRENT_TRANSPONDER, &g_settings.key_current_transponder, },
{LOCALE_KEYBINDINGMENU_CHANNELUP, &g_settings.key_quickzap_up, },
{LOCALE_KEYBINDINGMENU_CHANNELDOWN, &g_settings.key_quickzap_down, },
{LOCALE_KEYBINDINGMENU_SUBCHANNELUP, &g_settings.key_subchannel_up, },
@@ -193,7 +186,7 @@ const key_settings_struct_t key_settings[CKeybindSetup::KEYBINDS_COUNT] =
{LOCALE_MPKEY_PLUGIN, &g_settings.mpkey_plugin, },
{LOCALE_EXTRA_KEY_PLUGIN, &g_settings.key_plugin, },
{LOCALE_EXTRA_KEY_UNLOCK, &g_settings.key_unlock, },
{LOCALE_EXTRA_KEY_SCREENSHOT, &g_settings.key_screenshot, },
{LOCALE_EXTRA_KEY_SCREENSHOT, &g_settings.key_screenshot, }
};
@@ -289,8 +282,6 @@ void CKeybindSetup::showKeyBindSetup(CMenuWidget *bindSettings)
//bindSettings->addItem(new CMenuForwarder(keydescription[KEY_PLUGIN], true, NULL, keychooser[KEY_PLUGIN]));
bindSettings->addItem(new CMenuForwarder(key_settings[KEY_UNLOCK].keydescription, true, keychooser[KEY_UNLOCK]->getKeyName(), keychooser[KEY_UNLOCK]));
bindSettings->addItem(new CMenuForwarder(key_settings[KEY_SCREENSHOT].keydescription, true, keychooser[KEY_SCREENSHOT]->getKeyName(), keychooser[KEY_SCREENSHOT]));
bindSettings->addItem(new CMenuOptionNumberChooser(LOCALE_SCREENSHOT_COUNT, &g_settings.screenshot_count, true, 1, 5, NULL));
bindSettings->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_FORMAT, &g_settings.screenshot_format, KEYBINDINGMENU_SCREENSHOT_FMT_OPTIONS, KEYBINDINGMENU_SCREENSHOT_FMT_OPTION_COUNT, true));
//bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ZAP_CYCLE, &g_settings.zap_cycle, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_MENU_LEFT_EXIT, &g_settings.menu_left_exit, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
bindSettings->addItem(new CMenuOptionChooser(LOCALE_EXTRA_AUDIO_RUN_PLAYER, &g_settings.audio_run_player, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
@@ -311,7 +302,7 @@ void CKeybindSetup::showKeyBindChannellistSetup(CMenuWidget *bindSettings_chlist
CMenuOptionChooser *oj = new CMenuOptionChooser(LOCALE_KEYBINDINGMENU_BOUQUETHANDLING, &g_settings.bouquetlist_mode, KEYBINDINGMENU_BOUQUETHANDLING_OPTIONS, KEYBINDINGMENU_BOUQUETHANDLING_OPTION_COUNT, true );
bindSettings_chlist->addItem(oj);
for (int i = KEY_PAGE_UP; i <= KEY_BOUQUET_DOWN; i++)
for (int i = KEY_PAGE_UP; i <= KEY_CURRENT_TRANSPONDER; i++)
bindSettings_chlist->addItem(new CMenuForwarder(key_settings[i].keydescription, true, keychooser[i]->getKeyName(), keychooser[i]));
bindSettings_chlist->addItem(new CMenuOptionChooser(LOCALE_EXTRA_SMS_CHANNEL, &g_settings.sms_channel, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));

View File

@@ -56,6 +56,7 @@ class CKeybindSetup : public CMenuTarget
KEY_ADD_REMIND,
KEY_BOUQUET_UP,
KEY_BOUQUET_DOWN,
KEY_CURRENT_TRANSPONDER,
KEY_CHANNEL_UP,
KEY_CHANNEL_DOWN,
KEY_SUBCHANNEL_UP,

View File

@@ -67,6 +67,7 @@
#include <gui/widget/progressbar.h>
#include <gui/pictureviewer.h>
#include <gui/customcolor.h>
#include <driver/record.h>
extern CPictureViewer * g_PicViewer;
static CProgressBar *timescale;
@@ -515,6 +516,7 @@ void CMovieBrowser::init(void)
refreshBrowserList();
refreshFilterList();
g_PicViewer->getSupportedImageFormats(PicExts);
IsRecord = false;
#if 0
TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tBrowsr:\t%3d,%3d,%3d,%3d \r\n\tPlay:\t%3d,%3d,%3d,%3d \r\n\tRecord:\t%3d,%3d,%3d,%3d\r\n\r\n",
g_settings.screen_StartX,
@@ -1208,13 +1210,18 @@ void CMovieBrowser::refreshMovieInfo(void)
m_pcInfo->setText(&emptytext);
return;
}
if (m_movieSelectionHandler == NULL)
{
if (m_movieSelectionHandler == NULL) {
// There is no selected element, clear LCD
m_pcInfo->setText(&emptytext);
}
else
{
else {
// Is record?
bool tmp = CRecordManager::getInstance()->IsFileRecord(m_movieSelectionHandler->file.Name);
if (tmp != IsRecord) {
IsRecord = tmp;
refreshFoot();
}
bool logo_ok = false;
int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight);
int pich = m_cBoxFrameInfo.iHeight;
@@ -1615,10 +1622,13 @@ void CMovieBrowser::refreshFoot(void)
m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih);
m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6);
m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8
//delte icon
m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih);
m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6);
m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8
if (IsRecord == false) {
//delte icon
m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih);
m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6);
m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8
}
}
@@ -1714,13 +1724,8 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg)
}
else if (msg == CRCInput::RC_spkr)
{
if(m_vMovieInfo.size() > 0)
{
if(m_movieSelectionHandler != NULL)
{
onDeleteFile(*m_movieSelectionHandler);
}
}
if ((m_vMovieInfo.size() > 0) && (m_movieSelectionHandler != NULL) && (IsRecord == false))
onDeleteFile(*m_movieSelectionHandler);
}
else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info)
{

View File

@@ -294,6 +294,8 @@ class CMovieBrowser : public CMenuTarget
MB_SETTINGS m_settings;
std::vector<MB_DIR> m_dir;
bool IsRecord;
int movieInfoUpdateAll[MB_INFO_MAX_NUMBER];
int movieInfoUpdateAllIfDestEmptyOnly;

View File

@@ -586,18 +586,33 @@ void CMoviePlayerGui::PlayFile(void)
if(restore)
FileTime.show(position);
} else if (msg == (neutrino_msg_t) g_settings.key_screenshot) {
char ending[(sizeof(int)*2) + 6] = ".jpg";
if(!g_settings.screenshot_cover)
snprintf(ending, sizeof(ending) - 1, "_%x.jpg", position);
std::string fname = full_name;
std::string::size_type pos = fname.find_last_of('.');
if(pos != std::string::npos) {
fname.replace(pos, fname.length(), ".jpg");
fname.replace(pos, fname.length(), ending);
} else
fname += ".jpg";
fname += ending;
if(!g_settings.screenshot_cover){
pos = fname.find_last_of('/');
if(pos != std::string::npos) {
std::string fname_scr=fname;
fname.replace(0, pos, g_settings.screenshot_dir);
}
}
#if 0 // TODO disable overwrite ?
if(!access(fname.c_str(), F_OK)) {
}
#endif
CScreenShot * sc = new CScreenShot(fname);
if(g_settings.screenshot_cover && !g_settings.screenshot_video)
sc->EnableVideo(true);
sc->Start();
} else if ( msg == NeutrinoMessages::ANNOUNCE_RECORD ||

View File

@@ -52,6 +52,7 @@
#include <gui/widget/stringinput.h>
#include <driver/screen_max.h>
#include <driver/screenshot.h>
#include <system/debug.h>
@@ -257,6 +258,11 @@ int COsdSetup::exec(CMenuTarget* parent, const std::string &actionKey)
chooserDir(g_settings.logo_hdd_dir, false, action_str);
return menu_return::RETURN_REPAINT;
}
else if(actionKey=="screenshot_dir") {
const char *action_str = "screenshot";
chooserDir(g_settings.screenshot_dir, true, action_str);
return menu_return::RETURN_REPAINT;
}
else if(strncmp(actionKey.c_str(), "fontsize.d", 10) == 0) {
for (int i = 0; i < 6; i++) {
if (actionKey == font_sizes_groups[i].actionkey) {
@@ -413,6 +419,11 @@ int COsdSetup::showOsdSetup()
showOsdChanlistSetup(osd_menu_chanlist);
osd_menu->addItem( new CMenuForwarder(LOCALE_MISCSETTINGS_CHANNELLIST, true, NULL, osd_menu_chanlist, NULL, CRCInput::RC_2));
//screenshot
CMenuWidget *osd_menu_screenshot = new CMenuWidget(LOCALE_MAINMENU_SETTINGS, NEUTRINO_ICON_SETTINGS, width, MN_WIDGET_ID_OSDSETUP_SCREENSHOT);
showOsdScreenshottSetup(osd_menu_screenshot);
osd_menu->addItem( new CMenuForwarder(LOCALE_SCREENSHOT_MENU, true, NULL, osd_menu_screenshot, NULL, CRCInput::RC_3));
//monitor
//CScreenPresetNotifier * presetNotify = new CScreenPresetNotifier();
//osd_menu->addItem(new CMenuOptionChooser(LOCALE_COLORMENU_OSD_PRESET, &g_settings.screen_preset, OSD_PRESET_OPTIONS, OSD_PRESET_OPTIONS_COUNT, true, presetNotify));
@@ -619,9 +630,9 @@ void COsdSetup::showOsdChanlistSetup(CMenuWidget *menu_chanlist)
{
menu_chanlist->addIntroItems(LOCALE_MISCSETTINGS_CHANNELLIST);
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_EPGTEXT_ALIGN, &g_settings.channellist_epgtext_align_right, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS, CHANNELLIST_EPGTEXT_ALIGN_RIGHT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_EXTENDED, &g_settings.channellist_extended, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_CHANNELLIST_FOOT, &g_settings.channellist_foot, CHANNELLIST_FOOT_OPTIONS, CHANNELLIST_FOOT_OPTIONS_COUNT, true));
menu_chanlist->addItem(new CMenuOptionChooser(LOCALE_MISCSETTINGS_CHANNELLIST_COLORED_EVENTS, &g_settings.colored_events_channellist, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true));
}
@@ -696,3 +707,34 @@ int COsdSetup::showContextChanlistMenu()
delete menu_chanlist;
return res;
}
//screenshot
#define SCREENSHOT_FMT_OPTION_COUNT 3
const CMenuOptionChooser::keyval_ext SCREENSHOT_FMT_OPTIONS[SCREENSHOT_FMT_OPTION_COUNT] =
{
{ CScreenShot::FORMAT_PNG, NONEXISTANT_LOCALE, "PNG" },
{ CScreenShot::FORMAT_JPG, NONEXISTANT_LOCALE, "JPEG" },
{ CScreenShot::FORMAT_BMP, NONEXISTANT_LOCALE, "BMP" }
};
#define SCREENSHOT_OPTION_COUNT 2
const CMenuOptionChooser::keyval SCREENSHOT_OPTIONS[SCREENSHOT_OPTION_COUNT] =
{
{ 0, LOCALE_SCREENSHOT_TV },
{ 1, LOCALE_SCREENSHOT_OSD }
};
void COsdSetup::showOsdScreenshottSetup(CMenuWidget *menu_screenshot)
{
menu_screenshot->addIntroItems(LOCALE_SCREENSHOT_MENU);
if((uint)g_settings.key_screenshot == CRCInput::RC_nokey)
menu_screenshot->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_SCREENSHOT_INFO));
menu_screenshot->addItem(new CMenuOptionNumberChooser(LOCALE_SCREENSHOT_COUNT, &g_settings.screenshot_count, true, 1, 5, NULL));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_FORMAT, &g_settings.screenshot_format, SCREENSHOT_FMT_OPTIONS, SCREENSHOT_FMT_OPTION_COUNT, true));
menu_screenshot->addItem(new CMenuForwarder(LOCALE_SCREENSHOT_DEFDIR, true, g_settings.screenshot_dir, this, "screenshot_dir"));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_MENU, &g_settings.screenshot_mode, SCREENSHOT_OPTIONS, SCREENSHOT_OPTION_COUNT, true));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_VIDEO, &g_settings.screenshot_video, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
// menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_SCALE, &g_settings.screenshot_scale, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
menu_screenshot->addItem(new CMenuOptionChooser(LOCALE_SCREENSHOT_COVER, &g_settings.screenshot_cover, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
}

View File

@@ -57,6 +57,7 @@ class COsdSetup : public CMenuTarget, public CChangeObserver
void showOsdTimeoutSetup(CMenuWidget *menu_timeout);
void showOsdInfobarSetup(CMenuWidget *menu_infobar);
void showOsdChanlistSetup(CMenuWidget *menu_chanlist);
void showOsdScreenshottSetup(CMenuWidget *menu_screenshot);
void AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry);

View File

@@ -198,7 +198,7 @@ const CMenuOptionChooser::keyval PERSONALIZE_PROTECT_MODE_OPTIONS[CPersonalizeGu
CPersonalizeGui::CPersonalizeGui()
CPersonalizeGui::CPersonalizeGui() : CPINProtection(g_settings.personalize_pincode)
{
width = 0;
widget_count = 0;
@@ -206,6 +206,7 @@ CPersonalizeGui::CPersonalizeGui()
show_usermenu = false;
show_pin_setup = false;
user_menu_notifier = NULL;
pin_setup_notifier = NULL;
fkeyMenu = NULL;
plMenu = NULL;
tmpW = NULL;
@@ -250,8 +251,22 @@ int CPersonalizeGui::exec(CMenuTarget* parent, const string & actionKey)
return menu_return::RETURN_EXIT_ALL;
}
res = ShowPersonalizationMenu(); // Show main Personalization Menu
SaveAndExit();
//also handle pin access
handleSetting(&g_settings.personalize[SNeutrinoSettings::P_MAIN_PINSTATUS]);
//pin protected access to personalize menu also if found any pin protected items
bool is_pin_protected = g_settings.personalize[SNeutrinoSettings::P_MAIN_PINSTATUS];
if ( is_pin_protected || hasPinItems()){
setHint(LOCALE_PERSONALIZE_PINHINT); //from CPINProtection
if (check())
is_pin_protected = false;
}
if (!is_pin_protected){
res = ShowPersonalizationMenu(); // Show main Personalization Menu
SaveAndExit();
}
return res;
}
@@ -317,6 +332,7 @@ int CPersonalizeGui::ShowPersonalizationMenu()
delete plMenu;
v_userMenuSetup.clear();
delete user_menu_notifier;
delete pin_setup_notifier;
return res;
}
@@ -325,7 +341,14 @@ int CPersonalizeGui::ShowPersonalizationMenu()
void CPersonalizeGui::ShowPinSetup(CMenuWidget* p_widget, CPINChangeWidget *pin_widget)
{
pin_widget = new CPINChangeWidget(LOCALE_PERSONALIZE_PINCODE, g_settings.personalize_pincode, 4, LOCALE_PERSONALIZE_PINHINT);
p_widget->addItem(new CMenuForwarder(LOCALE_PERSONALIZE_PINCODE, true, g_settings.personalize_pincode, pin_widget, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED));
CMenuForwarder * fw_pin_setup = new CMenuForwarder(LOCALE_PERSONALIZE_PINCODE, true, g_settings.personalize_pincode, pin_widget, NULL, CRCInput::RC_red, NEUTRINO_ICON_BUTTON_RED);
pin_setup_notifier = new CPinSetupNotifier(fw_pin_setup);
p_widget->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_PIN_IN_USE, &g_settings.personalize[SNeutrinoSettings::P_MAIN_PINSTATUS], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, pin_setup_notifier));
fw_pin_setup->setActive(pin_setup_notifier->changeNotify());
p_widget->addItem(fw_pin_setup);
p_widget->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_PERSONALIZE_MENUCONFIGURATION));
}
@@ -892,3 +915,15 @@ bool CUserMenuNotifier::changeNotify(const neutrino_locale_t, void *)
return true;
}
//helper class to enable/disable pin setup
CPinSetupNotifier::CPinSetupNotifier( CMenuItem* item)
{
toDisable=item;
}
bool CPinSetupNotifier::changeNotify(const neutrino_locale_t, void *)
{
toDisable->setActive(g_settings.personalize[SNeutrinoSettings::P_MAIN_PINSTATUS]);
return g_settings.personalize[SNeutrinoSettings::P_MAIN_PINSTATUS];
}

View File

@@ -74,6 +74,16 @@ class CUserMenuNotifier : public CChangeObserver
bool changeNotify(const neutrino_locale_t = NONEXISTANT_LOCALE, void *data = NULL);
};
//helper class to enable/disable pin setup
class CPinSetupNotifier : public CChangeObserver
{
private:
CMenuItem* toDisable;
public:
CPinSetupNotifier( CMenuItem*);
bool changeNotify(const neutrino_locale_t = NONEXISTANT_LOCALE, void *data = NULL);
};
//some required typedefs
typedef struct mn_widget_t
@@ -122,10 +132,14 @@ typedef struct personalize_settings_t
} personalize_settings_struct_t;
class CPersonalizeGui : public CMenuTarget, public CChangeObserver
class CPersonalizeGui : public CMenuTarget, public CChangeObserver, public CPINProtection
{
protected:
virtual CMenuTarget* getParent() { return( NULL);};
private:
CUserMenuNotifier *user_menu_notifier;
CPinSetupNotifier *pin_setup_notifier;
CMenuWidget* fkeyMenu;
CMenuWidget* plMenu;
CMenuWidget* tmpW;

View File

@@ -55,7 +55,7 @@ CThemes::CThemes()
: themefile('\t')
{
width = w_max (40, 10);
notifier = NULL;
hasThemeChanged = false;
}

View File

@@ -54,6 +54,7 @@
#include "gui/imageinfo.h"
#include "gui/dboxinfo.h"
#include "gui/cam_menu.h"
#include "gui/pluginlist.h"
#include <global.h>
#include <neutrino.h>
@@ -125,6 +126,8 @@ bool CUserMenu::showUserMenu(int button)
CImageInfo *imageinfo = NULL;
CDBoxInfoWidget *boxinfo = NULL;
CNeutrinoApp * neutrino = NULL;
CPluginList * games = NULL;
CPluginList * scripts = NULL;
std::string txt = g_settings.usermenu_text[button];
neutrino_locale_t caption = user_menu[button].caption;
@@ -288,6 +291,22 @@ bool CUserMenu::showUserMenu(int button)
menu_item = new CMenuForwarder(LOCALE_EPGMENU_STREAMINFO, true, NULL, streamInfo, "-1", key, icon );
menu->addItem(menu_item, false);
break;
case SNeutrinoSettings::ITEM_GAMES:
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_GAMES;
games = new CPluginList(LOCALE_MAINMENU_GAMES,CPlugins::P_TYPE_GAME);
keyhelper.get(&key,&icon);
menu_item = new CMenuForwarder(LOCALE_MAINMENU_GAMES, g_PluginList->hasPlugin(CPlugins::P_TYPE_GAME), NULL, games, "-1", key, icon );
menu->addItem(menu_item, false);
break;
case SNeutrinoSettings::ITEM_SCRIPTS:
menu_items++;
menu_prev = SNeutrinoSettings::ITEM_SCRIPTS;
scripts = new CPluginList(LOCALE_MAINMENU_SCRIPTS,CPlugins::P_TYPE_SCRIPT);
keyhelper.get(&key,&icon);
menu_item = new CMenuForwarder(LOCALE_MAINMENU_SCRIPTS, g_PluginList->hasPlugin(CPlugins::P_TYPE_SCRIPT), NULL, scripts, "-1", key, icon );
menu->addItem(menu_item, false);
break;
case SNeutrinoSettings::ITEM_PLUGIN:
{
char id[5];
@@ -434,6 +453,8 @@ bool CUserMenu::showUserMenu(int button)
if (StreamFeaturesChanger) delete StreamFeaturesChanger;
if (imageinfo) delete imageinfo;
if (boxinfo) delete boxinfo;
if (games) delete games;
if (scripts) delete scripts;
if (menu) delete menu;
return 0;
}

View File

@@ -89,7 +89,9 @@ const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUN
{ SNeutrinoSettings::ITEM_IMAGEINFO, LOCALE_SERVICEMENU_IMAGEINFO },
{ SNeutrinoSettings::ITEM_BOXINFO, LOCALE_EXTRA_DBOXINFO },
{ SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS },
{ SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON }
{ SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON },
{ SNeutrinoSettings::ITEM_GAMES, LOCALE_MAINMENU_GAMES },
{ SNeutrinoSettings::ITEM_SCRIPTS, LOCALE_MAINMENU_SCRIPTS }
};
int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &)

View File

@@ -456,8 +456,8 @@ class CMenuWidget : public CMenuTarget
virtual void hide();
virtual int exec(CMenuTarget* parent, const std::string & actionKey);
virtual std::string getName();
virtual void setSelected(const int &Preselected){ preselected = Preselected; };
virtual int getSelected(){ return selected; };
void setSelected(const int &Preselected){ preselected = Preselected; };
int getSelected(){ return selected; };
void move(int xoff, int yoff);
int getSelectedLine(void){return exit_pressed ? -1 : selected;};
void setWizardMode(bool _from_wizard) { from_wizard = _from_wizard;};