option to en/disable wifigecko

This commit is contained in:
Christopher Roy Bratusek 2012-08-29 23:18:45 +02:00
parent 3670bbb712
commit 72cc00dbdd
9 changed files with 45 additions and 8 deletions

Binary file not shown.

View File

@ -662,7 +662,7 @@ int MenuMain()
if(boot_buffer)
menu = MENU_EXIT;
if(!first)
if(!first && Options.wifigecko)
{
WifiGecko_Connect();
wifi_printf("The HomebrewFilter rev%i\n", SvnRev());

View File

@ -452,6 +452,7 @@ int MenuSettingsFile()
{
strcpy (Options.temp_code, Settings.code);
Options.temp_network = Options.network;
Options.temp_wifigecko = Options.wifigecko;
Options.temp_newrevtext = Options.newrevtext;
menu = MENU_SETTINGS;
}
@ -497,6 +498,7 @@ int MenuSettingsFile()
device_dat = options.value[STORAGE_DEVICE];
Options.navigation = navigation;
Options.network = Options.temp_network;
Options.wifigecko = Options.temp_wifigecko;
Options.newrevtext = Options.temp_newrevtext;
if(device_dat == "SD")
@ -546,6 +548,7 @@ int MenuSettingsFile()
{
strcpy (Options.temp_code, Settings.code);
Options.temp_network = Options.network;
Options.temp_wifigecko = Options.wifigecko;
Options.temp_newrevtext = Options.newrevtext;
menu = MENU_SETTINGS;
}

View File

@ -29,11 +29,13 @@ int MenuSettingsNetwork()
int focus = 0;
int network = Options.temp_network;
int wifigecko = Options.temp_wifigecko;
int newrevtext = Options.temp_newrevtext;
OptionList options;
sprintf(options.name[i++], tr("Auto Connect"));
sprintf(options.name[i++], tr("Enable Wifi Gecko"));
sprintf(options.name[i++], tr("Update Info"));
options.length = i;
@ -112,6 +114,14 @@ int MenuSettingsNetwork()
break;
case 1:
change = wifigecko;
change++;
if(change > 1)
change = 1;
wifigecko = change;
break;
case 2:
change = newrevtext;
change++;
if(change > 1)
@ -136,6 +146,14 @@ int MenuSettingsNetwork()
break;
case 1:
change = wifigecko;
change--;
if(change < 0)
change = 0;
wifigecko = change;
break;
case 2:
change = newrevtext;
change--;
if(change < 0)
@ -155,11 +173,16 @@ int MenuSettingsNetwork()
else
sprintf (options.value[0], tr("Yes"));
if(newrevtext == 0)
if(wifigecko == 0)
sprintf (options.value[1], tr("No"));
else
sprintf (options.value[1], tr("Yes"));
if(newrevtext == 0)
sprintf (options.value[2], tr("No"));
else
sprintf (options.value[2], tr("Yes"));
optionBrowser.TriggerUpdate();
}
@ -196,6 +219,7 @@ int MenuSettingsNetwork()
}
}
Options.temp_network = network;
Options.temp_wifigecko = wifigecko;
Options.temp_newrevtext = newrevtext;
menu = MENU_SETTINGS_FILE;
}

View File

@ -109,6 +109,12 @@ void load()
Options.temp_network = Options.network;
}
if(get_setting(source, "wifigecko") != "")
{
Options.wifigecko = atoi(get_setting(source, "wifigecko").c_str());
Options.temp_wifigecko = Options.wifigecko;
}
if(get_setting(source, "newrevtext") != "")
{
Options.newrevtext = atoi(get_setting(source, "newrevtext").c_str());

View File

@ -103,6 +103,7 @@ void save()
save_settings << "show_all = \"" << Options.show_all << "\"" << endl;
save_settings << "navigation = \"" << Options.navigation << "\"" << endl;
save_settings << "network = \"" << Options.network << "\"" << endl;
save_settings << "wifigecko = \"" << Options.wifigecko << "\"" << endl;
save_settings << "newrevtext = \"" << Options.newrevtext << "\"" << endl;
save_settings << "code = \"" << Settings.code << "\"" << endl;
save_settings << "grid = \"" << Settings.grid << "\"" << endl;

View File

@ -169,6 +169,7 @@ DefaultOptions()
Options.show_all = 1;
Options.navigation = 0;
Options.temp_network = 0;
Options.temp_wifigecko = 0;
Options.temp_newrevtext = 1;
}

View File

@ -110,16 +110,16 @@ extern struct SSettings Settings;
struct SOptions
{
int temp_last_setting;
int temp_last_setting;
string temp_theme;
string temp_language;
string temp_font;
char temp_code[5];
int temp_network;
int temp_newrevtext;
int last_category; // letzte kategorie merken
int slide_effect;
int temp_network;
int temp_wifigecko;
int temp_newrevtext;
int last_category; // letzte kategorie merken
int slide_effect;
char theme[256];
char language[256];
char font[256];
@ -129,6 +129,7 @@ struct SOptions
int device_icon;
bool navigation;
bool network;
bool wifigecko;
bool newrevtext;
int wiiload_ahb;
int wiiload_ios;

View File

@ -2,6 +2,7 @@
- fixed auto-connecting Internet via WiFi
- basic support for WifiGecko
* only connection message is shown currently
* option to en/disable WifiGecko (settings->network)
* no option yet to change IP and Port
* also works via LAN