MCHttpRepository.st
changeset 1021 7ec8dc1c6c82
parent 909 b63cf5148da4
child 1053 86dccda75716
--- a/MCHttpRepository.st	Tue Feb 13 16:53:48 2018 +0100
+++ b/MCHttpRepository.st	Tue Feb 20 01:08:08 2018 +0100
@@ -1,5 +1,9 @@
+"{ Encoding: utf8 }"
+
 "{ Package: 'stx:goodies/monticello' }"
 
+"{ NameSpace: Smalltalk }"
+
 MCFileBasedRepository subclass:#MCHttpRepository
 	instanceVariableNames:'location user password readerCache'
 	classVariableNames:''
@@ -67,23 +71,26 @@
 !
 
 password
-	self userAndPasswordFromSettingsDo: [:usr :pwd | ^pwd].
+        self userAndPasswordFromSettingsDo: [:usr :pwd | ^pwd].
+
+        self user isEmpty ifTrue: [^password].
 
-	self user isEmpty ifTrue: [^password].
+        [password isEmpty] whileTrue: [
+                | answer dialog |
+
+                dialog := UIManager isNil ifTrue:[Dialog] ifFalse:[ UIManager default ].
 
-	[password isEmpty] whileTrue: [
-		| answer |
-		"Give the user a chance to change the login"
-		answer := UIManager default request: 'User name for ' translated, String cr, location
-			initialAnswer: self user.
-		answer isEmpty
-			ifTrue: [^password]
-			ifFalse: [self user: answer].
-		
-		password := UIManager default requestPassword: 'Password for' translated, ' "', self user, '" ', 'at ' translated, String cr, location.
-	].
+                "Give the user a chance to change the login"
+                answer := dialog request: 'User name for ' translated, String cr, location
+                        initialAnswer: self user.
+                answer isEmpty
+                        ifTrue: [^password]
+                        ifFalse: [self user: answer].
+                
+                password := UIManager default requestPassword: 'Password for' translated, ' "', self user, '" ', 'at ' translated, String cr, location.
+        ].
 
-	^ password
+        ^ password
 !
 
 password: passwordString
@@ -235,14 +242,14 @@
 !MCHttpRepository class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCHttpRepository.st,v 1.7 2014-02-12 14:53:40 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCHttpRepository.st,v 1.7 2014-02-12 14:53:40 cg Exp $'
+    ^ '$Header$'
 !
 
 version_SVN
-    ^ '$Id: MCHttpRepository.st,v 1.7 2014-02-12 14:53:40 cg Exp $'
+    ^ '$Id$'
 ! !