class: MCRepositoryBrowser
authorClaus Gittinger <cg@exept.de>
Wed, 03 Apr 2013 21:52:49 +0200
changeset 779 708d7b360e51
parent 778 3cdbfc6ff7da
child 780 fdd6a57098e4
class: MCRepositoryBrowser class definition changed: #addRepository: #repositoryAdd #repositoryAddFromExpressionString
MCRepositoryBrowser.st
--- a/MCRepositoryBrowser.st	Wed Apr 03 21:51:41 2013 +0200
+++ b/MCRepositoryBrowser.st	Wed Apr 03 21:52:49 2013 +0200
@@ -6,7 +6,7 @@
 		selectedRepositoryHolder targetPackage targetNamespace
 		lastPackage targetPackageHolder targetNamespaceNameHolder
 		updateChangefileHolder selectedPackageHolder'
-	classVariableNames:''
+	classVariableNames:'LastAddedRepository'
 	poolDictionaries:''
 	category:'SCM-Monticello-St/X UI'
 !
@@ -875,15 +875,19 @@
 !MCRepositoryBrowser methodsFor:'menu actions'!
 
 addRepository:rep
-    | files|
+    | files didWarn |
 
+    didWarn := false.    
     Error handle:[:ex |
-        Dialog warn:'Exception: ',ex description
+        Dialog warn:'Exception: ',ex description.
+        didWarn := true.
     ] do:[
         files := rep allFileNames.
     ].
     files isNil ifTrue:[
-        Dialog warn:'repository does not exist or is inaccessable.'.
+        didWarn ifFalse:[
+            Dialog warn:'repository does not exist or is inaccessable.'.
+        ].
         ^ self.
     ].
 
@@ -914,7 +918,9 @@
 repositoryAdd
     |repStr rep url|
 
-    repStr := Dialog request:'Repository to add (file- or HTTP-URL):'.
+    repStr := Dialog 
+                request:'Repository to add (file- or HTTP-URL):'
+                initialAnswer:'http://www.squeaksource.com/project'.
     repStr isEmptyOrNil ifTrue:[^ self].
 
     Error handle:[:ex |
@@ -944,18 +950,24 @@
 !
 
 repositoryAddFromExpressionString
-    |repStr rep|
+    |str repStr rep|
 
-    repStr := Dialog 
-                requestText:'Repository to add:'
-                initialAnswer:'MCHttpRepository
-    location: ''http://www.squeaksource.com/XMLSchemaCodeGen''
+    rep := LastAddedRepository ? 'XMLSchemaCodeGen'.
+
+    str := 'MCHttpRepository
+    location: ''http://www.squeaksource.com/',rep,'''
     user: ''''
     password: ''''
 '.
+    repStr := Dialog 
+                requestText:'Repository to add:'
+                initialAnswer:str
+                initialSelection:(str findRangeOfString:rep).
+
     repStr isEmptyOrNil ifTrue:[^ self].
 
     Error handle:[:ex |
+        Transcript showCR:ex description
     ] do:[
         rep := Parser evaluate:repStr.
     ].
@@ -1214,11 +1226,11 @@
 !MCRepositoryBrowser class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepositoryBrowser.st,v 1.25 2013-04-02 19:28:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepositoryBrowser.st,v 1.26 2013-04-03 19:52:49 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepositoryBrowser.st,v 1.25 2013-04-02 19:28:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/goodies/monticello/MCRepositoryBrowser.st,v 1.26 2013-04-03 19:52:49 cg Exp $'
 !
 
 version_SVN