[Slim-Checkins] r9669 - /trunk/server/Slim/Buttons/Block.pm

adrian at svn.slimdevices.com adrian at svn.slimdevices.com
Wed Sep 13 15:06:22 PDT 2006


Author: adrian
Date: Wed Sep 13 15:06:20 2006
New Revision: 9669

URL: http://svn.slimdevices.com?rev=9669&view=rev
Log:
Bug: N/A
Description: r9563 suppressing calling setMode when popping out of
block mode.  Need to ensure the correct lines function is restored for
the underlying mode.

Modified:
    trunk/server/Slim/Buttons/Block.pm

Modified: trunk/server/Slim/Buttons/Block.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Buttons/Block.pm?rev=9669&r1=9668&r2=9669&view=diff
==============================================================================
--- trunk/server/Slim/Buttons/Block.pm (original)
+++ trunk/server/Slim/Buttons/Block.pm Wed Sep 13 15:06:20 2006
@@ -49,7 +49,7 @@
 
 sub init {
 
-	Slim::Buttons::Common::addMode('block', getFunctions(), \&setMode);
+	Slim::Buttons::Common::addMode('block', getFunctions(), \&setMode, \&exitMode);
 }
 
 # Each button on the remote has a function:
@@ -60,12 +60,24 @@
 sub setMode {
 	my $client = shift;
 
+	# store current lines function so it can be replaced when block mode is popped
+	# this is required as popping block mode does not call the setMode of the previous mode
+	$client->modeParam('oldLines', $client->lines );
+
 	$client->lines(\&lines);
 
 	if (!$client->blocklines()->{'static'}) {
 
 		$client->modeParam('modeUpdateInterval', $ticklength);
 	}
+}
+
+sub exitMode {
+	my $client = shift;
+
+	# restore previous lines and display screen
+	$client->lines( $client->modeParam('oldLines') );
+	$client->update();
 }
 
 =head2 block( $client, $line1 )



More information about the checkins mailing list