mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
SNeutrinoSettings: convert more char[...] configuration values to std::string
Origin commit data
------------------
Branch: ni/coolstream
Commit: 004aa84e32
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2014-01-18 (Sat, 18 Jan 2014)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -117,8 +117,8 @@ void CVFD::count_down() {
|
|||||||
|
|
||||||
void CVFD::wake_up() {
|
void CVFD::wake_up() {
|
||||||
if(!has_lcd) return;
|
if(!has_lcd) return;
|
||||||
if (atoi(g_settings.lcd_setting_dim_time) > 0) {
|
if (atoi(g_settings.lcd_setting_dim_time.c_str()) > 0) {
|
||||||
timeout_cnt = atoi(g_settings.lcd_setting_dim_time);
|
timeout_cnt = atoi(g_settings.lcd_setting_dim_time.c_str());
|
||||||
g_settings.lcd_setting_dim_brightness > -1 ?
|
g_settings.lcd_setting_dim_brightness > -1 ?
|
||||||
setBrightness(g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS]) : setPower(1);
|
setBrightness(g_settings.lcd_setting[SNeutrinoSettings::LCD_BRIGHTNESS]) : setPower(1);
|
||||||
}
|
}
|
||||||
|
@@ -87,12 +87,13 @@ int CSettingsManager::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
fileBrowser.Dir_Mode = true;
|
fileBrowser.Dir_Mode = true;
|
||||||
if (fileBrowser.exec("/var/tuxbox") == true)
|
if (fileBrowser.exec("/var/tuxbox") == true)
|
||||||
{
|
{
|
||||||
char fname[256] = "neutrino.conf", sname[256];
|
std::string fname = "neutrino.conf";
|
||||||
CStringInputSMS * sms = new CStringInputSMS(LOCALE_EXTRA_SAVECONFIG, fname, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789. ");
|
CStringInputSMS * sms = new CStringInputSMS(LOCALE_EXTRA_SAVECONFIG, &fname, 30, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "abcdefghijklmnopqrstuvwxyz0123456789. ");
|
||||||
sms->exec(NULL, "");
|
sms->exec(NULL, "");
|
||||||
sprintf(sname, "%s/%s", fileBrowser.getSelectedFile()->Name.c_str(), fname);
|
|
||||||
printf("[neutrino] save settings: %s\n", sname);
|
std::string sname = fileBrowser.getSelectedFile()->Name + "/" + fname;
|
||||||
CNeutrinoApp::getInstance()->saveSetup(sname);
|
printf("[neutrino] save settings: %s\n", sname.c_str());
|
||||||
|
CNeutrinoApp::getInstance()->saveSetup(sname.c_str());
|
||||||
delete sms;
|
delete sms;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
@@ -163,9 +163,9 @@ bool CFlashUpdate::selectHttpImage(void)
|
|||||||
SelectionWidget.addItem(new CMenuSeparator(CMenuSeparator::LINE));
|
SelectionWidget.addItem(new CMenuSeparator(CMenuSeparator::LINE));
|
||||||
|
|
||||||
SelectionWidget.addItem(new CMenuForwarder(current, false));
|
SelectionWidget.addItem(new CMenuForwarder(current, false));
|
||||||
std::ifstream urlFile(g_settings.softupdate_url_file);
|
std::ifstream urlFile(g_settings.softupdate_url_file.c_str());
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("[update] file %s\n", g_settings.softupdate_url_file);
|
printf("[update] file %s\n", g_settings.softupdate_url_file.c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
unsigned int i = 0;
|
unsigned int i = 0;
|
||||||
|
@@ -107,7 +107,7 @@ int CUpdateSettings::exec(CMenuTarget* parent, const std::string &actionKey)
|
|||||||
fileFilter.addFilter("urls");
|
fileFilter.addFilter("urls");
|
||||||
fileBrowser.Filter = &fileFilter;
|
fileBrowser.Filter = &fileFilter;
|
||||||
if (fileBrowser.exec("/var/etc") == true)
|
if (fileBrowser.exec("/var/etc") == true)
|
||||||
strncpy(g_settings.softupdate_url_file, fileBrowser.getSelectedFile()->Name.c_str(), 30);
|
g_settings.softupdate_url_file = fileBrowser.getSelectedFile()->Name;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@@ -517,7 +517,7 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 );
|
g_settings.infobar_Text_blue = configfile.getInt32( "infobar_Text_blue", 0x64 );
|
||||||
|
|
||||||
//personalize
|
//personalize
|
||||||
strcpy( g_settings.personalize_pincode, configfile.getString( "personalize_pincode", "0000" ).c_str() );
|
g_settings.personalize_pincode = configfile.getString( "personalize_pincode", "0000" );
|
||||||
for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++)//settings.h, settings.cpp
|
for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++)//settings.h, settings.cpp
|
||||||
g_settings.personalize[i] = configfile.getInt32( personalize_settings[i].personalize_settings_name, personalize_settings[i].personalize_default_val );
|
g_settings.personalize[i] = configfile.getInt32( personalize_settings[i].personalize_settings_name, personalize_settings[i].personalize_default_val );
|
||||||
|
|
||||||
@@ -683,10 +683,10 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.flashupdate_createimage_add_spare = configfile.getInt32( "flashupdate_createimage_add_spare", 0);
|
g_settings.flashupdate_createimage_add_spare = configfile.getInt32( "flashupdate_createimage_add_spare", 0);
|
||||||
g_settings.flashupdate_createimage_add_kernel = configfile.getInt32( "flashupdate_createimage_add_kernel", 1);
|
g_settings.flashupdate_createimage_add_kernel = configfile.getInt32( "flashupdate_createimage_add_kernel", 1);
|
||||||
|
|
||||||
strcpy(g_settings.softupdate_url_file, configfile.getString("softupdate_url_file", "/var/etc/update.urls").c_str());
|
g_settings.softupdate_url_file = configfile.getString("softupdate_url_file", "/var/etc/update.urls");
|
||||||
strcpy(g_settings.softupdate_proxyserver, configfile.getString("softupdate_proxyserver", "" ).c_str());
|
g_settings.softupdate_proxyserver = configfile.getString("softupdate_proxyserver", "" );
|
||||||
strcpy(g_settings.softupdate_proxyusername, configfile.getString("softupdate_proxyusername", "" ).c_str());
|
g_settings.softupdate_proxyusername = configfile.getString("softupdate_proxyusername", "" );
|
||||||
strcpy(g_settings.softupdate_proxypassword, configfile.getString("softupdate_proxypassword", "" ).c_str());
|
g_settings.softupdate_proxypassword = configfile.getString("softupdate_proxypassword", "" );
|
||||||
//
|
//
|
||||||
g_settings.font_file = configfile.getString("font_file", FONTDIR"/neutrino.ttf");
|
g_settings.font_file = configfile.getString("font_file", FONTDIR"/neutrino.ttf");
|
||||||
g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf");
|
g_settings.ttx_font_file = configfile.getString( "ttx_font_file", FONTDIR"/DejaVuLGCSansMono-Bold.ttf");
|
||||||
@@ -702,14 +702,14 @@ int CNeutrinoApp::loadSetup(const char * fname)
|
|||||||
g_settings.parentallock_lockage = 18;
|
g_settings.parentallock_lockage = 18;
|
||||||
}
|
}
|
||||||
g_settings.parentallock_defaultlocked = configfile.getInt32("parentallock_defaultlocked", 0);
|
g_settings.parentallock_defaultlocked = configfile.getInt32("parentallock_defaultlocked", 0);
|
||||||
strcpy( g_settings.parentallock_pincode, configfile.getString( "parentallock_pincode", "0000" ).c_str() );
|
g_settings.parentallock_pincode = configfile.getString( "parentallock_pincode", "0000" );
|
||||||
|
|
||||||
for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++)
|
for (int i = 0; i < SNeutrinoSettings::TIMING_SETTING_COUNT; i++)
|
||||||
g_settings.timing[i] = configfile.getInt32(locale_real_names[timing_setting[i].name], timing_setting[i].default_timing);
|
g_settings.timing[i] = configfile.getInt32(locale_real_names[timing_setting[i].name], timing_setting[i].default_timing);
|
||||||
|
|
||||||
for (int i = 0; i < SNeutrinoSettings::LCD_SETTING_COUNT; i++)
|
for (int i = 0; i < SNeutrinoSettings::LCD_SETTING_COUNT; i++)
|
||||||
g_settings.lcd_setting[i] = configfile.getInt32(lcd_setting[i].name, lcd_setting[i].default_value);
|
g_settings.lcd_setting[i] = configfile.getInt32(lcd_setting[i].name, lcd_setting[i].default_value);
|
||||||
strcpy(g_settings.lcd_setting_dim_time, configfile.getString("lcd_dim_time","0").c_str());
|
g_settings.lcd_setting_dim_time = configfile.getString("lcd_dim_time","0");
|
||||||
g_settings.lcd_setting_dim_brightness = configfile.getInt32("lcd_dim_brightness", 0);
|
g_settings.lcd_setting_dim_brightness = configfile.getInt32("lcd_dim_brightness", 0);
|
||||||
g_settings.lcd_info_line = configfile.getInt32("lcd_info_line", 0);//channel name or clock
|
g_settings.lcd_info_line = configfile.getInt32("lcd_info_line", 0);//channel name or clock
|
||||||
|
|
||||||
|
@@ -96,21 +96,18 @@ printf("url is %s\n", URL.c_str());
|
|||||||
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(strcmp(g_settings.softupdate_proxyserver, "")!=0)
|
if (!g_settings.softupdate_proxyserver.empty()) {//use proxyserver
|
||||||
{//use proxyserver
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
printf("use proxyserver : %s\n", g_settings.softupdate_proxyserver);
|
printf("use proxyserver : %s\n", g_settings.softupdate_proxyserver.c_str());
|
||||||
#endif
|
#endif
|
||||||
curl_easy_setopt(curl, CURLOPT_PROXY, g_settings.softupdate_proxyserver);
|
curl_easy_setopt(curl, CURLOPT_PROXY, g_settings.softupdate_proxyserver.c_str());
|
||||||
|
|
||||||
if(strcmp(g_settings.softupdate_proxyusername,"")!=0)
|
if (!g_settings.softupdate_proxyusername.empty()) {//use auth
|
||||||
{//use auth
|
|
||||||
//printf("use proxyauth\n");
|
//printf("use proxyauth\n");
|
||||||
char tmp[200];
|
std::string tmp = g_settings.softupdate_proxyusername;
|
||||||
strcpy(tmp, g_settings.softupdate_proxyusername);
|
tmp += ":";
|
||||||
strcat(tmp, ":");
|
tmp += g_settings.softupdate_proxypassword;
|
||||||
strcat(tmp, g_settings.softupdate_proxypassword);
|
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, tmp.c_str());
|
||||||
curl_easy_setopt(curl, CURLOPT_PROXYUSERPWD, tmp);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@@ -238,7 +238,7 @@ struct SNeutrinoSettings
|
|||||||
};
|
};
|
||||||
|
|
||||||
int personalize[P_SETTINGS_MAX];
|
int personalize[P_SETTINGS_MAX];
|
||||||
char personalize_pincode[5];
|
std::string personalize_pincode;
|
||||||
|
|
||||||
//timing
|
//timing
|
||||||
enum TIMING_SETTINGS
|
enum TIMING_SETTINGS
|
||||||
@@ -492,10 +492,10 @@ struct SNeutrinoSettings
|
|||||||
|
|
||||||
//Software-update
|
//Software-update
|
||||||
int softupdate_mode;
|
int softupdate_mode;
|
||||||
char softupdate_url_file[31];
|
std::string softupdate_url_file;
|
||||||
char softupdate_proxyserver[31];
|
std::string softupdate_proxyserver;
|
||||||
char softupdate_proxyusername[31];
|
std::string softupdate_proxyusername;
|
||||||
char softupdate_proxypassword[31];
|
std::string softupdate_proxypassword;
|
||||||
int softupdate_name_mode_apply;
|
int softupdate_name_mode_apply;
|
||||||
int softupdate_name_mode_backup;
|
int softupdate_name_mode_backup;
|
||||||
int apply_settings;
|
int apply_settings;
|
||||||
@@ -514,7 +514,7 @@ struct SNeutrinoSettings
|
|||||||
int parentallock_prompt;
|
int parentallock_prompt;
|
||||||
int parentallock_lockage;
|
int parentallock_lockage;
|
||||||
int parentallock_defaultlocked;
|
int parentallock_defaultlocked;
|
||||||
char parentallock_pincode[5];
|
std::string parentallock_pincode;
|
||||||
|
|
||||||
|
|
||||||
// Font sizes
|
// Font sizes
|
||||||
@@ -568,7 +568,7 @@ struct SNeutrinoSettings
|
|||||||
};
|
};
|
||||||
int lcd_setting[LCD_SETTING_COUNT];
|
int lcd_setting[LCD_SETTING_COUNT];
|
||||||
int lcd_info_line;
|
int lcd_info_line;
|
||||||
char lcd_setting_dim_time[4];
|
std::string lcd_setting_dim_time;
|
||||||
int lcd_setting_dim_brightness;
|
int lcd_setting_dim_brightness;
|
||||||
int led_tv_mode;
|
int led_tv_mode;
|
||||||
int led_standby_mode;
|
int led_standby_mode;
|
||||||
|
Reference in New Issue
Block a user