[Slim-Checkins] r12519 - in /trunk/server: HTML/EN/html/fileselector.js HTML/EN/html/wizard.js HTML/EN/settings/server/fileselector.html HTML/EN/settings/server/wizard.html Slim/Web/Settings/Server/Wizard.pm strings.txt

mherger at svn.slimdevices.com mherger at svn.slimdevices.com
Thu Aug 9 08:38:09 PDT 2007


Author: mherger
Date: Thu Aug  9 08:38:09 2007
New Revision: 12519

URL: http://svn.slimdevices.com?rev=12519&view=rev
Log:
Bug: n/a
Description: wizard - music source validation validation

Modified:
    trunk/server/HTML/EN/html/fileselector.js
    trunk/server/HTML/EN/html/wizard.js
    trunk/server/HTML/EN/settings/server/fileselector.html
    trunk/server/HTML/EN/settings/server/wizard.html
    trunk/server/Slim/Web/Settings/Server/Wizard.pm
    trunk/server/strings.txt

Modified: trunk/server/HTML/EN/html/fileselector.js
URL: http://svn.slimdevices.com/trunk/server/HTML/EN/html/fileselector.js?rev=12519&r1=12518&r2=12519&view=diff
==============================================================================
--- trunk/server/HTML/EN/html/fileselector.js (original)
+++ trunk/server/HTML/EN/html/fileselector.js Thu Aug  9 08:38:09 2007
@@ -89,7 +89,19 @@
 	this.setRootNode(root);
 
 	this.on('click', this.onclick);
-	
+
+	// clean up collapsed nodes so we can refresh a view
+	this.on('collapse', function(node){
+		while(node.firstChild){
+			node.removeChild(node.firstChild);
+		}
+		node.childrenRendered = false;
+		node.loaded = false;
+		// add dummy node to prevent file icon instead of folder
+		node.appendChild([]);
+	});
+
+
 	// render the tree
 	this.render();
 	this.selectMyPath();	
@@ -125,13 +137,13 @@
 
 			path = input.dom.value.split(separator);
 			prev = '';
-			target = '|' + this.root.id;
+			target = this.pathSeparator + this.root.id;
 
 			// we don't need the root element on *X systems, but on Windows...
 			for (x=(path[0]=='/' ? 1 : 0); x<path.length; x++) {
 				if (path[x] == '') continue;
 				prev += (x==0 ? '' : separator) + path[x];
-				target += '|' + prev;
+				target += this.pathSeparator + prev;
 			}
 
 			this.selectPath(target, null, function(success, selNode){

Modified: trunk/server/HTML/EN/html/wizard.js
URL: http://svn.slimdevices.com/trunk/server/HTML/EN/html/wizard.js?rev=12519&r1=12518&r2=12519&view=diff
==============================================================================
--- trunk/server/HTML/EN/html/wizard.js (original)
+++ trunk/server/HTML/EN/html/wizard.js Thu Aug  9 08:38:09 2007
@@ -1,7 +1,7 @@
 Wizard = function(){
 	// we do not always show the language selection page
 	page = 0;
-	pages = new Array('welcome', 'proxy', 'sqn', 'source', 'audiodir', 'itunes', 'musicip', 'summary');
+	pages = new Array('welcome', 'proxy', 'sqn', 'source', 'audiodir', 'playlistdir', 'itunes', 'musicip', 'summary');
 	folderselectors = new Array();
 	sqnValidated = false;
 
@@ -38,8 +38,14 @@
 				gotoBtn: 'gotoAudiodir'
 			});
 
+			folderselectors['playlistdir'] = new FileSelector('playlistdirselector', {
+				filter: 'foldersonly',
+				input: 'playlistdir',
+				gotoBtn: 'gotoPlaylistdir'
+			});
+
 			folderselectors['itunes'] = new FileSelector('itunespathselector', {
-				input: 'xml_path',
+				input: 'xml_file',
 				filter: 'filetype:xml'
 			});
 
@@ -64,8 +70,10 @@
 		},
 		
 		whichPage : function(oldValue, offset){
-			if (pages[oldValue] == 'sqn')
+			// launch verification in the background
+			if (pages[oldValue] == 'sqn') {
 				this.verifySqnAccount();
+			}
 
 			newPage = oldValue + offset;
 			if (offset < 0) newPage = Math.max(newPage, 0);
@@ -84,16 +92,23 @@
 					}
 					break;
 
-				case 'itunes' :
-					if (el = Ext.get('useiTunes')) {
+				case 'playlistdir' :
+					if (el = Ext.get('useAudiodir')) {
 						if (!el.dom.checked)
 							newPage = this.whichPage(newPage, offset);
 					}
 					break;
 
+				case 'itunes' :
+					if (el = Ext.get('itunes')) {
+						if (! (el.dom.checked && showitunes))
+							newPage = this.whichPage(newPage, offset);
+					}
+					break;
+
 				case 'musicip' :
-					if (el = Ext.get('useMusicIP')) {
-						if (!el.dom.checked)
+					if (el = Ext.get('musicmagic')) {
+						if (! (el.dom.checked && showmusicip))
 							newPage = this.whichPage(newPage, offset);
 					}
 					break;

Modified: trunk/server/HTML/EN/settings/server/fileselector.html
URL: http://svn.slimdevices.com/trunk/server/HTML/EN/settings/server/fileselector.html?rev=12519&r1=12518&r2=12519&view=diff
==============================================================================
--- trunk/server/HTML/EN/settings/server/fileselector.html (original)
+++ trunk/server/HTML/EN/settings/server/fileselector.html Thu Aug  9 08:38:09 2007
@@ -28,10 +28,10 @@
 
 		<h1>A file selector (XML files only)</h1>
 		<div id="fileselector" style="overflow:auto; height:200px; width:400px;"></div>
-		<input type="text" name="xml_path" id="xml_path" value="[% xml_path %]" size="45">
+		<input type="text" name="xml_file" id="xml_file" value="[% xml_file %]" size="45">
 		<input type="button" name="gotoXML_path" id="gotoXML_path" value="&gt;">
 	</body>
-	<script type="text/javascript">		
+	<script type="text/javascript">
 		new FileSelector('folderselector', {
 			filter: 'foldersonly',
 			input: 'audiodir',
@@ -40,7 +40,7 @@
 
 		new FileSelector('fileselector', {
 			filter: 'filetype:xml',
-			input: 'xml_path',
+			input: 'xml_file',
 			gotoBtn: 'gotoXML_path'
 		});
 	</script>

Modified: trunk/server/HTML/EN/settings/server/wizard.html
URL: http://svn.slimdevices.com/trunk/server/HTML/EN/settings/server/wizard.html?rev=12519&r1=12518&r2=12519&view=diff
==============================================================================
--- trunk/server/HTML/EN/settings/server/wizard.html (original)
+++ trunk/server/HTML/EN/settings/server/wizard.html Thu Aug  9 08:38:09 2007
@@ -13,6 +13,8 @@
 
 		<script type="text/javascript">
 			var showproxy = [% showProxy ? "true" : "false" %];
+			var showitunes = [% showiTunes ? "true" : "false" %];
+			var showmusicip = [% showMusicIP ? "true" : "false" %];
 		</script>
 
 		<script type="text/javascript" src="/html/fileselector.js"></script>
@@ -77,6 +79,7 @@
 			<div id="sqn_h" class="page">[% "SETUP_WIZARD_SQN" | string %]</div>
 			<div id="source_h" class="page">[% "SETUP_WIZARD_SOURCE" | string %]</div>
 			<div id="audiodir_h" class="page">[% "SETUP_WIZARD_AUDIODIR" | string %]</div>
+			<div id="playlistdir_h" class="page">[% "SETUP_WIZARD_PLAYLISTDIR" | string %]</div>
 			<div id="itunes_h" class="page">[% "SETUP_WIZARD_ITUNES" | string %]</div>
 			<div id="musicip_h" class="page">[% "SETUP_WIZARD_MUSICIP" | string %]</div>
 			<div id="summary_h" class="page">[% "SETUP_WIZARD_SUMMARY" | string %]</div>
@@ -100,7 +103,7 @@
 					
 					</select>
 				</div>
-				<input name="saveSettings" type="hidden" value="1">
+				<input name="saveLanguage" type="hidden" value="1">
 				</form>
 			</div>
 
@@ -134,15 +137,15 @@
 				<div>[% "SETUP_WIZARD_SOURCE_DESC" | string %]</div>
 				<div><table>
 					<tr>
-						<td><input type="checkbox" name="useAudiodir" id="useAudiodir" [% IF prefs.audiodir %]checked [% END %] class="stdedit">&nbsp;</td>
+						<td><input type="checkbox" name="useAudiodir" id="useAudiodir" [% IF prefs.audiodir %]checked="checked" [% END %] class="stdedit">&nbsp;</td>
 						<td>[% "SETUP_WIZARD_SOURCE_AUDIODIR" | string %]</td>
 					</tr>
 					<tr>
-						<td><input type="checkbox" name="useiTunes" id="useiTunes" [% IF prefs.itunes %]checked [% END %] value="1" class="stdedit"></td>
+						<td><input type="checkbox" name="itunes" id="itunes" [% IF prefs.itunes %]checked="checked" [% END %] value="1" class="stdedit"></td>
 						<td>[% "SETUP_WIZARD_SOURCE_ITUNES" | string %]</td>
 					</tr>
 					<tr>
-						<td><input type="checkbox" name="useMusicIP" id="useMusicIP" [% IF prefs.musicmagic %]checked [% END %] value="1" class="stdedit"></td>
+						<td><input type="checkbox" name="musicmagic" id="musicmagic" [% IF prefs.musicmagic %]checked="checked" [% END %] value="1" class="stdedit"></td>
 						<td>[% "SETUP_WIZARD_SOURCE_MUSICIP" | string %]</td>
 					</tr>
 				</table></div>
@@ -157,17 +160,29 @@
 				</div>
 			</div>
 
+			<div id="playlistdir_m" class="page">
+				<div>[% "SETUP_WIZARD_PLAYLISTDIR_DESC" | string %]</div>
+				<div id="playlistdirselector"></div>
+				<div>
+					<input type="text" name="playlistdir" id="playlistdir" value="[% prefs.playlistdir %]" class="stdedit" size="50">
+					<input type="button" class="stdedit" name="gotoPlaylistdir" id="gotoPlaylistdir" value="&gt;">
+				</div>
+			</div>
+
 			<div id="itunes_m" class="page">
 				<div>[% "SETUP_WIZARD_ITUNES_DESC" | string %]</div>
 				<div id="itunespathselector"></div>
 				<div>
-					<input type="text" name="xml_path" id="xml_path" value="[% prefs.xml_path %]" class="stdedit" size="50">
+					<input type="text" name="xml_file" id="xml_file" value="[% prefs.xml_file %]" class="stdedit" size="50">
 					<input type="button" class="stdedit" name="gotoiTunesDir" id="gotoiTunesDir" value="&gt;">
 				</div>
 			</div>
 
 			<div id="musicip_m" class="page">
 				<div>[% "SETUP_WIZARD_MUSICIP_DESC" | string %]</div>
+				<div><input type="text" name="port" id="port" value="[% prefs.port %]" class="stdedit" size="20"></div>
+				<div>[% "SETUP_WIZARD_MUSICIP_DESC2" | string %]</div>
+				<div>[% "SETUP_WIZARD_MUSICIP_DESC3" | string %]</div>
 			</div>
 
 			<div id="summary_m" class="page">

Modified: trunk/server/Slim/Web/Settings/Server/Wizard.pm
URL: http://svn.slimdevices.com/trunk/server/Slim/Web/Settings/Server/Wizard.pm?rev=12519&r1=12518&r2=12519&view=diff
==============================================================================
--- trunk/server/Slim/Web/Settings/Server/Wizard.pm (original)
+++ trunk/server/Slim/Web/Settings/Server/Wizard.pm Thu Aug  9 08:38:09 2007
@@ -14,9 +14,14 @@
 my $showProxy = 1;
 my $prefs = preferences('server');
 
+my $log = Slim::Utils::Log->addLogCategory({
+	'category'     => 'wizard',
+	'defaultLevel' => 'DEBUG',
+});
+
 my %prefs = (
-	'server' => ['language', 'weproxy', 'sn_email', 'sn_password', 'audiodir', 'playlistdir'],
-	'plugin.itunes' => ['itunes', 'xml_path'],
+	'server' => ['weproxy', 'sn_email', 'sn_password', 'audiodir', 'playlistdir'],
+	'plugin.itunes' => ['itunes', 'xml_file'],
 	'plugin.musicmagic' => ['musicmagic', 'port']
 );
 
@@ -33,7 +38,7 @@
 		},
 		sub {
 			my $http = shift;
-			logger('wizard')->error("Couldn't connect to squeezenetwork.com - do we need a proxy?\n" . $http->error);
+			$log->error("Couldn't connect to squeezenetwork.com - do we need a proxy?\n" . $http->error);
 		}
 	);
 	$http->get('http://www.squeezenetwork.com/');
@@ -48,29 +53,46 @@
 sub handler {
 	my ($class, $client, $paramRef, $pageSetup) = @_;
 
-	# don't display the language selection when run for the first time on Windows,
-	# as this should have been set by the Windows installer
-	if (Slim::Utils::OSDetect::OS() eq 'win' && not $prefs->get('wizarddone')) {
-		$paramRef->{'showLanguage'} = 1;	
+	# handle language separately, as it is in its own form
+	if ($paramRef->{'saveLanguage'}) {
+		preferences('server')->set('language', $paramRef->{'language'});		
 	}
+	$paramRef->{'prefs'}->{'language'} = preferences('server')->get('language');
 
 	foreach my $namespace (keys %prefs) {
 		foreach my $pref (@{$prefs{$namespace}}) {
-			if ($paramRef->{'saveSettings'} && defined $paramRef->{$pref}) {	
-				my (undef, $ok) = preferences($namespace)->set($pref, $paramRef->{$pref});
+			if ($paramRef->{'saveSettings'}) {
+				
+				# reset audiodir if it had been disabled
+				if ($pref eq 'audiodir' && !$paramRef->{'useAudiodir'})	{
+					$paramRef->{'audiodir'} = '';
+				}
+
+				if ($pref eq 'itunes' && !$paramRef->{'itunes'})	{
+					$paramRef->{'itunes'} = '0';
+				}
+
+				if ($pref eq 'musicmagic' && !$paramRef->{'musicmagic'})	{
+					$paramRef->{'musicmagic'} = '0';
+				}
+
+				$log->debug("$namespace.$pref: " . $paramRef->{$pref});
+
+				preferences($namespace)->set($pref, $paramRef->{$pref});
 			}
 
 			$paramRef->{'prefs'}->{$pref} = preferences($namespace)->get($pref);
 
 			# Cleanup the checkbox
 			if ($pref =~ /itunes|musicmagic/) {
-				$paramRef->{'prefs'}->{$pref} = defined $paramRef->{'prefs'}->{$pref} ? 1 : 0;
+				$paramRef->{'prefs'}->{$pref} = defined $paramRef->{'prefs'}->{$pref} ? $paramRef->{'prefs'}->{$pref} : 0;
 			}
 		}
 	}
 
-	$paramRef->{'showiTunes'} = (preferences('plugin.itunes')->get('xml_file') || Slim::Plugin::iTunes::Common->canUseiTunesLibrary() == undef);
 	$paramRef->{'showProxy'} = $showProxy;
+	$paramRef->{'showiTunes'} = !Slim::Plugin::iTunes::Common->canUseiTunesLibrary();
+	$paramRef->{'showMusicIP'} = !Slim::Plugin::MusicMagic::Plugin::canUseMusicMagic();
 	$paramRef->{'languageoptions'} = Slim::Utils::Strings::languageOptions();
 
 	return Slim::Web::HTTP::filltemplatefile($class->page, $paramRef);

Modified: trunk/server/strings.txt
URL: http://svn.slimdevices.com/trunk/server/strings.txt?rev=12519&r1=12518&r2=12519&view=diff
==============================================================================
--- trunk/server/strings.txt (original)
+++ trunk/server/strings.txt Thu Aug  9 08:38:09 2007
@@ -6992,17 +6992,29 @@
 SETUP_WIZARD_AUDIODIR_DESC
 	EN	Please select the path to your local music collection.
 
+SETUP_WIZARD_PLAYLISTDIR
+	EN	SlimServer Setup: Playlist Folder
+
+SETUP_WIZARD_PLAYLISTDIR_DESC
+	EN	Please select the path to your playlist folder.
+
 SETUP_WIZARD_ITUNES
 	EN	SlimServer Setup: iTunes Integration
 
 SETUP_WIZARD_ITUNES_DESC
-	EN	Please select your iTunes XML file...
+	EN	SlimServer wasn't able to find your iTunes library automatically. Please select your iTunes XML file...
 
 SETUP_WIZARD_MUSICIP
 	EN	SlimServer Setup: MusicIP Integration
 
 SETUP_WIZARD_MUSICIP_DESC
-	EN	Please select your MusicIP settings...
+	EN	SlimServer wasn't able to connect to your MusicIP Mixer. If you're using a non-standard port (default: 10002) for your MusicIP Mixer, please enter the port number in this field.
+
+SETUP_WIZARD_MUSICIP_DESC2
+	EN	MusicIP Mixer must be started before SlimServer. If you have trouble connecting to MusicIP you might need to restart SlimServer after having configured MusicIP Mixer.
+
+SETUP_WIZARD_MUSICIP_DESC3
+	EN	For more information about the MusicIP Mixer configuration and SlimServer please visit <a href="http://www.musicip.com/mixer/slimserver.jsp" target="_blank">musicip.com</a>.
 
 SETUP_WIZARD_SUMMARY
 	EN	SlimServer Setup: Summary



More information about the checkins mailing list