mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 08:21:07 +02:00
- move clock function from red button (main menu) into features menu
- ...so it's customizable in all user menus
- switching between tv and radio only with red button (main menu) depend of current mode
- add timerlist into main menu
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1985 e54a6e83-5905-42d5-8d5c-058d10e6a962
Origin commit data
------------------
Commit: ed0166e600
Author: Thilo Graf <dbt@novatux.de>
Date: 2011-12-20 (Tue, 20 Dec 2011)
Origin message was:
------------------
*neutrino: rework clock and radio/tv switch functionality
- move clock function from red button (main menu) into features menu
- ...so it's customizable in all user menus
- switching between tv and radio only with red button (main menu) depend of current mode
- add timerlist into main menu
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-beta@1985 e54a6e83-5905-42d5-8d5c-058d10e6a962
129 lines
4.4 KiB
C++
129 lines
4.4 KiB
C++
/*
|
|
$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 <neutrino_menue.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)
|
|
{
|
|
local = menue_title;
|
|
button = menue_button;
|
|
|
|
width = w_max (40, 10);
|
|
}
|
|
|
|
CUserMenuSetup::~CUserMenuSetup()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
#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_EXTRA_DBOXINFO },
|
|
{ SNeutrinoSettings::ITEM_CAM, LOCALE_CI_SETTINGS },
|
|
{ SNeutrinoSettings::ITEM_CLOCK, LOCALE_CLOCK_SWITCH_ON }
|
|
};
|
|
|
|
int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &)
|
|
{
|
|
if(parent != NULL)
|
|
parent->hide();
|
|
|
|
return showSetup();
|
|
}
|
|
|
|
int CUserMenuSetup::showSetup()
|
|
{
|
|
mn_widget_id_t widget_id = MN_WIDGET_ID_USERMENU_RED + button; //add up ''button'' and becomes to MN_WIDGET_ID_USERMENU_ GREEN, MN_WIDGET_ID_USERMENU_ YELLOW, MN_WIDGET_ID_USERMENU_BLUE
|
|
CMenuWidget * ums = new CMenuWidget(local, NEUTRINO_ICON_KEYBINDING, width, widget_id);
|
|
|
|
//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, NULL, CRCInput::RC_nokey, "", true));
|
|
}
|
|
|
|
int res = ums->exec(NULL, "");
|
|
ums->hide();
|
|
delete ums;
|
|
return res;
|
|
}
|
|
|