Index: Slim/Plugin/AudioScrobbler/Plugin.pm =================================================================== --- Slim/Plugin/AudioScrobbler/Plugin.pm (revision 20214) +++ Slim/Plugin/AudioScrobbler/Plugin.pm (working copy) @@ -142,9 +142,9 @@ my $curAccount = $prefs->client($client)->get('account') || 0; if ( $account eq $curAccount ) { - $overlay = Slim::Buttons::Common::checkBoxOverlay( $client, 1 ); + $overlay = Slim::Buttons::Common::radioButtonOverlay( $client, 1 ); } else { - $overlay = Slim::Buttons::Common::checkBoxOverlay( $client, 0 ); + $overlay = Slim::Buttons::Common::radioButtonOverlay( $client, 0 ); } return ( undef, $overlay ); Index: Slim/Buttons/XMLBrowser.pm =================================================================== --- Slim/Buttons/XMLBrowser.pm (revision 20214) +++ Slim/Buttons/XMLBrowser.pm (working copy) @@ -774,7 +774,7 @@ if ( $item->{type} eq 'radio' ) { # Display check box overlay for type=radio my $default = $item->{default}; - $overlay = Slim::Buttons::Common::checkBoxOverlay( $client, $default eq $item->{name} ); + $overlay = Slim::Buttons::Common::radioButtonOverlay( $client, $default eq $item->{name} ); } elsif ( $item->{type} ne 'text' && ( hasDescription($item) || hasLink($item) ) ) { Index: Slim/Buttons/AlarmClock.pm =================================================================== --- Slim/Buttons/AlarmClock.pm (revision 20214) +++ Slim/Buttons/AlarmClock.pm (working copy) @@ -207,9 +207,9 @@ $item = ( ref $item ) ? $item->url : $item; if ( $item eq $prefs->client($client)->get('alarmplaylist')->[ weekDay($_[0]) ] ) { - $overlay = Slim::Buttons::Common::checkBoxOverlay( $client, 1 ); + $overlay = Slim::Buttons::Common::radioButtonOverlay( $client, 1 ); } else { - $overlay = Slim::Buttons::Common::checkBoxOverlay( $client, 0 ); + $overlay = Slim::Buttons::Common::radioButtonOverlay( $client, 0 ); } return [undef, $overlay]; Index: Slim/Buttons/Input/Choice.pm =================================================================== --- Slim/Buttons/Input/Choice.pm (revision 20214) +++ Slim/Buttons/Input/Choice.pm (working copy) @@ -461,7 +461,11 @@ # assume a single non-descending list of items, 'pref' item must be given in the params my $val = ref $pref eq 'CODE' ? $pref->($client) : preferences('server')->client($client)->get($pref); - $overlay2 = Slim::Buttons::Common::checkBoxOverlay($client, $val eq getItemValue($client)); + if (scalar(@$listRef) == 1) { + $overlay2 = Slim::Buttons::Common::checkBoxOverlay($client, $val eq getItemValue($client)); + } else { + $overlay2 = Slim::Buttons::Common::radioButtonOverlay($client, $val eq getItemValue($client)); + } } my $parts = { Index: Slim/Buttons/Common.pm =================================================================== --- Slim/Buttons/Common.pm (revision 20214) +++ Slim/Buttons/Common.pm (working copy) @@ -1676,25 +1676,53 @@ =head2 checkBoxOverlay ( $client, $value) -Update audio mixer settings +This is a standard UI widget for showing a multi-selected item in a list, or a true/false state of a setting -This is a standard UI widget for showing a single selected item in a list, or a true/false state of a setting +If the $client argument is a valid client object, graphics capable players will show a 'check box'-style ui. +Otherwise, an text-based check box will be marked wtih an X for true and empty for false. +The $value argument is a boolean result provided by the caller to determine if the box is checked or not. + +=cut + +# standard UI feature multi-select list +sub checkBoxOverlay { + my $client = shift; + my $value = shift; + + unless (blessed($client) && $client->isa('Slim::Player::Client')) { + + logBacktrace("Plugins must provide client when calling checkBoxOverlay!"); + + $value = $client; + + } elsif ($client->display->isa('Slim::Display::Graphics')) { + + return $client->symbols( $value ? 'filledsquare' : 'square' ); + } + + return $value ? "[X]" : "[ ]"; +} + +=head2 radioButtonOverlay ( $client, $value) + +This is a standard UI widget for showing a single-selected item in a list + If the $client argument is a valid client object, graphics capable players will show a 'radio button'-style ui. -Otherwise, an text-based check box will be marked wtih an X for true and empty for false. +Otherwise, an text-based radio button will be marked wtih an O for true and empty for false. The $value argument is a boolean result provided by the caller to determine if the box is checked or not. =cut # standard UI feature enable/disable a setting -sub checkBoxOverlay { +sub radioButtonOverlay { my $client = shift; my $value = shift; unless (blessed($client) && $client->isa('Slim::Player::Client')) { - logBacktrace("Plugins must now provide client when calling checkBoxOverlay!"); + logBacktrace("Plugins must now provide client when calling radioButtonOverlay!"); $value = $client; @@ -1703,9 +1731,11 @@ return $client->symbols( $value ? 'filledcircle' : 'circle' ); } - return $value ? "[X]" : "[ ]"; + return $value ? "(O)" : "( )"; } + + sub param { my $client = shift; return $client->modeParam(@_);