Index: Slim/Player/Squeezebox2.pm =================================================================== --- Slim/Player/Squeezebox2.pm (revision 20762) +++ Slim/Player/Squeezebox2.pm (working copy) @@ -791,6 +791,19 @@ } } +sub resetPrefs { + my $client = shift; + + # clear reset client prefs to default + $client->SUPER::resetPrefs; + + # reset prefs stored on player to new values + for my $pref (keys %$pref_settings) { + my $value = $prefs->client($client)->get($pref); + $client->setPlayerSetting($pref, $value); + } +} + sub pcm_sample_rates { my $client = shift; my $track = shift; Index: Slim/Player/Client.pm =================================================================== --- Slim/Player/Client.pm (revision 20762) +++ Slim/Player/Client.pm (working copy) @@ -283,6 +283,8 @@ Accessors for the list of known clients. These are functions, and do not need clients passed. They should be moved to be class methods. +=cut + =head2 clients() Returns an array of all client objects. @@ -293,6 +295,22 @@ return values %clientHash; } +=head2 resetPrefs() + +Resets a client's preference object. + +=cut + +sub resetPrefs { + my $client = shift; + + my $clientPrefs = $prefs->client($client); + + $clientPrefs->remove( keys %{$clientPrefs->all} ); + + $client->init(); +} + =head2 clientCount() Returns the number of known clients. Index: Slim/Web/Settings/Player/Basic.pm =================================================================== --- Slim/Web/Settings/Player/Basic.pm (revision 20762) +++ Slim/Web/Settings/Player/Basic.pm (working copy) @@ -65,6 +65,11 @@ return $class->SUPER::handler($client, $paramRef); } + # reset all client preferences to factory defaults + if ($paramRef->{resetprefs}) { + $client->resetPrefs(); + } + # array prefs handled by this handler not handler::SUPER my @prefs = (); Index: HTML/EN/settings/player/basic.html =================================================================== --- HTML/EN/settings/player/basic.html (revision 20762) +++ HTML/EN/settings/player/basic.html (working copy) @@ -108,6 +108,10 @@ [% END %] [% END %] + [% WRAPPER setting title="SETUP_RESET_PLAYER" desc="SETUP_RESET_PLAYER_DESC" %] + [% "SETUP_RESET_PLAYER" | string %] + [% END %] + [% IF !macaddress; WRAPPER setting title="FORGET_PLAYER" desc="FORGET_PLAYER_DESC" %]
[% IF useAJAX %] Index: strings.txt =================================================================== --- strings.txt (revision 20762) +++ strings.txt (working copy) @@ -3085,6 +3085,12 @@ SV Spelarens namn: ZH_CN 播放机名字: +SETUP_RESET_PLAYER + EN Reset player preferences + +SETUP_RESET_PLAYER_DESC + EN You can reset a player's settings like player name, title format, menus etc. to factory defaults. Please note that this will not reset the player's hardware settings like eg. networking parameters. + SETUP_POWERONBRIGHTNESS CS Jas pro 'zapnuto' DA Lysstyrke når tændt