Project "Tuxbox-GIT: apps":
The branch, master has been updated
via 9329e5b0197328e27df0467d0ffc13242f0ee05a (commit)
from 561f790b26148434212bfc21de9c9f680c1be1ca (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 9329e5b0197328e27df0467d0ffc13242f0ee05a
Author: martii <[email protected]>
Date: Sun May 31 19:18:31 2015 +0200
gui/keybind_setup: use CMenuOptionNumberChooser instead of CStringInput
based on martii's code with some changes for dbox
Signed-off-by: GetAway <[email protected]>
diff --git a/tuxbox/neutrino/data/locale/deutsch.locale
b/tuxbox/neutrino/data/locale/deutsch.locale
index c3834cb..aa19229 100644
--- a/tuxbox/neutrino/data/locale/deutsch.locale
+++ b/tuxbox/neutrino/data/locale/deutsch.locale
@@ -1227,8 +1227,6 @@ recordingmenu.use_o_sync Synchrones Schreiben (O_SYNC)
recordingmenu.vcr Videorekorder
recordingmenu.zap_on_announce Umschalten bei Ankündigung
recordtimer.announce Die Aufnahme beginnt in wenigen Minuten.
-repeatblocker.hint_1 Mindestzeit (in ms) zwischen 2 Tastendrücken
-repeatblocker.hint_2 0 schaltet den Blocker aus (Rot ist " ")
sambaserver.setup Globale Samba-Einstellungen
sambaserver.setup_configfile_path Konfigurationsdatei
sambaserver.setup_configfile_path_hint1 Bitte Pfad zur
Samba-Konfigurationsdatei eingeben!
@@ -1559,6 +1557,7 @@ videomenu.videosignal_yuv_c YUV + CVBS
videomenu.videosignal_yuv_v YUV + VBS
word.from ab
word.hours_short Std.
+word.milliseconds_short ms
word.minutes_short Min.
zapit.scantype Service-Auswahl
zapit.scantype.all Alle Services
diff --git a/tuxbox/neutrino/data/locale/english.locale
b/tuxbox/neutrino/data/locale/english.locale
index c6cf746..76bcdd1 100644
--- a/tuxbox/neutrino/data/locale/english.locale
+++ b/tuxbox/neutrino/data/locale/english.locale
@@ -1227,8 +1227,6 @@ recordingmenu.use_o_sync Write Synchronous (O_SYNC)
recordingmenu.vcr vcr
recordingmenu.zap_on_announce Announce zap
recordtimer.announce Recording starts in a few minutes
-repeatblocker.hint_1 Shortest time (in ms) to recognize 2 keystrokes
-repeatblocker.hint_2 Enter 0 to switch of the blocker (red is space)
sambaserver.setup Global Samba-settings
sambaserver.setup_configfile_path Configfile
sambaserver.setup_configfile_path_hint1 Please enter path for samba config
file!
@@ -1559,6 +1557,7 @@ videomenu.videosignal_yuv_c YUV + CVBS
videomenu.videosignal_yuv_v YUV + VBS
word.from from
word.hours_short hr.
+word.milliseconds_short ms
word.minutes_short min.
zapit.scantype scan for services
zapit.scantype.all all services
diff --git a/tuxbox/neutrino/src/gui/audio_setup.cpp
b/tuxbox/neutrino/src/gui/audio_setup.cpp
index 06ef19e..1728c06 100644
--- a/tuxbox/neutrino/src/gui/audio_setup.cpp
+++ b/tuxbox/neutrino/src/gui/audio_setup.cpp
@@ -91,9 +91,9 @@ const CMenuOptionChooser::keyval
AUDIOMENU_ANALOGOUT_OPTIONS[AUDIOMENU_ANALOGOUT
const CMenuOptionChooser::keyval
AUDIOMENU_AVS_CONTROL_OPTIONS[AUDIOMENU_AVS_CONTROL_OPTION_COUNT] =
{
{ CControld::TYPE_OST , LOCALE_AUDIOMENU_OST },
- { CControld::TYPE_AVS , LOCALE_AUDIOMENU_AVS },
+ { CControld::TYPE_AVS , LOCALE_AUDIOMENU_AVS }
#ifdef ENABLE_LIRC
- { CControld::TYPE_LIRC, LOCALE_AUDIOMENU_LIRC }
+ ,{ CControld::TYPE_LIRC, LOCALE_AUDIOMENU_LIRC }
#endif
};
#endif
@@ -149,8 +149,7 @@ int CAudioSetup::showAudioSetup()
audioSettings->addItem(GenericMenuSeparatorLine);
#ifdef HAVE_DBOX_HARDWARE
- CStringInput audio_PCMOffset(LOCALE_AUDIOMENU_PCMOFFSET,
g_settings.audio_PCMOffset, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE,
"0123456789 ", &audioSetupNotifier);
- CMenuForwarder *mf = new CMenuForwarder(LOCALE_AUDIOMENU_PCMOFFSET,
(g_settings.audio_avs_Control == CControld::TYPE_LIRC),
g_settings.audio_PCMOffset, &audio_PCMOffset);
+ CMenuOptionNumberChooser *mf = new
CMenuOptionNumberChooser(LOCALE_AUDIOMENU_PCMOFFSET,
&g_settings.audio_PCMOffset, (g_settings.audio_avs_Control ==
CControld::TYPE_LIRC), 0, 99, 0, 0, NONEXISTANT_LOCALE, NULL,
&audioSetupNotifier, CRCInput::RC_nokey, "", true);
CAudioSetupNotifier2 audioSetupNotifier2(mf);
oj = new CMenuOptionChooser(LOCALE_AUDIOMENU_AVS_CONTROL,
&g_settings.audio_avs_Control, AUDIOMENU_AVS_CONTROL_OPTIONS,
AUDIOMENU_AVS_CONTROL_OPTION_COUNT, true, &audioSetupNotifier2);
@@ -164,8 +163,7 @@ int CAudioSetup::showAudioSetup()
#endif
// volume bar steps
- CStringInput audio_step(LOCALE_AUDIOMENU_VOLUMEBAR_AUDIOSTEPS,
g_settings.audio_step, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789
");
- CMenuForwarder *as = new
CMenuForwarder(LOCALE_AUDIOMENU_VOLUMEBAR_AUDIOSTEPS, true,
g_settings.audio_step, &audio_step);
+ CMenuOptionNumberChooser *as = new
CMenuOptionNumberChooser(LOCALE_AUDIOMENU_VOLUMEBAR_AUDIOSTEPS,
&g_settings.audio_step, true, 0, 25, 0, 0, NONEXISTANT_LOCALE, NULL, NULL,
CRCInput::RC_nokey, "", true);
audioSettings->addItem(as);
// initial volume
@@ -187,7 +185,7 @@ bool CAudioSetupNotifier::changeNotify(const
neutrino_locale_t OptionName, void
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_PCMOFFSET))
{
if (g_settings.audio_avs_Control == CControld::TYPE_LIRC)
- g_Controld->setVolume(100 -
atoi(g_settings.audio_PCMOffset), CControld::TYPE_OST);
+ g_Controld->setVolume(100 - g_settings.audio_PCMOffset,
CControld::TYPE_OST);
}
else if (ARE_LOCALES_EQUAL(OptionName, LOCALE_AUDIOMENU_ANALOGOUT))
{
@@ -207,7 +205,7 @@ bool CAudioSetupNotifier2::changeNotify(const
neutrino_locale_t, void *)
toDisable[0]->setActive(g_settings.audio_avs_Control ==
CControld::TYPE_LIRC);
if (g_settings.audio_avs_Control == CControld::TYPE_LIRC)
- g_Controld->setVolume(100 - atoi(g_settings.audio_PCMOffset),
CControld::TYPE_OST);
+ g_Controld->setVolume(100 - g_settings.audio_PCMOffset,
CControld::TYPE_OST);
// tell controld the new volume_type
g_Controld->setVolume(g_Controld->getVolume((CControld::volume_type)g_settings.audio_avs_Control),
(CControld::volume_type)g_settings.audio_avs_Control);
diff --git a/tuxbox/neutrino/src/gui/keybind_setup.cpp
b/tuxbox/neutrino/src/gui/keybind_setup.cpp
index ffd562a..80c56eb 100644
--- a/tuxbox/neutrino/src/gui/keybind_setup.cpp
+++ b/tuxbox/neutrino/src/gui/keybind_setup.cpp
@@ -181,10 +181,12 @@ int CKeybindSetup::showSetup()
CMenuWidget * ks_rc = new CMenuWidget(menue_title,
menue_icon, width);
CMenuForwarder *ks_rc_fw = new
CMenuForwarder(LOCALE_KEYBINDINGMENU, true, NULL, ks_rc, NULL,
CRCInput::RC_red);
- CStringInput
keySettings_repeat_genericblocker(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC,
g_settings.repeat_genericblocker, 3, LOCALE_REPEATBLOCKER_HINT_1,
LOCALE_REPEATBLOCKER_HINT_2, "0123456789 ", this);
- CStringInput
keySettings_repeatBlocker(LOCALE_KEYBINDINGMENU_REPEATBLOCK,
g_settings.repeat_blocker, 3, LOCALE_REPEATBLOCKER_HINT_1,
LOCALE_REPEATBLOCKER_HINT_2, "0123456789 ", this);
- CMenuForwarder *ks_rc_repeat_fw = new
CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCK, true,
g_settings.repeat_blocker, &keySettings_repeatBlocker);
- CMenuForwarder *ks_rc_repeat_generic_fw = new
CMenuForwarder(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC, true,
g_settings.repeat_genericblocker, &keySettings_repeat_genericblocker);
+ std::string ms_number_format("%d ");
+ ms_number_format += g_Locale->getText(LOCALE_WORD_MILLISECONDS_SHORT);
+ CMenuOptionNumberChooser *ks_rc_repeat_fw = new
CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCK ,
&g_settings.repeat_blocker , true, 0, 999, 0, 0, NONEXISTANT_LOCALE,
NULL, this, CRCInput::RC_nokey, "", true);
+ ks_rc_repeat_fw->setNumberFormat(ms_number_format);
+ CMenuOptionNumberChooser *ks_rc_repeat_generic_fw = new
CMenuOptionNumberChooser(LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC,
&g_settings.repeat_genericblocker, true, 0, 999, 0, 0, NONEXISTANT_LOCALE,
NULL, this, CRCInput::RC_nokey, "", true);
+ ks_rc_repeat_generic_fw->setNumberFormat(ms_number_format);
//mode change
CMenuForwarder * ks_mc_fw = new
CMenuForwarder(keydescription[VIRTUALKEY_TV_RADIO_MODE], true,
keychooser[VIRTUALKEY_TV_RADIO_MODE]->getKeyName(),
keychooser[VIRTUALKEY_TV_RADIO_MODE]);
@@ -246,7 +248,7 @@ bool CKeybindSetup::changeNotify(const neutrino_locale_t
OptionName, void *)
if (ARE_LOCALES_EQUAL(OptionName, LOCALE_KEYBINDINGMENU_REPEATBLOCK) ||
ARE_LOCALES_EQUAL(OptionName,
LOCALE_KEYBINDINGMENU_REPEATBLOCKGENERIC))
{
- g_RCInput->setRepeat(atoi(g_settings.repeat_blocker),
atoi(g_settings.repeat_genericblocker));
+ g_RCInput->setRepeat(g_settings.repeat_blocker,
g_settings.repeat_genericblocker);
}
return false;
}
diff --git a/tuxbox/neutrino/src/neutrino.cpp b/tuxbox/neutrino/src/neutrino.cpp
index 3ac3bea..054ad0a 100644
--- a/tuxbox/neutrino/src/neutrino.cpp
+++ b/tuxbox/neutrino/src/neutrino.cpp
@@ -409,10 +409,10 @@ int CNeutrinoApp::loadSetup()
g_settings.audio_initial_volume = configfile.getInt32(
"audio_initial_volume" , 0 );
#ifdef HAVE_DBOX_HARDWARE
g_settings.audio_avs_Control = configfile.getInt32(
"audio_avs_Control", CControld::TYPE_AVS );
- strcpy( g_settings.audio_step, configfile.getString(
"audio_step" , "5" ).c_str() );
+ g_settings.audio_step = configfile.getInt32( "audio_step"
, 5 );
#else
// the dreambox 500 (and the TD) has 32 volume steps, so a stepwidth of
3 matches the hardware better
- strcpy( g_settings.audio_step, configfile.getString(
"audio_step" , "3" ).c_str() );
+ g_settings.audio_step = configfile.getInt32( "audio_step"
, 3 );
#ifdef HAVE_TRIPLEDRAGON
g_settings.audio_avs_Control =
configfile.getInt32("audio_avs_Control", CControld::TYPE_AVS);
#else
@@ -420,7 +420,7 @@ int CNeutrinoApp::loadSetup()
g_settings.audio_avs_Control = CControld::TYPE_OST;
#endif
#endif
- strcpy( g_settings.audio_PCMOffset, configfile.getString(
"audio_PCMOffset", "0" ).c_str() );
+ g_settings.audio_PCMOffset = configfile.getInt32(
"audio_PCMOffset", 0 );
//vcr
g_settings.vcr_AutoSwitch =
configfile.getBool("vcr_AutoSwitch" , true );
@@ -640,12 +640,12 @@ int CNeutrinoApp::loadSetup()
g_settings.key_menu_pagedown =
(neutrino_msg_t)configfile.getInt32("key_menu_pagedown",
CRCInput::RC_page_down);
#ifdef HAVE_DBOX_HARDWARE
- strcpy(g_settings.repeat_blocker,
configfile.getString("repeat_blocker", g_info.box_Type ==
CControld::TUXBOX_MAKER_PHILIPS ? "150" : "25").c_str());
- strcpy(g_settings.repeat_genericblocker,
configfile.getString("repeat_genericblocker", g_info.box_Type ==
CControld::TUXBOX_MAKER_PHILIPS ? "25" : "0").c_str());
+ g_settings.repeat_blocker = configfile.getInt32("repeat_blocker"
, g_info.box_Type == CControld::TUXBOX_MAKER_PHILIPS ? 150 : 25);
+ g_settings.repeat_genericblocker =
configfile.getInt32("repeat_genericblocker", g_info.box_Type ==
CControld::TUXBOX_MAKER_PHILIPS ? 25 : 0);
#else
// my dm500s and tripledragon works good with those - seife
- strcpy(g_settings.repeat_blocker,
configfile.getString("repeat_blocker", "300").c_str());
- strcpy(g_settings.repeat_genericblocker,
configfile.getString("repeat_genericblocker", "100").c_str());
+ g_settings.repeat_blocker =
configfile.getInt32("repeat_blocker", 300);
+ g_settings.repeat_genericblocker =
configfile.getInt32("repeat_genericblocker", 100);
#endif
g_settings.audiochannel_up_down_enable =
configfile.getBool("audiochannel_up_down_enable", false);
g_settings.audio_left_right_selectable =
configfile.getBool("audio_left_right_selectable", false);
@@ -956,8 +956,8 @@ void CNeutrinoApp::saveSetup()
configfile.setBool("audio_DolbyDigital" ,
g_settings.audio_DolbyDigital);
configfile.setInt32( "audio_initial_volume" ,
g_settings.audio_initial_volume);
configfile.setInt32( "audio_avs_Control", g_settings.audio_avs_Control);
- configfile.setString( "audio_PCMOffset" , g_settings.audio_PCMOffset);
- configfile.setString( "audio_step" , g_settings.audio_step);
+ configfile.setInt32( "audio_PCMOffset" , g_settings.audio_PCMOffset);
+ configfile.setInt32( "audio_step" , g_settings.audio_step);
//vcr
configfile.setBool("vcr_AutoSwitch" , g_settings.vcr_AutoSwitch);
@@ -1139,8 +1139,8 @@ void CNeutrinoApp::saveSetup()
configfile.setInt32( "key_menu_pageup", (int)g_settings.key_menu_pageup
);
configfile.setInt32( "key_menu_pagedown",
(int)g_settings.key_menu_pagedown );
- configfile.setString( "repeat_blocker", g_settings.repeat_blocker );
- configfile.setString( "repeat_genericblocker",
g_settings.repeat_genericblocker );
+ configfile.setInt32( "repeat_blocker", g_settings.repeat_blocker );
+ configfile.setInt32( "repeat_genericblocker",
g_settings.repeat_genericblocker );
configfile.setBool ( "audiochannel_up_down_enable",
g_settings.audiochannel_up_down_enable );
configfile.setBool ( "audio_left_right_selectable",
g_settings.audio_left_right_selectable );
@@ -2627,11 +2627,8 @@ int CNeutrinoApp::handleMsg(const neutrino_msg_t m,
neutrino_msg_data_t data)
struct timeval endtime;
time_t seconds;
- int timeout = 0;
- int timeout1 = 0;
-
-
sscanf(g_settings.repeat_blocker, "%d", &timeout);
-
sscanf(g_settings.repeat_genericblocker, "%d", &timeout1);
+ int timeout =
g_settings.repeat_blocker;
+ int timeout1 =
g_settings.repeat_genericblocker;
if (timeout1 > timeout)
timeout = timeout1;
@@ -3458,7 +3455,7 @@ void CNeutrinoApp::setVolume(const neutrino_msg_t key,
const bool bDoPaint)
const int bwtop = 20; // border width y from top
const int bwbot = 20; // border width y from bottom
int x, y;
- int a_step = atoi(g_settings.audio_step);
+ int a_step = g_settings.audio_step;
volumeBarIsVisible = ((g_settings.volumebar_disp_pos !=
VOLUMEBAR_DISP_POS_OFF) ? true : false);
if( g_settings.volumebar_disp_pos == VOLUMEBAR_DISP_POS_TOP_RIGHT )
diff --git a/tuxbox/neutrino/src/system/locals.h
b/tuxbox/neutrino/src/system/locals.h
index 2e40fe0..9cad528 100644
--- a/tuxbox/neutrino/src/system/locals.h
+++ b/tuxbox/neutrino/src/system/locals.h
@@ -1254,8 +1254,6 @@ typedef enum
LOCALE_RECORDINGMENU_VCR,
LOCALE_RECORDINGMENU_ZAP_ON_ANNOUNCE,
LOCALE_RECORDTIMER_ANNOUNCE,
- LOCALE_REPEATBLOCKER_HINT_1,
- LOCALE_REPEATBLOCKER_HINT_2,
LOCALE_SAMBASERVER_SETUP,
LOCALE_SAMBASERVER_SETUP_CONFIGFILE_PATH,
LOCALE_SAMBASERVER_SETUP_CONFIGFILE_PATH_HINT1,
@@ -1586,6 +1584,7 @@ typedef enum
LOCALE_VIDEOMENU_VIDEOSIGNAL_YUV_V,
LOCALE_WORD_FROM,
LOCALE_WORD_HOURS_SHORT,
+ LOCALE_WORD_MILLISECONDS_SHORT,
LOCALE_WORD_MINUTES_SHORT,
LOCALE_ZAPIT_SCANTYPE,
LOCALE_ZAPIT_SCANTYPE_ALL,
diff --git a/tuxbox/neutrino/src/system/locals_intern.h
b/tuxbox/neutrino/src/system/locals_intern.h
index 381b664..eea4202 100644
--- a/tuxbox/neutrino/src/system/locals_intern.h
+++ b/tuxbox/neutrino/src/system/locals_intern.h
@@ -1254,8 +1254,6 @@ const char * locale_real_names[] =
"recordingmenu.vcr",
"recordingmenu.zap_on_announce",
"recordtimer.announce",
- "repeatblocker.hint_1",
- "repeatblocker.hint_2",
"sambaserver.setup",
"sambaserver.setup_configfile_path",
"sambaserver.setup_configfile_path_hint1",
@@ -1586,6 +1584,7 @@ const char * locale_real_names[] =
"videomenu.videosignal_yuv_v",
"word.from",
"word.hours_short",
+ "word.milliseconds_short",
"word.minutes_short",
"zapit.scantype",
"zapit.scantype.all",
diff --git a/tuxbox/neutrino/src/system/settings.h
b/tuxbox/neutrino/src/system/settings.h
index 0261f65..66eb16c 100644
--- a/tuxbox/neutrino/src/system/settings.h
+++ b/tuxbox/neutrino/src/system/settings.h
@@ -100,8 +100,8 @@ struct SNeutrinoSettings
int audio_DolbyDigital;
int audio_avs_Control;
int audio_initial_volume;
- char audio_step[3];
- char audio_PCMOffset[3];
+ int audio_step;
+ int audio_PCMOffset;
//vcr
int vcr_AutoSwitch;
@@ -337,8 +337,8 @@ struct {
neutrino_msg_t key_menu_pageup;
neutrino_msg_t key_menu_pagedown;
- char repeat_blocker[4];
- char repeat_genericblocker[4];
+ int repeat_blocker;
+ int repeat_genericblocker;
int audiochannel_up_down_enable;
int audio_left_right_selectable;
-----------------------------------------------------------------------
Summary of changes:
tuxbox/neutrino/data/locale/deutsch.locale | 3 +-
tuxbox/neutrino/data/locale/english.locale | 3 +-
tuxbox/neutrino/src/gui/audio_setup.cpp | 14 +++++-------
tuxbox/neutrino/src/gui/keybind_setup.cpp | 12 ++++++----
tuxbox/neutrino/src/neutrino.cpp | 31 ++++++++++++---------------
tuxbox/neutrino/src/system/locals.h | 3 +-
tuxbox/neutrino/src/system/locals_intern.h | 3 +-
tuxbox/neutrino/src/system/settings.h | 8 +++---
8 files changed, 35 insertions(+), 42 deletions(-)
--
Tuxbox-GIT: apps
------------------------------------------------------------------------------
_______________________________________________
Tuxbox-cvs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tuxbox-cvs-commits