mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
Preparing the menu classes for Lua Part #2
- Remove CMenuForwarderNonLocalized
- Add overloaded function CMenuForwarder for non local
THX Martii
Origin commit data
------------------
Branch: ni/coolstream
Commit: b41819190d
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-01-16 (Thu, 16 Jan 2014)
Origin message was:
------------------
Preparing the menu classes for Lua Part #2
- Remove CMenuForwarderNonLocalized
- Add overloaded function CMenuForwarder for non local
THX Martii
------------------
This commit was generated by Migit
This commit is contained in:
@@ -710,36 +710,42 @@ private:
|
||||
CChangeObserver * observer;
|
||||
CConfigFile * configfile;
|
||||
int32_t defaultvalue;
|
||||
char value[11];
|
||||
std::string value;
|
||||
|
||||
protected:
|
||||
|
||||
virtual const char * getOption(void)
|
||||
{
|
||||
sprintf(value, "%u", configfile->getInt32(locale_real_names[text], defaultvalue));
|
||||
return value;
|
||||
}
|
||||
std::string getOption(fb_pixel_t * bgcol __attribute__((unused)) = NULL) {
|
||||
return to_string(configfile->getInt32(locale_real_names[name], defaultvalue));
|
||||
}
|
||||
|
||||
virtual bool changeNotify(const neutrino_locale_t OptionName, void * Data)
|
||||
{
|
||||
configfile->setInt32(locale_real_names[text], atoi(value));
|
||||
return observer->changeNotify(OptionName, Data);
|
||||
}
|
||||
{
|
||||
configfile->setInt32(locale_real_names[name], atoi(value.c_str()));
|
||||
return observer->changeNotify(OptionName, Data);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
CMenuNumberInput(const neutrino_locale_t Text, const int32_t DefaultValue, CChangeObserver * const Observer, CConfigFile * const Configfile) : CMenuForwarder(Text, true, NULL, this)
|
||||
{
|
||||
observer = Observer;
|
||||
configfile = Configfile;
|
||||
defaultvalue = DefaultValue;
|
||||
}
|
||||
{
|
||||
observer = Observer;
|
||||
configfile = Configfile;
|
||||
defaultvalue = DefaultValue;
|
||||
}
|
||||
|
||||
int exec(CMenuTarget * parent, const std::string & action_Key)
|
||||
{
|
||||
CStringInput input(text, (char *)getOption(), 3, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, "0123456789 ", this);
|
||||
return input.exec(parent, action_Key);
|
||||
}
|
||||
{
|
||||
value = getOption();
|
||||
while (value.length() < 3)
|
||||
value = " " + value;
|
||||
CStringInput input(name, &value, 3, LOCALE_IPSETUP_HINT_1, LOCALE_IPSETUP_HINT_2, "0123456789 ", this);
|
||||
return input.exec(parent, action_Key);
|
||||
}
|
||||
|
||||
std::string &getValue(void) {
|
||||
value = getOption();
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
void COsdSetup::AddFontSettingItem(CMenuWidget &font_Settings, const SNeutrinoSettings::FONT_TYPES number_of_fontsize_entry)
|
||||
|
Reference in New Issue
Block a user