tuxbox-port: modul files added

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@894 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Commit: a508e4ab5f
Author: Thilo Graf <dbt@novatux.de>
Date: 2010-11-28 (Sun, 28 Nov 2010)
This commit is contained in:
2010-11-27 23:16:38 +00:00
parent 1fca50d3a1
commit 590f705df8
29 changed files with 3645 additions and 0 deletions

View File

@@ -0,0 +1,139 @@
/*
$port: user_menue_setup.cpp,v 1.1 2010/07/30 20:52:31 tuxbox-cvs Exp $
user_menue setup implementation - Neutrino-GUI
based up implementation by Günther
Copyright (C) 2001 Steffen Hehn 'McClean'
and some other guys
Homepage: http://dbox.cyberphoria.org/
Copyright (C) 2010 T. Graf 'dbt'
Homepage: http://www.dbox2-tuning.net/
License: GPL
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gui/user_menue_setup.h"
#include <global.h>
#include <neutrino.h>
#include <gui/widget/icons.h>
#include <gui/widget/stringinput.h>
#include <gui/widget/keychooser.h>
#include <driver/screen_max.h>
#include <system/debug.h>
CUserMenuSetup::CUserMenuSetup(neutrino_locale_t menue_title, int menue_button)
{
frameBuffer = CFrameBuffer::getInstance();
local = menue_title;
button = menue_button;
width = w_max (35, 10);
hheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight();
mheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight();
height = hheight+13*mheight+ 10;
x = getScreenStartX (width);
y = getScreenStartY (height);
}
CUserMenuSetup::~CUserMenuSetup()
{
}
void CUserMenuSetup::hide()
{
frameBuffer->paintBackgroundBoxRel(x,y, width,height);
}
#define USERMENU_ITEM_OPTION_COUNT SNeutrinoSettings::ITEM_MAX
const CMenuOptionChooser::keyval USERMENU_ITEM_OPTIONS[USERMENU_ITEM_OPTION_COUNT] =
{
{ SNeutrinoSettings::ITEM_NONE, LOCALE_USERMENU_ITEM_NONE },
{ SNeutrinoSettings::ITEM_BAR, LOCALE_USERMENU_ITEM_BAR },
{ SNeutrinoSettings::ITEM_EPG_LIST, LOCALE_EPGMENU_EVENTLIST },
{ SNeutrinoSettings::ITEM_EPG_SUPER, LOCALE_EPGMENU_EPGPLUS },
{ SNeutrinoSettings::ITEM_EPG_INFO, LOCALE_EPGMENU_EVENTINFO },
{ SNeutrinoSettings::ITEM_EPG_MISC, LOCALE_USERMENU_ITEM_EPG_MISC },
{ SNeutrinoSettings::ITEM_AUDIO_SELECT, LOCALE_AUDIOSELECTMENUE_HEAD },
{ SNeutrinoSettings::ITEM_SUBCHANNEL, LOCALE_INFOVIEWER_SUBSERVICE },
{ SNeutrinoSettings::ITEM_RECORD, LOCALE_TIMERLIST_TYPE_RECORD },
{ SNeutrinoSettings::ITEM_MOVIEPLAYER_MB, LOCALE_MOVIEBROWSER_HEAD },
{ SNeutrinoSettings::ITEM_TIMERLIST, LOCALE_TIMERLIST_NAME },
{ SNeutrinoSettings::ITEM_REMOTE, LOCALE_RCLOCK_MENUEADD },
{ SNeutrinoSettings::ITEM_FAVORITS, LOCALE_FAVORITES_MENUEADD },
{ SNeutrinoSettings::ITEM_TECHINFO, LOCALE_EPGMENU_STREAMINFO },
{ SNeutrinoSettings::ITEM_PLUGIN, LOCALE_TIMERLIST_PLUGIN },
{ SNeutrinoSettings::ITEM_VTXT, LOCALE_USERMENU_ITEM_VTXT },
{ SNeutrinoSettings::ITEM_IMAGEINFO, LOCALE_SERVICEMENU_IMAGEINFO },
{ SNeutrinoSettings::ITEM_BOXINFO, LOCALE_DBOXINFO },
{ SNeutrinoSettings::ITEM_CAM, LOCALE_CAM_SETTINGS }
};
int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &)
{
if(parent != NULL)
parent->hide();
showSetup();
return menu_return::RETURN_REPAINT;
}
void CUserMenuSetup::showSetup()
{
CMenuWidget * ums = new CMenuWidget(local, NEUTRINO_ICON_KEYBINDING, width);
//CUserMenuNotifier *notify = new CUserMenuNotifier();
CStringInputSMS name(LOCALE_USERMENU_NAME, &g_settings.usermenu_text[button], 11, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzäöüß/- "/*, notify*/);
CMenuForwarder *mf = new CMenuForwarder(LOCALE_USERMENU_NAME, true, g_settings.usermenu_text[button],&name);
// notify->setItem(mf);
//-------------------------------------
ums->addIntroItems();
//-------------------------------------
ums->addItem(mf);
ums->addItem(GenericMenuSeparatorLine);
//-------------------------------------
char text[10];
for(int item = 0; item < SNeutrinoSettings::ITEM_MAX && item <13; item++) // Do not show more than 13 items
{
snprintf(text,10,"%d:",item);
text[9]=0;// terminate for sure
ums->addItem( new CMenuOptionChooser(text, &g_settings.usermenu[button][item], USERMENU_ITEM_OPTIONS, USERMENU_ITEM_OPTION_COUNT,true ));
}
ums->exec(NULL, "");
ums->hide();
delete ums;
}